Check Results when using In-Course Quiz

Home Forums Legacy Support Support queries Other issues Check Results when using In-Course Quiz

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #236732
    damiko
    Participant
    Hello again, We want to add answer explanations to our quizzes. Particularly for users who do not pass. However, we have the setting <b>In-Course Quiz</b> enabled, which automatically takes the user to this screen: https://i.imgur.com/foELawa.png This is the optimal flow for our purposes, but there doesn't seem to be a way to display the Check Results data, which contains the answer explanations. If we could somehow embed that data on the page shown in the screenshot, that would be perfect! Otherwise, do you know of any other way we can provide that info to the user without disrupting our flow? Thanks, Mike
    #236807
    Anshuman Sahu
    Keymaster
    Well there can be many quizzes in a single course . in such case which quiz data we would  show . Also the results are shown in the results tab in user profile easily : http://prntscr.com/qabtc9  
    #236822
    damiko
    Participant
    Ah, true... That makes sense.   In our case, we will only every have one quiz. Can you recommend some code to implement to show our single quiz results on that page? Or maybe help point us in the right direction? Thanks, Mike
    #236844
    damiko
    Participant
    Actually, I just realized that the link in the profile page does not show the individual questions and answers. The whole goal that we are trying to achieve is to show the user what questions were wrong and why it was wrong, so when they re-take the module they can more easily pass.
    #236893
    Anshuman Sahu
    Keymaster
    #236916
    damiko
    Participant
    Okay, thanks. Not sure whey it's not showing up on my install. In any case, can you answer this query? "In our case, we will only ever have one quiz. Can you recommend some code to implement to show our single quiz results on that page? Or maybe help point us in the right direction?"
    #237007
    logan
    Member
    Hello, here is the code: add_action('bp_get_course_check_course_complete',function($id,$user_id){ $course_curriculum=bp_course_get_curriculum_units($id); $quiz_id = 0; if(isset($course_curriculum) && count($course_curriculum)){ foreach ($course_curriculum as $k => $v) { if(is_numeric($v) && get_post_type($v) == 'quiz'){ $quiz_id = $v; break; } }   } if(!empty($quiz_id)){ echo bp_course_quiz_results($quiz_id,$user_id); } },10,2);
    #237237
    damiko
    Participant
    This worked perfectly! Thanks again for the awesome support :)
    #237254
    logan
    Member
    This reply has been marked as private.
    #237256
    damiko
    Participant
    Done!
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Check Results when using In-Course Quiz’ is closed to new replies.