PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.8
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.8
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
← All changes | assets/src/apps/js/frontend/custom.js +27 -27 4.3.84.4.8 View file →
@@ -1,27 +1,27 @@
1 -/**
2 - * Custom functions for frontend quiz.
3 - */
4 -
5 -const { Hook } = LP;
6 -
7 -const $ = window.jQuery || jQuery;
8 -
9 -Hook.addFilter( 'question-blocks', function( blocks ) {
10 - return blocks; ///[ 'answer-options', 'title', 'content', 'hint', 'explanation'];
11 -} );
12 -
13 -Hook.addAction( 'before-start-quiz', function() {
14 -} );
15 -
16 -Hook.addAction( 'quiz-started', function( results, id ) {
17 - $( `.course-item-${ id }` ).removeClass( 'status-completed failed passed' ).addClass( 'has-status status-started' );
18 -
19 - window.onbeforeunload = function() {
20 - return 'Warning!';
21 - };
22 -} );
23 -
24 -Hook.addAction( 'quiz-submitted', function( response, id ) {
25 - $( `.course-item-${ id }` ).removeClass( 'status-started passed failed' ).addClass( `has-status status-completed ${ response.results.graduation }` );
26 - window.onbeforeunload = null;
27 -} );
1 +/**
2 + * Custom functions for frontend quiz.
3 + */
4 +
5 +const { Hook } = LP;
6 +
7 +const $ = window.jQuery || jQuery;
8 +
9 +Hook.addFilter( 'question-blocks', function( blocks ) {
10 + return blocks; ///[ 'answer-options', 'title', 'content', 'hint', 'explanation'];
11 +} );
12 +
13 +Hook.addAction( 'before-start-quiz', function() {
14 +} );
15 +
16 +Hook.addAction( 'quiz-started', function( results, id ) {
17 + $( `.course-item-${ id }` ).removeClass( 'status-completed failed passed' ).addClass( 'has-status status-started' );
18 +
19 + window.onbeforeunload = function() {
20 + return 'Warning!';
21 + };
22 +} );
23 +
24 +Hook.addAction( 'quiz-submitted', function( response, id ) {
25 + $( `.course-item-${ id }` ).removeClass( 'status-started passed failed' ).addClass( `has-status status-completed ${ response.results.graduation }` );
26 + window.onbeforeunload = null;
27 +} );