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';
8 require_once
'./Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
9 require_once
'./Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
105 $data = $ilDB->fetchAssoc(
$result);
106 $this->
setId($question_id);
115 require_once
'./Services/RTE/classes/class.ilRTE.php';
118 $this->
setEstimatedWorkingTime(substr($data[
"working_time"], 0, 2), substr($data[
"working_time"], 3, 2), substr($data[
"working_time"], 6, 2));
129 $result = $ilDB->queryF(
"SELECT * FROM qpl_num_range WHERE question_fi = %s ORDER BY aorder ASC",
134 require_once
'./Modules/TestQuestionPool/classes/class.assNumericRange.php';
138 while ($data = $ilDB->fetchAssoc(
$result))
168 $this_id = $this->
getId();
172 require_once
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
176 if( (
int)$testObjId > 0 )
178 $clone->setObjId($testObjId);
205 $clone->copyPageOfQuestion($this_id);
207 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
209 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
231 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
234 $source_questionpool_id = $this->
getObjId();
235 $clone->setObjId($target_questionpool_id);
247 $clone->onCopy($source_questionpool_id,
$original_id, $clone->getObjId(), $clone->getId());
260 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
263 $sourceParentId = $this->
getObjId();
269 $clone->setObjId($targetParentId);
271 if ($targetQuestionTitle)
273 $clone->setTitle($targetQuestionTitle);
278 $clone->copyPageOfQuestion($sourceQuestionId);
280 $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
282 $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
299 $a_limit = str_replace(
',',
'.', $a_limit);
300 $this->lower_limit = $a_limit;
305 $a_limit = str_replace(
',',
'.', $a_limit);
306 $this->upper_limit = $a_limit;
335 throw new ilTestException(
'return details not implemented for '.__METHOD__);
341 $found_values = array();
346 $result = $this->getCurrentSolutionResultSet($active_id,
$pass);
347 $data = $ilDB->fetchAssoc(
$result);
349 $enteredvalue = $data[
"value1"];
383 require_once
'./Services/Math/classes/class.EvalMath.php';
385 $eval->suppress_errors = TRUE;
401 return trim(str_replace(
",",
".",
$_POST[
"numeric_result"]));
406 require_once
'./Services/Math/classes/class.EvalMath.php';
408 $math->suppress_errors = TRUE;
409 $result = $math->evaluate($numeric_solution);
412 (
$result === FALSE ||
$result === TRUE) && strlen($numeric_solution) > 0
431 require_once
'./Modules/Test/classes/class.ilObjTest.php';
444 $returnvalue =
false;
449 $result = $this->getCurrentSolutionResultSet($active_id,
$pass);
452 $update =
$row[
"solution_id"];
455 if (strlen($numeric_result))
457 $ilDB->update(
"tst_solutions", array(
458 "value1" => array(
"clob", trim($numeric_result)),
459 "tstamp" => array(
"integer", time())
462 "solution_id" => array(
"integer", $update)
470 $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE solution_id = %s",
478 if (strlen($numeric_result))
480 $this->saveCurrentSolution($active_id,
$pass, trim($numeric_result), null);
489 require_once
'./Modules/Test/classes/class.ilObjAssessmentFolder.php';
494 "log_user_entered_values",
504 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
509 "log_user_not_entered_values",
541 array( $this->
getId() )
545 ) .
" (question_fi, maxnumofchars) VALUES (%s, %s)",
546 array(
"integer",
"integer" ),
560 $ilDB->manipulateF(
"DELETE FROM qpl_num_range WHERE question_fi = %s",
562 array( $this->
getId() )
565 $next_id = $ilDB->nextId(
'qpl_num_range' );
566 $ilDB->manipulateF(
"INSERT INTO qpl_num_range (range_id, question_fi, lowerlimit, upperlimit, points, aorder, tstamp)
567 VALUES (%s, %s, %s, %s, %s, %s, %s)",
568 array(
'integer',
'integer',
'text',
'text',
'float',
'integer',
'integer' ),
623 return "qpl_qst_numeric";
649 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
655 if (strlen($solutions[0][
"value1"]))
660 return $startrow + $i + 1;
673 require_once
"./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
704 $data = $ilDB->queryF(
705 "SELECT value1 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = (
706 SELECT MAX(step) FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s
708 array(
"integer",
"integer",
"integer",
"integer",
"integer",
"integer"),
712 while(
$row = $ilDB->fetchAssoc($data))