23 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
24 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
85 $this->maxNumOfChars = 0;
98 if (($this->title) and ($this->author) and ($this->question) and ($this->
getMaximumPoints() > 0))
121 $affectedRows = $ilDB->manipulateF(
"DELETE FROM " . $this->
getAdditionalTableName() .
" WHERE question_fi = %s",
123 array($this->
getId())
126 $affectedRows = $ilDB->manipulateF(
"INSERT INTO " . $this->
getAdditionalTableName() .
" (question_fi, maxnumofchars, keywords, textgap_rating) VALUES (%s, %s, %s, %s)",
127 array(
"integer",
"integer",
"text",
"text"),
157 $this->
setId($question_id);
166 include_once(
"./Services/RTE/classes/class.ilRTE.php");
190 $this_id = $this->
getId();
192 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
219 $clone->copyPageOfQuestion($this_id);
221 $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
223 $clone->duplicateFeedbackGeneric($this_id);
224 $clone->onDuplicate($this_id);
243 include_once (
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
246 $source_questionpool = $this->
getObjId();
247 $clone->setObjId($target_questionpool);
274 if (strcmp($this->maxNumOfChars,
"") == 0)
293 $this->maxNumOfChars = $maxchars;
326 $affectedRows = $ilDB->manipulateF(
"UPDATE tst_test_result SET points = %s WHERE active_fi = %s AND question_fi = %s AND pass = %s",
327 array(
'float',
'integer',
'integer',
'integer'),
351 include_once
"./Services/Utilities/classes/class.ilStr.php";
358 if (
ilStr::strPos($answertext, $a_keyword) !==
false)
return TRUE;
361 $answerwords = array();
362 if (preg_match_all(
"/([^\s.]+)/", $answertext, $matches))
364 foreach ($matches[1] as $answerword)
366 array_push($answerwords, trim($answerword));
369 foreach ($answerwords as $a_original)
374 if (levenshtein($a_original, $a_keyword) <= 1)
return TRUE;
377 if (levenshtein($a_original, $a_keyword) <= 2)
return TRUE;
380 if (levenshtein($a_original, $a_keyword) <= 3)
return TRUE;
383 if (levenshtein($a_original, $a_keyword) <= 4)
return TRUE;
386 if (levenshtein($a_original, $a_keyword) <= 5)
return TRUE;
411 $result = $ilDB->queryF(
"SELECT * FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
412 array(
'integer',
'integer',
'integer'),
427 $foundkeyword =
false;
434 $foundkeyword =
true;
460 include_once
"./Services/Utilities/classes/class.ilStr.php";
463 include_once
"./Modules/Test/classes/class.ilObjTest.php";
466 $affectedRows = $ilDB->manipulateF(
"DELETE FROM tst_solutions WHERE active_fi = %s AND question_fi = %s AND pass = %s",
467 array(
'integer',
'integer',
'integer'),
473 include_once
"./Services/Utilities/classes/class.ilStr.php";
474 $text_without_tags = preg_replace(
"/<[^>*?]>/is",
"", $text);
479 if (!$this->
isHTML($text))
487 $text = preg_replace(
"/<[^>]*$/ims",
"", $text);
496 $next_id = $ilDB->nextId(
'tst_solutions');
497 $affectedRows = $ilDB->insert(
"tst_solutions", array(
498 "solution_id" => array(
"integer", $next_id),
499 "active_fi" => array(
"integer", $active_id),
500 "question_fi" => array(
"integer", $this->
getId()),
501 "value1" => array(
"clob", trim($text)),
502 "value2" => array(
"clob", null),
503 "pass" => array(
"integer",
$pass),
504 "tstamp" => array(
"integer", time())
510 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
518 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
540 return "assTextQuestion";
562 $this->keywords = $a_keywords;
574 if (preg_match_all(
"/([^\s]+)/", $this->keywords, $matches))
576 foreach ($matches[1] as $keyword)
605 switch ($a_text_rating)
614 $this->text_rating = $a_text_rating;
630 return "qpl_qst_essay";
656 include_once (
"./Services/Excel/classes/class.ilExcelUtils.php");
662 if (strlen($solutions[0][
"value1"]))
667 return $startrow + $i + 1;
675 include_once(
"./Services/RTE/classes/class.ilRTE.php");