Pārlūkot izejas kodu

Adding "assign members" table see BT#6312

Julio Montoya 11 gadi atpakaļ
vecāks
revīzija
195daff185

+ 10 - 0
main/css/base.css

@@ -5309,3 +5309,13 @@ i.size-32.icon-new-work {
     margin-bottom: 15px;
     padding: 7px 9px;
 }
+
+
+.table td div.success {
+    background-color: #98E57F;
+}
+
+
+.table td.hover {
+    background-color: rgba(255, 153, 0, 0.5);
+}

+ 813 - 0
main/inc/Entity/CQuiz.php

@@ -0,0 +1,813 @@
+<?php
+
+namespace Entity;
+
+use Doctrine\ORM\Mapping as ORM;
+
+/**
+ * CQuiz
+ *
+ * @ORM\Table(name="c_quiz")
+ * @ORM\Entity
+ */
+class CQuiz
+{
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="iid", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     * @ORM\Id
+     * @ORM\GeneratedValue(strategy="IDENTITY")
+     */
+    private $iid;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="c_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $cId;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="title", type="string", length=255, precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $title;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="description", type="text", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $description;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="sound", type="string", length=255, precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $sound;
+
+    /**
+     * @var boolean
+     *
+     * @ORM\Column(name="type", type="boolean", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $type;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="random", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $random;
+
+    /**
+     * @var boolean
+     *
+     * @ORM\Column(name="random_answers", type="boolean", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $randomAnswers;
+
+    /**
+     * @var boolean
+     *
+     * @ORM\Column(name="active", type="boolean", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $active;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="results_disabled", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $resultsDisabled;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="access_condition", type="text", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $accessCondition;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="max_attempt", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $maxAttempt;
+
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="start_time", type="datetime", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $startTime;
+
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="end_time", type="datetime", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $endTime;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="feedback_type", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $feedbackType;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="expired_time", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $expiredTime;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="session_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $sessionId;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="propagate_neg", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $propagateNeg;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="review_answers", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $reviewAnswers;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="random_by_category", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $randomByCategory;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="text_when_finished", type="text", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $textWhenFinished;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="display_category_name", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $displayCategoryName;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="pass_percentage", type="integer", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $passPercentage;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="autolaunch", type="integer", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $autolaunch;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="end_button", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $endButton;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="email_notification_template", type="text", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $emailNotificationTemplate;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="model_type", type="integer", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $modelType;
+
+    /**
+     * Get iid
+     *
+     * @return integer
+     */
+    public function getIid()
+    {
+        return $this->iid;
+    }
+
+    /**
+     * Set cId
+     *
+     * @param integer $cId
+     * @return CQuiz
+     */
+    public function setCId($cId)
+    {
+        $this->cId = $cId;
+
+        return $this;
+    }
+
+    /**
+     * Get cId
+     *
+     * @return integer
+     */
+    public function getCId()
+    {
+        return $this->cId;
+    }
+
+    /**
+     * Set title
+     *
+     * @param string $title
+     * @return CQuiz
+     */
+    public function setTitle($title)
+    {
+        $this->title = $title;
+
+        return $this;
+    }
+
+    /**
+     * Get title
+     *
+     * @return string
+     */
+    public function getTitle()
+    {
+        return $this->title;
+    }
+
+    /**
+     * Set description
+     *
+     * @param string $description
+     * @return CQuiz
+     */
+    public function setDescription($description)
+    {
+        $this->description = $description;
+
+        return $this;
+    }
+
+    /**
+     * Get description
+     *
+     * @return string
+     */
+    public function getDescription()
+    {
+        return $this->description;
+    }
+
+    /**
+     * Set sound
+     *
+     * @param string $sound
+     * @return CQuiz
+     */
+    public function setSound($sound)
+    {
+        $this->sound = $sound;
+
+        return $this;
+    }
+
+    /**
+     * Get sound
+     *
+     * @return string
+     */
+    public function getSound()
+    {
+        return $this->sound;
+    }
+
+    /**
+     * Set type
+     *
+     * @param boolean $type
+     * @return CQuiz
+     */
+    public function setType($type)
+    {
+        $this->type = $type;
+
+        return $this;
+    }
+
+    /**
+     * Get type
+     *
+     * @return boolean
+     */
+    public function getType()
+    {
+        return $this->type;
+    }
+
+    /**
+     * Set random
+     *
+     * @param integer $random
+     * @return CQuiz
+     */
+    public function setRandom($random)
+    {
+        $this->random = $random;
+
+        return $this;
+    }
+
+    /**
+     * Get random
+     *
+     * @return integer
+     */
+    public function getRandom()
+    {
+        return $this->random;
+    }
+
+    /**
+     * Set randomAnswers
+     *
+     * @param boolean $randomAnswers
+     * @return CQuiz
+     */
+    public function setRandomAnswers($randomAnswers)
+    {
+        $this->randomAnswers = $randomAnswers;
+
+        return $this;
+    }
+
+    /**
+     * Get randomAnswers
+     *
+     * @return boolean
+     */
+    public function getRandomAnswers()
+    {
+        return $this->randomAnswers;
+    }
+
+    /**
+     * Set active
+     *
+     * @param boolean $active
+     * @return CQuiz
+     */
+    public function setActive($active)
+    {
+        $this->active = $active;
+
+        return $this;
+    }
+
+    /**
+     * Get active
+     *
+     * @return boolean
+     */
+    public function getActive()
+    {
+        return $this->active;
+    }
+
+    /**
+     * Set resultsDisabled
+     *
+     * @param integer $resultsDisabled
+     * @return CQuiz
+     */
+    public function setResultsDisabled($resultsDisabled)
+    {
+        $this->resultsDisabled = $resultsDisabled;
+
+        return $this;
+    }
+
+    /**
+     * Get resultsDisabled
+     *
+     * @return integer
+     */
+    public function getResultsDisabled()
+    {
+        return $this->resultsDisabled;
+    }
+
+    /**
+     * Set accessCondition
+     *
+     * @param string $accessCondition
+     * @return CQuiz
+     */
+    public function setAccessCondition($accessCondition)
+    {
+        $this->accessCondition = $accessCondition;
+
+        return $this;
+    }
+
+    /**
+     * Get accessCondition
+     *
+     * @return string
+     */
+    public function getAccessCondition()
+    {
+        return $this->accessCondition;
+    }
+
+    /**
+     * Set maxAttempt
+     *
+     * @param integer $maxAttempt
+     * @return CQuiz
+     */
+    public function setMaxAttempt($maxAttempt)
+    {
+        $this->maxAttempt = $maxAttempt;
+
+        return $this;
+    }
+
+    /**
+     * Get maxAttempt
+     *
+     * @return integer
+     */
+    public function getMaxAttempt()
+    {
+        return $this->maxAttempt;
+    }
+
+    /**
+     * Set startTime
+     *
+     * @param \DateTime $startTime
+     * @return CQuiz
+     */
+    public function setStartTime($startTime)
+    {
+        $this->startTime = $startTime;
+
+        return $this;
+    }
+
+    /**
+     * Get startTime
+     *
+     * @return \DateTime
+     */
+    public function getStartTime()
+    {
+        return $this->startTime;
+    }
+
+    /**
+     * Set endTime
+     *
+     * @param \DateTime $endTime
+     * @return CQuiz
+     */
+    public function setEndTime($endTime)
+    {
+        $this->endTime = $endTime;
+
+        return $this;
+    }
+
+    /**
+     * Get endTime
+     *
+     * @return \DateTime
+     */
+    public function getEndTime()
+    {
+        return $this->endTime;
+    }
+
+    /**
+     * Set feedbackType
+     *
+     * @param integer $feedbackType
+     * @return CQuiz
+     */
+    public function setFeedbackType($feedbackType)
+    {
+        $this->feedbackType = $feedbackType;
+
+        return $this;
+    }
+
+    /**
+     * Get feedbackType
+     *
+     * @return integer
+     */
+    public function getFeedbackType()
+    {
+        return $this->feedbackType;
+    }
+
+    /**
+     * Set expiredTime
+     *
+     * @param integer $expiredTime
+     * @return CQuiz
+     */
+    public function setExpiredTime($expiredTime)
+    {
+        $this->expiredTime = $expiredTime;
+
+        return $this;
+    }
+
+    /**
+     * Get expiredTime
+     *
+     * @return integer
+     */
+    public function getExpiredTime()
+    {
+        return $this->expiredTime;
+    }
+
+    /**
+     * Set sessionId
+     *
+     * @param integer $sessionId
+     * @return CQuiz
+     */
+    public function setSessionId($sessionId)
+    {
+        $this->sessionId = $sessionId;
+
+        return $this;
+    }
+
+    /**
+     * Get sessionId
+     *
+     * @return integer
+     */
+    public function getSessionId()
+    {
+        return $this->sessionId;
+    }
+
+    /**
+     * Set propagateNeg
+     *
+     * @param integer $propagateNeg
+     * @return CQuiz
+     */
+    public function setPropagateNeg($propagateNeg)
+    {
+        $this->propagateNeg = $propagateNeg;
+
+        return $this;
+    }
+
+    /**
+     * Get propagateNeg
+     *
+     * @return integer
+     */
+    public function getPropagateNeg()
+    {
+        return $this->propagateNeg;
+    }
+
+    /**
+     * Set reviewAnswers
+     *
+     * @param integer $reviewAnswers
+     * @return CQuiz
+     */
+    public function setReviewAnswers($reviewAnswers)
+    {
+        $this->reviewAnswers = $reviewAnswers;
+
+        return $this;
+    }
+
+    /**
+     * Get reviewAnswers
+     *
+     * @return integer
+     */
+    public function getReviewAnswers()
+    {
+        return $this->reviewAnswers;
+    }
+
+    /**
+     * Set randomByCategory
+     *
+     * @param integer $randomByCategory
+     * @return CQuiz
+     */
+    public function setRandomByCategory($randomByCategory)
+    {
+        $this->randomByCategory = $randomByCategory;
+
+        return $this;
+    }
+
+    /**
+     * Get randomByCategory
+     *
+     * @return integer
+     */
+    public function getRandomByCategory()
+    {
+        return $this->randomByCategory;
+    }
+
+    /**
+     * Set textWhenFinished
+     *
+     * @param string $textWhenFinished
+     * @return CQuiz
+     */
+    public function setTextWhenFinished($textWhenFinished)
+    {
+        $this->textWhenFinished = $textWhenFinished;
+
+        return $this;
+    }
+
+    /**
+     * Get textWhenFinished
+     *
+     * @return string
+     */
+    public function getTextWhenFinished()
+    {
+        return $this->textWhenFinished;
+    }
+
+    /**
+     * Set displayCategoryName
+     *
+     * @param integer $displayCategoryName
+     * @return CQuiz
+     */
+    public function setDisplayCategoryName($displayCategoryName)
+    {
+        $this->displayCategoryName = $displayCategoryName;
+
+        return $this;
+    }
+
+    /**
+     * Get displayCategoryName
+     *
+     * @return integer
+     */
+    public function getDisplayCategoryName()
+    {
+        return $this->displayCategoryName;
+    }
+
+    /**
+     * Set passPercentage
+     *
+     * @param integer $passPercentage
+     * @return CQuiz
+     */
+    public function setPassPercentage($passPercentage)
+    {
+        $this->passPercentage = $passPercentage;
+
+        return $this;
+    }
+
+    /**
+     * Get passPercentage
+     *
+     * @return integer
+     */
+    public function getPassPercentage()
+    {
+        return $this->passPercentage;
+    }
+
+    /**
+     * Set autolaunch
+     *
+     * @param integer $autolaunch
+     * @return CQuiz
+     */
+    public function setAutolaunch($autolaunch)
+    {
+        $this->autolaunch = $autolaunch;
+
+        return $this;
+    }
+
+    /**
+     * Get autolaunch
+     *
+     * @return integer
+     */
+    public function getAutolaunch()
+    {
+        return $this->autolaunch;
+    }
+
+    /**
+     * Set endButton
+     *
+     * @param integer $endButton
+     * @return CQuiz
+     */
+    public function setEndButton($endButton)
+    {
+        $this->endButton = $endButton;
+
+        return $this;
+    }
+
+    /**
+     * Get endButton
+     *
+     * @return integer
+     */
+    public function getEndButton()
+    {
+        return $this->endButton;
+    }
+
+    /**
+     * Set emailNotificationTemplate
+     *
+     * @param string $emailNotificationTemplate
+     * @return CQuiz
+     */
+    public function setEmailNotificationTemplate($emailNotificationTemplate)
+    {
+        $this->emailNotificationTemplate = $emailNotificationTemplate;
+
+        return $this;
+    }
+
+    /**
+     * Get emailNotificationTemplate
+     *
+     * @return string
+     */
+    public function getEmailNotificationTemplate()
+    {
+        return $this->emailNotificationTemplate;
+    }
+
+    /**
+     * Set modelType
+     *
+     * @param integer $modelType
+     * @return CQuiz
+     */
+    public function setModelType($modelType)
+    {
+        $this->modelType = $modelType;
+
+        return $this;
+    }
+
+    /**
+     * Get modelType
+     *
+     * @return integer
+     */
+    public function getModelType()
+    {
+        return $this->modelType;
+    }
+}

