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.
Where should I find replacement for this function quiz_jump_to().
And are you thinking to add a button 'Exit quiz' in between of quiz?
Thanks,
Rahul Lamkhade
Comments
Comment #1
rahullamkhade CreditAttribution: rahullamkhade commentedComment #2
djdevinHi,
There is no exit button however if you wanted to add one, you can form alter the "quiz_question_answering_form" form, and add your own button in $form['actions']. It is standard form API. You could add your own submit handler to that button, then remove the active quiz from their session.
quiz_jump_to has been replaced by quiz_question_goto (so that we can navigation questions even without question jumping turned on)
Example to go to the next question (pulled from quiz_question_answering_form_submit)
Note that even when using quiz_question_goto(), the permissions are still obeyed. That is, the user will get "access denied" if you go to a question they don't have access to yet.
OR:
Quiz uses the menu system for questions now, so you could just build a URL like
node/X/take/Y
Where X is the quiz node ID and Y is the question number (starting with 1)
Comment #3
djdevin