Home › Forums › Legacy Support › Support queries › Setup issues › Admin to handle timing units AGAIN
- This topic has 9 replies, 3 voices, and was last updated 3 years, 6 months ago by Veronica.
Viewing 10 posts - 1 through 10 (of 10 total)
-
AuthorPosts
-
September 23, 2020 at 11:12 pm #313444szabonyelviskolaSpectatorSomebody closed my open thread in the same topic, even I was waiting answer and solution from Alex! He promised me a code in topic 5 days ago. The original thread was with the same topic name: https://wplms.io/support/forums/topic/admin-to-handle-timing-units/?bbp_reply_to=312110&_wpnonce=d72049ffa6#new-postSeptember 24, 2020 at 2:52 pm #313737Anshuman SahuKeymastersorry for this our forums use to close the topics if there is no reply for three days .As this is a custom request we will be sharing a code with you soon .please provide time , ping back for reminder .September 28, 2020 at 11:00 am #314511szabonyelviskolaSpectatorAny news, regarding the code?September 29, 2020 at 2:15 pm #314897Anshuman SahuKeymasterplease try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
add_action('init',function(){ if(class_exists('WPLMS_tips')){ $tups = WPLMS_tips::init(); add_filter('wplms_quiz_metabox',array($tups,'show_unit_date_time_backend')); } });
October 1, 2020 at 3:46 pm #315467szabonyelviskolaSpectatorHi, I have tried different courses but unfortunately does not work. I have made a course on that way as I described above and added myself (admin) as a student, and tried to get in to the quiz. The system stops me as anyone else is stopped. I see the countdown, but I can not override it. Just to remember the problem: I have different starting date+time for each quiz. Plus in one course I have more quizzes (with different starting date+time). The members of the course if they are students, are not allowed to see the quiz before the specified starting date+time. But the instructor and mainly admin should get access to the quiz anytime he wants to, as you wrote. Even if in the course we have two quizzes with different starting date+time. The main reason for that, that we are using in course quizzes, and checking the real results and formats of the quiz is only possible from course, to start it as a member of the course.October 5, 2020 at 4:06 pm #316145Anshuman SahuKeymasterPlease remove previous code and add this one :add_action('init',function(){ if(class_exists('WPLMS_tips')){ $tups = WPLMS_tips::init(); add_filter('wplms_quiz_metabox',array($tups,'show_unit_date_time_backend')); add_filter('wplms_drip_value','apply_unit_date_time_drip_feed_custom',10001,4); } }); function apply_unit_date_time_drip_feed_custom($value,$pre_unit_id,$course_id,$unit_id){ if(current_user_can('manage_options')){ $value= 0; } return $value; }
October 8, 2020 at 3:01 pm #316990szabonyelviskolaSpectatorThanks! I have tested it, it works great for admin! Can we extend this functionality to the instructor (author) of the course?October 9, 2020 at 2:09 pm #317292Anshuman SahuKeymasterremove previou use this :add_action('init',function(){ if(class_exists('WPLMS_tips')){ $tups = WPLMS_tips::init(); add_filter('wplms_quiz_metabox',array($tups,'show_unit_date_time_backend')); add_filter('wplms_drip_value','apply_unit_date_time_drip_feed_custom',10001,4); } }); function apply_unit_date_time_drip_feed_custom($value,$pre_unit_id,$course_id,$unit_id){ $post = get_post($course_id); if(current_user_can('manage_options') && $post->post_author==get_current_user_id()){ $value= 0; } return $value; }
October 9, 2020 at 2:55 pm #317302szabonyelviskolaSpectatorThank you, Alex! You Are Great! Finally, I have understood your solution and I had to change the "&&" to "||" but now it works! Thanks again! 10 Stars! :) You can close this topic.October 10, 2020 at 6:55 am #317406VeronicaModeratorThanks for your kind words. You are our valuable customer. Hope you will share your words for our theme & support. We aim to improve the usability of our customer’s web-sites and we are glad to have made a contribution. If you find our information to be helpful & you wouldn’t mind leaving a review, we would really appreciate that! closing this one😊 -
AuthorPosts
Viewing 10 posts - 1 through 10 (of 10 total)
- The topic ‘Admin to handle timing units AGAIN’ is closed to new replies.