From 7feba90b43a2a41e52ed7e676d4030415d8fc7d8 Mon Sep 17 00:00:00 2001 From: tusharvikky Date: Fri, 7 Aug 2015 23:58:07 +0530 Subject: [PATCH 1/3] Ability to dynimically complete Quiz --- js/slickQuiz.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/slickQuiz.js b/js/slickQuiz.js index 71e2a62..022ee08 100755 --- a/js/slickQuiz.js +++ b/js/slickQuiz.js @@ -2,8 +2,8 @@ * SlickQuiz jQuery Plugin * http://github.com/jewlofthelotus/SlickQuiz * - * @updated October 25, 2014 - * @version 1.5.20 + * @updated August 7, 2015 + * @version 1.5.21 * * @author Julie Cameron - http://www.juliecameron.com * @copyright (c) 2013 Quicken Loans - http://www.quickenloans.com @@ -52,7 +52,8 @@ events: { onStartQuiz: function (options) {}, onCompleteQuiz: function (options) {} // reserved: options.questionCount, options.score - } + }, + triggerComplete: null }, // Class Name Strings (Used for building quiz and for selectors) @@ -71,6 +72,7 @@ lastQuestionClass = 'lastQuestion', backToQuestionClass = 'backToQuestion', tryAgainClass = 'tryAgain', + completeQuizClass = 'completeQuiz', // Sub-Quiz / Sub-Question Class Selectors _questionCount = '.' + questionCountClass, @@ -87,6 +89,7 @@ _nextQuestionBtn = '.' + nextQuestionClass, _prevQuestionBtn = '.' + backToQuestionClass, _tryAgainBtn = '.' + tryAgainClass, + _completeQuizBtn = '.' + completeQuizClass, // Top Level Quiz Element Class Selectors _quizStarter = _element + ' .startQuiz', @@ -718,6 +721,12 @@ plugin.method.nextQuestion(this, {callback: plugin.config.animationCallbacks.nextQuestion}); }); + // Bind "completeQuiz" buttons + $(_element + ' ' + _completeQuizBtn).on('click', function(e) { + e.preventDefault(); + plugin.method.completeQuiz({callback: plugin.config.animationCallbacks.completeQuiz}); + }) + // Accessibility (WAI-ARIA). var _qnid = $element.attr('id') + '-name'; $quizName.attr('id', _qnid); From c1089a9a9872eeb0aae7c30add9ec58bb2a811b6 Mon Sep 17 00:00:00 2001 From: tusharvikky Date: Sat, 8 Aug 2015 00:01:06 +0530 Subject: [PATCH 2/3] Clean up --- js/slickQuiz.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/slickQuiz.js b/js/slickQuiz.js index 022ee08..314b4ba 100755 --- a/js/slickQuiz.js +++ b/js/slickQuiz.js @@ -2,8 +2,8 @@ * SlickQuiz jQuery Plugin * http://github.com/jewlofthelotus/SlickQuiz * - * @updated August 7, 2015 - * @version 1.5.21 + * @updated October 25, 2014 + * @version 1.5.20 * * @author Julie Cameron - http://www.juliecameron.com * @copyright (c) 2013 Quicken Loans - http://www.quickenloans.com @@ -721,9 +721,9 @@ plugin.method.nextQuestion(this, {callback: plugin.config.animationCallbacks.nextQuestion}); }); - // Bind "completeQuiz" buttons $(_element + ' ' + _completeQuizBtn).on('click', function(e) { e.preventDefault(); + console.log('completeQuiz'); plugin.method.completeQuiz({callback: plugin.config.animationCallbacks.completeQuiz}); }) From 5b9fcd13ebc6d2e1ac82edace5ae6c4c68370408 Mon Sep 17 00:00:00 2001 From: tusharvikky Date: Sat, 8 Aug 2015 00:02:41 +0530 Subject: [PATCH 3/3] Clean up debug log --- js/slickQuiz.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/slickQuiz.js b/js/slickQuiz.js index 314b4ba..ed06e49 100755 --- a/js/slickQuiz.js +++ b/js/slickQuiz.js @@ -723,7 +723,6 @@ $(_element + ' ' + _completeQuizBtn).on('click', function(e) { e.preventDefault(); - console.log('completeQuiz'); plugin.method.completeQuiz({callback: plugin.config.animationCallbacks.completeQuiz}); })