Pārlūkot izejas kodu

Moodle Import - fix e_notice #2734

Angel Fernando Quiroz Campos 6 gadi atpakaļ
vecāks
revīzija
32ba8ee3e5
1 mainītis faili ar 6 papildinājumiem un 9 dzēšanām
  1. 6 9
      main/inc/lib/MoodleImport.php

+ 6 - 9
main/inc/lib/MoodleImport.php

@@ -222,15 +222,12 @@ class MoodleImport
                     $exercise->updateFeedbackType(0);
 
                     // Match shuffle question with chamilo
-                    switch ($moduleValues['shufflequestions']) {
-                        case '0':
-                            $exercise->setRandom(0);
-                            break;
-                        case '1':
-                            $exercise->setRandom(-1);
-                            break;
-                        default:
-                            $exercise->setRandom(0);
+                    if (isset($moduleValues['shufflequestions']) &&
+                        (int) $moduleValues['shufflequestions'] === 1
+                    ) {
+                        $exercise->setRandom(-1);
+                    } else {
+                        $exercise->setRandom(0);
                     }
                     $exercise->updateRandomAnswers($moduleValues['shuffleanswers']);
                     // @todo divide to minutes