本文整理汇总了PHP中UserUtils::add_student_to_module_by_name方法的典型用法代码示例。如果您正苦于以下问题:PHP UserUtils::add_student_to_module_by_name方法的具体用法?PHP UserUtils::add_student_to_module_by_name怎么用?PHP UserUtils::add_student_to_module_by_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserUtils
的用法示例。
在下文中一共展示了UserUtils::add_student_to_module_by_name方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: list
echo "\n</body>\n</html>\n";
exit;
} else {
//valid data
list($c_internal_id, $upd) = $lti->lookup_lti_context();
$session = date_utils::get_current_academic_year();
if (is_null($c_internal_id)) {
// $lti_i::invalid_module_code($c_internal_id, $data, 'no returned data');
}
$data = $lti_i::module_code_translate($c_internal_id);
foreach ($data as $v) {
$returned_check = module_utils::get_full_details_by_name($v[1], $mysqli);
if (!UserUtils::is_user_on_module_by_name($userObject->get_user_ID(), $v[1], $session, $mysqli) and $returned_check !== false and $lti_i::allow_module_self_reg($v)) {
if ($returned_check['active'] == 1 and $returned_check['selfenroll'] == 1 and !UserUtils::is_user_on_module_by_name($userObject->get_user_ID(), $v[1], $session, $mysqli)) {
// Insert new module enrollment
UserUtils::add_student_to_module_by_name($userObject->get_user_ID(), $v[1], 1, $session, $mysqli);
}
}
}
$_SESSION['lti']['paperlink'] = $returned[0];
header("location: ../paper/user_index.php?id=" . $returned[0]);
echo "Please click <a href='../paper/user_index.php?id=" . $returned[0] . ".>here</a> to continue";
exit;
}
} else {
//staff
if ($returned !== false) {
// goto link
$returned2 = $lti->lookup_lti_context();
$mod = $returned2[0];
$data = $lti_i::module_code_translate($mod);
示例2: adduser
$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();
UserUtils::add_student_to_module_by_name($userid, $new_moduleid, 1, $session, $mysqli);
// Add student to the new module
UserUtils::add_student_to_module_by_name($userid, 'A10DEMO', 1, $session, $mysqli);
// Add student to the demo module
}
// Send out email welcome.
if (isset($_POST['new_welcome']) and $_POST['new_welcome'] != '') {
$tmp_email = trim($_POST['new_email']);
$subject = "{$string['newrogoaccount']}";
$headers = "From: {$tmp_email}\n";
$headers .= "MIME-Version: 1.0\nContent-type: text/html; charset=UTF-8\n";
$headers .= "bcc: {$tmp_email}\n";
$sname = ucwords($_POST['new_surname']);
$message = <<<MESSAGE
<!DOCTYPE html>
<html>
<head>
<title>{$string['rogoaccount']}</title>