| 1 |
/******/ (() => { // webpackBootstrap |
| 2 |
var __webpack_exports__ = {}; |
| 3 |
/*!***********************************************!*\ |
| 4 |
!*** ./assets/src/apps/js/frontend/custom.js ***! |
| 5 |
\***********************************************/ |
| 6 |
/** |
| 7 |
* Custom functions for frontend quiz. |
| 8 |
*/ |
| 9 |
|
| 10 |
const { |
| 11 |
Hook |
| 12 |
} = LP; |
| 13 |
const $ = window.jQuery || jQuery; |
| 14 |
Hook.addFilter('question-blocks', function (blocks) { |
| 15 |
return blocks; ///[ 'answer-options', 'title', 'content', 'hint', 'explanation']; |
| 16 |
}); |
| 17 |
|
| 18 |
Hook.addAction('before-start-quiz', function () {}); |
| 19 |
Hook.addAction('quiz-started', function (results, id) { |
| 20 |
$(`.course-item-${id}`).removeClass('status-completed failed passed').addClass('has-status status-started'); |
| 21 |
window.onbeforeunload = function () { |
| 22 |
return 'Warning!'; |
| 23 |
}; |
| 24 |
}); |
| 25 |
Hook.addAction('quiz-submitted', function (response, id) { |
| 26 |
$(`.course-item-${id}`).removeClass('status-started passed failed').addClass(`has-status status-completed ${response.results.graduation}`); |
| 27 |
window.onbeforeunload = null; |
| 28 |
}); |
| 29 |
/******/ })() |
| 30 |
; |
| 31 |
//# sourceMappingURL=custom.js.map |