Sfoglia il codice sorgente

Fix hidden select when preview fill in blank question #2415

jmontoyaa 7 anni fa
parent
commit
6919041abd
1 ha cambiato i file con 9 aggiunte e 3 eliminazioni
  1. 9 3
      main/inc/ajax/exercise.ajax.php

+ 9 - 3
main/inc/ajax/exercise.ajax.php

@@ -537,8 +537,8 @@ switch ($action) {
             exit;
             exit;
         }
         }
 
 
-        $questionId = isset($_GET['question']) ? intval($_GET['question']) : 0;
-        $exerciseId = isset($_REQUEST['exercise']) ? intval($_REQUEST['exercise']) : 0;
+        $questionId = isset($_GET['question']) ? (int) $_GET['question'] : 0;
+        $exerciseId = isset($_REQUEST['exercise']) ? (int) $_REQUEST['exercise'] : 0;
 
 
         if (!$questionId || !$exerciseId) {
         if (!$questionId || !$exerciseId) {
             break;
             break;
@@ -548,9 +548,15 @@ switch ($action) {
         $objExercise->read($exerciseId);
         $objExercise->read($exerciseId);
 
 
         $objQuestion = Question::read($questionId);
         $objQuestion = Question::read($questionId);
-        $objQuestion->get_question_type_name();
 
 
         echo '<p class="lead">'.$objQuestion->get_question_type_name().'</p>';
         echo '<p class="lead">'.$objQuestion->get_question_type_name().'</p>';
+        if ($objQuestion->type == FILL_IN_BLANKS) {
+            echo '<script>
+                $(function() {
+                    $(".selectpicker").selectpicker({});
+                });
+            </script>';
+        }
         ExerciseLib::showQuestion(
         ExerciseLib::showQuestion(
             $objExercise,
             $objExercise,
             $questionId,
             $questionId,