4require_once
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
88 $this->
id = (int)
$id;
132 $this->index = (int)
$index;
154 $this->points = (float)
$points;
201 WHERE qht_hint_id = %s
230 if ($this->
getId()) {
249 return $ilDB->update(
252 'qht_question_fi' => array(
'integer', $this->
getQuestionId()),
253 'qht_hint_index' => array(
'integer', $this->
getIndex()),
254 'qht_hint_points' => array(
'float', $this->
getPoints()),
255 'qht_hint_text' => array(
'clob', $this->
getText())
258 'qht_hint_id' => array(
'integer', $this->
getId())
275 $this->
setId($ilDB->nextId(
'qpl_hints'));
277 return $ilDB->insert(
'qpl_hints', array(
278 'qht_hint_id' => array(
'integer', $this->
getId()),
279 'qht_question_fi' => array(
'integer', $this->
getQuestionId()),
280 'qht_hint_index' => array(
'integer', $this->
getIndex()),
281 'qht_hint_points' => array(
'float', $this->
getPoints()),
282 'qht_hint_text' => array(
'clob', $this->
getText())
292 public function delete()
306 public static function assignDbRow(
self $questionHint, $hintDbRow)
308 foreach ($hintDbRow as $field => $value) {
310 case 'qht_hint_id': $questionHint->setId($value);
break;
311 case 'qht_question_fi': $questionHint->setQuestionId($value);
break;
312 case 'qht_hint_index': $questionHint->setIndex($value);
break;
313 case 'qht_hint_points': $questionHint->setPoints($value);
break;
314 case 'qht_hint_text': $questionHint->setText($value);
break;
336 DELETE FROM qpl_hints
337 WHERE qht_hint_id = %s
340 return $ilDB->manipulateF(
358 $questionHint =
new self();
359 $questionHint->load($hintId);
360 return $questionHint;
370 return sprintf(
$lng->txt(
'tst_question_hints_index_column_label'), $hintIndex);
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
getPoints()
returns the points to ground-off for this hint
save()
saves the current hint object state to database.
static deleteById($hintId)
deletes the persisted hint object in database by deleting the hint dataset identified by hint id
static assignDbRow(self $questionHint, $hintDbRow)
assigns the field elements of passed hint db row array to the corresponding hint object properties of...
update()
persists the current object state to database by updating an existing dataset identified by hint id
getText()
returns the hint text
insert()
persists the current object state to database by inserting a new dataset with a new hint id fetched f...
getQuestionId()
returns the question id the hint currently relates to
setId($id)
sets the passed hint id
__construct()
Constructor.
static getInstanceById($hintId)
creates a hint object instance, loads the persisted hint dataset identified by passed hint id from da...
load($id)
loads the hint dataset with passed id from database and assigns it the to this hint object instance
getIndex()
returns the ordering index of hint
setQuestionId($questionId)
sets the passed question id so hint relates to it
setText($text)
sets the passed hint text
setPoints($points)
sets the passed points to ground-off for this hint
setIndex($index)
sets the passed hint ordering index
getId()
returns the hint id
static getHintIndexLabel(ilLanguage $lng, $hintIndex)
foreach($_POST as $key=> $value) $res