Disable test retake if passed?

Home Forums Legacy Support Support queries How-to & Troubleshooting Disable test retake if passed?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #225864
    dianaw84
    Spectator
    Hi, I would ask you if there is the possibility to not allow to retake the test if it is passed. I set the option to retake test if the student doesn't pass it, but if he pass it I don't want to give him the possibility to retake. Hope my question is clear, thank you very much.
    #225872
    dianaw84
    Spectator
    Hi, I found this https://wplms.io/support/knowledge-base/disable-quiz-retakes-when-user-gets-marks-more-than-passing-score/, the code works: if the test is passed is not possible to retake the test, if not, is possible to retake.
    #225909
    logan
    Member
    Hello, yes this solution will work. add_filter('wplms_quiz_retakes_left','wplms_passed_quiz_retakes',10,2); function wplms_passed_quiz_retakes($remaining_retakes,$quiz_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 0; } } return $remaining_retakes; }
    #226418
    dianaw84
    Spectator
    ok thank you, it seems working.
    #226537
    logan
    Member
    Greetings :)
Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Disable test retake if passed?’ is closed to new replies.