Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Configure these quiz setting by admin for default for all course
- This topic has 22 replies, 3 voices, and was last updated 2 years, 9 months ago by Veronica.
-
AuthorPosts
-
June 22, 2021 at 5:35 am #362243silverchairSpectator1. When instructor creating a Quiz, I want to hide these option and I want to configure those option by Admin only for the default for all course. So I want to restrict Instructor to configure these setting. How can I do that? 2. And also, I want to hide "Search Question" for Quiz creation, because I want to force instructor to create question for each quiz, not connected to other course. Refer: https://prnt.sc/169zlml 3. I want to configure these setting (Assignment) only by admin for the default for all assignment, so hide/restrict the Instructor to change these configuration. How can I do that?June 22, 2021 at 6:14 am #362261silverchairSpectatorThis reply has been marked as private.June 24, 2021 at 7:26 am #362615AdaParticipantHi, yes, it's possible but admin have to set it from the code. It can not be set default using front-end. So whenever you will need to perform any changes you will need to change values from wplms-customizer.php file. Providing you code.June 24, 2021 at 8:01 am #362620silverchairSpectatorOkay, it's alright, that's better for me. ThxJune 24, 2021 at 9:32 am #362631silverchairSpectatorFor now, as a default configuration for all course: Auto Evaluate Results: Yes Number of questions per page: 1 Number of Extra Quiz Retake: 2 Post Quiz Message: Thanks for submitting your quiz, now you can move to next session/unit Show results after submission: Yes Add check answer switch: Yes Randomize quiz quiestion: Yes And please provide which value at the code I have to change when someday I want to change these configuration Thx so much...June 26, 2021 at 10:52 am #362918AdaParticipantHI, For now there is no such hook so that we can save the default setting so that instructor can not edit it . I can only share code to set default value but then you'll need to hide these settings for instructor user type so that they can not edit it.June 26, 2021 at 3:03 pm #362962silverchairSpectatorAlright then, thats better for me as long as admin can change those configuration later and hide it for instructor user type...June 29, 2021 at 7:09 am #363188AdaParticipantSharing the code.June 29, 2021 at 7:09 am #363189AdaParticipantAdd it in wplms customizer.php
function quiz_instructor_control(){ if ( !current_user_can('manage_options') ) { ?> <style> #course_component .course_curriculum_builder .curriculum_element_wrapper.quiz_static .field_wrapper.field_switch, .field_wrapper.field_duration, .field_wrapper.field_number, .field_wrapper.field_editor { display:none !important; } #course_component .curriculum_element_wrapper.quiz_dynamic .field_wrapper.field_switch, .field_wrapper.field_duration, .field_wrapper.field_number, .field_wrapper.field_editor { display:none !important; } </style> <?php } } add_action('wp_head','quiz_instructor_control');
June 29, 2021 at 9:51 am #363206silverchairSpectatorNow "detailed description" is also gone https://prnt.sc/17fvrkoJune 29, 2021 at 9:59 am #363211silverchairSpectator1. Detailed Description , and many field on "SETTINGS" session gone. This happen on instructor account only, for admin it works normally. 2. "Search Question" still there, refer: https://prnt.sc/17fxcwd 3. PLEASE NOTE: I know how to set LMS > Course Nav , there are some field that I set to "SHOW", but after I put this code, those field are gone. 4. I don't know is it from the code u provide here, or from this topic: https://wplms.io/support/forums/topic/dont-connect-forum-or-assignment-to-other-course-unit/page/2/ Refer: https://prnt.sc/17fvrko & https://prnt.sc/17fwizuJune 29, 2021 at 10:22 am #363223AdaParticipantHi, Please remove the code that I provided in this current topic. Actually I provided you css code so that admin can manage quiz setting values from front-end but it is causing other elements to disappear. I'll need to provide php code for this issue also.June 29, 2021 at 10:59 am #363232silverchairSpectatorOkay, that's better. So you mean you will provide css code and php code also for this?June 29, 2021 at 11:01 am #363233silverchairSpectatorBtw, your code has already removed, did you do that? Because I'm not removing it yet. It's ok if u're did thatJune 30, 2021 at 11:19 am #363403AdaParticipantHi Yes, I removed that code because it was css based code that was causing other elements to disappear. You can now add this code in wplms customizer.php.add_filter('wplms_course_creation_tabs',function($tabs, $course_id=null, $user_id=null){ if($user_id && !user_can($user_id,'manage_options')){ $curriculum_elements = $tabs['course_curriculum']['fields'][0]['curriculum_elements']; foreach ($curriculum_elements as $key => $curriculum_element) { if($curriculum_element['type'] == 'quiz'){ foreach ($curriculum_element['types'] as $key1 => $quiz_type) { if($quiz_type['id']=='static') { foreach ($quiz_type['fields'] as $key2=> $quiz_content){ //print_r($unit_content); if($quiz_content['id']=='vibe_quiz_auto_evaluate' && !current_user_can('manage_options') ){ array_splice($curriculum_element['types'][$key1]['fields'], $key2,7); } } } } $curriculum_elements[$key] = $curriculum_element; } } $tabs['course_curriculum']['fields'][0]['curriculum_elements'] = $curriculum_elements; } return $tabs; },10,1);
-
AuthorPosts
- The topic ‘Configure these quiz setting by admin for default for all course’ is closed to new replies.