Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events / Public API #11

Closed
jewlofthelotus opened this issue Nov 2, 2013 · 4 comments
Closed

Events / Public API #11

jewlofthelotus opened this issue Nov 2, 2013 · 4 comments

Comments

@jewlofthelotus
Copy link
Owner

From @hellopablo @abensrhir @Jaace https://github.com/QuickenLoans/SlickQuiz/issues/46

Would be nice to have a public API for events so that we can hook into the plugin easily/cleanly. e.g:

onCompleteQuiz = function() {
//    AJAX save the results of the quiz, or something
}
@jewlofthelotus
Copy link
Owner Author

From @cxelegance https://github.com/QuickenLoans/SlickQuiz/issues/53

Since jQuery animations are being used, animation callback functions could be used to do some work when animations are complete. Since we don't personally have any work to do when the animations are complete, how about letting user define callbacks for the 5 main methods in SlickQuiz... when all animations are complete in any given method, then user-defined callback function is executed.

@jewlofthelotus
Copy link
Owner Author

From @margando https://github.com/QuickenLoans/SlickQuiz/issues/51

For scorm elearning integration:

a) in defaults add:
,callBack: null

b) At end of "completeQuiz: function() {" add:
if (plugin.config.callBack){
plugin.config.callBack(questionCount, score);
}

c) call with:
$('#slickQuiz').slickQuiz({callBack: autoevalFin});
function autoevalFin(questionCount, score){
...
}

@jewlofthelotus jewlofthelotus mentioned this issue Nov 3, 2013
@cxelegance
Copy link

The callbacks I've been adding are for when animations complete; it would be easy to add another one at the end of the completeQuiz() method, as per the above comments. I'll try it when I have time and I'll let you know!

@jewlofthelotus jewlofthelotus modified the milestone: 1.5.2 Changeset Feb 26, 2014
@cxelegance
Copy link

Hello! I have a commit (plus a secondary "testing" branch) which has animationCallbacks (should anyone need them - I did at one point), plus event methods, such as onCompleteQuiz, which feedsback with the score and question count.
https://github.com/cxelegance/SlickQuiz/commit/c9a812881a14487045ae11f602a490c4409e1194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants