Opigno quiz type

marcis26
How i can get quiz type if type is quiz in quiz_finished hook i mean if question is long_answer type or homework or etc. ?
Profile picture for user James Aparicio
James Aparicio

Hi marcis26,

Hi marcis26,

In the hook_quiz_finished you have the quiz and the result id. This is executed each time a quiz/lesson is finished. You can look at the opigno_quiz_app_quiz_finished implementation for example.

To get the quiz type you can just look at the quiz node. $quiz_node=node_load($quiz_nid);

Having the quiz and the result id you can get the list of question/answers for that particular quiz/lesson. Check the function inside quiz.module _quiz_get_answers

Best regards