Okay
  Public Ticket #3564098
Quiz extra attempts bug
Closed

Comments

  • IeengSolution started the conversation

    Hello!

    In quiz with extra attempts, once the quiz is passed, it's given the possibility of doing it again.
    Retaking the quiz (if there are extra attempts available) should be possible only if the quiz has not been passed previously. Some help? I need to set some other settings?

  • [deleted] replied

    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; }


  • IeengSolution replied

    Thanks! It works

    You can close the ticket if you want (I don't see a button to close it myself)