UserNotices::display_notice($string['NotAddedToModuleTitle'], $string['NotAddedToModule'] . $v[1], '../artwork/exclamation_64.png', '#C00000'); echo "\n</body>\n</html>\n"; exit; } } $module_store = $lti_i::module_code_translated_store($data); if ($problem === false) { $lti->add_lti_context($module_store); } $returned2 = $lti->lookup_lti_context(); } $mod = $returned2[0]; $data = $lti_i::module_code_translate($mod); foreach ($data as $v) { if (!$userObject->is_staff_user_on_module($v[1]) and $lti_i::allow_staff_module_register($v) and $userObject->has_role(array('Staff', 'Admin', 'SysAdmin')) and module_utils::is_allowed_add_team_members_by_name($v[1], $mysqli)) { UserUtils::add_staff_to_module_by_modulecode($userObject->get_user_ID(), $v[1], $mysqli); } elseif (!$userObject->is_staff_user_on_module($v[1]) and !$lti_i::allow_staff_module_register($v)) { UserNotices::display_notice($string['NotAddedToModuleTitle'], $string['NotAddedToModule'] . $v[1], '../artwork/exclamation_64.png', '#C00000'); echo "\n</body>\n</html>\n"; exit; } } list($c_internal_id, $upd) = $returned2; $moduleid = $c_internal_id; echo <<<END <!DOCTYPE html> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="content-type" content="text/html;charset={$configObject->get('cfg_page_charset')}" />
$unique_username = true; } $schoolID = SchoolUtils::add_school(1, 'School of Practice', $mysqli); // Make sure the 'School of Practice' school exists. CourseUtils::add_course($schoolID, 'A10DEMO', 'Demonstration BSc', $mysqli); // Make sure demo course exists. $new_modid = module_utils::add_modules($new_moduleid, $_POST['new_grade2'], 1, $schoolID, NULL, NULL, true, true, true, false, false, true, false, $mysqli, 0, 0, 1, 1, '07/01'); if ($unique_username == true) { $_POST['new_grade'] = $new_moduleid; $session = date_utils::get_current_academic_year(); // Add staff account $new_username = trim($_POST['new_username']); $useridstf = adduser('Staff', 'Staff', $new_username, $mysqli); UserUtils::add_staff_to_module_by_modulecode($useridstf, $new_moduleid, $mysqli); // Add staff to the new module UserUtils::add_staff_to_module_by_modulecode($useridstf, 'DEMO', $mysqli); // Add staff to the general DEMO module // Add student account $max_sid = 0; $new_username = $new_username . '-stu'; $userid = adduser('A10DEMO', 'Student', $new_username, $mysqli); $result = $mysqli->prepare("SELECT MAX(id) as a FROM users"); $result->execute(); $result->bind_result($max_sid); $result->fetch(); $result->close(); $max_sid++; $result = $mysqli->prepare("INSERT INTO sid VALUES (?, ?)"); $result->bind_param('si', $max_sid, $userid); $result->execute(); $result->close();