23 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
60 $this->ordertext =
"";
70 if (($this->title) and ($this->author) and ($this->question) and ($this->
getMaximumPoints() > 0))
91 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
96 $affectedRows = $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, ordertext, textsize) VALUES (%s, %s, %s)",
97 array(
"integer",
"text",
"float"),
122 if ($result->numRows() == 1)
124 $data = $ilDB->fetchAssoc($result);
125 $this->
setId($question_id);
134 include_once(
"./Services/RTE/classes/class.ilRTE.php");
155 $this_id = $this->
getId();
157 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
184 $clone->copyPageOfQuestion($this_id);
186 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
188 $clone->duplicateFeedbackGeneric($this_id);
190 $clone->onDuplicate($this_id);
206 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
209 $source_questionpool = $this->
getObjId();
210 $clone->setObjId($target_questionpool);
251 $found_values = array();
256 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
257 array(
'integer',
'integer',
'integer'),
261 $data = $ilDB->fetchAssoc($result);
284 include_once
"./Modules/Test/classes/class.ilObjTest.php";
288 $affectedRows = $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
289 array(
'integer',
'integer',
'integer'),
293 $entered_values =
false;
294 if (strlen(
$_POST[
"orderresult"]))
296 $next_id = $ilDB->nextId(
'tst_solutions');
297 $affectedRows = $ilDB->insert(
"tst_solutions", array(
298 "solution_id" => array(
"integer", $next_id),
299 "active_fi" => array(
"integer", $active_id),
300 "question_fi" => array(
"integer", $this->
getId()),
301 "value1" => array(
"clob",
$_POST[
'orderresult']),
302 "value2" => array(
"clob", null),
303 "pass" => array(
"integer",
$pass),
304 "tstamp" => array(
"integer", time())
306 $entered_values =
true;
310 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
318 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
338 include_once
"./Modules/Test/classes/class.ilObjTest.php";
344 if (count($solutions) == 1)
346 $elements = split(
"{::}", $solutions[0][
"value1"]);
350 $elements =
$_SESSION[
'qst_ordering_horizontal_elements'];
352 if (count($elements))
354 $affectedRows = $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
355 array(
'integer',
'integer',
'integer'),
359 if ($position < count($elements)-1)
361 $temp = $elements[$position];
362 $elements[$position] = $elements[$position+1];
363 $elements[$position+1] = $temp;
365 $entered_values =
false;
366 $next_id = $ilDB->nextId(
'tst_solutions');
367 $affectedRows = $ilDB->insert(
"tst_solutions", array(
368 "solution_id" => array(
"integer", $next_id),
369 "active_fi" => array(
"integer", $active_id),
370 "question_fi" => array(
"integer", $this->
getId()),
371 "value1" => array(
"clob", join($elements,
'{::}')),
372 "value2" => array(
"clob", null),
373 "pass" => array(
"integer",
$pass),
374 "tstamp" => array(
"integer", time())
376 $entered_values =
true;
379 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
387 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
405 return "assOrderingHorizontal";
415 return "qpl_qst_horder";
457 $adapter->setCellValue($startrow, 0, $this->lng->txt($this->getQuestionType()),
CELL_FORMAT_TITLE);
462 $solutionvalue = str_replace(
"{::}",
" ", $solutions[0][
"value1"]);
464 $adapter->setCellValue($startrow+$i, 0, $solutionvalue);
466 return $startrow + $i + 1;
481 public function fromXML(&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
483 include_once
"./Modules/TestQuestionPool/classes/import/qti12/class.assOrderingHorizontalImport.php";
485 $import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
494 public function toXML($a_include_header =
true, $a_include_binary =
true, $a_shuffle =
false, $test_output =
false, $force_image_references =
false)
496 include_once
"./Modules/TestQuestionPool/classes/export/qti12/class.assOrderingHorizontalExport.php";
498 return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
508 $user_solution = array();
509 return $user_solution;
521 include_once
"./Services/Utilities/classes/class.ilStr.php";
524 $result = preg_split(
"/\\s+/", $text);
528 $result = split($this->separator, $text);
562 $this->ordertext = $a_value;
584 $this->textsize = $a_value;
605 $this->separator = $a_value;