+ 2 - 1
main/inc/Entity/Jury.php

@@ -73,11 +73,12 @@ class Jury
 
     /**
      * @ORM\OneToMany(targetEntity="JuryMembers", mappedBy="jury")
+     * @ORM\OrderBy({"roleId" = "ASC"})
      **/
     private $members;
 
     /**
-     * @ORM\OneToMany(targetEntity="TrackExercise", mappedBy="jury")
+     * @ORM\OneToMany(targetEntity="TrackExercise", mappedBy="attempt")
      **/
     private $exerciseAttempts;
 

+ 0 - 2
main/inc/Entity/JuryMembers.php

@@ -85,8 +85,6 @@ class JuryMembers
         $this->user = $user;
     }
 
-
-
     /**
      * Get id
      *

+ 7 - 2
main/inc/Entity/Repository/JuryRepository.php

@@ -39,13 +39,18 @@ class JuryRepository extends EntityRepository
         $wherePart = $qb->expr()->andx();
 
         //Get only users subscribed to this course
-        $wherePart->add($qb->expr()->eq('r.name', $qb->expr()->literal('ROLE_JURY_PRESIDENT')));
+        $wherePart->add($qb->expr()->eq('r.role', $qb->expr()->literal('ROLE_JURY_PRESIDENT')));
         $wherePart->add($qb->expr()->eq('c.userId', $userId));
 
         $qb->where($wherePart);
         $q = $qb->getQuery();
-        return $q->execute();
+        return $q->getSingleResult();
         //return $qb;
     }
 
+    public function getExerciseAttemptsByJury($juryId)
+    {
+
+    }
+
 }

+ 662 - 0
main/inc/Entity/TrackExercise.php

@@ -0,0 +1,662 @@
+<?php
+
+namespace Entity;
+
+use Doctrine\ORM\Mapping as ORM;
+
+/**
+ * TrackExercise
+ *
+ * @ORM\Table(name="track_e_exercices")
+ * @ORM\Entity
+ */
+class TrackExercise
+{
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="exe_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     * @ORM\Id
+     * @ORM\GeneratedValue(strategy="IDENTITY")
+     */
+    private $exeId;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="exe_user_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
+     */
+    private $exeUserId;
+
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="exe_date", type="datetime", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $exeDate;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="exe_exo_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $exeExoId;
+
+    /**
+     * @var float
+     *
+     * @ORM\Column(name="exe_result", type="float", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $exeResult;
+
+    /**
+     * @var float
+     *
+     * @ORM\Column(name="exe_weighting", type="float", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $exeWeighting;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="c_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $cId;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="status", type="string", length=20, precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $status;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="data_tracking", type="text", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $dataTracking;
+
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="start_date", type="datetime", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $startDate;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="steps_counter", type="smallint", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $stepsCounter;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="session_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $sessionId;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="orig_lp_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $origLpId;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="orig_lp_item_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $origLpItemId;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="exe_duration", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $exeDuration;
+
+    /**
+     * @var \DateTime
+     *
+     * @ORM\Column(name="expired_time_control", type="datetime", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $expiredTimeControl;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="orig_lp_item_view_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $origLpItemViewId;
+
+    /**
+     * @var string
+     *
+     * @ORM\Column(name="questions_to_check", type="text", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $questionsToCheck;
+
+     /**
+     * @var float
+     *
+     * @ORM\Column(name="jury_score", type="float", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $juryScore;
+
+    /**
+     * @var integer
+     *
+     * @ORM\Column(name="jury_id", type="integer", precision=0, scale=0, nullable=false, unique=false)
+     */
+    private $juryId;
+
+    /**
+     * @ORM\ManyToOne(targetEntity="CQuiz")
+     * @ORM\JoinColumn(name="exe_exo_id", referencedColumnName="iid")
+     */
+    private $exercise;
+
+    /**
+     * @ORM\ManyToOne(targetEntity="Jury")
+     * @ORM\JoinColumn(name="exe_exo_id", referencedColumnName="exercise_id")
+     */
+    private $attempt;
+
+    public function getAttempt()
+    {
+        return $this->attempt;
+    }
+
+
+     /**
+     * @ORM\OneToMany(targetEntity="TrackExerciseAttemptJury", mappedBy="attempt")
+     **/
+    private $juryAttempts;
+
+    public function getExercise()
+    {
+        return $this->exercise;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function getJuryAttempts()
+    {
+        return $this->juryAttempts;
+    }
+
+    /**
+     * Get exeId
+     *
+     * @return integer
+     */
+    public function getExeId()
+    {
+        return $this->exeId;
+    }
+
+    /**
+     * Set exeUserId
+     *
+     * @param integer $exeUserId
+     * @return TrackExercise
+     */
+    public function setExeUserId($exeUserId)
+    {
+        $this->exeUserId = $exeUserId;
+
+        return $this;
+    }
+
+    /**
+     * Get exeUserId
+     *
+     * @return integer
+     */
+    public function getExeUserId()
+    {
+        return $this->exeUserId;
+    }
+
+    /**
+     * Set exeDate
+     *
+     * @param \DateTime $exeDate
+     * @return TrackExercise
+     */
+    public function setExeDate($exeDate)
+    {
+        $this->exeDate = $exeDate;
+
+        return $this;
+    }
+
+    /**
+     * Get exeDate
+     *
+     * @return \DateTime
+     */
+    public function getExeDate()
+    {
+        return $this->exeDate;
+    }
+
+    /**
+     * Set exeExoId
+     *
+     * @param integer $exeExoId
+     * @return TrackExercise
+     */
+    public function setExeExoId($exeExoId)
+    {
+        $this->exeExoId = $exeExoId;
+
+        return $this;
+    }
+
+    /**
+     * Get exeExoId
+     *
+     * @return integer
+     */
+    public function getExeExoId()
+    {
+        return $this->exeExoId;
+    }
+
+    /**
+     * Set exeResult
+     *
+     * @param float $exeResult
+     * @return TrackExercise
+     */
+    public function setExeResult($exeResult)
+    {
+        $this->exeResult = $exeResult;
+
+        return $this;
+    }
+
+    /**
+     * Get exeResult
+     *
+     * @return float
+     */
+    public function getExeResult()
+    {
+        return $this->exeResult;
+    }
+
+    /**
+     * Set exeWeighting
+     *
+     * @param float $exeWeighting
+     * @return TrackExercise
+     */
+    public function setExeWeighting($exeWeighting)
+    {
+        $this->exeWeighting = $exeWeighting;
+
+        return $this;
+    }
+
+    /**
+     * Get exeWeighting
+     *
+     * @return float
+     */
+    public function getExeWeighting()
+    {
+        return $this->exeWeighting;
+    }
+
+    /**
+     * Set cId
+     *
+     * @param integer $cId
+     * @return TrackExercise
+     */
+    public function setCId($cId)
+    {
+        $this->cId = $cId;
+
+        return $this;
+    }
+
+    /**
+     * Get cId
+     *
+     * @return integer
+     */
+    public function getCId()
+    {
+        return $this->cId;
+    }
+
+    /**
+     * Set status
+     *
+     * @param string $status
+     * @return TrackExercise
+     */
+    public function setStatus($status)
+    {
+        $this->status = $status;
+
+        return $this;
+    }
+
+    /**
+     * Get status
+     *
+     * @return string
+     */
+    public function getStatus()
+    {
+        return $this->status;
+    }
+
+    /**
+     * Set dataTracking
+     *
+     * @param string $dataTracking
+     * @return TrackExercise
+     */
+    public function setDataTracking($dataTracking)
+    {
+        $this->dataTracking = $dataTracking;
+
+        return $this;
+    }
+
+    /**
+     * Get dataTracking
+     *
+     * @return string
+     */
+    public function getDataTracking()
+    {
+        return $this->dataTracking;
+    }
+
+    /**
+     * Set startDate
+     *
+     * @param \DateTime $startDate
+     * @return TrackExercise
+     */
+    public function setStartDate($startDate)
+    {
+        $this->startDate = $startDate;
+
+        return $this;
+    }
+
+    /**
+     * Get startDate
+     *
+     * @return \DateTime
+     */
+    public function getStartDate()
+    {
+        return $this->startDate;
+    }
+
+    /**
+     * Set stepsCounter
+     *
+     * @param integer $stepsCounter
+     * @return TrackExercise
+     */
+    public function setStepsCounter($stepsCounter)
+    {
+        $this->stepsCounter = $stepsCounter;
+
+        return $this;
+    }
+
+    /**
+     * Get stepsCounter
+     *
+     * @return integer
+     */
+    public function getStepsCounter()
+    {
+        return $this->stepsCounter;
+    }
+
+    /**
+     * Set sessionId
+     *
+     * @param integer $sessionId
+     * @return TrackExercise
+     */
+    public function setSessionId($sessionId)
+    {
+        $this->sessionId = $sessionId;
+
+        return $this;
+    }
+
+    /**
+     * Get sessionId
+     *
+     * @return integer
+     */
+    public function getSessionId()
+    {
+        return $this->sessionId;
+    }
+
+    /**
+     * Set origLpId
+     *
+     * @param integer $origLpId
+     * @return TrackExercise
+     */
+    public function setOrigLpId($origLpId)
+    {
+        $this->origLpId = $origLpId;
+
+        return $this;
+    }
+
+    /**
+     * Get origLpId
+     *
+     * @return integer
+     */
+    public function getOrigLpId()
+    {
+        return $this->origLpId;
+    }
+
+    /**
+     * Set origLpItemId
+     *
+     * @param integer $origLpItemId
+     * @return TrackExercise
+     */
+    public function setOrigLpItemId($origLpItemId)
+    {
+        $this->origLpItemId = $origLpItemId;
+
+        return $this;
+    }
+
+    /**
+     * Get origLpItemId
+     *
+     * @return integer
+     */
+    public function getOrigLpItemId()
+    {
+        return $this->origLpItemId;
+    }
+
+    /**
+     * Set exeDuration
+     *
+     * @param integer $exeDuration
+     * @return TrackExercise
+     */
+    public function setExeDuration($exeDuration)
+    {
+        $this->exeDuration = $exeDuration;
+
+        return $this;
+    }
+
+    /**
+     * Get exeDuration
+     *
+     * @return integer
+     */
+    public function getExeDuration()
+    {
+        return $this->exeDuration;
+    }
+
+    /**
+     * Set expiredTimeControl
+     *
+     * @param \DateTime $expiredTimeControl
+     * @return TrackExercise
+     */
+    public function setExpiredTimeControl($expiredTimeControl)
+    {
+        $this->expiredTimeControl = $expiredTimeControl;
+
+        return $this;
+    }
+
+    /**
+     * Get expiredTimeControl
+     *
+     * @return \DateTime
+     */
+    public function getExpiredTimeControl()
+    {
+        return $this->expiredTimeControl;
+    }
+
+    /**
+     * Set origLpItemViewId
+     *
+     * @param integer $origLpItemViewId
+     * @return TrackExercise
+     */
+    public function setOrigLpItemViewId($origLpItemViewId)
+    {
+        $this->origLpItemViewId = $origLpItemViewId;
+
+        return $this;
+    }
+
+    /**
+     * Get origLpItemViewId
+     *
+     * @return integer
+     */
+    public function getOrigLpItemViewId()
+    {
+        return $this->origLpItemViewId;
+    }
+
+    /**
+     * Set questionsToCheck
+     *
+     * @param string $questionsToCheck
+     * @return TrackExercise
+     */
+    public function setQuestionsToCheck($questionsToCheck)
+    {
+        $this->questionsToCheck = $questionsToCheck;
+
+        return $this;
+    }
+
+    /**
+     * Get questionsToCheck
+     *
+     * @return string
+     */
+    public function getQuestionsToCheck()
+    {
+        return $this->questionsToCheck;
+    }
+
+     /**
+     * Get juryScore
+     *
+     * @return integer
+     */
+    public function getJuryScore()
+    {
+        return $this->juryScore;
+    }
+
+    /**
+     * Set juryScore
+     *
+     * @param integer $juryScore
+     * @return TrackExercise
+     */
+    public function setJuryScore($juryScore)
+    {
+        $this->juryScore = $juryScore;
+
+        return $this;
+    }
+
+    /**
+     * Get juryId
+     *
+     * @return integer
+     */
+    public function getJuryId()
+    {
+        return $this->juryId;
+    }
+
+    /**
+     * Set juryId
+     *
+     * @param integer $juryId
+     * @return TrackExercise
+     */
+    public function setJuryId($juryId)
+    {
+        $this->juryId = $juryId;
+
+        return $this;
+    }
+
+    /**
+     * Get juryMembers
+     *
+     * @return integer
+     */
+    public function getJuryMembers()
+    {
+        return $this->juryMembers;
+    }
+
+    /**
+     * Set juryMembers
+     *
+     * @param JuryMembers $juryMembers
+     * @return TrackExercise
+     */
+    public function setJuryMembers(JuryMembers $juryMembers)
+    {
+        $this->juryMembers = $juryMembers;
+
+        return $this;
+    }
+}

+ 13 - 0
main/install/1.10.0/db_main.sql

@@ -3274,6 +3274,8 @@ ALTER TABLE track_e_exercices ADD exe_duration int UNSIGNED NOT NULL default 0;
 ALTER TABLE track_e_exercices ADD COLUMN expired_time_control datetime NOT NULL DEFAULT '0000-00-00 00:00:00';
 ALTER TABLE track_e_exercices ADD COLUMN orig_lp_item_view_id INT NOT NULL DEFAULT 0;
 ALTER TABLE track_e_exercices ADD COLUMN questions_to_check TEXT  NOT NULL DEFAULT '';
+ALTER TABLE track_e_exercices ADD COLUMN jury_score float(6,2);
+ALTER TABLE track_e_exercices ADD COLUMN jury_id INT DEFAULT NULL;
 
 DROP TABLE IF EXISTS track_e_attempt;
 CREATE TABLE track_e_attempt (
@@ -3597,6 +3599,17 @@ CREATE TABLE question_score (
   PRIMARY KEY (id)
 ) DEFAULT CHARSET=utf8;
 
+DROP TABLE IF EXISTS track_attempt_jury;
+CREATE TABLE track_attempt_jury(
+    id int NOT NULL AUTO_INCREMENT,
+    exe_id INT,
+    question_id INT,
+    score float(6,2),
+    jury_member_id INT,
+    question_score_name_id INT,
+    PRIMARY KEY (id)
+) DEFAULT CHARSET=utf8;
+
 
 -- Do not move this
 UPDATE settings_current SET selected_value = '1.10.0.028' WHERE variable = 'chamilo_database_version';

+ 46 - 8
main/template/default/admin/jury_president/assign_members.tpl

@@ -1,33 +1,71 @@
 {% extends app.template_style ~ "/layout/layout_1_col.tpl" %}
 {% block content %}
     <a class="btn" href="">Asignar al azar</a>
+    <hr>
+    <form>
+
     <table class="table table-bordered">
         <tbody>
         <tr>
             <td>Revisar</td>
             {% for member in members %}
-                <td>Postulante {{ member.firstName }}</td>
+                {% if _u.user_id == member.user.userId %}
+                    <td class="hover">
+                {% else %}
+                    <td>
+                {% endif %}
+
+                    {# member.user.userId #}
+                    {%  if member.role.role == 'ROLE_JURY_PRESIDENT' %}
+                        P{{ loop.index }}
+                    {% elseif member.role.role == 'ROLE_JURY_MEMBER' %}
+                        M{{ loop.index -1}}
+                    {% else %}
+                        S{{ loop.index -1}}
+                    {% endif %}
+                </td>
             {% endfor %}
             <td>Estado</td>
         </tr>
         {% for student in students %}
             <tr>
                 <td>
-                    {{ student.firstName }}
+                    Estudiante #{{ student }}
                 </td>
                 {% for member in members %}
-                <td>
-                    11
-                </td>
+
+                    {% if _u.user_id == member.user.userId %}
+                        {% set memberHover = 'hover' %}
+                    {% else %}
+                        {% set memberHover = '' %}
+                    {% endif %}
+
+                    {% if relations[student][member.user.userId] == 3 %}
+                        {% set checked = 'checked="checked"' %}
+                        <td class="{{ memberHover }}">
+                            <div class="success">
+                    {% else %}
+                        {% set checked = '' %}
+                        <td class="{{ memberHover }}">
+                            <div>
+                    {% endif %}
+
+                        <input {{ checked }} id="check_{{ student }}_{{ member.user.userId }}" type="checkbox">
+                        </div>
+                    </td>
                 {% endfor %}
                 <td>
-                    Evaluado?
+                    {% if my_status_for_student[student] %}
+                        <a href="#" class="btn btn-success disabled">Evaluado</a>
+                    {% else %}
+                        <a href="#" class="btn btn-warning">Evaluar</a>
+                    {% endif %}
                 </td>
             </tr>
         {% endfor %}
         </tbody>
     </table>
+    </form>
+    <hr>
     <a class="btn" href="">Cierre de proceso</a>
-
-      {{ form_widget(form) }}
 {% endblock %}

+ 51 - 23
src/ChamiloLMS/Controller/Admin/JuryPresident/JuryPresidentController.php

@@ -121,36 +121,64 @@ class JuryPresidentController extends CommonController
             $userId = $user->getUserId();
         }
 
-        $juryUserType = new JuryUserType();
-        $form = $this->get('form.factory')->create($juryUserType);
-
+        /** @var Entity\Jury $jury */
         $jury = $this->getRepository()->getJuryByPresidentId($userId);
 
-        $user1 = new Entity\User(); $user1->setFirstname('111');
-        $user2 = new Entity\User(); $user2->setFirstname('222');
-        $user3 = new Entity\User(); $user3->setFirstname('333');
-
-        $m1 = new Entity\User(); $m1->setFirstname('m 11');
-        $m2 = new Entity\User(); $m2->setFirstname('m 22');
-        $m3 = new Entity\User(); $m3->setFirstname('m 33');
-
-        $users = array(
-            $user1,
-            $user2,
-            $user3,
-        );
+        if (!$jury) {
+            $this->get('session')->getFlashBag()->add('warning', "No tiene un comité asignado.");
+            $url = $this->get('url_generator')->generate('jury_president.controller:indexAction');
+            return $this->redirect($url);
+        }
 
-        $members = array(
-            $m1,
-            $m2,
-            $m3
-        );
+        // @todo add something
+        // $students = $this->getRepository()->getStudentsByJury($jury->getId());
+
+        $attempts = $jury->getExerciseAttempts();
+
+        // @todo move logic in a repository
+        /** @var Entity\TrackExercise $attempt */
+        $students = array();
+        $relations = array();
+        $myStatusForStudent = array();
+        foreach ($attempts as $attempt) {
+
+            $studentId = $attempt->getExeUserId();
+            $students[] = $studentId;
+            $juryAttempts = $attempt->getJuryAttempts();
+
+            /** @var Entity\TrackExerciseAttemptJury $juryAttempt */
+            $tempAttempt = array();
+            foreach ($juryAttempts as $juryAttempt) {
+                if (!isset($tempAttempt[$juryAttempt->getJuryMemberId()])) {
+                    $tempAttempt[$juryAttempt->getJuryMemberId()] = 1;
+                } else {
+                    $tempAttempt[$juryAttempt->getJuryMemberId()]++;
+                }
+            }
+
+            foreach ($tempAttempt as $memberId => $answerCount) {
+                $relations[$studentId][$memberId] = $answerCount;
+
+                if ($userId == $memberId) {
+                    if ($answerCount == 3) {
+                        $myStatusForStudent[$studentId] = true;
+                    } else {
+                        $myStatusForStudent[$studentId] = false;
+                    }
+                }
+            }
+        }
 
+        $members = $jury->getMembers();
         $template = $this->get('template');
+
+        $template->assign('my_status_for_student', $myStatusForStudent);
+        $template->assign('relations', $relations);
+        $template->assign('attempts', $attempts);
         $template->assign('members', $members);
-        $template->assign('students', $users);
-        $template->assign('form', $form->createView());
+        $template->assign('students', $students);
         $response = $template->render_template($this->getTemplatePath().'assign_members.tpl');
+
         return new Response($response, 200, array());
     }