From: Vincent Vanwaelscappel Date: Mon, 2 Nov 2020 15:13:00 +0000 (+0100) Subject: wait #4031 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c29ba7294b179c1bd66baa5c4f8c221b77270c09;p=fluidbook-toolbox.git wait #4031 @0.5 --- diff --git a/app/Http/Controllers/Admin/Operations/ImportOperation.php b/app/Http/Controllers/Admin/Operations/ImportOperation.php index 8ac5c263d..1ba768b49 100644 --- a/app/Http/Controllers/Admin/Operations/ImportOperation.php +++ b/app/Http/Controllers/Admin/Operations/ImportOperation.php @@ -34,7 +34,8 @@ trait ImportOperation $default = ['title' => '', 'translation' => '1', 'scorm' => '1', - 'review' => '1', + 'review' => 'always', + 'instantReview' => '1', 'threshold' => '0', 'owner' => auth()->user()->id]; @@ -52,7 +53,7 @@ trait ImportOperation $z = new ZipArchive(); $ok = $z->open($file); if ($ok !== true) { - Alert::warning('Unable to open '.$file)->flash(); + Alert::warning('Unable to open ' . $file)->flash(); continue; } @@ -60,7 +61,7 @@ trait ImportOperation $data = []; $datacontent = $z->getFromName('data.xml'); if (!$datacontent || stripos($datacontent, 'flash(); + Alert::warning($file . ' doesn\'t seem to be a valid quiz')->flash(); continue; } $x = simplexml_load_string($datacontent, "SimpleXMLElement", LIBXML_NOERROR | LIBXML_ERR_NONE); @@ -112,6 +113,11 @@ trait ImportOperation $questions = []; foreach ($xquestions as $xquestion) { $q = [ + 'type' => 'multiple', + 'count_for_score' => true, + 'report_label' => '', + 'placeholder' => '', + 'min_score' => 0, 'question' => (string)$xquestion->label, 'explaination' => (string)$xquestion->correction, 'multiple' => isset($xquestion['multiple']) ? (bool)$xquestion['multiple'] : false, diff --git a/app/Models/Quiz.php b/app/Models/Quiz.php index 39e963474..411d7adbd 100644 --- a/app/Models/Quiz.php +++ b/app/Models/Quiz.php @@ -238,7 +238,7 @@ class Quiz extends CubistMagicAbstractModel $xml->addChild('threshold', $data->get('threshold', '0') ?: '0'); $xml->addChild('restart_button', $data->get('restart_button', '0') ? '1' : '0'); $xml->addChild('instantReview', $data->get('instantReview', true) ? '1' : '0'); - $xml->addChild('review', $data->get('review', true) ? '1' : '0'); + $xml->addChild('review', $data->get('review', 'always')); $xml->addChild('logattempts', $data->get('logattempts', false) ? '1' : '0'); $xt = $xml->addChild('translations'); /** @var QuizTranslation $translation */ diff --git a/resources/quiz/js/main.js b/resources/quiz/js/main.js index fbc228d2e..77a9394f4 100644 --- a/resources/quiz/js/main.js +++ b/resources/quiz/js/main.js @@ -275,8 +275,12 @@ return; } + if ($(next).is("#resultsscreen")) { + updateScore(); + console.log(showReview, checkScore()) var show = showReview === 'always' || (showReview === 'passed' && checkScore()); + console.log(showReview, checkScore(), show, score); if (!show) { $('#correction').hide(); } else {