Skip to content

Commit

Permalink
fix student role being added to the assign form
Browse files Browse the repository at this point in the history
  • Loading branch information
joel1124 committed Apr 9, 2024
1 parent bb663d6 commit 2489b84
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
16 changes: 12 additions & 4 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,16 +561,24 @@ function zoom_get_course_instructors($courseid) {
$role = $DB->get_record('role', array('shortname' => 'editingteacher'));
// Get the 'teacher' role
$teacher_role = $DB->get_record('role', array('shortname' => 'teacher'));
// Get the 'teaching assistant' role
$role_ta = $DB->get_record('role', array('shortname' => 'teachingassistant'));

/**
* Joel Dapiawen
* April 1, 2024
* Add Teaching assistant role in drop down form to be selected as a host
*/

// Get the 'teaching assistant' role
$role_ta = $DB->get_record('role', array('shortname' => 'teaching-assistant'));

$context = context_course::instance($courseid);

// Get users with the 'teaching assistant' role
$teachers_ta = get_role_users($role_ta->id, $context);

$teachers = get_role_users($teacher_role->id, $context);
$teacher = get_role_users($role->id, $context);
// Get users with the 'teaching assistant' role
$teachers_ta = get_role_users($role_ta->id, $context);



// Merge the two arrays of teachers
Expand Down
5 changes: 1 addition & 4 deletions mod_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,10 +233,7 @@ public function definition() {
if ($zoomuser) {
if (!$isnew) {
$select->setSelected(strtolower($zoomuser->email));
}else {
$select->setSelected(strtolower($zoomuser->email));
}

}

/*
Expand Down Expand Up @@ -1257,7 +1254,7 @@ public function validation($data, $files) {
/**
* Joel Dapiawen
* April 7, 2024
* Need to update this Validate assign field form if user account is found in zoom
* Need to update this Validate assign field form if user account is or not found in zoom
*/
if (isset($data['assign'])) {
$useremail = $data['assign'];
Expand Down

0 comments on commit 2489b84

Please sign in to comment.