-
Notifications
You must be signed in to change notification settings - Fork 26
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
Start the quiz on button click #37
Comments
let config = {
startOnLoad: true, // detect and convert all div html elements with class quizdown
shuffleAnswers: true, // shuffle answers for each question
shuffleQuestions: false, // shuffle questions for each quiz
nQuestions: undefined, // display n questions at random, if shuffleQuestions is true
primaryColor: 'steelblue', // primary CSS color
secondaryColor: '#f2f2f2', // secondary CSS color
textColor: 'black', // text color of some elements
locale: null // language of the user interface (auto-detect per default)
};
let node = document.querySelector('.quizdown');
createApp(node.innerHTML, node, config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. Im wondering if it is possible to start/load/initialize the quiz with some event listener, for example, Start the quiz when I press a button.
Currently I got it working just fine, when page loads. Then I tried to put all quizdown javascript into a function, which is called with button. So with a click of a button, I append
with a questions content, and call
quizdown.init()
But this way, it doesnt seem to be initialized. I can see the question content being appended to the div, but its just text, no quiz. Im not sure if im doing something wrong or this is intended behaviour.Thanks in advance for reply!
The text was updated successfully, but these errors were encountered: