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

rahullamkhade’s picture

Issue summary: View changes
djdevin’s picture

Hi,

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)

  quiz_question_goto($quiz_node, 5);
  $form_state['redirect'] = "node/{$quiz_node->nid}/take"; //will redirect to question 5

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)

djdevin’s picture

Status: Active » Closed (fixed)