5 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
6 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
47 $this->ordertext =
"";
57 if (strlen($this->title) and ($this->author) and ($this->question) and ($this->
getMaximumPoints() > 0))
78 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
83 $affectedRows = $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, ordertext, textsize) VALUES (%s, %s, %s)",
84 array(
"integer",
"text",
"float"),
112 $this->
setId($question_id);
121 include_once(
"./Services/RTE/classes/class.ilRTE.php");
142 $this_id = $this->
getId();
144 if( (
int)$testObjId > 0 )
150 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
154 if( (
int)$testObjId > 0 )
156 $clone->setObjId($testObjId);
183 $clone->copyPageOfQuestion($this_id);
185 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
187 $clone->duplicateGenericFeedback($this_id);
189 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
206 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
209 $source_questionpool = $this->
getObjId();
210 $clone->setObjId($target_questionpool);
253 throw new ilTestException(
'return details not implemented for '.__METHOD__);
258 $found_values = array();
263 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
264 array(
'integer',
'integer',
'integer'),
272 $data[
'value1'] = join(
$data[
'value1'], $this->answer_separator);
293 include_once
"./Services/Utilities/classes/class.ilStr.php";
297 $result = preg_split(
"/\\s+/", $in_string);
304 foreach (
$result as $key => $value)
327 include_once
"./Modules/Test/classes/class.ilObjTest.php";
331 $affectedRows = $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
332 array(
'integer',
'integer',
'integer'),
336 $entered_values =
false;
337 if (strlen(
$_POST[
"orderresult"]))
339 $next_id = $ilDB->nextId(
'tst_solutions');
340 $affectedRows = $ilDB->insert(
"tst_solutions", array(
341 "solution_id" => array(
"integer", $next_id),
342 "active_fi" => array(
"integer", $active_id),
343 "question_fi" => array(
"integer", $this->
getId()),
344 "value1" => array(
"clob",
$_POST[
'orderresult']),
345 "value2" => array(
"clob", null),
346 "pass" => array(
"integer",
$pass),
347 "tstamp" => array(
"integer", time())
349 $entered_values =
true;
353 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
361 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
394 include_once
"./Modules/Test/classes/class.ilObjTest.php";
400 if (count($solutions) == 1)
402 $elements = split(
"{::}", $solutions[0][
"value1"]);
406 $elements =
$_SESSION[
'qst_ordering_horizontal_elements'];
408 if (count($elements))
410 $affectedRows = $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
411 array(
'integer',
'integer',
'integer'),
415 if ($position < count($elements)-1)
417 $temp = $elements[$position];
418 $elements[$position] = $elements[$position+1];
419 $elements[$position+1] = $temp;
421 $entered_values =
false;
422 $next_id = $ilDB->nextId(
'tst_solutions');
423 $affectedRows = $ilDB->insert(
"tst_solutions", array(
424 "solution_id" => array(
"integer", $next_id),
425 "active_fi" => array(
"integer", $active_id),
426 "question_fi" => array(
"integer", $this->
getId()),
427 "value1" => array(
"clob", join($elements,
'{::}')),
428 "value2" => array(
"clob", null),
429 "pass" => array(
"integer",
$pass),
430 "tstamp" => array(
"integer", time())
432 $entered_values =
true;
435 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
443 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
461 return "assOrderingHorizontal";
471 return "qpl_qst_horder";
516 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
522 $solutionvalue = str_replace(
"{::}",
" ", $solutions[0][
"value1"]);
526 return $startrow + $i + 1;
541 public function fromXML(&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
543 include_once
"./Modules/TestQuestionPool/classes/import/qti12/class.assOrderingHorizontalImport.php";
545 $import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
554 public function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
556 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assOrderingHorizontalExport.php";
558 return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
568 $user_solution = array();
569 return $user_solution;
611 $this->ordertext = $a_value;
633 $this->textsize = $a_value;
654 $this->separator = $a_value;
706 include_once(
"./Services/RTE/classes/class.ilRTE.php");
713 $result[
'shuffle'] = (bool)
true;
723 array_push($arr, array(
724 "answertext" => (
string) $answer,
725 "order" => (
int) $order+1