4 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
5 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
6 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
7 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilObjAnswerScoringAdjustable.php';
103 $data = $ilDB->fetchAssoc(
$result);
104 $this->
setId($question_id);
113 require_once
'./Services/RTE/classes/class.ilRTE.php';
116 $this->
setEstimatedWorkingTime(substr($data[
"working_time"], 0, 2), substr($data[
"working_time"], 3, 2), substr($data[
"working_time"], 6, 2));
127 $result = $ilDB->queryF(
"SELECT * FROM qpl_num_range WHERE question_fi = %s ORDER BY aorder ASC",
132 require_once
'./Modules/TestQuestionPool/classes/class.assNumericRange.php';
136 while ($data = $ilDB->fetchAssoc(
$result))
166 $this_id = $this->
getId();
170 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
174 if( (
int)$testObjId > 0 )
176 $clone->setObjId($testObjId);
203 $clone->copyPageOfQuestion($this_id);
205 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
207 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
229 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
232 $source_questionpool_id = $this->
getObjId();
233 $clone->setObjId($target_questionpool_id);
245 $clone->onCopy($source_questionpool_id,
$original_id, $clone->getObjId(), $clone->getId());
258 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
261 $sourceParentId = $this->
getObjId();
267 $clone->setObjId($targetParentId);
269 if ($targetQuestionTitle)
271 $clone->setTitle($targetQuestionTitle);
276 $clone->copyPageOfQuestion($sourceQuestionId);
278 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
280 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
297 $a_limit = str_replace(
',',
'.', $a_limit);
298 $this->lower_limit = $a_limit;
303 $a_limit = str_replace(
',',
'.', $a_limit);
304 $this->upper_limit = $a_limit;
333 throw new ilTestException(
'return details not implemented for '.__METHOD__);
339 $found_values = array();
344 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
345 array(
'integer',
'integer',
'integer'),
348 $data = $ilDB->fetchAssoc(
$result);
350 $enteredvalue = $data[
"value1"];
373 require_once
'./Services/Math/classes/class.EvalMath.php';
375 $eval->suppress_errors = TRUE;
404 require_once
'./Modules/Test/classes/class.ilObjTest.php';
409 $numeric_result = str_replace(
",",
".",
$_POST[
"numeric_result"]);
411 require_once
'./Services/Math/classes/class.EvalMath.php';
413 $math->suppress_errors = TRUE;
414 $result = $math->evaluate($numeric_result);
419 $returnvalue =
false;
424 $result = $ilDB->queryF(
"SELECT solution_id FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
425 array(
'integer',
'integer',
'integer'),
430 $update =
$row[
"solution_id"];
433 if (strlen($numeric_result))
435 $ilDB->update(
"tst_solutions", array(
436 "value1" => array(
"clob", trim($numeric_result)),
437 "tstamp" => array(
"integer", time())
440 "solution_id" => array(
"integer", $update)
448 $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE solution_id = %s",
456 if (strlen($numeric_result))
458 $next_id = $ilDB->nextId(
'tst_solutions');
459 $ilDB->insert(
"tst_solutions", array(
460 "solution_id" => array(
"integer", $next_id),
461 "active_fi" => array(
"integer", $active_id),
462 "question_fi" => array(
"integer", $this->
getId()),
463 "value1" => array(
"clob", trim($numeric_result)),
464 "value2" => array(
"clob", null),
465 "pass" => array(
"integer",
$pass),
466 "tstamp" => array(
"integer", time())
478 require_once
'./Modules/Test/classes/class.ilObjAssessmentFolder.php';
483 "log_user_entered_values",
493 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
498 "log_user_not_entered_values",
518 array( $this->
getId() )
522 ) .
" (question_fi, maxnumofchars) VALUES (%s, %s)",
523 array(
"integer",
"integer" ),
537 $ilDB->manipulateF(
"DELETE FROM qpl_num_range WHERE question_fi = %s",
539 array( $this->
getId() )
542 $next_id = $ilDB->nextId(
'qpl_num_range' );
543 $ilDB->manipulateF(
"INSERT INTO qpl_num_range (range_id, question_fi, lowerlimit, upperlimit, points, aorder, tstamp)
544 VALUES (%s, %s, %s, %s, %s, %s, %s)",
545 array(
'integer',
'integer',
'text',
'text',
'float',
'integer',
'integer' ),
600 return "qpl_qst_numeric";
626 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
632 if (strlen($solutions[0][
"value1"]))
637 return $startrow + $i + 1;