23 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
82 if (strlen($this->title) and ($this->author) and ($this->question) and ($this->
getMaximumPoints() > 0))
105 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
107 array($this->
getId())
110 $affectedRows = $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, maxnumofchars) VALUES (%s, %s)",
111 array(
"integer",
"integer"),
121 $result = $ilDB->manipulateF(
"DELETE FROM qpl_num_range WHERE question_fi = %s",
123 array($this->
getId())
127 $next_id = $ilDB->nextId(
'qpl_num_range');
128 $answer_result = $ilDB->manipulateF(
"INSERT INTO qpl_num_range (range_id, question_fi, lowerlimit, upperlimit, points, aorder, tstamp) VALUES (%s, %s, %s, %s, %s, %s, %s)",
129 array(
'integer',
'integer',
'text',
'text',
'float',
'integer',
'integer'),
154 $this->
setId($question_id);
163 include_once(
"./Services/RTE/classes/class.ilRTE.php");
170 $result = $ilDB->queryF(
"SELECT * FROM qpl_num_range WHERE question_fi = %s ORDER BY aorder ASC",
175 include_once
"./Modules/TestQuestionPool/classes/class.assNumericRange.php";
202 $this_id = $this->
getId();
204 if( (
int)$testObjId > 0 )
210 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
214 if( (
int)$testObjId > 0 )
216 $clone->setObjId($testObjId);
243 $clone->copyPageOfQuestion($this_id);
245 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
247 $clone->duplicateFeedbackGeneric($this_id);
249 $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
268 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
271 $source_questionpool = $this->
getObjId();
272 $clone->setObjId($target_questionpool);
302 $a_limit = str_replace(
',',
'.', $a_limit);
303 $this->lower_limit = $a_limit;
308 $a_limit = str_replace(
',',
'.', $a_limit);
309 $this->upper_limit = $a_limit;
336 $found_values = array();
341 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
342 array(
'integer',
'integer',
'integer'),
347 $enteredvalue =
$data[
"value1"];
370 include_once
"./Services/Math/classes/class.EvalMath.php";
372 $eval->suppress_errors = TRUE;
398 include_once
"./Modules/Test/classes/class.ilObjTest.php";
402 $numeric_result = str_replace(
",",
".",
$_POST[
"numeric_result"]);
404 include_once
"./Services/Math/classes/class.EvalMath.php";
406 $math->suppress_errors = TRUE;
407 $result = $math->evaluate($numeric_result);
412 $returnvalue =
false;
414 $result = $ilDB->queryF(
"SELECT solution_id FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
415 array(
'integer',
'integer',
'integer'),
419 $update =
$row[
"solution_id"];
422 if (strlen($numeric_result))
424 $affectedRows = $ilDB->update(
"tst_solutions", array(
425 "value1" => array(
"clob", trim($numeric_result)),
426 "tstamp" => array(
"integer", time())
428 "solution_id" => array(
"integer", $update)
434 $affectedRows = $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE solution_id = %s",
442 if (strlen($numeric_result))
444 $next_id = $ilDB->nextId(
'tst_solutions');
445 $affectedRows = $ilDB->insert(
"tst_solutions", array(
446 "solution_id" => array(
"integer", $next_id),
447 "active_fi" => array(
"integer", $active_id),
448 "question_fi" => array(
"integer", $this->
getId()),
449 "value1" => array(
"clob", trim($numeric_result)),
450 "value2" => array(
"clob", null),
451 "pass" => array(
"integer",
$pass),
452 "tstamp" => array(
"integer", time())
459 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
467 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
519 return "qpl_qst_numeric";
545 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
551 if (strlen($solutions[0][
"value1"]))
556 return $startrow + $i + 1;