本文整理汇总了PHP中Evaluation::set_evaluation_type_id方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::set_evaluation_type_id方法的具体用法?PHP Evaluation::set_evaluation_type_id怎么用?PHP Evaluation::set_evaluation_type_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluation
的用法示例。
在下文中一共展示了Evaluation::set_evaluation_type_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
static function create_gradebook_evaluation($data)
{
//error_log('create_gradebook_evaluation() function called');
$session_id = isset($data['session_id']) ? $data['session_id'] : null;
if (!empty($session_id)) {
global $data_list;
$course_list = array(0 => array('code' => $data_list['session_course'][$session_id]));
//$course_list = SessionManager::get_course_list_by_session_id($session_id);
if (!empty($course_list)) {
$course_data = current($course_list);
if (isset($course_data['code'])) {
//Get gradebook (if does not exist, create it)
$gradebook = null;
if (!empty($data_list['session_course_gradebook'][$course_data['code']][$session_id])) {
$gradebook = array('id' => $data_list['session_course_gradebook'][$course_data['code']][$session_id]);
} else {
require_once api_get_path(SYS_CODE_PATH) . 'gradebook/lib/gradebook_functions.inc.php';
$gradebook = array('id' => create_default_course_gradebook($course_data['code'], false, $session_id));
error_log('Gradebook not found. Creating one with ID ' . $gradebook['id']);
$data_list['session_course_gradebook'][$course_data['code']][$session_id] = $gradebook['id'];
}
if (!empty($gradebook)) {
//Check if gradebook exists
$eval = 0;
$evals_found = $data_list['session_course_gradebook_eval'][$course_data['code']][$data['gradebook_description']];
if (!empty($evals_found)) {
return null;
}
$eval = new Evaluation();
$evals_found = $eval->load(null, null, $course_data['code'], $gradebook['id'], null, null, $data['gradebook_description']);
if (empty($evals_found)) {
$eval->set_name($data['gradebook_description']);
$eval->set_description($data['gradebook_description']);
$eval->set_evaluation_type_id($data['gradebook_evaluation_type_id']);
$eval->set_user_id(self::default_admin_id);
$eval->set_course_code($course_data['code']);
$eval->set_category_id($gradebook['id']);
//harcoded values
$eval->set_weight(100);
$eval->set_max(100);
$eval->set_visible(1);
$eval_id = $eval->add();
$data_list['session_course_gradebook_eval'][$course_data['code']][$data['gradebook_description']] = $eval_id;
error_log("Gradebook evaluation ID {$eval_id} created!!");
} else {
error_log("Gradebook evaluation already exists - skipping insert :/ ");
}
} else {
error_log("Gradebook does not exists");
}
} else {
error_log("Something is wrong with the course ");
}
} else {
error_log("NO course found for session id: {$session_id}");
}
} else {
error_log("NO session id found: {$session_id}");
}
}