4 require_once
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
88 $this->
id = (int)
$id;
132 $this->index = (int)
$index;
154 $this->points = (float)
$points;
191 $ilDB = $DIC[
'ilDB'];
202 WHERE qht_hint_id = %s 212 self::assignDbRow($this,
$row);
231 if ($this->
getId()) {
249 $ilDB = $DIC[
'ilDB'];
251 return $ilDB->update(
254 'qht_question_fi' => array(
'integer', $this->
getQuestionId()),
255 'qht_hint_index' => array(
'integer', $this->
getIndex()),
256 'qht_hint_points' => array(
'float', $this->
getPoints()),
257 'qht_hint_text' => array(
'clob', $this->
getText())
260 'qht_hint_id' => array(
'integer', $this->
getId())
276 $ilDB = $DIC[
'ilDB'];
280 return $ilDB->insert(
'qpl_hints', array(
281 'qht_hint_id' => array(
'integer', $this->
getId()),
282 'qht_question_fi' => array(
'integer', $this->
getQuestionId()),
283 'qht_hint_index' => array(
'integer', $this->
getIndex()),
284 'qht_hint_points' => array(
'float', $this->
getPoints()),
285 'qht_hint_text' => array(
'clob', $this->
getText())
295 public function delete()
297 return self::deleteById($this->
getId());
309 public static function assignDbRow(
self $questionHint, $hintDbRow)
311 foreach ($hintDbRow as $field => $value) {
313 case 'qht_hint_id': $questionHint->setId($value);
break;
314 case 'qht_question_fi': $questionHint->setQuestionId($value);
break;
315 case 'qht_hint_index': $questionHint->setIndex($value);
break;
316 case 'qht_hint_points': $questionHint->setPoints($value);
break;
317 case 'qht_hint_text': $questionHint->setText($value);
break;
337 $ilDB = $DIC[
'ilDB'];
340 DELETE FROM qpl_hints 341 WHERE qht_hint_id = %s 344 return $ilDB->manipulateF(
362 $questionHint =
new self();
363 $questionHint->load($hintId);
364 return $questionHint;
369 return self::PAGE_OBJECT_TYPE;
374 return sprintf($lng->
txt(
'tst_question_hints_index_column_label'), $hintIndex);
setId($id)
sets the passed hint id
setPoints($points)
sets the passed points to ground-off for this hint
load($id)
loads the hint dataset with passed id from database and assigns it the to this hint object instance ...
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
getIndex()
returns the ordering index of hint
static deleteById($hintId)
deletes the persisted hint object in database by deleting the hint dataset identified by hint id ...
update()
persists the current object state to database by updating an existing dataset identified by hint id ...
getQuestionId()
returns the question id the hint currently relates to
setIndex($index)
sets the passed hint ordering index
getId()
returns the hint id
insert()
persists the current object state to database by inserting a new dataset with a new hint id fetched f...
save()
saves the current hint object state to database.
static getHintIndexLabel(ilLanguage $lng, $hintIndex)
setQuestionId($questionId)
sets the passed question id so hint relates to it
foreach($_POST as $key=> $value) $res
__construct()
Constructor.
setText($text)
sets the passed hint text
static assignDbRow(self $questionHint, $hintDbRow)
assigns the field elements of passed hint db row array to the corresponding hint object properties of...
getPoints()
returns the points to ground-off for this hint
getText()
returns the hint text
txt($a_topic, $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...