public function __construct($quiz, $dest, $forceScorm = false)
{
$this->quiz = Quiz::withoutGlobalScopes()->find($quiz);
- $this->theme =$this->quiz->getTheme();
+ $this->theme = $this->quiz->getTheme();
$this->compilePath = protected_path('quiz/compile/' . $this->quiz->id);
$this->dest = $dest;
$this->forceScorm = $forceScorm;
{
$data = $this->quiz->getData();
$json = json_encode($data, JSON_THROW_ON_ERROR);
- $dataSource = $this->compilePath . '/js/quiz.data.js';
+ $dataSource = $this->compilePath . '/js/quiz.js';
file_put_contents($dataSource, str_replace('this.data = data;', 'this.data = ' . $json . ';', file_get_contents($dataSource)));
}
$compile->sync(true);
}
- protected function runWebpack()
+ protected function runWebpack($dev = false)
{
+ $dev = $dev || config('app.env') === 'development';
$mix = 'const mix = require("laravel-mix");';
foreach ($this->mixDirectories as $from => $to) {
$mix .= 'mix.copyDirectory("' . $from . '","' . $to . '");';
$cli = new Npx();
$cli->cd($this->compilePath);
- $cli->setModule('cross-env process.env.local=1 mix --production');
+ $arg = '';
+ if (!$dev) {
+ $arg = ' --production';
+ }
+ $cli->setModule('cross-env process.env.local=1 mix' . $arg);
$cli->execute();
if (!file_exists($this->compilePath . '/dist/js/quiz.js')) {
$mediaId = $p[0];
/** @var Media $media */
$media = Media::withoutGlobalScopes()->find($mediaId);
+ if($media) {
- $model = $media->getAttribute('model');
- $instanceId = $media->getAttribute('model_id');
+ $model = $media->getAttribute('model');
+ $instanceId = $media->getAttribute('model_id');
- /** @var CubistMagicAbstractModel $instance */
- $instance = $model::withoutGlobalScopes()->find($instanceId);
- if (!$instance->canView(backpack_user())) {
- abort(404);
+ /** @var CubistMagicAbstractModel $instance */
+ $instance = $model::withoutGlobalScopes()->find($instanceId);
+ if (!$instance->canView(backpack_user())) {
+ abort(404);
+ }
}
$p = storage_path('app/public/') . $path;
- if (!file_exists($p)) {
+ if ($media && !file_exists($p)) {
$cmd = 'media-library:regenerate --force --only-missing --ids=' . $mediaId;
Artisan::call($cmd);
}
+++ /dev/null
-function QuizData(quiz) {
- this.quiz = quiz;
- // Data will be populated at compile time
- this.data = data;
- console.log(this.data);
-}
-
-module.exports = QuizData;
import gsap from "gsap";
import {CubeSCORM} from '/application/resources/scorm/scorm';
-import QuizData from "./quiz.data";
+import QuizResize from "./quiz.resize";
window.cubeSCORM = new CubeSCORM();
window.$ = window.jQuery = $;
Quiz.prototype = {
init: function () {
- this.data = new QuizData(this);
+ let $this = this;
+
+ // Initialisation des modules
+ this.resize=new QuizResize(this);
+
+ // Ici seront injectées dans this.data toutes les données du quiz et du thème pour qu'elles soient disponibles
+ // dans l'object à tout moment
+ this.data = data;
+ console.log(this.data);
// ICI tout commence vraiment
+
+
+
+
+ // La fonction resize est appellée à chaque fois qu'un resize de la fenêtre survient (et à l'init de l'app)
+ $(window).on('resize', function () {
+ $this.quizResize();
+ });
+ this.quizResize();
+ },
+
+ updateIcons: function () {
+ $("[data-icon]").each(function () {
+ var iconId = 'quiz-' + $(this).data('icon');
+ // L'icône est déjà en place
+ if ($(this).children('svg.' + iconId).length) {
+ return;
+ }
+ // Si une autre icône est présente, on la supprime
+ $(this).children('svg.svg-icon').remove();
+ // Puis on ajoute l'icône
+ var icon = getSpriteIcon(iconId);
+ if ($(this).is('[data-icon-prepend]')) {
+ $(this).prepend(icon);
+ } else {
+ $(this).append(icon);
+ }
+ });
+
+ },
+
+ quizResize: function () {
+ this.updateIcons();
+ this.resize.resize();
},
}
--- /dev/null
+function QuizResize(quiz) {
+ this.quiz = quiz;
+}
+
+QuizResize.prototype = {
+ resize: function () {
+ this.ww = $(window).width();
+ this.hh = $(window).height();
+
+ // Exécuter ici toutes opérations qui doivent intervenir lorsque la fenêtre est redimensionnée par le système ou l'utiisateur
+ },
+}
+
+module.exports = QuizResize;
--- /dev/null
+body
+ background-color: $neutral-color
+ font-family: $font
+ color: $texts-color
+
+[data-icon] svg
+ height: 20px
@import 002-item-variables
@import 003-reset
-body
- background-color: $neutral-color
- font-family: $font
- color: $texts-color
+@import 100-global
+++ /dev/null
-{{--
-
-Downloaded from https://toolbox.fluidbook.com/tool-sprite/9/download
-Edit here : https://toolbox.fluidbook.com/tool-sprite/9/edit
-
---}}<div class="svg-sprite" style="height: 0;width: 0;position: absolute;" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><symbol id="quizrunning-man" viewBox="0 0 18.998 26.45"><path d="M11.885 0.079 C 11.224 0.223,10.624 0.685,10.312 1.291 C 10.114 1.677,10.069 1.851,10.049 2.327 C 10.023 2.909,10.115 3.295,10.390 3.759 C 10.528 3.991,10.956 4.419,11.190 4.557 C 11.582 4.789,12.186 4.935,12.585 4.892 C 13.559 4.788,14.347 4.157,14.648 3.239 C 14.733 2.980,14.739 2.927,14.738 2.470 C 14.736 1.897,14.696 1.702,14.497 1.305 C 14.266 0.842,13.786 0.401,13.289 0.195 C 12.912 0.038,12.303 -0.012,11.885 0.079 M9.258 5.570 C 9.028 5.627,5.801 7.361,5.296 7.700 C 4.734 8.077,4.216 8.758,3.975 9.436 C 3.775 9.997,3.766 10.075,3.747 11.415 C 3.729 12.789,3.751 13.179,3.864 13.411 C 3.958 13.606,4.252 13.900,4.451 13.998 C 4.640 14.090,5.110 14.122,5.342 14.057 C 5.662 13.967,6.049 13.575,6.134 13.255 C 6.164 13.141,6.186 12.685,6.207 11.716 L 6.238 10.339 6.320 10.171 C 6.472 9.859,6.750 9.646,7.551 9.224 C 7.726 9.132,7.880 9.057,7.895 9.056 C 7.927 9.056,7.916 9.144,7.753 10.227 C 7.298 13.256,6.639 17.234,6.455 18.064 C 6.358 18.506,6.199 18.717,5.844 18.874 C 5.495 19.028,5.448 19.019,3.499 18.397 C 2.785 18.169,2.087 17.953,1.947 17.917 C 1.615 17.831,1.252 17.845,1.045 17.952 C 0.574 18.195,0.343 18.560,0.343 19.062 C 0.343 19.342,0.413 19.552,0.586 19.786 C 0.696 19.936,0.767 19.994,0.947 20.085 C 1.317 20.270,4.279 21.234,4.860 21.358 C 5.480 21.490,6.308 21.366,6.982 21.040 C 7.601 20.740,8.121 20.256,8.480 19.647 C 8.749 19.190,8.813 18.953,9.106 17.331 C 9.203 16.794,9.293 16.343,9.305 16.330 C 9.345 16.289,11.264 17.958,11.472 18.215 C 11.532 18.288,11.613 18.412,11.652 18.489 L 11.723 18.629 11.739 22.051 L 11.756 25.473 11.864 25.689 C 12.151 26.263,12.740 26.525,13.333 26.345 C 13.533 26.285,13.592 26.248,13.776 26.070 C 13.894 25.956,14.032 25.783,14.087 25.681 L 14.185 25.496 14.185 21.951 L 14.185 18.406 14.062 18.029 C 13.905 17.547,13.757 17.228,13.537 16.889 C 13.325 16.564,13.102 16.339,12.270 15.606 C 11.921 15.299,11.604 15.013,11.564 14.970 L 11.493 14.892 11.685 13.945 C 11.935 12.712,12.279 11.098,12.324 10.948 C 12.343 10.882,12.368 10.829,12.380 10.829 C 12.392 10.829,12.536 11.053,12.700 11.328 C 13.303 12.338,13.528 12.635,13.942 12.967 C 14.285 13.242,14.642 13.448,14.957 13.554 C 15.199 13.635,16.357 13.909,17.098 14.060 C 17.520 14.146,17.750 14.132,18.023 14.004 C 18.274 13.886,18.410 13.771,18.539 13.569 C 18.856 13.070,18.815 12.526,18.427 12.086 C 18.201 11.830,18.040 11.773,16.657 11.461 C 15.790 11.266,15.693 11.231,15.495 11.044 C 15.275 10.836,15.118 10.588,14.122 8.882 C 13.185 7.277,12.828 6.693,12.688 6.533 C 12.505 6.325,12.152 6.192,10.892 5.856 C 9.955 5.607,9.462 5.520,9.258 5.570 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quizarrow" viewBox="0 0 14.253 17.6"><path d="M6.919 0.033 C 6.667 0.116,6.729 0.045,3.891 3.450 C 0.974 6.949,0.450 7.585,0.388 7.704 C 0.325 7.822,0.330 8.174,0.397 8.320 C 0.459 8.455,0.644 8.646,0.787 8.721 C 0.875 8.768,0.926 8.776,1.128 8.776 C 1.332 8.776,1.381 8.768,1.471 8.721 C 1.658 8.622,1.466 8.845,4.835 4.811 L 6.283 3.078 6.298 4.039 C 6.306 4.568,6.314 7.689,6.316 10.975 L 6.319 16.949 6.387 17.092 C 6.474 17.272,6.601 17.418,6.742 17.502 C 6.846 17.563,6.871 17.567,7.127 17.567 C 7.382 17.567,7.407 17.563,7.511 17.502 C 7.652 17.418,7.779 17.272,7.866 17.092 L 7.934 16.949 7.938 10.892 C 7.939 7.560,7.947 4.431,7.955 3.939 L 7.970 3.044 8.328 3.476 C 9.914 5.388,11.624 7.439,12.087 7.988 C 12.747 8.768,12.760 8.778,13.125 8.777 C 13.385 8.777,13.509 8.728,13.678 8.559 C 13.854 8.382,13.907 8.252,13.907 7.994 C 13.906 7.841,13.895 7.758,13.866 7.705 C 13.787 7.556,11.352 4.599,8.958 1.746 C 7.713 0.262,7.616 0.153,7.474 0.084 C 7.318 0.007,7.068 -0.016,6.919 0.033 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quizwrong" viewBox="0 0 70.711 70.711"><path d="M4.184 4.243 L -0.058 8.486 13.376 21.921 L 26.811 35.356 13.405 48.762 L -0.000 62.168 4.243 66.409 L 8.486 70.651 21.891 57.246 L 35.297 43.841 48.732 57.276 L 62.166 70.711 66.409 66.468 L 70.652 62.226 57.217 48.791 L 43.782 35.355 57.247 21.891 L 70.711 8.426 66.468 4.184 L 62.225 -0.058 48.761 13.406 L 35.297 26.870 21.861 13.435 L 8.426 -0.000 4.184 4.243 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quizok" viewBox="0 0 91.924 65.054"><path d="M59.367 24.054 L 35.315 48.107 21.865 34.663 L 8.416 21.219 4.219 25.509 L 0.023 29.799 15.600 45.397 C 24.168 53.976,32.128 61.898,33.290 63.001 L 35.403 65.007 44.607 55.829 C 49.669 50.781,62.385 38.066,72.864 27.572 L 91.917 8.493 87.668 4.247 L 83.420 0.001 59.367 24.054 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quizreset" viewBox="0 0 26 26.213"><path d="M4.371 0.282 C 4.057 0.383,3.851 0.615,3.734 0.998 C 3.601 1.440,2.930 4.136,2.837 4.604 C 2.744 5.071,2.788 5.280,3.042 5.568 C 3.180 5.724,3.268 5.779,3.502 5.851 C 4.185 6.062,7.111 6.769,7.388 6.789 C 7.663 6.810,7.714 6.800,7.929 6.687 C 8.498 6.386,8.618 5.607,8.166 5.141 C 7.997 4.967,7.725 4.869,6.703 4.612 C 6.365 4.527,6.072 4.441,6.052 4.422 C 5.974 4.345,7.034 3.721,7.933 3.314 C 8.902 2.875,9.833 2.593,11.028 2.378 C 11.668 2.263,13.404 2.216,14.178 2.292 C 15.716 2.444,17.341 2.997,18.742 3.844 C 19.687 4.417,20.776 5.368,21.499 6.252 C 22.823 7.872,23.698 9.939,23.918 11.969 C 23.986 12.600,23.975 14.037,23.896 14.634 C 23.639 16.602,22.892 18.378,21.631 20.020 C 21.276 20.483,20.246 21.512,19.760 21.889 C 18.207 23.096,16.369 23.861,14.343 24.143 C 13.667 24.237,12.105 24.214,11.397 24.100 C 8.545 23.639,6.157 22.250,4.380 20.020 C 2.934 18.204,2.159 16.097,2.014 13.585 C 1.971 12.828,1.892 12.637,1.524 12.393 C 1.029 12.065,0.340 12.276,0.088 12.832 C -0.013 13.054,-0.026 13.508,0.045 14.300 C 0.336 17.548,1.776 20.504,4.143 22.713 C 6.018 24.463,8.130 25.516,10.833 26.051 C 11.301 26.144,11.435 26.150,13.022 26.149 L 14.712 26.147 15.362 26.011 C 18.082 25.440,20.320 24.259,22.156 22.426 C 24.114 20.471,25.282 18.215,25.836 15.318 C 25.928 14.835,25.935 14.686,25.935 13.217 C 25.935 11.478,25.918 11.319,25.604 10.075 C 24.717 6.558,22.474 3.636,19.283 1.841 C 16.417 0.229,12.870 -0.194,9.468 0.671 C 8.281 0.972,7.360 1.330,6.160 1.956 C 5.794 2.147,5.488 2.296,5.479 2.287 C 5.470 2.278,5.504 2.106,5.554 1.904 C 5.604 1.703,5.647 1.389,5.650 1.206 C 5.655 0.903,5.644 0.858,5.524 0.687 C 5.258 0.309,4.796 0.146,4.371 0.282 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quizhelp" viewBox="0 0 26 26"><path d="M11.787 0.068 C 10.395 0.217,9.377 0.463,8.199 0.936 C 7.042 1.400,5.820 2.106,4.897 2.843 C 4.415 3.228,3.213 4.429,2.842 4.897 C 0.606 7.715,-0.365 11.275,0.134 14.820 C 0.820 19.690,4.214 23.758,8.900 25.326 C 11.789 26.292,14.892 26.207,17.781 25.081 C 21.033 23.814,23.761 21.101,25.048 17.855 C 25.392 16.988,25.696 15.919,25.857 15.015 C 25.970 14.378,25.970 11.622,25.857 10.985 C 25.666 9.908,25.299 8.697,24.874 7.735 C 23.103 3.726,19.441 0.907,15.051 0.174 C 14.625 0.102,12.759 -0.015,12.393 0.006 C 12.358 0.008,12.085 0.036,11.787 0.068 M14.733 2.144 C 15.817 2.317,16.792 2.631,17.832 3.141 C 21.044 4.718,23.273 7.729,23.863 11.288 C 23.976 11.975,23.976 14.025,23.863 14.712 C 23.549 16.607,22.789 18.331,21.609 19.821 C 21.202 20.336,20.367 21.176,19.847 21.594 C 18.317 22.825,16.256 23.693,14.322 23.922 C 13.762 23.988,12.235 23.988,11.678 23.921 C 9.767 23.693,7.683 22.825,6.224 21.650 C 4.387 20.171,3.064 18.215,2.444 16.061 C 2.154 15.054,2.072 14.484,2.048 13.315 C 2.034 12.675,2.045 12.083,2.075 11.799 C 2.278 9.874,3.051 7.940,4.263 6.327 C 4.628 5.840,5.642 4.805,6.132 4.419 C 7.782 3.116,9.680 2.332,11.830 2.064 C 12.212 2.017,14.294 2.074,14.733 2.144 M12.610 6.504 C 11.103 6.638,9.751 7.794,9.367 9.276 C 9.259 9.692,9.212 10.129,9.249 10.373 C 9.285 10.614,9.483 10.916,9.704 11.070 C 10.068 11.322,10.660 11.237,10.967 10.888 C 11.134 10.697,11.161 10.623,11.246 10.130 C 11.373 9.388,11.696 8.917,12.263 8.649 C 12.522 8.526,12.582 8.515,13.000 8.515 C 13.418 8.515,13.478 8.526,13.737 8.649 C 14.098 8.820,14.407 9.129,14.578 9.490 C 14.701 9.749,14.712 9.808,14.712 10.227 C 14.712 10.634,14.699 10.709,14.591 10.939 C 14.354 11.446,14.001 11.758,13.485 11.918 C 13.332 11.965,13.125 12.003,13.024 12.003 C 12.786 12.003,12.351 12.219,12.207 12.408 C 12.148 12.485,12.077 12.626,12.051 12.720 C 11.991 12.937,11.988 14.913,12.047 15.126 C 12.070 15.211,12.160 15.363,12.246 15.463 C 12.667 15.956,13.329 15.959,13.747 15.472 C 13.953 15.231,13.997 15.047,13.997 14.423 L 13.997 13.884 14.333 13.746 C 15.277 13.359,16.001 12.685,16.401 11.819 C 16.669 11.238,16.744 10.888,16.739 10.227 C 16.735 9.539,16.649 9.153,16.380 8.596 C 15.697 7.185,14.212 6.361,12.610 6.504 M12.554 17.696 C 12.192 17.832,11.863 18.143,11.714 18.489 C 11.608 18.737,11.616 19.294,11.730 19.543 C 11.944 20.011,12.375 20.314,12.884 20.355 C 13.963 20.442,14.695 19.371,14.228 18.386 C 14.122 18.161,13.815 17.864,13.585 17.762 C 13.329 17.649,12.774 17.614,12.554 17.696 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quizhourglass" viewBox="0 0 22 26.004"><path d="M1.302 0.034 C 0.590 0.058,0.481 0.093,0.241 0.374 C -0.135 0.813,-0.042 1.470,0.443 1.806 C 0.690 1.976,0.892 2.017,1.503 2.017 L 1.969 2.017 1.992 3.382 C 2.005 4.134,2.032 4.875,2.053 5.030 C 2.134 5.626,2.421 6.393,2.777 6.963 C 3.067 7.429,3.186 7.559,6.795 11.345 L 7.735 12.332 7.433 12.647 C 6.927 13.175,3.775 16.498,3.463 16.832 C 2.819 17.523,2.496 18.059,2.243 18.854 C 2.019 19.558,2.007 19.697,1.989 21.931 L 1.973 23.970 1.370 23.988 C 0.794 24.006,0.758 24.011,0.559 24.113 C 0.189 24.302,-0.040 24.717,0.013 25.102 C 0.058 25.431,0.304 25.754,0.620 25.901 L 0.788 25.978 11.000 25.978 L 21.212 25.978 21.380 25.901 C 21.583 25.806,21.787 25.609,21.898 25.400 C 22.011 25.185,22.012 24.794,21.900 24.581 C 21.773 24.341,21.645 24.211,21.430 24.106 C 21.248 24.017,21.180 24.006,20.634 23.985 L 20.038 23.962 20.015 21.957 C 20.003 20.855,19.981 19.857,19.967 19.739 C 19.881 19.026,19.475 18.007,19.047 17.436 C 18.836 17.153,18.216 16.486,16.049 14.210 L 14.270 12.342 14.514 12.081 C 14.648 11.938,15.635 10.897,16.707 9.769 C 17.778 8.641,18.737 7.619,18.836 7.498 C 19.253 6.993,19.546 6.460,19.751 5.833 C 19.951 5.223,19.984 4.910,20.009 3.382 L 20.031 2.017 20.497 2.017 C 21.108 2.017,21.310 1.976,21.557 1.806 C 22.078 1.445,22.140 0.785,21.697 0.309 C 21.517 0.116,21.490 0.102,21.267 0.066 C 21.008 0.025,2.429 -0.005,1.302 0.034 M18.001 2.723 C 18.000 3.111,17.985 3.775,17.969 4.198 C 17.943 4.893,17.931 4.997,17.841 5.262 C 17.725 5.606,17.528 5.951,17.287 6.233 C 17.129 6.417,16.048 7.562,13.805 9.918 C 12.575 11.211,12.036 11.806,11.963 11.952 C 11.866 12.147,11.875 12.548,11.982 12.765 C 12.039 12.881,12.598 13.493,13.721 14.672 C 17.553 18.691,17.544 18.681,17.784 19.247 C 17.844 19.387,17.909 19.614,17.929 19.752 C 17.949 19.889,17.976 20.897,17.990 21.991 L 18.015 23.980 11.000 23.980 L 3.985 23.980 4.009 21.918 C 4.035 19.705,4.041 19.636,4.235 19.198 C 4.288 19.078,4.402 18.872,4.488 18.739 C 4.677 18.450,4.782 18.337,7.702 15.271 C 9.762 13.107,10.008 12.831,10.083 12.600 C 10.144 12.409,10.115 12.115,10.013 11.904 C 9.953 11.781,9.365 11.139,8.001 9.706 C 5.726 7.316,5.045 6.596,4.741 6.259 C 4.490 5.981,4.270 5.587,4.127 5.161 C 4.034 4.883,4.032 4.859,4.008 3.448 L 3.985 2.017 10.994 2.017 L 18.003 2.017 18.001 2.723 M10.578 13.819 C 10.372 13.913,10.095 14.221,10.059 14.397 C 10.020 14.582,10.020 15.854,10.058 16.037 C 10.095 16.213,10.372 16.520,10.578 16.615 C 10.779 16.706,11.221 16.706,11.422 16.615 C 11.502 16.578,11.645 16.465,11.739 16.364 C 11.972 16.113,12.005 15.943,11.981 15.088 C 11.970 14.711,11.944 14.381,11.919 14.318 C 11.854 14.154,11.628 13.936,11.422 13.838 C 11.188 13.727,10.798 13.718,10.578 13.819 M10.682 17.530 C 10.619 17.549,10.412 17.702,10.224 17.871 C 9.693 18.347,6.376 21.698,6.194 21.942 C 6.033 22.158,6.032 22.162,6.033 22.456 C 6.033 22.688,6.051 22.784,6.114 22.903 C 6.224 23.112,6.487 23.333,6.712 23.406 C 6.946 23.481,7.048 23.482,7.288 23.411 C 7.510 23.345,7.765 23.109,9.744 21.141 L 11.000 19.892 12.274 21.159 C 13.947 22.822,14.469 23.318,14.616 23.379 C 14.793 23.453,15.239 23.443,15.419 23.361 C 15.640 23.261,15.896 22.957,15.951 22.731 C 16.028 22.409,15.986 22.184,15.805 21.938 C 15.718 21.821,14.745 20.824,13.644 19.722 C 11.439 17.516,11.406 17.488,11.018 17.494 C 10.897 17.495,10.746 17.512,10.682 17.530 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol></svg></div>
-<script>
- function getSpriteIcon(icon, attrs, dimensions) {
- var a = [];
- var iconSymbol = $('svg symbol[id="' + icon + '"]');
- if (iconSymbol.length > 1) {
- $('svg symbol[id="' + icon + '"]:not(:last)').remove();
- iconSymbol = $('svg symbol[id="' + icon + '"]');
- }
-
- if (iconSymbol.length == 0) {
- return ''; // Bail out because symbol doesn't exist
- }
-
- if (attrs == undefined) {
- attrs = {};
- }
- if (attrs.viewBox == null) {
- attrs.viewBox = iconSymbol.get(0).attributes.viewBox.value;
- }
- if (dimensions === true) {
- var vb = attrs.viewBox.split(' ');
- attrs.x = vb[0];
- attrs.y = vb[1];
- attrs.width = vb[2];
- attrs.height = vb[3];
- }
- if (attrs.class == null) {
- attrs.class = icon;
- } else {
- attrs.class += ' ' + icon;
- }
-
- attrs.class += ' nav-icon svg-icon'; // Common class for all icons
-
- $.each(attrs, function (k, v) {
- a.push(k + '="' + v + '"');
- });
- return '<svg ' + a.join(' ') + ' aria-hidden="true"><use xlink:href="#' + icon + '" /></svg>';
- }
-
-</script>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, shrink-to-fit=no">
<meta name="width" content="1024">
<meta name="height" content="768">
- <title></title>
+ <title>{{$quiz->title}}</title>
<link type="text/css" rel="stylesheet" href="css/style.css">
</head>
<body>
-@include("quizv2.icons")
+@include("quizv2.sprite")
<div id="quiz">
- TEST
+ <div id="title">
+ <h1 id="quizTitle">{{$quiz->title}}</h1>
+ <img src="{{$quiz->logo}}" id="logo"/>
+ </div>
+ @if($quiz->intro_enable)
+ <div class="screen" id="welcome">
+ <h2>{{$quiz->intro_title}}</h2>
+ <p>{{$quiz->intro_text}}</p>
+ <a class="btn">{{$quiz->intro_button}} <span data-icon="running-man"></span></a>
+ </div>
+ @endif
</div>
<script src="js/quiz.js"></script>
</body>
--- /dev/null
+{{--
+
+Downloaded from https://toolbox.fluidbook.com/tool-sprite/9/download
+Edit here : https://toolbox.fluidbook.com/tool-sprite/9/edit
+
+--}}<div class="svg-sprite" style="height: 0;width: 0;position: absolute;" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><symbol id="quiz-running-man" viewBox="0 0 18.998 26.45"><path d="M11.910 0.077 C 11.449 0.165,10.908 0.495,10.585 0.884 C 10.393 1.115,10.161 1.569,10.097 1.836 C 10.034 2.099,10.042 2.848,10.109 3.103 C 10.211 3.485,10.394 3.804,10.691 4.116 C 11.031 4.473,11.246 4.617,11.629 4.744 C 12.235 4.945,12.657 4.943,13.205 4.738 C 13.892 4.481,14.424 3.920,14.654 3.211 C 14.797 2.772,14.770 1.962,14.598 1.533 C 14.322 0.843,13.683 0.272,13.008 0.111 C 12.713 0.040,12.188 0.024,11.910 0.077 M8.588 5.892 C 7.363 6.522,5.722 7.424,5.330 7.683 C 4.997 7.902,4.636 8.267,4.396 8.625 C 4.162 8.975,4.088 9.121,3.959 9.483 C 3.787 9.963,3.769 10.133,3.748 11.446 C 3.720 13.187,3.753 13.379,4.147 13.754 C 4.421 14.016,4.563 14.071,4.971 14.073 C 5.377 14.075,5.515 14.021,5.795 13.754 C 6.093 13.470,6.141 13.341,6.174 12.740 C 6.189 12.464,6.211 11.810,6.222 11.288 C 6.246 10.208,6.250 10.189,6.508 9.912 C 6.590 9.825,6.770 9.681,6.908 9.592 C 7.210 9.399,7.881 9.042,7.903 9.064 C 7.971 9.132,6.569 17.719,6.407 18.222 C 6.305 18.542,6.160 18.709,5.863 18.849 C 5.502 19.019,5.439 19.006,3.166 18.286 C 1.903 17.887,1.709 17.841,1.391 17.868 C 1.002 17.900,0.649 18.148,0.468 18.516 C 0.372 18.712,0.364 18.750,0.364 19.045 C 0.364 19.322,0.375 19.385,0.448 19.540 C 0.573 19.808,0.740 19.973,1.007 20.098 C 1.479 20.316,4.412 21.260,4.925 21.358 C 5.357 21.441,5.846 21.407,6.359 21.258 C 7.229 21.006,7.882 20.532,8.370 19.799 C 8.713 19.283,8.789 19.044,9.053 17.621 C 9.274 16.432,9.283 16.389,9.312 16.357 C 9.342 16.324,9.702 16.611,10.465 17.277 C 11.167 17.889,11.524 18.248,11.628 18.445 L 11.712 18.605 11.733 22.039 L 11.754 25.473 11.859 25.664 C 12.016 25.950,12.197 26.138,12.425 26.250 C 12.756 26.413,13.154 26.426,13.472 26.284 C 13.634 26.211,13.907 25.942,14.064 25.699 L 14.185 25.511 14.185 21.948 L 14.185 18.385 14.058 18.012 C 13.806 17.271,13.540 16.804,13.136 16.398 C 13.008 16.269,12.586 15.880,12.198 15.535 C 11.811 15.190,11.494 14.903,11.494 14.897 C 11.494 14.871,11.975 12.540,12.110 11.908 C 12.287 11.086,12.350 10.829,12.377 10.829 C 12.388 10.829,12.524 11.039,12.680 11.296 C 13.343 12.392,13.661 12.780,14.193 13.144 C 14.706 13.495,14.997 13.592,16.618 13.953 C 17.576 14.166,17.807 14.155,18.233 13.875 C 18.632 13.612,18.839 13.025,18.698 12.551 C 18.638 12.349,18.450 12.080,18.276 11.947 C 18.104 11.816,17.844 11.736,16.750 11.477 C 16.259 11.361,15.807 11.236,15.714 11.191 C 15.425 11.050,15.254 10.808,14.359 9.277 C 13.552 7.898,12.884 6.789,12.765 6.632 C 12.551 6.347,12.293 6.236,11.082 5.907 C 10.230 5.676,9.726 5.573,9.441 5.573 C 9.209 5.573,9.209 5.573,8.588 5.892 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quiz-arrow" viewBox="0 0 14.253 17.6"><path d="M6.965 0.026 C 6.699 0.077,6.762 0.008,3.897 3.444 C 0.352 7.697,0.394 7.643,0.357 7.826 C 0.323 7.987,0.344 8.195,0.407 8.330 C 0.464 8.451,0.668 8.658,0.796 8.725 C 0.874 8.766,0.934 8.775,1.128 8.776 C 1.344 8.776,1.377 8.770,1.487 8.710 C 1.658 8.616,1.709 8.556,4.537 5.169 L 6.259 3.107 6.277 3.210 C 6.286 3.267,6.301 6.387,6.309 10.143 L 6.325 16.973 6.396 17.108 C 6.491 17.290,6.608 17.423,6.742 17.502 C 6.846 17.563,6.871 17.567,7.127 17.567 C 7.382 17.567,7.407 17.563,7.511 17.502 C 7.645 17.423,7.762 17.290,7.857 17.108 L 7.928 16.973 7.943 10.132 C 7.951 6.369,7.964 3.240,7.973 3.179 L 7.988 3.067 8.218 3.345 C 9.700 5.133,12.272 8.212,12.439 8.397 C 12.556 8.528,12.704 8.667,12.767 8.706 C 12.875 8.772,12.898 8.777,13.110 8.776 C 13.292 8.775,13.362 8.765,13.452 8.724 C 13.583 8.665,13.775 8.477,13.836 8.350 C 13.892 8.231,13.920 8.010,13.899 7.852 C 13.884 7.740,13.859 7.692,13.729 7.525 C 13.352 7.037,11.966 5.352,10.158 3.183 C 7.737 0.280,7.629 0.156,7.441 0.077 C 7.306 0.020,7.104 -0.002,6.965 0.026 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quiz-wrong" viewBox="0 0 70.711 70.711"><path d="M4.184 4.243 L -0.058 8.486 13.376 21.921 L 26.811 35.356 13.405 48.762 L -0.000 62.168 4.243 66.409 L 8.486 70.651 21.891 57.246 L 35.297 43.841 48.732 57.276 L 62.166 70.711 66.409 66.468 L 70.652 62.226 57.217 48.791 L 43.782 35.355 57.247 21.891 L 70.711 8.426 66.468 4.184 L 62.225 -0.058 48.761 13.406 L 35.297 26.870 21.861 13.435 L 8.426 -0.000 4.184 4.243 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quiz-ok" viewBox="0 0 91.924 65.054"><path d="M59.367 24.054 L 35.315 48.107 21.869 34.663 L 8.422 21.219 4.221 25.509 L 0.020 29.799 17.600 47.379 C 27.268 57.048,35.244 64.960,35.323 64.960 C 35.403 64.960,48.171 52.257,63.696 36.731 L 91.925 8.502 87.672 4.251 L 83.420 0.001 59.367 24.054 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quiz-reset" viewBox="0 0 26 26.213"><path d="M12.198 0.265 C 10.722 0.335,9.095 0.689,7.731 1.235 C 7.400 1.369,6.773 1.656,6.339 1.874 C 5.905 2.092,5.537 2.258,5.521 2.242 C 5.506 2.227,5.527 2.046,5.567 1.841 C 5.608 1.635,5.643 1.334,5.646 1.171 C 5.650 0.910,5.635 0.853,5.525 0.693 C 5.337 0.423,5.027 0.261,4.694 0.260 C 4.546 0.260,4.377 0.279,4.317 0.301 C 4.114 0.379,3.864 0.648,3.775 0.884 C 3.679 1.141,2.889 4.296,2.817 4.712 C 2.732 5.198,2.932 5.596,3.356 5.789 C 3.585 5.893,6.156 6.545,7.020 6.718 C 7.603 6.835,7.759 6.819,8.026 6.615 C 8.398 6.333,8.537 5.865,8.366 5.479 C 8.166 5.025,8.000 4.940,6.642 4.596 C 6.446 4.546,6.234 4.486,6.170 4.462 C 6.057 4.418,6.056 4.417,6.137 4.328 C 6.246 4.207,6.821 3.870,7.491 3.535 C 9.386 2.587,11.307 2.184,13.542 2.268 C 14.365 2.299,14.944 2.382,15.708 2.578 C 17.694 3.088,19.328 4.030,20.822 5.525 C 22.374 7.079,23.450 9.179,23.832 11.402 C 23.948 12.077,23.991 13.357,23.927 14.200 C 23.774 16.206,23.004 18.190,21.711 19.910 C 21.310 20.444,20.179 21.574,19.638 21.981 C 17.963 23.243,15.894 24.030,13.839 24.186 C 11.101 24.394,8.329 23.537,6.153 21.810 C 5.691 21.443,4.837 20.590,4.449 20.107 C 3.008 18.315,2.220 16.252,2.037 13.794 C 2.010 13.441,1.960 13.051,1.926 12.927 C 1.812 12.522,1.449 12.263,0.996 12.263 C 0.693 12.263,0.528 12.333,0.291 12.560 C -0.005 12.844,-0.065 13.345,0.062 14.473 C 0.403 17.507,1.612 20.113,3.660 22.226 C 5.598 24.225,7.801 25.417,10.682 26.024 C 11.226 26.138,11.302 26.143,12.917 26.163 L 14.589 26.184 15.399 26.004 C 18.299 25.358,20.447 24.185,22.360 22.204 C 24.182 20.317,25.302 18.107,25.827 15.362 C 25.944 14.751,25.988 13.106,25.919 11.982 C 25.787 9.860,24.815 7.331,23.407 5.451 C 21.727 3.206,19.229 1.472,16.622 0.740 C 15.229 0.349,13.762 0.191,12.198 0.265 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quiz-help" viewBox="0 0 26 26"><path d="M11.787 0.066 C 9.687 0.328,8.300 0.766,6.654 1.687 C 5.479 2.345,4.862 2.816,3.842 3.834 C 2.693 4.981,2.064 5.840,1.391 7.182 C -0.177 10.308,-0.421 13.826,0.699 17.176 C 1.646 20.010,3.713 22.577,6.286 24.113 C 9.849 26.241,14.009 26.573,17.871 25.039 C 21.036 23.782,23.716 21.112,25.018 17.918 C 25.362 17.077,25.762 15.670,25.868 14.928 C 25.940 14.431,25.970 12.565,25.920 11.756 C 25.781 9.523,24.708 6.858,23.157 4.897 C 22.746 4.376,21.509 3.158,20.995 2.768 C 19.231 1.427,17.212 0.539,15.166 0.202 C 14.225 0.047,12.494 -0.023,11.787 0.066 M13.595 2.081 C 14.836 2.132,15.395 2.228,16.402 2.560 C 17.183 2.819,18.331 3.372,19.002 3.813 C 21.464 5.434,23.178 7.950,23.769 10.812 C 23.908 11.487,23.959 12.534,23.915 13.802 C 23.880 14.778,23.766 15.406,23.446 16.380 C 22.817 18.289,21.863 19.741,20.262 21.224 C 18.795 22.583,16.594 23.603,14.489 23.899 C 13.816 23.993,11.801 23.972,11.241 23.864 C 9.588 23.546,8.153 22.974,6.879 22.125 C 5.127 20.958,3.579 19.037,2.795 17.059 C 2.353 15.943,2.148 15.037,2.074 13.874 C 1.967 12.168,2.133 10.812,2.624 9.403 C 3.022 8.260,3.688 7.049,4.417 6.143 C 4.813 5.650,5.855 4.628,6.309 4.287 C 7.709 3.235,9.292 2.528,10.964 2.208 C 11.902 2.029,12.098 2.019,13.595 2.081 M12.198 6.569 C 11.286 6.773,10.386 7.396,9.859 8.189 C 9.533 8.679,9.302 9.342,9.248 9.942 C 9.206 10.401,9.276 10.620,9.552 10.904 C 9.857 11.216,10.151 11.292,10.532 11.157 C 10.942 11.013,11.135 10.764,11.223 10.268 C 11.374 9.414,11.678 8.945,12.273 8.648 C 12.475 8.548,12.546 8.537,13.000 8.537 C 13.459 8.537,13.524 8.547,13.739 8.654 C 14.041 8.803,14.423 9.185,14.573 9.488 C 14.680 9.703,14.690 9.767,14.689 10.224 C 14.688 10.627,14.672 10.762,14.604 10.911 C 14.320 11.537,13.821 11.896,13.096 11.996 C 12.663 12.056,12.296 12.258,12.142 12.520 L 12.025 12.718 12.025 13.913 L 12.025 15.108 12.156 15.320 C 12.575 15.999,13.453 15.991,13.855 15.306 C 13.967 15.114,13.975 15.065,13.990 14.490 L 14.006 13.879 14.340 13.741 C 15.264 13.359,16.036 12.625,16.432 11.753 C 16.652 11.267,16.727 10.887,16.726 10.252 C 16.725 9.607,16.662 9.250,16.472 8.802 C 16.014 7.726,15.135 6.957,13.989 6.628 C 13.557 6.504,12.628 6.473,12.198 6.569 M12.665 17.679 C 12.214 17.748,11.713 18.284,11.661 18.752 C 11.584 19.447,11.823 19.927,12.383 20.202 C 12.641 20.329,12.712 20.345,13.021 20.342 C 13.586 20.338,13.976 20.096,14.221 19.599 C 14.402 19.231,14.416 18.828,14.259 18.470 C 14.127 18.169,13.731 17.799,13.471 17.733 C 13.211 17.667,12.884 17.645,12.665 17.679 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol><symbol id="quiz-hourglass" viewBox="0 0 22 26.004"><path d="M0.787 0.072 C 0.554 0.107,0.402 0.185,0.278 0.334 C -0.077 0.756,-0.079 1.249,0.274 1.641 C 0.537 1.934,0.709 1.990,1.403 2.009 L 1.980 2.025 1.982 2.837 C 1.984 3.930,2.036 4.986,2.103 5.298 C 2.218 5.832,2.527 6.580,2.815 7.023 C 3.070 7.417,3.381 7.756,6.125 10.639 L 7.734 12.329 6.751 13.360 C 3.193 17.095,3.051 17.251,2.710 17.801 C 2.415 18.278,2.141 19.046,2.050 19.653 C 2.027 19.812,1.999 20.779,1.985 21.945 L 1.962 23.962 1.375 23.985 C 0.981 24.000,0.746 24.026,0.660 24.063 C 0.314 24.211,0.061 24.527,0.014 24.869 C -0.037 25.239,0.224 25.693,0.595 25.878 L 0.760 25.960 11.005 25.960 L 21.249 25.960 21.396 25.883 C 22.020 25.554,22.169 24.845,21.725 24.317 C 21.673 24.255,21.540 24.160,21.430 24.106 C 21.246 24.016,21.181 24.006,20.660 23.989 C 20.305 23.977,20.082 23.954,20.066 23.929 C 20.052 23.907,20.029 22.963,20.014 21.832 C 19.984 19.600,19.979 19.541,19.759 18.868 C 19.619 18.442,19.261 17.716,19.056 17.445 C 18.969 17.330,18.727 17.049,18.518 16.822 C 18.200 16.476,15.511 13.635,14.550 12.631 L 14.269 12.337 14.478 12.117 C 14.593 11.997,15.414 11.131,16.302 10.193 C 19.151 7.185,19.114 7.228,19.450 6.545 C 19.670 6.099,19.804 5.719,19.892 5.293 C 19.966 4.932,20.018 3.949,20.019 2.874 L 20.020 2.025 20.598 2.009 C 21.280 1.990,21.455 1.935,21.718 1.653 C 22.082 1.264,22.077 0.739,21.703 0.314 C 21.454 0.030,22.495 0.056,11.147 0.050 C 5.550 0.047,0.889 0.057,0.787 0.072 M18.002 2.594 C 18.001 3.494,17.938 4.884,17.890 5.082 C 17.826 5.348,17.597 5.818,17.409 6.068 C 17.238 6.296,16.875 6.685,14.465 9.222 C 12.926 10.842,12.306 11.508,12.092 11.771 C 11.935 11.965,11.866 12.216,11.902 12.463 C 11.952 12.805,11.927 12.776,13.950 14.905 C 17.646 18.795,17.628 18.774,17.833 19.393 C 17.933 19.696,17.934 19.714,17.968 21.079 C 17.986 21.838,18.002 22.801,18.002 23.219 L 18.003 23.980 11.000 23.980 L 3.997 23.980 3.998 23.073 C 4.001 21.718,4.062 19.731,4.107 19.545 C 4.169 19.290,4.428 18.801,4.643 18.531 C 4.843 18.280,5.561 17.513,7.639 15.332 C 9.199 13.695,9.803 13.038,9.966 12.801 C 10.092 12.618,10.101 12.586,10.099 12.343 C 10.097 12.153,10.076 12.041,10.020 11.935 C 9.908 11.719,9.925 11.737,7.036 8.690 C 5.956 7.551,4.963 6.497,4.828 6.349 C 4.447 5.931,4.152 5.371,4.072 4.918 C 4.052 4.805,4.025 4.105,4.011 3.364 L 3.985 2.017 10.994 2.017 L 18.003 2.017 18.002 2.594 M10.648 13.790 C 10.492 13.835,10.206 14.094,10.112 14.277 C 10.039 14.417,10.034 14.485,10.032 15.218 L 10.030 16.007 10.130 16.178 C 10.496 16.802,11.358 16.860,11.793 16.289 C 11.969 16.059,12.004 15.828,11.979 15.062 C 11.955 14.318,11.931 14.237,11.668 14.006 C 11.414 13.782,10.987 13.691,10.648 13.790 M10.721 17.515 C 10.679 17.524,10.514 17.635,10.355 17.762 C 10.004 18.043,6.415 21.651,6.191 21.948 C 6.032 22.159,6.032 22.160,6.034 22.463 C 6.037 22.732,6.049 22.786,6.146 22.942 C 6.206 23.040,6.340 23.177,6.449 23.254 C 6.863 23.543,7.239 23.516,7.645 23.170 C 7.766 23.067,8.570 22.290,9.432 21.443 L 11.000 19.904 12.568 21.443 C 14.365 23.208,14.513 23.342,14.718 23.398 C 14.943 23.459,15.304 23.413,15.497 23.300 C 15.689 23.188,15.892 22.923,15.953 22.705 C 16.011 22.496,15.974 22.212,15.863 22.022 C 15.759 21.845,12.814 18.851,12.031 18.126 C 11.741 17.858,11.435 17.605,11.351 17.564 C 11.205 17.494,10.936 17.473,10.721 17.515 " stroke="none" fill-rule="evenodd" fill="currentColor"></path></symbol></svg></div>
+<script>
+ function getSpriteIcon(icon, attrs, dimensions) {
+ var a = [];
+ var iconSymbol = $('svg symbol[id="' + icon + '"]');
+ if (iconSymbol.length > 1) {
+ $('svg symbol[id="' + icon + '"]:not(:last)').remove();
+ iconSymbol = $('svg symbol[id="' + icon + '"]');
+ }
+
+ if (iconSymbol.length == 0) {
+ return ''; // Bail out because symbol doesn't exist
+ }
+
+ if (attrs == undefined) {
+ attrs = {};
+ }
+ if (attrs.viewBox == null) {
+ attrs.viewBox = iconSymbol.get(0).attributes.viewBox.value;
+ }
+ if (dimensions === true) {
+ var vb = attrs.viewBox.split(' ');
+ attrs.x = vb[0];
+ attrs.y = vb[1];
+ attrs.width = vb[2];
+ attrs.height = vb[3];
+ }
+ if (attrs.class == null) {
+ attrs.class = icon;
+ } else {
+ attrs.class += ' ' + icon;
+ }
+
+ attrs.class += ' nav-icon svg-icon'; // Common class for all icons
+
+ $.each(attrs, function (k, v) {
+ a.push(k + '="' + v + '"');
+ });
+ return '<svg ' + a.join(' ') + ' aria-hidden="true"><use xlink:href="#' + icon + '" /></svg>';
+ }
+
+</script>