Home › Forums › Legacy Support › Support queries › How-to & Troubleshooting › Assign certificates to students
Tagged: assign certificates, capability, instructor
- This topic has 7 replies, 3 voices, and was last updated 5 years, 4 months ago by logan.
Viewing 8 posts - 1 through 8 (of 8 total)
-
AuthorPosts
-
July 30, 2019 at 8:19 am #220380gsjaak_118ParticipantHi Where can i find the code that determines whether an instructor can assign certificates to course students? I have created a new user role for my instructors, and now they cannot do this action anymore. (I have the backend setting enabled). They still can send messages and add people to the course though. Would love to hear from you! Kind regardsJuly 31, 2019 at 7:04 am #220516loganMemberHello, here it is: http://prntscr.com/ombuwf add_filter('wplms_course_admin_bulk_actions_list','wplms_course_admin_bulk_actions_add_students_list'); function wplms_course_admin_bulk_actions_add_students_list($list){ $instructor_add_students = vibe_get_option('instructor_add_students'); if(isset($instructor_add_students) && $instructor_add_students || current_user_can('manage_options')) $list .= '<li><a href="#" class="expand_add_students tip" title="'.__('Add Students to Course','vibe').'"><i class="icon-users"></i></a></li>'; return $list; }July 31, 2019 at 3:43 pm #220625gsjaak_118ParticipantHi! Thanks, i tried modifying this so it would show up for my custom user role but unfortunately the issue is not here. I see that the div that handles these functions is not loaded on the page (see https://prnt.sc/omk7zx) So i guess there is user role check that determines whether this is printed yes or no. Could you tell me where I can find this (so this class: bulk_assign_students) Kind regardsAugust 1, 2019 at 6:19 am #220660loganMemberHello, everything is handled by that shared page. there is no other coding related to the frontend. please share your all custom codes and then i will look into the possibility.August 1, 2019 at 8:23 am #220674gsjaak_118Participanthmm sure? Then where are these divs created (<span style="color: #4b4d4d; font-family: Lato; font-size: 14px;">https://prnt.sc/omk7zx)</span>? I cant find these in the file you pointed out. The problem is dat i am using a custom user role so instructors have a different role then instructor. Admins can still use this function. So i guess there should be an if statement somewhere that only allows instructors or admins.August 2, 2019 at 2:20 pm #220896Anshuman SahuKeymasterWell you have to make the vendor as course author if you wish that vendor can assign certificates to students . use this plugin to add multiple authors in course : https://wplms.io/support/knowledge-base/wplms-coauthor-plus-integration/August 5, 2019 at 8:33 am #221065gsjaak_118Participanthi thanks! well the strange thing is that the vendor is the course author. so unfortunately this is not the fix. Only the user role instructor seems to be able to assign it (admin). But i don't know by which capability this is filtered. It does not seem to be handled with in the code you pointed out earlier. (as changing that if statement does nog change anything).August 7, 2019 at 12:58 pm #221430loganMemberHello, add this code into your wp-admin >> plugins >> plugin editor. add_action('wplms_course_admin_bulk_actions','bp_course_admin_assign_students2',20); function bp_course_admin_assign_students2(){ $user_id = get_current_user_id(); // Get the user object. $user = get_userdata( $user_id ); // Get all the user roles as an array. $user_roles = $user->roles; if(in_array( 'vendor', $user_roles )){ echo' <div class="bulk_assign_students"> <select id="assign_action" name="assign_action"> <option value="add_badge">'.__('ASSIGN COURSE BADGE','vibe').'</option> <option value="add_certificate">'.__('ASSIGN COURSE CERTIFICATE','vibe').'</option> <option value="remove_badge">'.__('REMOVE COURSE BADGE','vibe').'</option> <option value="remove_certificate">'.__('REMOVE COURSE CERTIFICATE','vibe').'</option> </select> <a href="#" id="assign_course_badge_certificate" data-course="'.get_the_ID().'" class="button full">'.__('Assign Action','vibe').'</a>'; echo '</div>'; } }
-
AuthorPosts
Viewing 8 posts - 1 through 8 (of 8 total)
- The topic ‘Assign certificates to students’ is closed to new replies.