Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
How build a quiz with random questions ?
How build a quiz with random questions ?
Comments
Comment #1
quicksketchClosing after lack of activity. Sorry you were not able to receive an answer to your question.
Comment #2
jvieille CreditAttribution: jvieille commentedIs this possible today?
Comment #3
quicksketchWebform does not have the ability to select a random question.
Comment #4
quicksketchComment #5
jayhaase CreditAttribution: jayhaase commentedJust checking, because the previous responses are a bit old:
Would it be possible to build a webform quiz that could display random questions from a pool of available questions?
Comment #6
DanChadwick CreditAttribution: DanChadwick commentedNot quite.
If you wrote some custom code to generate which questions are desired, you could use conditionals to look at a hidden field and then show those questions.
Not sure if this would be possible in the 6.x-3.x and 7.x-3.x branch -- would require the webform conditionals add-on module. 7.x-4.x has conditions built in.
Comment #7
merylmabin CreditAttribution: merylmabin commentedHere is my approach:
It will be a little bit more complicated than that because there are other elements in $form["submitted"] that I'll need to keep (like "#tree" and probably the hidden field), but that's the basic idea. Feel free to let me know if there's a better way or if that just sounds like a bad way to begin with.