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.
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.
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;
}
ok thank you, it seems working.