本文整理汇总了PHP中assQuestion::syncWithOriginal方法的典型用法代码示例。如果您正苦于以下问题:PHP assQuestion::syncWithOriginal方法的具体用法?PHP assQuestion::syncWithOriginal怎么用?PHP assQuestion::syncWithOriginal使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类assQuestion
的用法示例。
在下文中一共展示了assQuestion::syncWithOriginal方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: syncWithOriginal
function syncWithOriginal()
{
if ($this->getOriginalId()) {
parent::syncWithOriginal();
}
}
示例2: syncWithOriginal
function syncWithOriginal()
{
global $ilDB;
if ($this->original_id) {
$complete = 0;
if ($this->isComplete()) {
$complete = 1;
}
$estw_time = $this->getEstimatedWorkingTime();
$estw_time = sprintf("%02d:%02d:%02d", $estw_time['h'], $estw_time['m'], $estw_time['s']);
$query = sprintf("UPDATE qpl_questions SET obj_fi = %s, title = %s, description = %s, author = %s, question_text = %s, points = %s, working_time=%s, complete = %s WHERE question_id = %s", $ilDB->quote($this->obj_id . ""), $ilDB->quote($this->title . ""), $ilDB->quote($this->comment . ""), $ilDB->quote($this->author . ""), $ilDB->quote($this->question . ""), $ilDB->quote($this->getMaximumPoints() . ""), $ilDB->quote($estw_time . ""), $ilDB->quote($complete . ""), $ilDB->quote($this->original_id . ""));
$result = $ilDB->query($query);
$query = sprintf("UPDATE il_qpl_qst_st_quest SET textgap_rating = %s, correctanswers = %s WHERE question_fi = %s", $ilDB->quote($this->getTextRating() . ""), $ilDB->quote($this->getCorrectAnswers() . ""), $ilDB->quote($this->original_id . ""));
$result = $ilDB->query($query);
if (PEAR::isError($result)) {
global $ilias;
$ilias->raiseError($result->getMessage());
} else {
// Write Ranges to the database
// 1. delete old ranges
$query = sprintf("DELETE FROM il_qpl_qst_st_answer WHERE question_fi = %s", $ilDB->quote($this->original_id));
$result = $ilDB->query($query);
// 2. write ranges
foreach ($this->answers as $key => $value) {
$answer_obj = $this->answers[$key];
$query = sprintf("INSERT INTO il_qpl_qst_st_answer (answer_id, question_fi, answertext, points, aorder) VALUES (NULL, %s, %s, %s, %s)", $ilDB->quote($this->original_id . ""), $ilDB->quote($answer_obj->getAnswertext() . ""), $ilDB->quote($answer_obj->getPoints() . ""), $ilDB->quote($answer_obj->getOrder() . ""));
$answer_result = $ilDB->query($query);
}
}
parent::syncWithOriginal();
}
}
示例3: syncWithOriginal
function syncWithOriginal()
{
if ($this->getOriginalId()) {
$this->syncImages();
parent::syncWithOriginal();
}
}
示例4: syncWithOriginal
function syncWithOriginal()
{
if ($this->getOriginalId()) {
parent::syncWithOriginal();
$this->syncFeedbackSingleAnswers();
}
}