Admin to handle timing units AGAIN

Home Forums Legacy Support Support queries Setup issues Admin to handle timing units AGAIN

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #313444
    szabonyelviskola
    Spectator
    Somebody 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-post
    #313737
    Anshuman Sahu
    Keymaster
    sorry 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 .
    #314511
    szabonyelviskola
    Spectator
    Any news, regarding the code?
    #314897
    Anshuman Sahu
    Keymaster
    please 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'));
        }
    
    });
    #315467
    szabonyelviskola
    Spectator
    Hi, 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.
    #316145
    Anshuman Sahu
    Keymaster
    Please 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;
    }
    #316990
    szabonyelviskola
    Spectator
    Thanks! I have tested it, it works great for admin! Can we extend this functionality to the instructor (author) of the course?
    #317292
    Anshuman Sahu
    Keymaster
    remove 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;
    }
    
    #317302
    szabonyelviskola
    Spectator
    Thank 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.
    #317406
    Veronica
    Moderator
    Thanks 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😊
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Admin to handle timing units AGAIN’ is closed to new replies.