From: Vincent Vanwaelscappel Date: Thu, 7 Mar 2024 08:36:19 +0000 (+0100) Subject: wait #6765 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=5a06443411d55ef3bdb8334e68597d9fd55aeca9;p=fluidbook-toolbox.git wait #6765 @1 --- diff --git a/app/Elearning/QuizCompiler.php b/app/Elearning/QuizCompiler.php index 5e390a1b0..2f2c9cf51 100644 --- a/app/Elearning/QuizCompiler.php +++ b/app/Elearning/QuizCompiler.php @@ -19,6 +19,7 @@ use Cubist\Util\Files\VirtualDirectory; use Cubist\Util\Graphics\Color; use Cubist\Util\Text; use GrahamCampbell\Markdown\Facades\Markdown; +use Illuminate\Support\Facades\Log; use RyanChandler\Blade\Blade; class QuizCompiler extends Base @@ -85,7 +86,7 @@ class QuizCompiler extends Base $vdir = new VirtualDirectory($this->dest); $vdir->copyDirectory($this->compilePath . '/dist/css', 'css'); $vdir->copyDirectory($this->compilePath . '/dist/js', 'js'); - $vdir->copyDirectory($this->compilePath . '/dist/assets', 'assets',false); + $vdir->copyDirectory($this->compilePath . '/dist/assets', 'assets', false); $l10n = $this->data->l10n; $blade = new Blade($this->_resourcesPath() . '/views', $this->_resourcesPath() . '/cache/' . md5(rand(100000, 10000000)) . '/'); @@ -315,6 +316,10 @@ class QuizCompiler extends Base $mix = 'const mix = require("laravel-mix");'; foreach ($this->mixDirectories as $from => $to) { + if (!file_exists($this->compilePath ."/". $from)) { + Log::debug('skip ' . $this->compilePath .'/'. $from); + continue; + } $mix .= 'mix.copyDirectory("' . $from . '","' . $to . '");'; } $mix .= 'mix.setPublicPath("dist");'; @@ -332,6 +337,7 @@ class QuizCompiler extends Base } $cli->setModule('cross-env process.env.local=1 mix' . $arg); $cli->execute(); + $cli->debug(); $requiredFiles = ['js/quiz.js', 'css/style.css']; diff --git a/app/Models/Traits/ToolboxPlayerBranches.php b/app/Models/Traits/ToolboxPlayerBranches.php index 9f3023629..9ccb26319 100644 --- a/app/Models/Traits/ToolboxPlayerBranches.php +++ b/app/Models/Traits/ToolboxPlayerBranches.php @@ -19,6 +19,9 @@ trait ToolboxPlayerBranches protected function getActiveBranches() { $cacheFile = self::getPlayerBaseDirectory() . 'activebranches'; + if (!file_exists($cacheFile)) { + return self::updateAllBranches(); + } $res = json_decode(file_get_contents($cacheFile), true); if (!$res) { return self::updateAllBranches(); diff --git a/resources/quiz/assets/banner.jpg b/resources/quiz/assets/banner.jpg deleted file mode 100644 index 75f2cd5cd..000000000 Binary files a/resources/quiz/assets/banner.jpg and /dev/null differ diff --git a/resources/quiz/assets/nok.svg b/resources/quiz/assets/nok.svg deleted file mode 100644 index 6f969abac..000000000 --- a/resources/quiz/assets/nok.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/resources/quiz/assets/ok.svg b/resources/quiz/assets/ok.svg deleted file mode 100644 index 10a0e82af..000000000 --- a/resources/quiz/assets/ok.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - diff --git a/resources/quiz/fonts/Roboto-Bold-webfont.woff b/resources/quiz/fonts/Roboto-Bold-webfont.woff deleted file mode 100644 index 8c9b02410..000000000 Binary files a/resources/quiz/fonts/Roboto-Bold-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/Roboto-Light-webfont.woff b/resources/quiz/fonts/Roboto-Light-webfont.woff deleted file mode 100644 index 983083c7f..000000000 Binary files a/resources/quiz/fonts/Roboto-Light-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/Roboto-Regular-webfont.woff b/resources/quiz/fonts/Roboto-Regular-webfont.woff deleted file mode 100644 index 7245f5cae..000000000 Binary files a/resources/quiz/fonts/Roboto-Regular-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/RobotoCondensed-Bold-webfont.woff b/resources/quiz/fonts/RobotoCondensed-Bold-webfont.woff deleted file mode 100644 index f56461221..000000000 Binary files a/resources/quiz/fonts/RobotoCondensed-Bold-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/RobotoCondensed-Light-webfont.woff b/resources/quiz/fonts/RobotoCondensed-Light-webfont.woff deleted file mode 100644 index 6a8ae661a..000000000 Binary files a/resources/quiz/fonts/RobotoCondensed-Light-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/RobotoCondensed-Regular-webfont.woff b/resources/quiz/fonts/RobotoCondensed-Regular-webfont.woff deleted file mode 100644 index dd61f2414..000000000 Binary files a/resources/quiz/fonts/RobotoCondensed-Regular-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/fontawesome-webfont.woff b/resources/quiz/fonts/fontawesome-webfont.woff deleted file mode 100644 index 400014a4b..000000000 Binary files a/resources/quiz/fonts/fontawesome-webfont.woff and /dev/null differ diff --git a/resources/quiz/fonts/fontawesome-webfont.woff2 b/resources/quiz/fonts/fontawesome-webfont.woff2 deleted file mode 100644 index 4d13fc604..000000000 Binary files a/resources/quiz/fonts/fontawesome-webfont.woff2 and /dev/null differ diff --git a/resources/quiz/index.html b/resources/quiz/index.html deleted file mode 100644 index ef0dceb21..000000000 --- a/resources/quiz/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - -
-
-
-
-
-
-
-
-
-
- - - - diff --git a/resources/quiz/js/app.js b/resources/quiz/js/app.js deleted file mode 100644 index e6431f301..000000000 --- a/resources/quiz/js/app.js +++ /dev/null @@ -1,749 +0,0 @@ -import $ from "jquery"; -import gsap from "gsap"; -import {CubeSCORM} from '../../scorm/scorm'; - -window.cubeSCORM = new CubeSCORM(); -window.$ = window.jQuery = $; - -(function (global) { - $(function () { - var data; - var score; - var questionStatus = {}; - var testMode, quizMode, showReview, threshold, instantReview, logAttempts, displayScore, countQuestions, - passedAction, failedAction, - logQuestions; - - function initApp() { - if (cubeSCORM.SCORM_INITED) { - return; - } - - let disable = false; - try { - if (window.parent !== undefined && window.parent.fluidbook !== undefined) { - disable = true; - } - } catch (e) { - - } - - cubeSCORM.initScorm(disable); - init(cubeSCORM.getScormLocation({q: 1})); - } - - $(window).on('resize', resize); - - initContents(); - - function resize() { - // Window size that reserve enough space for all questions and avoid scroll jumps - var maxHeight = 0; - $(".question").each(function () { - var hide = false; - if (!$(this).is(':visible')) { - hide = true; - $(this).show(); - } - maxHeight = Math.max(maxHeight, $(this).outerHeight()); - if (hide) { - $(this).hide(); - } - }); - if ($("#resultsscreen:visible").length == 1) { - maxHeight = Math.max(maxHeight, $("#resultsscreen:visible").outerHeight()); - } - $("main").css('minHeight', Math.max(maxHeight + 100, $(window).outerHeight() - $('header').outerHeight() - 70)); - - // Header - var ww = $(window).outerWidth(); - var h1 = $("header .headerholder .titleHolder h1"); - h1.css('width', '100%'); - h1.css('font-size', ''); - if (ww > 640) { - var fz = 32; - var h1h = h1.outerHeight() - 40; - while (h1h > 32) { - fz--; - h1.css('font-size', fz); - h1h = h1.outerHeight() - 40; - } - } - - // Badge position - try { - var left = (ww - 220) / 2; - var answersBox = $(".question:visible .answers").get(0).getBoundingClientRect(); - var top = answersBox.top + (answersBox.height - 200) / 2; - $("#badge").css({top: top, left: left}); - } catch (e) { - - } - } - - function getTranslation(key) { - return DATA.translations[key]; - } - - function resizeContainer() { - try { - if (parent.window.fluidbook !== undefined) { - parent.window.fluidbook.links.resizeIframe($(document).outerHeight()); - } - if (parent.window.resize !== undefined) { - parent.window.resize(); - } - } catch (e) { - - } - } - - function initContents() { - if (DATA.css !== '') { - $("head").append(''); - } - $("header .headerholder .titleHolder").append('

' + DATA.title + '

'); - $("header .headerholder .titleHolder h1").css('width', '99%'); - $("title").text(DATA.title); - - document.documentElement.style.setProperty('--main-color', DATA.mainColor); - document.documentElement.style.setProperty('--header-overlay', DATA.overlay); - document.documentElement.style.setProperty('--ok-color', DATA.okColor); - document.documentElement.style.setProperty('--nok-color', DATA.nokColor); - document.documentElement.style.setProperty('--review-background', DATA.reviewBackground); - $('head').append(''); - - showReview = DATA.review; - threshold = 0; - instantReview = DATA.instantReview; - logAttempts = DATA.logattempts; - displayScore = DATA.display_score; - testMode = DATA.type === 'test'; - quizMode = DATA.type === 'quiz'; - - threshold = DATA.threshold; - if (threshold > 1) { - threshold /= 100; - } - - // Create quiz container - var results = '
'; - results += '
'; - - var correction = $('

' + getTranslation('reviewAnswer') + '

'); - - var qn = 1; - countQuestions = 0; - // Create questions - $.each(DATA.questions, function (k, question) { - if (question.count_for_score) { - countQuestions++; - } - var multipleClass = question.multiple ? ' multiple' : ''; - var questionHtml = '
'; - questionHtml += '

' + sprintf(getTranslation('question'), qn) + '

' + question.question + '
'; - questionHtml += '
'; - if (question.multiple) { - questionHtml += '' + getTranslation('validateAnswer') + ''; - } else if (question.type !== 'multiple') { - questionHtml += '' + getTranslation('validateAnswerSingular') + ''; - } - questionHtml += '
'; - - var questionCorrection = question.explaination; - if (questionCorrection === '') { - var c = []; - $.each(question.answers, function (kk, answer) { - if (answer.correct == 1) { - c.push(answer.answer); - } - }); - questionCorrection = c.join('
'); - } - - var c = '

' + sprintf(getTranslation('question'), qn) + ' ' + question.question + '

' + questionCorrection + '

'; - $(correction).append(c); - - var q = $(questionHtml); - var required = question.required === 1 ? 'required' : ''; - - // Append answers - var holder = $('
'); - if (question.type === 'multiple') { - var an = 0; - var correctCount = 0; - - $.each(question.answers, function (aa, answer) { - var a = $('
' + answer.answer + '
'); - // Set correct tag - var correct = answer.correct == 1 ? 1 : 0; - correctCount += correct; - $(a).find('.answer').attr('data-correct', correct); - $(holder).append($(a)); - an++; - }); - } else if (question.type === 'text' || question.type === "email") { - $(holder).append('') - } else if (question.type === 'textarea') { - $(holder).append('') - } else if (question.type === 'country') { - var select = '
'; - $(holder).append(select); - } - - $(q).find('.answers').append($(holder)); - - $("main").append(q); - - qn++; - }); - - var results; - if (testMode) { - results = testResults(); - } else { - results = quizResults(correction); - } - - $("main").append(results); - - $(document).on('quizinit', function (event, state) { - init(state); - }); - - initApp(); - - resizeContainer(); - resize(); - } - - function quizResults(correction) { - var defaultMessage = DATA.defaultMessage !== '' ? DATA.defaultMessage : 'You have finished the quiz!'; - var passedMessage = DATA.passedMessage !== '' ? DATA.passedMessage : defaultMessage; - var failedMessage = DATA.failedMessage !== '' ? DATA.failedMessage : defaultMessage; - - passedAction = DATA.passedAction !== '' ? DATA.passedAction : null; - failedAction = DATA.failedAction !== '' ? DATA.failedAction : null; - - var results = '
'; - results += '
'; - results += '

' + defaultMessage + '

'; - results += '

' + passedMessage + '

'; - results += '

' + failedMessage + '

'; - if (displayScore) { - results += '
' + getTranslation('totalQuestions') + ' ' + countQuestions + '
' + getTranslation('correctAnswers') + '
'; - } - results += '
'; - results += '' + getTranslation('restartQuiz') + ''; - results += '
'; - - results = $(results); - $(results).append(correction); - return results; - } - - function testResults() { - var results = '
'; - results += '
'; - $.each(DATA.test_results, function (k, v) { - results += '

' + v.text + '

'; - }); - results += '
'; - results += '
'; - - results = $(results); - return results; - } - - function init(state) { - resize(); - $(document).on('click', ".answer", function () { - answer($(this)); - return false; - }); - - $(document).on('click', ".validatemulti", function () { - validateMulti($(this)); - return false; - }); - - if (state.a) { - $.each($(state.a), function (k, v) { - var q = $('section.question[data-q="' + (k + 1) + '"]'); - $.each(v, function (kk, vv) { - $(q).find('.answer[data-a="' + vv + '"]').addClass('active'); - }); - }); - } - initScreen(state.q - 1); - } - - function validateMulti(button) { - var question = $(button).closest('.question'); - if ($(question).find('input').length > 0) { - var input = $(question).find('input'); - if (!$(input).get(0).checkValidity()) { - $(input).get(0).reportValidity() - return; - } - } - updateScore(); - var ok = null; - if ($(question).attr('data-count') == '1') { - ok = questionStatus[$(question).data('q')] - } - - displayBadge(ok); - resizeContainer(); - } - - function answer(answer) { - var multiple = $(answer).closest('.question').hasClass('multiple'); - if (!multiple && $("section:visible .answer.active").length > 0) { - return; - } - - if (!multiple) { - $(answer).addClass('active'); - $('section:visible').find('.answer:not(.active)').addClass('inactive'); - updateScore(); - if (testMode) { - displayBadge(true); - } else { - displayBadge($(answer).attr('data-correct') == 1); - } - resizeContainer(); - } else { - $(answer).toggleClass('active'); - } - } - - function initScreen(screen) { - // When displaying first question - setTimeout(function () { - $("section").eq(screen).show(); - resizeContainer(); - }, 50) - } - - function nextScreen() { - var prev = $("section:visible"); - var next = $(prev).next('section'); - var $this = this; - - // If no screen remaining - if ($(next).length == 0) { - return; - } - - - if ($(next).is("#resultsscreen")) { - updateScore(); - if (quizMode) { - var show = showReview === 'always' || (showReview === 'passed' && checkScore()); - - if (!show) { - $('#correction').hide(); - } else { - $('#correction').show(); - } - } else { - $('.test_result').each(function () { - var show = score >= $(this).data('min') && score <= $(this).data('max'); - console.log(this, show, score, $(this).data('min'), $(this).data('max')); - if (show) { - $(this).show(); - } else { - $(this).hide(); - } - }); - } - completed(); - } - - var w = $(prev).outerWidth(); - $(next).show(); - resize(); - gsap.fromTo($(next), {left: w + 50, opacity: 0}, {duration: 0.5, left: 0, opacity: 1}); - gsap.fromTo($(prev), {left: 0, opacity: 1}, { - duration: 0.5, left: -w - 50, opacity: 0, onComplete: function () { - $(prev).hide(); - endTransition(); - } - }); - resizeContainer(); - } - - function endTransition() { - $("section:visible .focusme").focus(); - } - - function completed() { - updateScore(); - - var passed = checkScore(); - if (logAttempts) { - logAttempt(passed); - } - - if (DATA.scorm) { - cubeSCORM.setScormValue('status', 'completed'); - cubeSCORM.setScormValue('success_status', passed ? 'passed' : 'failed'); - cubeSCORM.setSCORMScore(getNormalizedScore(true), 100, 0, getNormalizedScore()); - cubeSCORM.setSCORMLocation({q: 1}); - } - } - - function getNormalizedScore(pct) { - var s = score / countQuestions; - if (pct === undefined || pct === false) { - return s; - } - return Math.round(100 * s); - } - - function logAttempt(passed) { - var score = getNormalizedScore(true); - if (isNaN(score)) { - score = 0; - } - var logdata = { - score: score, passed: passed, questions: logQuestions, - }; - - $.ajax('https://toolbox.fluidbook.com/quiz/' + DATA.id + '/log', { - method: 'POST', data: logdata, crossDomain: true, - }); - } - - function checkScore() { - if (quizMode) { - var normalizedScore = getNormalizedScore(false); - $('#results > h2').hide(); - var passed; - $('#restart').hide(); - if (threshold === 0) { - $('.defaultMessage').show(); - passed = true; - } else if (normalizedScore >= threshold) { - $(".passedMessage").show(); - execAction(passedAction); - passed = true; - } else { - $('.failedMessage').show(); - execAction(failedAction); - passed = false; - if ($(data).find('restart_button').text() === "1") { - $('#restart').show(); - } - } - return passed; - } - return true; - } - - function execAction(action) { - if (action === undefined || action === null || action === '' || !action) { - return; - } - try { - eval(action); - } catch (e) { - console.error('Error while running code ' + action + ' :: ' + e.message); - } - } - - function displayBadge(correct) { - resize(); - if (!instantReview || correct === null) { - nextScreen(); - return; - } - if (correct) { - $("#badge").addClass('correct').removeClass('incorrect'); - } else { - $("#badge").addClass('incorrect').removeClass('correct'); - } - $("#badge").fadeIn(350, function () { - setTimeout(function () { - $("#badge").fadeOut(350, function () { - nextScreen(); - }); - }, 1000); - }); - } - - function updateScore() { - if (testMode) { - return updateTestScore(); - } - if (quizMode) { - return updateQuizScore(); - } - } - - function updateTestScore() { - score = 0; - var answers = []; - var qn = 1; - logQuestions = []; - - - $('.question').each(function () { - var q = $(this); - var a = []; - var log = {}; - - var qScore = null; - if ($(this).data('type') === 'multiple') { - $(this).find('.answer.active').each(function () { - a.push($(this).data('a')) - qScore = DATA.questions[q.data('q') - 1].answers[$(this).data('a')].score; - }); - - answers.push(a); - log.answer = a; - } else { - log.answer = $(this).find('input,textarea,select').val(); - } - - questionStatus[qn] = qScore; - - if (qScore !== null) { - score += qScore; - } - log.score = qScore; - - logQuestions[qn] = log; - qn++; - }); - - - var state = { - q: $(".answer.active").last().closest('.question').data('q') + 1, a: answers - }; - - if (SCORM) { - cubeSCORM.setSCORMLocation(state); - } - $("#correctanswers").text(score); - } - - function updateQuizScore() { - score = 0; - var answers = []; - var qn = 1; - logQuestions = []; - - $('.question').each(function () { - var a = []; - var ok = true; - var count = $(this).attr('data-count') == '1'; - var log = { - 'count': count, - }; - - if ($(this).data('type') === 'multiple') { - var min_score = parseInt($(this).data('min-score')); - if (min_score === 0) { - min_score = $(this).find('.answer[data-correct="1"]').length; - } - var this_score = 0; - $(this).find('.answer').each(function () { - if ($(this).hasClass('active')) { - var correct = $(this).attr('data-correct') == '1'; - this_score += correct ? 1 : -1; - a.push($(this).data('a')) - } - }); - ok = this_score >= min_score; - - answers.push(a); - log.answer = a; - } else { - log.answer = $(this).find('input,textarea,select').val(); - } - - if (!count) { - ok = null; - } - - questionStatus[qn] = ok; - - var b = $("#correction .correction[data-i='" + qn + "'] .badge"); - $(b).removeClass('correct').removeClass('incorrect'); - if (ok === true) { - $(b).addClass('correct'); - } else if (ok === false) { - $(b).addClass('incorrect'); - } - if (ok && count) { - score++; - log.score = 1; - } else { - log.score = 0; - } - logQuestions[qn] = log; - qn++; - }); - - - var state = { - q: $(".answer.active").last().closest('.question').data('q') + 1, a: answers - }; - - if (cubeSCORM.SCORM) { - cubeSCORM.setSCORMLocation(state); - } - $("#correctanswers").text(score); - } - - - }); -})(typeof window === 'undefined' ? this : window); - - -(function (global) { - 'use strict'; - if (!global.console) { - global.console = {}; - } - var con = global.console; - var prop, method; - var dummy = function () { - }; - var properties = ['memory']; - var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' + 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' + 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(','); - while (prop = properties.pop()) if (!con[prop]) con[prop] = {}; - while (method = methods.pop()) if (typeof con[method] !== 'function') con[method] = dummy; - // Using `this` for web workers & supports Browserify / Webpack. -})(typeof window === 'undefined' ? this : window); - -/*! sprintf-js v1.1.2 | Copyright (c) 2007-present, Alexandru Mărășteanu | BSD-3-Clause */ -!function () { - "use strict"; - var g = { - not_string: /[^s]/, - not_bool: /[^t]/, - not_type: /[^T]/, - not_primitive: /[^v]/, - number: /[diefg]/, - numeric_arg: /[bcdiefguxX]/, - json: /[j]/, - not_json: /[^j]/, - text: /^[^\x25]+/, - modulo: /^\x25{2}/, - placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/, - key: /^([a-z_][a-z_\d]*)/i, - key_access: /^\.([a-z_][a-z_\d]*)/i, - index_access: /^\[(\d+)\]/, - sign: /^[+-]/ - }; - - function y(e) { - return function (e, t) { - var r, n, i, s, a, o, p, c, l, u = 1, f = e.length, d = ""; - for (n = 0; n < f; n++) if ("string" == typeof e[n]) d += e[n]; else if ("object" == typeof e[n]) { - if ((s = e[n]).keys) for (r = t[u], i = 0; i < s.keys.length; i++) { - if (null == r) throw new Error(y('[sprintf] Cannot access property "%s" of undefined value "%s"', s.keys[i], s.keys[i - 1])); - r = r[s.keys[i]] - } else r = s.param_no ? t[s.param_no] : t[u++]; - if (g.not_type.test(s.type) && g.not_primitive.test(s.type) && r instanceof Function && (r = r()), g.numeric_arg.test(s.type) && "number" != typeof r && isNaN(r)) throw new TypeError(y("[sprintf] expecting number but found %T", r)); - switch (g.number.test(s.type) && (c = 0 <= r), s.type) { - case"b": - r = parseInt(r, 10).toString(2); - break; - case"c": - r = String.fromCharCode(parseInt(r, 10)); - break; - case"d": - case"i": - r = parseInt(r, 10); - break; - case"j": - r = JSON.stringify(r, null, s.width ? parseInt(s.width) : 0); - break; - case"e": - r = s.precision ? parseFloat(r).toExponential(s.precision) : parseFloat(r).toExponential(); - break; - case"f": - r = s.precision ? parseFloat(r).toFixed(s.precision) : parseFloat(r); - break; - case"g": - r = s.precision ? String(Number(r.toPrecision(s.precision))) : parseFloat(r); - break; - case"o": - r = (parseInt(r, 10) >>> 0).toString(8); - break; - case"s": - r = String(r), r = s.precision ? r.substring(0, s.precision) : r; - break; - case"t": - r = String(!!r), r = s.precision ? r.substring(0, s.precision) : r; - break; - case"T": - r = Object.prototype.toString.call(r).slice(8, -1).toLowerCase(), r = s.precision ? r.substring(0, s.precision) : r; - break; - case"u": - r = parseInt(r, 10) >>> 0; - break; - case"v": - r = r.valueOf(), r = s.precision ? r.substring(0, s.precision) : r; - break; - case"x": - r = (parseInt(r, 10) >>> 0).toString(16); - break; - case"X": - r = (parseInt(r, 10) >>> 0).toString(16).toUpperCase() - } - g.json.test(s.type) ? d += r : (!g.number.test(s.type) || c && !s.sign ? l = "" : (l = c ? "+" : "-", r = r.toString().replace(g.sign, "")), o = s.pad_char ? "0" === s.pad_char ? "0" : s.pad_char.charAt(1) : " ", p = s.width - (l + r).length, a = s.width && 0 < p ? o.repeat(p) : "", d += s.align ? l + r + a : "0" === o ? l + a + r : a + l + r) - } - return d - }(function (e) { - if (p[e]) return p[e]; - var t, r = e, n = [], i = 0; - for (; r;) { - if (null !== (t = g.text.exec(r))) n.push(t[0]); else if (null !== (t = g.modulo.exec(r))) n.push("%"); else { - if (null === (t = g.placeholder.exec(r))) throw new SyntaxError("[sprintf] unexpected placeholder"); - if (t[2]) { - i |= 1; - var s = [], a = t[2], o = []; - if (null === (o = g.key.exec(a))) throw new SyntaxError("[sprintf] failed to parse named argument key"); - for (s.push(o[1]); "" !== (a = a.substring(o[0].length));) if (null !== (o = g.key_access.exec(a))) s.push(o[1]); else { - if (null === (o = g.index_access.exec(a))) throw new SyntaxError("[sprintf] failed to parse named argument key"); - s.push(o[1]) - } - t[2] = s - } else i |= 2; - if (3 === i) throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported"); - n.push({ - placeholder: t[0], - param_no: t[1], - keys: t[2], - sign: t[3], - pad_char: t[4], - align: t[5], - width: t[6], - precision: t[7], - type: t[8] - }) - } - r = r.substring(t[0].length) - } - return p[e] = n - }(e), arguments) - } - - function e(e, t) { - return y.apply(null, [e].concat(t || [])) - } - - var p = Object.create(null); - "undefined" != typeof exports && (exports.sprintf = y, exports.vsprintf = e), "undefined" != typeof window && (window.sprintf = y, window.vsprintf = e, "function" == typeof define && define.amd && define(function () { - return {sprintf: y, vsprintf: e} - })) -}(); diff --git a/resources/quiz/style/000-imports.sass b/resources/quiz/style/000-imports.sass deleted file mode 100644 index 91ff4848b..000000000 --- a/resources/quiz/style/000-imports.sass +++ /dev/null @@ -1,3 +0,0 @@ -@import 001-variables -@import 003-reset -@import 004-fonts diff --git a/resources/quiz/style/001-variables.sass b/resources/quiz/style/001-variables.sass deleted file mode 100644 index 9fd5f3315..000000000 --- a/resources/quiz/style/001-variables.sass +++ /dev/null @@ -1,19 +0,0 @@ -$font-base: 'RobotoCondensed' -$font-condensed: 'RobotoCondensed' - -//-- Colors -$color-back: #fefefe -$color-text: #575756 - -$color-answer-back: #575756 -$color-answer-text: #fff -$color-answer-hover: #000 - -$color-badge-incorrect-text: #fff -$color-badge-correct-text: #fff - -$color-result-background: #E7007A -$color-result-text: #fff - -$color-review-text: #fff - diff --git a/resources/quiz/style/003-reset.sass b/resources/quiz/style/003-reset.sass deleted file mode 100644 index 45897f9ce..000000000 --- a/resources/quiz/style/003-reset.sass +++ /dev/null @@ -1,51 +0,0 @@ -/* http://meyerweb.com/eric/tools/css/reset/ - v2.0 | 20110126 - License: none (public domain) */ - -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video, main - margin: 0 - padding: 0 - border: 0 - font-size: 100% - font: inherit - vertical-align: baseline - box-sizing: border-box - - -/* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section, main - display: block - - -body - line-height: 1 - - -ol, ul - list-style: none - - -blockquote, q - quotes: none - -blockquote:before, blockquote:after, -q:before, q:after - content: '' - content: none - -table - border-collapse: collapse - border-spacing: 0 diff --git a/resources/quiz/style/004-fonts.sass b/resources/quiz/style/004-fonts.sass deleted file mode 100644 index 1282e602d..000000000 --- a/resources/quiz/style/004-fonts.sass +++ /dev/null @@ -1,17 +0,0 @@ -@font-face - font-family: 'RobotoCondensed' - src: url('../fonts/RobotoCondensed-Regular-webfont.woff') format('woff') - font-weight: 400 - font-style: normal - -@font-face - font-family: 'RobotoCondensed' - src: url('../fonts/RobotoCondensed-Light-webfont.woff') format('woff') - font-weight: 300 - font-style: normal - -@font-face - font-family: 'RobotoCondensed' - src: url('../fonts/RobotoCondensed-Bold-webfont.woff') format('woff') - font-weight: 700 - font-style: normal diff --git a/resources/quiz/style/010-common.sass b/resources/quiz/style/010-common.sass deleted file mode 100644 index a4ffa2f91..000000000 --- a/resources/quiz/style/010-common.sass +++ /dev/null @@ -1,55 +0,0 @@ -\:root - --main-color: #e7007a - -#holder - max-width: 100% - overflow: hidden - -body, input, textarea, table - font-family: $font-base - -body - overflow-y: scroll - overflow-x: hidden - font-size: 18px - color: $color-text - background-color: $color-back - line-height: 1.4em - cursor: default - - -webkit-touch-callout: none - -webkit-user-select: none - -moz-user-select: none - -ms-user-select: none - user-select: none - -.fa - font-family: FontAwesome - -@mixin badge($width, $border) - text-align: center - text-transform: lowercase - font-family: $font-condensed - font-weight: 700 - letter-spacing: 1px - z-index: 1 - border-radius: 50% - line-height: $width - width: $width - height: $width - font-size: $width*0.24 - border: $border solid #fff - position: absolute - background-position: 50% 50% - background-size: 55% auto - background-repeat: no-repeat - - &.correct - background-color: var(--ok-color) - color: $color-badge-correct-text - background-image: url("../assets/ok.svg") - - &.incorrect - background-color: var(--nok-color) - color: $color-badge-incorrect-text - background-image: url("../assets/nok.svg") diff --git a/resources/quiz/style/020-header.sass b/resources/quiz/style/020-header.sass deleted file mode 100644 index f1d0ef57f..000000000 --- a/resources/quiz/style/020-header.sass +++ /dev/null @@ -1,78 +0,0 @@ -header - background-image: url("../assets/banner.jpg") - background-position: 50% 50% - background-size: cover - height: 108px - position: relative - margin-bottom: 40px - - .headerholder - background-color: var(--header-overlay) - height: 73px - width: 100% - position: relative - - @media (max-width: 640px) - min-height: 20% - - - @media (max-width: 320px) - min-height: 30% - - .titleHolder - width: 100% - height: 100% - max-width: 800px - margin: 0 auto - position: relative - - h1 - text-align: left - color: #fff - font-family: $font-condensed - font-weight: 700 - font-size: 32px - line-height: 1em - width: 100% - padding: 20px 180px 20px 40px - - @media (max-width: 640px) - text-align: center - font-size: 22px - bottom: 25px - padding: 20px 40px 20px 40px - - - @media (max-width: 320px) - font-size: 20px - bottom: 15px - - &:after - position: absolute - content: '' - right: 45px - top: 20px - display: block - background-image: url("../assets/logo.png") - background-size: contain - background-position: 100% 50% - background-repeat: no-repeat - width: 151px - height: 40px - z-index: 1 - - @media (max-width: 900px) - width: 151px*0.75 - height: 38px*0.75 - - @media (max-width: 640px) - display: none - - @media (max-width: 1280px) - height: 150px - - @media (max-width: 640px) - height: 135px - - @media (max-width: 320px) - height: 100px diff --git a/resources/quiz/style/030-quiz.sass b/resources/quiz/style/030-quiz.sass deleted file mode 100644 index c0292be1a..000000000 --- a/resources/quiz/style/030-quiz.sass +++ /dev/null @@ -1,191 +0,0 @@ -main - width: 100% - max-width: 800px - margin: 0 auto -50px - position: relative - -section - display: none - position: absolute - width: 100% - top: 0 - padding: 0 40px 0 40px - - @media (max-width: 640px) - padding: 0 30px 0 30px - - @media (max-width: 480px) - padding: 0 20px 0 20px - -.button - color: var(--main-color) - text-decoration: none - font-weight: 700 - font-size: 22px - float: right - margin-top: 15px - -.question - .label - font-size: 20px - @media (max-width: 640px) - font-size: 16px - line-height: 1.4em - - h3 - font-family: $font-condensed - font-size: 100% - font-weight: 700 - margin-bottom: 10px - display: inline - @media (max-width: 640px) - font-size: 21px - - @media (max-width: 320px) - font-size: 21px - - .answers - margin-top: 30px - - .select-holder - position: relative - - &:after - display: block - content: "" - position: absolute - right: 0rem - bottom: 1.2rem - width: 3rem - height: 0.5rem - background-image: url("data:image/svg+xml;charset=utf-8;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iQ2FscXVlXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMjguMiAxNS4xIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyOC4yIDE1LjE7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxwb2x5bGluZSBzdHlsZT0iZmlsbDpub25lO3N0cm9rZTojRkZGRkZGO3N0cm9rZS13aWR0aDozO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDoxMDsiIHBvaW50cz0iMjYuNywxLjUgMTQuMSwxMy42IDEuNSwxLjUgIi8+DQo8L3N2Zz4=") - background-size: 100% 100% - background-repeat: no-repeat - pointer-events: none - - select - appearance: none - - input[type="text"], input[type="email"], textarea, select - border: 0px - border-radius: 5px - padding: 15px - width: 100% - height: 100% - font-size: 16px - line-height: 1.2em - background-color: $color-answer-back - color: $color-answer-text - - textarea - height: 100px - - .answer-holder - width: 50% - height: 91px - display: inline-block - vertical-align: top - - &:nth-child(odd) - padding: 5px 5px 5px 0 - - - &:nth-child(even) - padding: 5px 0 5px 5px - - @media (max-width: 640px) - width: 100% - padding: 5px 0px !important - - .answer - display: flex /* contexte sur le parent */ - flex-direction: column /* direction d'affichage verticale */ - justify-content: center /* alignement vertical */ - padding: 15px - cursor: pointer - width: 100% - height: 100% - font-size: 16px - line-height: 1.2em - background-color: $color-answer-back - color: $color-answer-text - border-radius: 5px - transition: background-color 150ms - - &:hover - background-color: $color-answer-hover - - &.active - background-color: var(--main-color) !important - - &.inactive - background-color: $color-answer-back !important - -#badge - @include badge(220px, 4px) - display: none - -#resultsscreen - font-size: 20px - line-height: 1.3em - - > div - padding: 60px - background-color: var(--main-color) - color: $color-result-text - border-radius: 5px - margin-top: 10px - - &#correction - @media (max-width: 640px) - padding: 30px 30px 30px 60px - - #results - text-align: center - - h2 - font-size: 26px - font-weight: 700 - margin: 0px 0 30px - display: none - - #correction - background-color: var(--review-background) - color: $color-review-text - - @media (max-width: 640px) - font-size: 16px - - .correction - position: relative - padding-left: 40px - - @media (max-width: 640px) - padding-left: 20px - - .badge - position: absolute - left: -20px - top: 8px - @include badge(40px, 0) - font-weight: 400 - - @media (max-width: 640px) - left: -39px - - h4 - font-weight: 600 - margin-top: 40px - margin-bottom: 10px - @media (max-width: 640px) - margin-top: 25px - - h2 - font-size: 26px - color: $color-result-text - text-align: center - font-weight: 700 - margin-bottom: 40px - - @media (max-width: 640px) - font-size: 20px diff --git a/resources/quiz/style/style.sass b/resources/quiz/style/style.sass deleted file mode 100644 index 9758c2f1b..000000000 --- a/resources/quiz/style/style.sass +++ /dev/null @@ -1,4 +0,0 @@ -@import 000-imports -@import 010-common -@import 020-header -@import 030-quiz diff --git a/resources/quiz/webpack.mix.js b/resources/quiz/webpack.mix.js deleted file mode 100644 index 50d50440b..000000000 --- a/resources/quiz/webpack.mix.js +++ /dev/null @@ -1,4 +0,0 @@ -const mix = require("laravel-mix"); - -mix.setPublicPath('resources/quiz/dist').js('resources/quiz/js/app.js', 'js') - .sass('resources/quiz/style/style.sass', 'css').options({processCssUrls: false}).version(); diff --git a/resources/quiztheme/transparent.png b/resources/quiztheme/transparent.png new file mode 100644 index 000000000..1914264c0 Binary files /dev/null and b/resources/quiztheme/transparent.png differ