Admin to handle timing units

Home Forums Legacy Support 4.0 Bugs & Issues Admin to handle timing units

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #310640
    szabonyelviskola
    Spectator
    For my quizzes, I have to use the drip-feed timing function of units. It is working after lot of tests... (It is important that the first unit can not be timed it works only from 2nd.) But now I have faced another problem. How to check the working system in this status? I have though that Admin roll could overwrite the timings, but if the timer is working I can not get in even in Admin. I can not switch the timing of because of the users, not see the quiz earlier than it is necessary, but I need to check my quiz in course for formatting issues. (The in course is very important in my situation) How can I do that?
    #311004
    Diana
    Participant
    Disable the Drip Feed and then do your editing work and other stuff If you want the drip-feed Starts from Unit 2 then enable "Previous Unit" Based Drip Feed
    #311112
    szabonyelviskola
    Spectator
    But if I disable the Drip Feed, for that time the users will see the exam too! I can not allow that. I need a solution where Admin can access but student not.
    #311440
    Anshuman Sahu
    Keymaster
    this will disable drip feed for admins. : please try adding this given code in your wplms-customizer.php file in wplms customizer plugin :
    add_filter('vibe_total_drip_duration','total_drip_duration',11,4);
    function total_drip_duration($value,$course_id,$unit_id,$pre_unit_id){
        if(current_user_can('manage_options')){
            $value= 0;
        }
        return $value;
    }
    #311485
    szabonyelviskola
    Spectator
    I have tried the code but unfortunately does not work. I will describe my structure, to be closer to the solution. I have a quiz which should be started at a given time. For that, I have created 2 additional units. (there are only 3 elements in course): 1. Welcome unit, no starting time given in unit. 2. Pre quiz unit, in this unit I have set up the starting time of the quiz 3. Course inline Quiz, no any starting information here In course settings: the previous unit should be completed before next switch, on Drip feed, on Drip feed origin, previous unit Drip feed type, unit duration type, static drip duration, 1 sec I have tried different structures but for me this was the only one working. Now the student starts with welcome, proceed to Prequize unit wait for time to elapse, and to access the quiz, then after 1 sec he can reach the course inline quiz. I have tried without Welcome unit but in this case, the starting time setup in Prequiz unit did not work at all. I do not know that in this case, your above code could work? If you could suggest me a more simple solution for the given problem, where your code is working, It would be also great.
    #311782
    Anshuman Sahu
    Keymaster
    Well the code disable drip feed for administrators only . Well the unit start date and time does not works for quizzes . It will only work for units . But also this does not works for the very first unit as well. So i get your case . you can the quiz to start at very specific timing . Please provide some time till we get a code for this for you .
    #311817
    szabonyelviskola
    Spectator
    Thanks! I'm waiting for your suggestions to get into such a structure in admin mode.
    #312086
    Anshuman Sahu
    Keymaster
    Hi before doing this I want to confirm do you want quiz start date time ?is this the exact thing you want ? and this date and time will remain same for all and should be disabled for admin , admin should get access to quiz anytime he wants to?
    #312110
    szabonyelviskola
    Spectator
    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.
    #315804
    Anshuman Sahu
    Keymaster
    Remove the previous both codes and use 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;
    }
Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Admin to handle timing units’ is closed to new replies.