Browse Source

Minor - adding comments.

Julio Montoya 11 years ago
parent
commit
91d72e86f8
2 changed files with 7 additions and 1 deletions
  1. 1 1
      main/exercice/admin.php
  2. 6 0
      main/exercice/exercise.class.php

+ 1 - 1
main/exercice/admin.php

@@ -533,7 +533,7 @@ if ($inATest) {
     // we are in create a new question from question pool not in a test
     echo '<div class="actions">';
     echo '<a href="'.$urlMainExercise.'admin.php?exerciseId='.$objExercise->id.'&'.api_get_cidreq().'">'.
-          Display::return_icon('back.png', get_lang('GoBackToQuestionList'),'', ICON_SIZE_MEDIUM ).'</a>';
+          Display::return_icon('back.png', get_lang('GoBackToQuestionList'), '', ICON_SIZE_MEDIUM).'</a>';
     echo '</div>';
 }
 

+ 6 - 0
main/exercice/exercise.class.php

@@ -915,17 +915,21 @@ class Exercise
                 $categoryParentInfo = null;
 
                 if (!empty($cat['parent_id'])) {
+
                     if (!isset($parentsLoaded[$cat['parent_id']])) {
                         $categoryEntity = $em->find('Entity\CQuizCategory', $cat['parent_id']);
                         $parentsLoaded[$cat['parent_id']] = $categoryEntity;
                     } else {
                         $categoryEntity = $parentsLoaded[$cat['parent_id']];
                     }
+
                     $path = $repo->getPath($categoryEntity);
                     $index = 0;
+
                     if ($this->categoryMinusOne) {
                         //$index = 1;
                     }
+
                     /** @var Entity\CQuizCategory $categoryParent*/
 
                     foreach ($path as $categoryParent) {
@@ -6019,6 +6023,7 @@ class Exercise
         }
 
         $categoryList = Session::read('categoryList');
+        // Use session too boost performance the variable is deleted in exercise_result.php
         $categoryList = null;
 
         if (empty($categoryList)) {
@@ -6082,6 +6087,7 @@ class Exercise
                 $newMediaList[$questionId] = $mediaId;
             }
         }
+
         $categoryList = $this->categoryWithQuestionList;
         $categoriesWithQuestion = array();