Home › Forums › Legacy Support › Support queries › Setup issues › Course material only visible for instructor role
- This topic has 6 replies, 2 voices, and was last updated 2 years, 10 months ago by Veronica.
Viewing 7 posts - 1 through 7 (of 7 total)
-
AuthorPosts
-
February 3, 2022 at 8:32 am #379248maurigutSpectatorhi, I would need to know how to publish a material in the course program that is only visible to the instructor role. Greetings.February 4, 2022 at 6:49 am #379333VeronicaModeratorhi means you want a course that the curriculum of the course is only visible to instructor! isn't it? if yes then you can do a thing create a paid course and add instructor as a student so other users can't see the content until they paid for that or create a private course and instructor as a studentFebruary 4, 2022 at 7:10 am #379334maurigutSpectatorHi, no. What I need is that in the course view the instructor can see a section or unit only he. Example: Unit 1. (viewed by instructor and students) Unit 2. (viewed by instructor and students) Unit 3. (viewed by instructor and students) Unit 4. (Only visible to instructor) I hope it is clear what I need. Greetings.February 5, 2022 at 1:19 pm #379442VeronicaModeratorok the requirement is clear now yes this can be done with the Custom code we need to check this will provide code in some timeFebruary 5, 2022 at 1:58 pm #379444VeronicaModeratorhi refer: this is how setting is added: http://prntscr.com/26p60zc unit content will not available to students: http://prntscr.com/26p6gjp add this code in wplms-customizer.php
add_filter('wplms_course_creation_tabs','hide_unit'); function hide_unit($tabs){ foreach($tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types'] as $k=>$unit){ $tabs['course_curriculum']['fields'][0]['curriculum_elements'][1]['types'][$k]['fields'][] =array( 'label'=> __('Hide Unit','wplms' ), 'type'=> 'showhide', 'id' => 'vibe_instructor_only', 'from'=>'meta', 'value_type'=>'single', 'style'=>'', 'default'=> __('Hide Unit','wplms' ), 'desc'=> __('Hide Unit for Students','wplms' ) ); } return $tabs; } add_filter('bp_course_api_get_user_course_status_item',function($return, $request ){ $body = json_decode($request->get_body(),true); if(!empty($body['token']) && is_numeric($request['course'])){ $user = apply_filters('vibebp_api_get_user_from_token','',$body['token']); if(!empty($user)){ $item_id = $request['id']; $inst = get_post_meta($item_id,'vibe_instructor_only',true); if(!empty($inst) && $inst=='S'){ $inst_id = get_post_field('post_author',$item_id); if($inst_id!=$user->id){ $return =array('content'=>_x('Access not available','','wplms'),'meta'=>[]); } } } } return $return; },11,2);
February 9, 2022 at 5:46 pm #379713maurigutSpectatorHI, It works well. Super grateful for your help. Greetings!February 10, 2022 at 8:32 am #379746VeronicaModeratorHey, 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! Here: https://themeforest.net/item/wplms-learning-management-system/reviews/6780226 closing this topic Thanks & Regards -
AuthorPosts
Viewing 7 posts - 1 through 7 (of 7 total)
- The topic ‘Course material only visible for instructor role’ is closed to new replies.