当前位置: 首页>>代码示例>>PHP>>正文


PHP Evaluation::set_description方法代码示例

本文整理汇总了PHP中Evaluation::set_description方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::set_description方法的具体用法?PHP Evaluation::set_description怎么用?PHP Evaluation::set_description使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Evaluation的用法示例。


在下文中一共展示了Evaluation::set_description方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Evaluation

$is_allowedToEdit = $is_courseAdmin;
$evaladd = new Evaluation();
$evaladd->set_user_id($_user['user_id']);
if (isset($_GET['selectcat']) && !empty($_GET['selectcat'])) {
    $evaladd->set_category_id($_GET['selectcat']);
    $cat = Category::load($_GET['selectcat']);
    $evaladd->set_course_code($cat[0]->get_course_code());
} else {
    $evaladd->set_category_id(0);
}
$form = new EvalForm(EvalForm::TYPE_ADD, $evaladd, null, 'add_eval_form', null, api_get_self() . '?selectcat=' . $select_cat . '&' . api_get_cidreq());
if ($form->validate()) {
    $values = $form->exportValues();
    $eval = new Evaluation();
    $eval->set_name($values['name']);
    $eval->set_description($values['description']);
    $eval->set_user_id($values['hid_user_id']);
    if (!empty($values['hid_course_code'])) {
        $eval->set_course_code($values['hid_course_code']);
    }
    //Always add the gradebook to the course
    $eval->set_course_code(api_get_course_id());
    $eval->set_category_id($values['hid_category_id']);
    $parent_cat = Category::load($values['hid_category_id']);
    $global_weight = $cat[0]->get_weight();
    //$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
    $values['weight'] = $values['weight_mask'];
    $eval->set_weight($values['weight']);
    $eval->set_max($values['max']);
    if (empty($values['visible'])) {
        $visible = 0;
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:gradebook_add_eval.php

示例2: create_evaluation_objects_from_sql_result

 /**
  * @param array $result
  * @return array
  */
 private static function create_evaluation_objects_from_sql_result($result)
 {
     $alleval = array();
     if (Database::num_rows($result)) {
         while ($data = Database::fetch_array($result)) {
             $eval = new Evaluation();
             $eval->set_id($data['id']);
             $eval->set_name($data['name']);
             $eval->set_description($data['description']);
             $eval->set_user_id($data['user_id']);
             $eval->set_course_code($data['course_code']);
             $eval->set_category_id($data['category_id']);
             $eval->set_date(api_get_local_time($data['created_at']));
             $eval->set_weight($data['weight']);
             $eval->set_max($data['max']);
             $eval->set_visible($data['visible']);
             $eval->set_type($data['type']);
             $eval->set_locked($data['locked']);
             $eval->setSessionId(api_get_session_id());
             $alleval[] = $eval;
         }
     }
     return $alleval;
 }
开发者ID:omaoibrahim,项目名称:chamilo-lms,代码行数:28,代码来源:evaluation.class.php

示例3: 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}");
     }
 }
开发者ID:ilosada,项目名称:chamilo-lms-icpna,代码行数:60,代码来源:migration.custom.class.php


注:本文中的Evaluation::set_description方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。