Okay
  Public Ticket #3516215
Issues retake quiz and time finished.
Closed

Comments

  • Luis started the conversation

    Hello, we have 2 issues with our courses, we are using wplms framework 3.

    1. Retake button is not appearing if the time limit is finished, so they cannot try again retaking the quiz, even when they are set to retake many times. We have set that if the failed the quiz, the retake button appears right after, but it does not appear when the time is gone.
    The example is in the attached image.

    2. You gave us a custom code for bakery/framework 3 that it shows a message if the student passed or fail the quiz like this one:

    [pass_fail id="15165" fail="1"]

    Quiz failed message

    [vibe_quiz_retake quiz="15165" course="20793"]

    [/pass_fail]

    [pass_fail id="15165" pass="1"]

    Approved quiz message, continue

    [/pass_fail]


    As we are migrating all of our quizzes to elementor because in framework 4 our quizzes didn't work we want some custom code like this one, but with courses created with elementor, it's just a message if the student passed or fail the quiz.

    Please.
    Thank you.


    Attached files:  retake.jpg

  • [deleted] replied

    1 . strange one retakes does not have do anything with the quiz timeout there . 


    2 . Im afraid the quizzes question might not work even in elementor due to this issue : https://trello.com/c/rXlkOR3y


    but yes the same shortcode will work in v4 as well. its added by default now in wplms v4

  • Luis replied

    So, what do we have to use to create quiz questions tomigrate to version 4? elementor or bakery?

    If the V4 has this by default, the user will see a different message if they pass or fail the quiz?
    Thank you.

  • [deleted] replied

    the quiz pass fail shortcode will work in v4 like it used to work in your v3 . 

    for questions you can create it in elementor or wp bakery but they wont render in the same structure like you expect , we are actually working on this issue and most probably fix it this month  so that structure of question remains intact . 

  • Luis replied

    That's perfect, we are waiting for this

    But can you help us with quiz timeout? we would like that retake button appears if this happens, because currently our users can't continue the course if this happens.

    Thank you, Alex.

  • [deleted] replied

    this issue does not happen in v4 . 

    when quiz auto submits on expire the retake button appears if you set it in the quiz settings : 

    2374515762.png
  • Luis replied

    Perfect, I have tested the retake button in a staging site with framework 4, and the retake buttons it's appearing correctly, 

    We want to confirm with you, that quizzes with elementor or bakery are going to see good at framework 4, with the task that you are working, right?

    Thanks.

  • [deleted] replied

    yes in futrue wp bakery too will be supported no need to migrate if almost migrated then continue otherwise do not migrate ,

  • Luis replied

    Hello, Hopefully it will be very soon because we have already hired 2 people for 2 months to migrate the exams to Elementor, however, not being able to use framework 4 we have to continue with a platform that takes 6 to 10 seconds to load; which has caused us many complaints. 

    Just so you keep it in mind, we have been requesting help with this issue since March Ticket
    Thanks

  • [deleted] replied

    yes we are working on that.

  • Luis replied

    We are still having this issue but we noticed that the code you gave us, it's not working for elementor quizzes, but only happens when the time is out, if you don't pass the quiz it shows the retake button:

    Can you give us a solution for V3 with elementor? we have migrated all quizzes to elementor to be ready for V4.

    Thank you.

    [pass_fail id="172525" fail="1"]

     

    error.png
    <p style="padding-left: 65px; text-align: justify; color: #5b5b5f;">Retoma la evaluación una vez más hasta aprobar, para que puedas continuar con la siguiente unidad del curso.</p>
     

    [vibe_quiz_retake quiz="172525" course="59854"]

    [/pass_fail]

    [pass_fail id="172525" pass="1"]
     

    acierto-1.png
    <p style="padding-left: 65px; text-align: justify; color: #5b5b5f;">Haz clic en <em>siguiente unidad </em>para continuar con el curso.</p>
     

    [/pass_fail]

  • [deleted] replied

    Hi this shortcode in the quiz submission will work but this shortcode : 

    [vibe_quiz_retake quiz="172525" course="59854"] will not work .

    you would need another code to control the retakes actually .


  • Luis replied

    Alright, we tried like this way and yes, it's working, but
    It's not working when the time is out and only for elementor quizzes.

    As we have more than 1000 quizzes, we would like to avoid to revert this situation.

    So, we would like to know if there is an option forcing to appear the retake button if you're not approving or the time is out.

    Thank you.

  • [deleted] replied

    With the code the retake option will be hidden once the passes the test . 

    if you want we can show user unlimited retakes if he does not passes the test .

  • Luis replied

    Thank you Alex, 
    I mean when the user doesn't pass the test the retake button is appearing, but when the time is out for a user in any test, the retake button is not appearing, so they got stuck in the course because they can't continue or try to retake the quiz.

  • [deleted] replied

    Are you talking about v3 or v4 quizzes ?

    the below retake shortcode wont work in v4 at all .


  • Luis replied

    It is for V3 quizzes.

  • [deleted] replied

    ok I got it you mean that this shortcode is not working in v4 :

    [vibe_quiz_retake quiz="15165" course="20793"]

    which it will not work for now but please add this code in order to hide retakes if user passed the quiz : 

    add this code in your wplms-customizer.php file in wplms customizer plugin : 


    add_filter('wplms_quiz_retake_count','remove_retake_button_if_user_passed_the_quiz',10,4);
    function remove_retake_button_if_user_passed_the_quiz($retakes,$quiz_id,$course,$user_id){
     $user_marks=get_post_meta($quiz_id,$user_id,true);
     $quiz_passing_marks=get_post_meta($quiz_id,'vibe_quiz_passing_score',true);
     if(empty($quiz_passing_marks))
        return $retakes;
     if($user_marks >= $quiz_passing_marks){
       return 0;
    }
       else    return $retakes; }
  • Luis replied

    Thanks Alex,

    I have to mention that we are still using V3 because we can't migrate to version 4 because the quizzes look wrong.

    I have added the given custom code in our wplms-customizer.php file and nothing changed, the retake button after the quizz is time out, there are weird and specific cases where users are taking a course, then they start the quiz and then they leave the course, when they go back and the quiz time is out, they can't continue because the retake button is not shown.

    So, maybe we can add a code that the retake button is always there, we had a custom code that it dissapears if the user approved the quiz.

    Here are the custom codes that you gave us before:
    Thank you again for you help.

    /*hide retake button after approve*/
    add_shortcode('quiz_retake',function($atts){
      if(!is_user_logged_in())
        return;
      $user_id = get_current_user_id();
      ob_start();
      bp_course_quiz_retake_form($atts['quiz'],$user_id,$atts['course']);
          echo '<style>.prev_quiz_results{display:block !important;}</style>';
      $return = ob_get_clean();
      return $return;
    });

    /*retake button after quiz (new code)*/ add_filter('wplms_quiz_retake_count','remove_retake_button_if_user_passed_the_quiz',10,4); function remove_retake_button_if_user_passed_the_quiz($retakes,$quiz_id,$course,$user_id){  $user_marks=get_post_meta($quiz_id,$user_id,true);  $quiz_passing_marks=get_post_meta($quiz_id,'vibe_quiz_passing_score',true);  if(empty($quiz_passing_marks))     return $retakes;  if($user_marks >= $quiz_passing_marks){    return 0; }    else    return $retakes; }


    //Show retake button after take a quiz add_action('wplms_bulk_action',function ($action,$course_id,$member_ids){   if($action != 'added_students')       return;     foreach ($member_ids as $key => $member) {       update_user_meta($member ,'user_subscribed_to_partial_free_course_'.$course_id,2);     } },10,3); add_filter('bp_course_fetch_user_quiz_retake_count',function ($retake_count,$quiz_id,$user_id){ $passing_score = get_post_meta($quiz_id,'vibe_quiz_passing_score',true); if(isset($passing_score) && is_numeric($passing_score)){ $user_id = get_current_user_id(); $score = get_post_meta($quiz_id,$user_id,true); if($score > $passing_score){ return get_post_meta($quiz_id,'vibe_quiz_retakes',true); } } return $retake_count; },99999,3);

    Attached files:  Captura de Pantalla 2024-01-29 a la(s) 12.53.40.png

  • [deleted] replied

    Please share your quiz name and url and admin creds in private reply

  •   Luis replied privately
  • [deleted] replied

    creds are not working : 

    8201735379.png


  •   Luis replied privately
  • [deleted] replied

    Hi its asking for wordfence code : 

    2709202025.png