Comments (7)
Hi @shannpersand - There's nothing built in to the plugin that would give you this functionality, but you should definitely be able to set up a new on click event for the answer inputs. You could probably modify or duplicate the event that already exists for the button:
https://github.com/jewlofthelotus/SlickQuiz/blob/master/js/slickQuiz.js#L630
And use the same checkAnswer
method, you'll just need to pass that function the button associated with that question, or modify the method to not need it.
Hope that gets you started.
from slickquiz.
Thanks! I set up a new event and it works perfectly.
from slickquiz.
Glad to hear it @shannpersand! Thanks for using SlickQuiz!
from slickquiz.
@shannpersand would you be interested in sharing how you got this to work? I'm interested in doing the same.
from slickquiz.
@blfeigel sure, it's been a long time since I looked at this, I'm sure this is an incredibly inefficient way to do it:
https://gist.github.com/shannpersand/917535d68df2a26b35fc
You'll probably just have to change the level of selection. I was doing a quiz where the radio buttons would turn red/green on click based on if you got the question right or wrong.
from slickquiz.
I'm finally back on this and was able to get the correct response to show when you click an answer input, but it seems to have broken the next button.
// Bind "check answer" to any click on answer
$(_element + ' ' + _answers).find('input[type=radio]').on('click', function(e) {
e.preventDefault();
plugin.method.checkAnswer(this, {callback: plugin.config.animationCallbacks.checkAnswer});
});
Any ideas?
from slickquiz.
Figured it out, e.preventDefault(); is not needed. In this case it was preventing the input from getting the :clicked attribute, which made the next button logic return false.
from slickquiz.
Related Issues (20)
- Disable the next button if the answer is incorrect
- Answer is highlighted HOT 3
- Remove Introductory text on loading of first question HOT 1
- a.startQuiz gets display:inline;
- Include minified assets in repo
- Option to hide the title / desc once the quiz starts HOT 2
- Resuming Quiz HOT 4
- trigger completeQuiz dynamically.
- Correct Answer Option Highlighted when Next button Clicked
- Adding images or video HOT 3
- How to get rid of 'Next Question' button and just jump to next question? HOT 3
- Issue with number
- correct answer logic fails with Jquery > 3 HOT 1
- Having multiple quizzes in a page
- Multiple quizzes on the same page
- Return to top after clicking nextQuestion/
- Emailing Quiz results
- How to add timer to slick quiz
- Disable checkAnswerText button until there is no answer
- response message each answer
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slickquiz.