Home › Forums › Legacy Support › Support queries › Setup issues › Hide quizzes when passed
Tagged: hide quizzes passed
- This topic has 11 replies, 3 voices, and was last updated 3 years, 2 months ago by Veronica.
Viewing 12 posts - 1 through 12 (of 12 total)
-
AuthorPosts
-
January 27, 2021 at 6:44 pm #336734studiomedicopavesi_0412SpectatorHi, I want to hide quizzes when student pass them. You gave me the following code in order to remove retake button when quiz is passed, but if in course pageyou click on the left on the same quiz in the curriculum, it's possible to retake it. How to block the quiz retake from curriculum? Thanks 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; }January 30, 2021 at 11:18 am #337221AdaParticipantHi Use this code instead of that. add this code in wplms-customizer.php
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){ ?> <style> .vibebp_main .incourse.quiz_retake { display:none !important; } </style> <?php return 0;} else return $retakes; }
January 31, 2021 at 11:35 pm #337362studiomedicopavesi_0412SpectatorHi Ada, thank you for your code. Now on the left on curriculum, passed quizzes are blocked, but button retake quiz is still there,and also the number of remaining retakes. If you click on it nothing happens, the program is searching. Is it possible hide retake button and number of remaining retakes? http://prnt.sc/xxvn31February 1, 2021 at 10:41 am #337463AdaParticipantHi Here in this topic I shared updated code with you but you did not add it in wplms-customizer.php . You missed this part
I added the code at your site and see it does not show retake button now. https://drive.google.com/file/d/10CR4Qp6JOz2oUXurv0njnxCpKegL0DEd/viewif($user_marks >= $quiz_passing_marks){ ?> <style> .vibebp_main .course_status .incourse .quiz_retake{ display:none !important; } </style> <?php return 0;}
February 1, 2021 at 8:24 pm #337567studiomedicopavesi_0412SpectatorHi Ada, sorry for my distraction. Unfortunately I continue to see retake button, even if quiz is passed. Moreaover, I noticed that the icons I removed: flag, bookmraks etc. sometimes reappear(as you can see in the image below). http://prnt.sc/xzqc8lFebruary 2, 2021 at 9:05 am #337622AdaParticipantHi, Pleas recheck as I did not found flags and bookmark anywhere in the quiz while testing. For this retake button I am rechecking the code .February 6, 2021 at 11:21 am #338478studiomedicopavesi_0412SpectatorHi Ada, did you checked the code to hide retake button once passed quiz? Thank youFebruary 8, 2021 at 10:42 am #338734AdaParticipantHi, Yes I checked it. Sorry to say but this is all I can provide for this issue. This does not remove the retake button just after submitting but disables the button and when refreshing the page retake button is removed. The code I shared in the last reply was not working so I replaced it with the original one at your site. https://prntscr.com/yp3tx6 One thing I noticed that you have added duplicate code of the above here https://prntscr.com/yp3ua1 So you can remove it as it's unnecessary.February 8, 2021 at 3:40 pm #338810studiomedicopavesi_0412SpectatorHi Ada, thank you so much for your assitance. I checked my quizzes, if you refresh page you automatically go out from course. I have a lot of quizzes and for each one passed you have to go out and access again to continue course. I thing it's better to leave button. I may add a message when quiz is passed in which I invite to go ahead. The most important thing is hide quiz once passed. I have a big issue (alread asked your support and still waiting for a solution): If you set a passing score and totalize the same passing score you passed quiz, but your message says fail. Thank you for your supportFebruary 9, 2021 at 12:15 pm #338981AdaParticipantYes it is better to add a message to move forward when user passes the quiz. Your other issue will be solved soon in related topic. Please confirm can we close this topic now?February 9, 2021 at 4:35 pm #339064studiomedicopavesi_0412SpectatorYes, please close the topicFebruary 10, 2021 at 7:40 am #339180VeronicaModeratorthanks for confirmation closing this topic -
AuthorPosts
Viewing 12 posts - 1 through 12 (of 12 total)
- The topic ‘Hide quizzes when passed’ is closed to new replies.