本文整理汇总了PHP中Evaluation::add_evaluation_log方法的典型用法代码示例。如果您正苦于以下问题:PHP Evaluation::add_evaluation_log方法的具体用法?PHP Evaluation::add_evaluation_log怎么用?PHP Evaluation::add_evaluation_log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Evaluation
的用法示例。
在下文中一共展示了Evaluation::add_evaluation_log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* Update the properties of this evaluation in the database
*/
public function save()
{
$tbl_grade_evaluations = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$sql = 'UPDATE ' . $tbl_grade_evaluations . " SET name = '" . Database::escape_string($this->get_name()) . "'" . ', description = ';
if (isset($this->description)) {
$sql .= "'" . Database::escape_string($this->get_description()) . "'";
} else {
$sql .= 'null';
}
$sql .= ', user_id = ' . intval($this->get_user_id()) . ', course_code = ';
if (isset($this->course_code)) {
$sql .= "'" . Database::escape_string($this->get_course_code()) . "'";
} else {
$sql .= 'null';
}
$sql .= ', category_id = ';
if (isset($this->category)) {
$sql .= intval($this->get_category_id());
} else {
$sql .= 'null';
}
$sql .= ', weight = "' . Database::escape_string($this->get_weight()) . '" ' . ', max = ' . intval($this->get_max()) . ', visible = ' . intval($this->is_visible()) . ' WHERE id = ' . intval($this->id);
//recorded history
$eval_log = new Evaluation();
$eval_log->add_evaluation_log($this->id);
Database::query($sql);
}
示例2: updateEvaluationWeight
/**
* @param int $id
* @param float $weight
*/
public static function updateEvaluationWeight($id, $weight)
{
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$id = intval($id);
$evaluation = new Evaluation();
$evaluation->add_evaluation_log($id);
$sql = 'UPDATE ' . $table_evaluation . '
SET weight = ' . "'" . Database::escape_string($weight) . "'" . '
WHERE id = ' . $id;
Database::query($sql);
}
示例3: build_type_icon_tag
$resource_name = Database::fetch_array($tempsql);
if (isset($resource_name['lp_type'])) {
$resource_name = $resource_name[2];
} else {
$resource_name = $resource_name[1];
}
$output .= '<tr><td>' . build_type_icon_tag($row['type']) . '</td><td> ' . $resource_name . ' ' . Display::label($table_evaluated[$row['type']][3], 'info') . ' </td>';
$output .= '<td><input type="hidden" name="link_' . $row['id'] . '" value="' . $resource_name . '" /><input size="10" type="text" name="link[' . $row['id'] . ']" value="' . $item_weight . '"/></td></tr>';
}
$sql = Database::query('SELECT * FROM ' . $table_evaluation . ' WHERE category_id = ' . $my_selectcat);
while ($row = Database::fetch_array($sql)) {
$item_weight = $row['weight'];
//$item_weight = $masked_total*$item_weight/$original_total;
//update only if value changed
if (isset($_POST['evaluation'][$row['id']])) {
Evaluation::add_evaluation_log($row['id']);
//$new_weight = trim($_POST['evaluation'][$row['id']]*$original_total/$masked_total);
$new_weight = trim($_POST['evaluation'][$row['id']]);
$update_sql = 'UPDATE ' . $table_evaluation . ' SET weight = ' . "'" . Database::escape_string($new_weight) . "'" . ' WHERE id = ' . $row['id'];
Database::query($update_sql);
$item_weight = trim($_POST['evaluation'][$row['id']]);
}
$type_evaluated = isset($row['type']) ? $table_evaluated[$type_evaluated][3] : null;
$output .= '<tr><td>' . build_type_icon_tag('evalnotempty') . '</td><td>' . $row['name'] . ' ' . Display::label(get_lang('Evaluation') . $type_evaluated) . '</td>';
$output .= '<td><input type="hidden" name="eval_' . $row['id'] . '" value="' . $row['name'] . '" /><input type="text" size="10" name="evaluation[' . $row['id'] . ']" value="' . $item_weight . '"/></td></tr>';
}
//by iflorespaz
$my_api_cidreq = api_get_cidreq();
if ($my_api_cidreq == '') {
$my_api_cidreq = 'cidReq=' . $my_category['course_code'];
}
示例4: save
/**
* Update the properties of this evaluation in the database
*/
public function save()
{
$em = Database::getManager();
$gradebookEvaluation = $em->find('ChamiloCoreBundle:GradebookEvaluation', $this->id);
if (!$gradebookEvaluation) {
return;
}
$eval_log = new Evaluation();
$eval_log->add_evaluation_log($this->id);
$gradebookEvaluation->setName($this->get_name())->setUserId($this->get_user_id())->setWeight($this->get_weight())->setMax($this->get_max())->setVisible($this->is_visible());
if (isset($this->description)) {
$gradebookEvaluation->setDescription($this->get_description());
}
if (isset($this->course_code)) {
$course = $em->getRepository('ChamiloCoreBundle:Course')->findOneBy(['code' => $this->get_course_code()]);
$gradebookEvaluation->setCourse($course);
}
if (isset($this->category)) {
$gradebookEvaluation->setCategoryId($this->get_category_id());
}
//recorded history
$em->persist($gradebookEvaluation);
$em->flush();
}