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';
104 $this->
setId($question_id);
113 require_once
'./Services/RTE/classes/class.ilRTE.php';
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';
144 parent::loadFromDb($question_id);
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'),
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";
609 return parent::getRTETextWithMediaObjects();
626 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
632 if (strlen($solutions[0][
"value1"]))
637 return $startrow + $i + 1;
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
getId()
Gets the id of the assQuestion object.
setExportDetailsXLS(&$worksheet, $startrow, $active_id, $pass, &$format_title, &$format_bold)
Creates an Excel worksheet for the detailed cumulated results of this question.
static _getOriginalId($question_id)
Returns the original id of a question.
__construct( $title="", $comment="", $author="", $owner=-1, $question="")
assNumeric constructor
saveAdditionalQuestionDataToDb()
Saves a record to the question types additional data table.
getPoints()
Returns the maximum available points for the question.
getMaxChars()
Returns the maximum number of characters for the numeric input field.
& getSolutionValues($active_id, $pass=NULL)
Loads solutions of a given user from the database an returns it.
Abstract basic class which is to be extended by the concrete assessment question type classes...
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
_convert_text($a_text, $a_target="has been removed")
setId($id=-1)
Sets the id of the assQuestion object.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question.
setNrOfTries($a_nr_of_tries)
_enabledAssessmentLogging()
check wether assessment logging is enabled or not
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
getQuestionType()
Returns the question type of the question.
loadFromDb($question_id)
Loads the question from the database.
getObjId()
Get the object id of the container object.
Base Exception for all Exceptions relating to Modules/Test.
setMaxChars($maxchars)
Sets the maximum number of characters for the numeric input field.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
fetchAssoc($a_set)
Fetch row as associative array from result set.
setAuthor($author="")
Sets the authors name of the assQuestion object.
Interface ilObjAnswerScoringAdjustable.
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates an assNumericQuestion.
reworkWorkingData($active_id, $pass, $obligationsAnswered)
Reworks the allready saved working data if neccessary.
saveToDb($original_id="")
Saves a assNumeric object to a database.
getAdditionalTableName()
Returns the name of the additional question data table in the database.
_getLogLanguage()
retrieve the log language for assessment logging
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
copyObject($target_questionpool_id, $title="")
Copies an assNumeric object.
setPoints($a_points)
Sets the maximum available points for the question.
saveQuestionDataToDb($original_id="")
static _replaceMediaObjectImageSrc($a_text, $a_direction=0)
replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
calculateReachedPoints($active_id, $pass=NULL, $returndetails=FALSE)
Returns the points, a learner has reached answering the question.
isComplete()
Returns true, if a numeric question is complete for use.
Class for numeric questions.
setQuestion($question="")
Sets the question string of the question object.
Interface ilObjQuestionScoringAdjustable.
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
setOriginalId($original_id)
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
logAction($logtext="", $active_id="", $question_id="")
Logs an action into the Test&Assessment log.
getTitle()
Gets the title string of the assQuestion object.
setTitle($title="")
Sets the title string of the assQuestion object.
setObjId($obj_id=0)
Set the object id of the container object.
setComment($comment="")
Sets the comment string of the assQuestion object.
contains($value)
Checks for a given value within the range.
saveWorkingData($active_id, $pass=NULL)
Saves the learners input of the question to the database.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.