Przeglądaj źródła

Fixing grid when use have many answers see BT#6312

Julio Montoya 11 lat temu
rodzic
commit
c8de12c06b

+ 2 - 2
main/template/minedu/admin/jury_member/assign_members.tpl

@@ -36,7 +36,7 @@
                         {% set memberHover = '' %}
                         {% set memberHover = '' %}
                     {% endif %}
                     {% endif %}
 
 
-                    {% if relations[attempt.user.getUserId][member.user.userId] %}
+                    {% if relations[attempt.exeId][attempt.user.getUserId][member.user.userId] %}
                         {% set checkedSuccess = 'class="success"' %}
                         {% set checkedSuccess = 'class="success"' %}
                     {% else %}
                     {% else %}
                         {% set checkedSuccess = '' %}
                         {% set checkedSuccess = '' %}
@@ -56,7 +56,7 @@
                     </td>
                     </td>
                 {% endfor %}
                 {% endfor %}
                 <td>
                 <td>
-                    {% if my_student_status[attempt.user.getUserId] %}
+                    {% if my_student_status[attempt.exeId][attempt.user.getUserId] %}
                         <a href="#" class="btn btn-success disabled">Evaluado</a>
                         <a href="#" class="btn btn-success disabled">Evaluado</a>
                     {% else %}
                     {% else %}
                         {% if attempt.user.getUserId in students_by_member[_u.user_id] %}
                         {% if attempt.user.getUserId in students_by_member[_u.user_id] %}

+ 2 - 2
main/template/minedu/admin/jury_president/assign_members.tpl

@@ -62,7 +62,7 @@
                         {% set memberHover = '' %}
                         {% set memberHover = '' %}
                     {% endif %}
                     {% endif %}
 
 
-                    {% if relations[attempt.user.getUserId][member.user.userId] %}
+                    {% if relations[attempt.exeId][attempt.user.getUserId][member.user.userId] %}
                         {% set checkedSuccess = 'class="success"' %}
                         {% set checkedSuccess = 'class="success"' %}
                         {% set disabled = 'disabled' %}
                         {% set disabled = 'disabled' %}
                     {% else %}
                     {% else %}
@@ -83,7 +83,7 @@
                     </td>
                     </td>
                 {% endfor %}
                 {% endfor %}
                 <td>
                 <td>
-                    {% if my_student_status[attempt.user.getUserId] %}
+                    {% if my_student_status[attempt.exeId][attempt.user.getUserId] %}
                         <a href="#" class="btn btn-success disabled">Evaluado</a>
                         <a href="#" class="btn btn-success disabled">Evaluado</a>
                     {% else %}
                     {% else %}
                         {% if attempt.user.getUserId in students_by_member[_u.user_id] %}
                         {% if attempt.user.getUserId in students_by_member[_u.user_id] %}

+ 3 - 3
src/ChamiloLMS/Controller/Admin/JuryMember/JuryMemberController.php

@@ -74,11 +74,11 @@ class JuryMemberController extends CommonController
 
 
             $juryCorrections = 1;
             $juryCorrections = 1;
             foreach ($tempAttempt as $memberId => $answerCount) {
             foreach ($tempAttempt as $memberId => $answerCount) {
-                $relations[$user->getUserId()][$memberId] = $answerCount;
+                $relations[$attempt->getExeId()][$user->getUserId()][$memberId] = $answerCount;
 
 
                 // the jury_member correct the attempt
                 // the jury_member correct the attempt
                 if (!empty($answerCount) && $userId == $memberId) {
                 if (!empty($answerCount) && $userId == $memberId) {
-                    $myStudentStatus[$user->getUserId()] = true;
+                    $myStudentStatus[$attempt->getExeId()][$user->getUserId()] = true;
                 }
                 }
                 $juryCorrections++;
                 $juryCorrections++;
             }
             }
@@ -342,7 +342,6 @@ class JuryMemberController extends CommonController
                         $obj->setQuestionId($questionId);
                         $obj->setQuestionId($questionId);
                     }
                     }
                     $em->persist($obj);
                     $em->persist($obj);
-                    $em->flush();
                 }
                 }
             }
             }
 
 
@@ -350,6 +349,7 @@ class JuryMemberController extends CommonController
             $attempt->setJuryId($juryId);
             $attempt->setJuryId($juryId);
             //$attempt->setJuryScore($totalScore);
             //$attempt->setJuryScore($totalScore);
             $em->persist($attempt);
             $em->persist($attempt);
+            $em->flush();
 
 
             $this->get('session')->getFlashBag()->add('success', "Saved");
             $this->get('session')->getFlashBag()->add('success', "Saved");
             //$url = $this->generateUrl('jury_member.controller:scoreAttemptAction', array('exeId' => $exeId, 'juryId' => $juryId));
             //$url = $this->generateUrl('jury_member.controller:scoreAttemptAction', array('exeId' => $exeId, 'juryId' => $juryId));

+ 2 - 2
src/ChamiloLMS/Controller/Admin/JuryPresident/JuryPresidentController.php

@@ -229,11 +229,11 @@ class JuryPresidentController extends CommonController
 
 
             $juryCorrections = 1;
             $juryCorrections = 1;
             foreach ($tempAttempt as $memberId => $answerCount) {
             foreach ($tempAttempt as $memberId => $answerCount) {
-                $relations[$user->getUserId()][$memberId] = $answerCount;
+                $relations[$attempt->getExeId()][$user->getUserId()][$memberId] = $answerCount;
 
 
                 // the jury_member correct the attempt
                 // the jury_member correct the attempt
                 if (!empty($answerCount) && $userId == $memberId) {
                 if (!empty($answerCount) && $userId == $memberId) {
-                    $myStudentStatus[$user->getUserId()] = true;
+                    $myStudentStatus[$attempt->getExeId()][$user->getUserId()] = true;
                 }
                 }
 
 
                 if ($juryCorrections == $this->maxCountOfMemberToVoteToConsiderEvaluated) {
                 if ($juryCorrections == $this->maxCountOfMemberToVoteToConsiderEvaluated) {