Browse Source

Fix upload exercise see BT#12698

jmontoyaa 7 years ago
parent
commit
b702a8ecab
1 changed files with 4 additions and 9 deletions
  1. 4 9
      main/exercise/upload_exercise.php

+ 4 - 9
main/exercise/upload_exercise.php

@@ -1,7 +1,7 @@
 <?php
 /* For licensing terms, see /license.txt */
 
-use \ChamiloSession as Session;
+use ChamiloSession as Session;
 
 /**
  * Upload quiz: This script shows the upload quiz feature
@@ -59,7 +59,6 @@ function lp_upload_quiz_actions()
     return $return;
 }
 
-
 function lp_upload_quiz_main()
 {
     $lp_id = isset($_GET['lp_id']) ? intval($_GET['lp_id']) : null;
@@ -127,7 +126,6 @@ function lp_upload_quiz_main()
  */
 function lp_upload_quiz_action_handling()
 {
-    global $debug;
     $_course = api_get_course_info();
     $courseId = $_course['real_id'];
 
@@ -265,7 +263,6 @@ function lp_upload_quiz_action_handling()
 
         // Quiz object
         $exercise = new Exercise();
-
         $quiz_id = $exercise->createExercise(
             $quizTitle,
             $expired_time,
@@ -471,17 +468,17 @@ function lp_upload_quiz_action_handling()
                         }
                         break;
                     case FILL_IN_BLANKS:
-                        $scoreList = [];
+                        $fillInScoreList = [];
                         $size = [];
                         $globalScore = 0;
                         foreach ($myAnswerList as $data) {
                             $score = isset($data['extra']) ? $data['extra'] : 0;
                             $globalScore += $score;
-                            $scoreList[] = $score;
+                            $fillInScoreList[] = $score;
                             $size[] = 200;
                         }
 
-                        $scoreToString = implode(',', $scoreList);
+                        $scoreToString = implode(',', $fillInScoreList);
                         $sizeToString = implode(',', $size);
 
                         //<p>Texte long avec les [mots] à [remplir] mis entre [crochets]</p>::10,10,10:200.36363999999998,200,200:0@'
@@ -527,9 +524,7 @@ function lp_upload_quiz_action_handling()
                             );
                             $counter++;
                         }
-
                         $objAnswer->save();
-
                         $questionObj = Question::read($question_id, $courseId);
                         if ($questionObj) {
                             $questionObj->updateWeighting($globalScore);