4require_once 
'./Modules/TestQuestionPool/classes/class.assQuestion.php';
 
    5require_once 
'./Modules/Test/classes/inc.AssessmentConstants.php';
 
    6require_once 
'./Modules/TestQuestionPool/interfaces/interface.ilObjQuestionScoringAdjustable.php';
 
    7require_once 
'./Modules/TestQuestionPool/interfaces/interface.ilObjAnswerScoringAdjustable.php';
 
    8require_once 
'./Modules/TestQuestionPool/interfaces/interface.iQuestionCondition.php';
 
    9require_once 
'./Modules/TestQuestionPool/classes/class.ilUserQuestionResult.php';
 
   49        $this->errortext = 
'';
 
   50        $this->textsize = 100.0;
 
   51        $this->errordata = array();
 
   61        if (strlen($this->title)
 
   88            "DELETE FROM qpl_a_errortext WHERE question_fi = %s",
 
   90            array( $this->
getId() )
 
   94        foreach ($this->errordata as $object) {
 
   95            $next_id = 
$ilDB->nextId(
'qpl_a_errortext');
 
   97                "INSERT INTO qpl_a_errortext (answer_id, question_fi, text_wrong, text_correct, points, sequence) VALUES (%s, %s, %s, %s, %s, %s)",
 
   98                array( 
'integer', 
'integer', 
'text', 
'text', 
'float', 
'integer' ),
 
  103                                    $object->text_correct,
 
  124            array( $this->
getId() )
 
  128            "INSERT INTO " . $this->
getAdditionalTableName() . 
" (question_fi, errortext, textsize, points_wrong) VALUES (%s, %s, %s, %s)",
 
  129            array(
"integer", 
"text", 
"float", 
"float"),
 
  157            $this->
setId($question_id);
 
  166            include_once(
"./Services/RTE/classes/class.ilRTE.php");
 
  186            "SELECT * FROM qpl_a_errortext WHERE question_fi = %s ORDER BY sequence ASC",
 
  190        include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
 
  197        parent::loadFromDb($question_id);
 
  205        if ($this->
id <= 0) {
 
  210        $this_id = $this->
getId();
 
  214        include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
  218        if ((
int) $testObjId > 0) {
 
  219            $clone->setObjId($testObjId);
 
  239        $clone->copyPageOfQuestion($this_id);
 
  241        $clone->copyXHTMLMediaObjectsOfQuestion($this_id);
 
  243        $clone->onDuplicate($thisObjId, $this_id, $clone->getObjId(), $clone->getId());
 
  252        if ($this->
id <= 0) {
 
  258        $thisId = $this->
getId();
 
  262        include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
  265        $clone->setObjId($target_questionpool_id);
 
  276        $clone->onCopy($thisObjId, $thisId, $clone->getObjId(), $clone->getId());
 
  283        if ($this->
id <= 0) {
 
  288        include_once(
"./Modules/TestQuestionPool/classes/class.assQuestion.php");
 
  291        $sourceParentId = $this->
getObjId();
 
  297        $clone->setObjId($targetParentId);
 
  299        if ($targetQuestionTitle) {
 
  300            $clone->setTitle($targetQuestionTitle);
 
  305        $clone->copyPageOfQuestion($sourceQuestionId);
 
  307        $clone->copyXHTMLMediaObjectsOfQuestion($sourceQuestionId);
 
  309        $clone->onCopy($sourceParentId, $sourceQuestionId, $clone->getObjId(), $clone->getId());
 
  322        foreach ($this->errordata as $object) {
 
  323            if ($object->points > 0) {
 
  324                $maxpoints += $object->points;
 
  342        if ($returndetails) {
 
  343            throw new ilTestException(
'return details not implemented for ' . __METHOD__);
 
  350        $positions = array();
 
  351        if (is_null(
$pass)) {
 
  357            array_push($positions, $row[
'value1']);
 
  384        if (is_null(
$pass)) {
 
  385            include_once 
"./Modules/Test/classes/class.ilObjTest.php";
 
  389        $entered_values = 
false;
 
  391        $this->
getProcessLocker()->executeUserSolutionUpdateLockOperation(
function () use (&$entered_values, $active_id, 
$pass, $authorized) {
 
  395                $selected = explode(
",", 
$_POST[
"qst_" . $this->
getId()]);
 
  396                foreach ($selected as $position) {
 
  399                $entered_values = 
true;
 
  403        if ($entered_values) {
 
  404            include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
 
  409            include_once(
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
 
  421            $selection = explode(
',', 
$_POST[
"qst_{$this->getId()}"]);
 
  423            $selection = array();
 
  436        return "assErrorText";
 
  446        return "qpl_qst_errortext";
 
  456        return "qpl_a_errortext";
 
  465        $text = parent::getRTETextWithMediaObjects();
 
  474        parent::setExportDetailsXLS($worksheet, $startrow, $active_id, 
$pass);
 
  477        $selections = array();
 
  479        if (is_array($solutions)) {
 
  480            foreach ($solutions as $solution) {
 
  481                array_push($selections, $solution[
'value1']);
 
  483            $errortext_value = join(
",", $selections);
 
  490        return $startrow + 
$i + 1;
 
  505    public function fromXML(&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
 
  507        include_once 
"./Modules/TestQuestionPool/classes/import/qti12/class.assErrorTextImport.php";
 
  509        $import->fromXML($item, $questionpool_id, $tst_id, $tst_object, $question_counter, $import_mapping);
 
  518    public function toXML($a_include_header = 
true, $a_include_binary = 
true, $a_shuffle = 
false, $test_output = 
false, $force_image_references = 
false)
 
  520        include_once 
"./Modules/TestQuestionPool/classes/export/qti12/class.assErrorTextExport.php";
 
  522        return $export->toXML($a_include_header, $a_include_binary, $a_shuffle, $test_output, $force_image_references);
 
  532        $user_solution = array();
 
  533        return $user_solution;
 
  538        if (strlen($a_text) == 0) {
 
  545        $a_text = str_replace(array(
"((", 
"))"), array(
"~", 
"~"), $a_text);
 
  549        $r_passage = 
"/(~([^~]+)~|#([^\s]+))/";
 
  551        preg_match_all($r_passage, $a_text, $matches);
 
  553        if (is_array($matches[0]) && !empty($matches[0])) {
 
  558            $matches = array_intersect_key($matches, array(2 => 
'', 3 => 
''));
 
  561            $matches[2] = array_diff($matches[2], array(
''));
 
  562            $matches[3] = array_diff($matches[3], array(
''));
 
  565                "passages" => $matches[2],
 
  566                "words" => $matches[3],);
 
  574        include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
 
  576        $this->errordata = array();
 
  577        foreach ($a_data as $err_type => 
$errors) {
 
  580            foreach (
$errors as $idx => $error) {
 
  584                foreach ($temp as $object) {
 
  585                    if (strcmp($object->text_wrong, $error) == 0) {
 
  586                        $text_correct = $object->text_correct;
 
  594        ksort($this->errordata);
 
  597    public function createErrorTextOutput($selections = 
null, $graphicalOutput = 
false, $correct_solution = 
false, $use_link_tags = 
true)
 
  601        include_once 
"./Services/Utilities/classes/class.ilStr.php";
 
  602        if (!is_array($selections)) {
 
  603            $selections = array();
 
  605        $textarray = preg_split(
"/[\n\r]+/", $this->
getErrorText());
 
  607        foreach ($textarray as $textidx => $text) {
 
  609            $passage_end = 
false;
 
  610            $items = preg_split(
"/\s+/", $text);
 
  611            foreach ($items as $idx => $item) {
 
  615                    ($posHash = strpos($item, 
'#')) === 0 ||
 
  616                    ($posOpeningBrackets = strpos($item, 
'((')) === 0 ||
 
  617                    ($posClosingBrackets = strpos($item, 
'))')) !== 
false 
  621                    if ($posHash !== 
false) {
 
  622                        $item = ilStr::substr($item, 1, ilStr::strlen($item) - 1);
 
  623                        $passage_end = 
false;
 
  624                    } elseif ($posOpeningBrackets !== 
false) {
 
  626                        $passage_start_idx = $counter;
 
  627                        $items_in_passage = array();
 
  628                        $passage_end = 
false;
 
  629                        $item = ilStr::substr($item, 2, ilStr::strlen($item) - 2);
 
  633                        if (strpos($item, 
'))') !== 
false) {
 
  634                            $item = str_replace(
"))", 
"", $item);
 
  639                        $item = str_replace(
"))", 
"", $item);
 
  642                    if ($correct_solution && !$in_passage) {
 
  643                        $errorobject = $this->errordata[$errorcounter];
 
  644                        if (is_object($errorobject)) {
 
  645                            $item = strlen($errorobject->text_correct) ? $errorobject->text_correct : 
' ';
 
  651                if ($in_passage && !$passage_end) {
 
  652                    $items_in_passage[$idx] = $item;
 
  658                if ($in_passage && $passage_end) {
 
  660                    $passage_end = 
false;
 
  661                    if ($correct_solution) {
 
  664                            "ilc_qetitem_ErrorTextSelected" : 
"ilc_qetitem_ErrorTextItem" 
  667                        $errorobject = $this->errordata[$errorcounter];
 
  668                        if (is_object($errorobject)) {
 
  669                            $item = strlen($errorobject->text_correct) ? $errorobject->text_correct : 
' ';
 
  677                    $group_selected = 
true;
 
  678                    if ($graphicalOutput) {
 
  679                        $start_idx = $passage_start_idx;
 
  680                        foreach ($items_in_passage as $tmp_idx => $tmp_item) {
 
  682                                $group_selected = 
false;
 
  688                        if ($group_selected) {
 
  690                                $group_selected = 
false;
 
  695                    $item_stack = array();
 
  696                    $start_idx = $passage_start_idx;
 
  697                    foreach ($items_in_passage as $tmp_idx => $tmp_item) {
 
  700                            "ilc_qetitem_ErrorTextSelected" : 
"ilc_qetitem_ErrorTextItem" 
  707                        "ilc_qetitem_ErrorTextSelected" : 
"ilc_qetitem_ErrorTextItem" 
  709                    if ($graphicalOutput) {
 
  710                        if ($group_selected) {
 
  711                            $img = 
' <img src="' . 
ilUtil::getImagePath(
"icon_ok.svg") . 
'" alt="' . $this->lng->txt(
"answer_is_right") . 
'" title="' . $this->lng->txt(
"answer_is_right") . 
'" /> ';
 
  713                            $img = 
' <img src="' . 
ilUtil::getImagePath(
"icon_not_ok.svg") . 
'" alt="' . $this->lng->txt(
"answer_is_wrong") . 
'" title="' . $this->lng->txt(
"answer_is_wrong") . 
'" /> ';
 
  718                    $item_stack = trim(implode(
" ", $item_stack));
 
  719                    $item_stack = strlen($item_stack) ? $item_stack : 
' ';
 
  721                    if ($graphicalOutput) {
 
  722                        $items[$idx] = 
'<span class="selGroup">' . $item_stack . 
'</span>';
 
  724                        $items[$idx] = $item_stack;
 
  732                $class = 
'ilc_qetitem_ErrorTextItem';
 
  735                    $class = 
"ilc_qetitem_ErrorTextSelected";
 
  736                    if ($graphicalOutput) {
 
  738                            $img = 
' <img src="' . 
ilUtil::getImagePath(
"icon_ok.svg") . 
'" alt="' . $this->lng->txt(
"answer_is_right") . 
'" title="' . $this->lng->txt(
"answer_is_right") . 
'" /> ';
 
  740                            $img = 
' <img src="' . 
ilUtil::getImagePath(
"icon_not_ok.svg") . 
'" alt="' . $this->lng->txt(
"answer_is_wrong") . 
'" title="' . $this->lng->txt(
"answer_is_wrong") . 
'" /> ';
 
  748            $textarray[$textidx] = 
'<p>' . implode(
" ", $items) . 
'</p>';
 
  751        return implode(
"\n", $textarray);
 
  756        foreach ($selection as 
$data) {
 
  757            if (!is_array(
$data)) {
 
  758                if ($counter == 
$data) {
 
  761            } elseif (in_array($counter, 
$data)) {
 
  773        include_once 
"./Services/Utilities/classes/class.ilStr.php";
 
  774        if (!is_array($selections)) {
 
  775            $selections = array();
 
  777        $textarray = preg_split(
"/[\n\r]+/", $this->
getErrorText());
 
  778        foreach ($textarray as $textidx => $text) {
 
  779            $items = preg_split(
"/\s+/", $text);
 
  780            foreach ($items as $idx => $item) {
 
  781                if (($posHash = strpos($item, 
'#')) === 0
 
  782                    || ($posOpeningBrackets = strpos($item, 
'((')) === 0
 
  783                    || ($posClosingBrackets = strpos($item, 
'))')) !== 
false) {
 
  786                    if ($posHash !== 
false) {
 
  787                        $item = ilStr::substr($item, 1, ilStr::strlen($item) - 1);
 
  788                    } elseif ($posOpeningBrackets !== 
false) {
 
  789                        $item = ilStr::substr($item, 2, ilStr::strlen($item) - 2);
 
  793                        if (strpos($item, 
'))') !== 
false) {
 
  794                            $item = ilStr::substr($item, 0, ilStr::strlen($item) - 2);
 
  798                        if ($item[$posClosingBrackets + 2] == 
',') {
 
  802                        $item = ilStr::substr($item, 0, $posClosingBrackets) . $appendComma;
 
  807                if (in_array($counter, $selections)) {
 
  811                if (in_array($counter, $selections)) {
 
  814                $items[$idx] = $word;
 
  817            $textarray[$textidx] = join(
" ", $items);
 
  819        return join(
"\n", $textarray);
 
  828        $textarray = preg_split(
"/[\n\r]+/", $this->
getErrorText());
 
  829        foreach ($textarray as $textidx => $text) {
 
  830            $items = preg_split(
"/\s+/", $text);
 
  832            foreach ($items as $word) {
 
  834                $isErrorItem = 
false;
 
  835                if (strpos($word, 
'#') === 0) {
 
  837                    $errorobject = $this->errordata[$errorcounter];
 
  838                    if (is_object($errorobject)) {
 
  839                        $points = $errorobject->points;
 
  843                } elseif (($posOpeningBracket = strpos($word, 
'((')) === 0
 
  844                        || ($posClosingBracket = strpos($word, 
'))')) !== 
false 
  848                    if ($posOpeningBracket !== 
false) {
 
  849                        $passages[] = array(
'begin_pos' => $counter, 
'cnt_words' => 0);
 
  851                    } elseif ($posClosingBracket !== 
false) {
 
  853                        $cur_pidx = count($passages) - 1;
 
  854                        $passages[$cur_pidx][
'end_pos'] = $counter;
 
  856                        $errorobject = $this->errordata[$errorcounter];
 
  857                        if (is_object($errorobject)) {
 
  858                            $passages[$cur_pidx][
'score'] = $errorobject->points;
 
  859                            $passages[$cur_pidx][
'isError'] = 
true;
 
  865                    $cur_pidx = count($passages) - 1;
 
  866                    $passages[$cur_pidx][
'cnt_words']++;
 
  870                $words[$counter] = array(
"word" => $word, 
"points" => 
$points, 
"isError" => $isErrorItem);
 
  875        $selections = array();
 
  876        foreach ($passages as $cnt => $pdata) {
 
  877            if (!$withPositivePointsOnly && $pdata[
'isError'] || $withPositivePointsOnly && $pdata[
'score'] > 0) {
 
  878                $indexes = range($pdata[
'begin_pos'], $pdata[
'end_pos']);
 
  879                $selections[$pdata[
'begin_pos']] = $indexes;
 
  883        foreach ($words as $idx => $word) {
 
  884            if (!$withPositivePointsOnly && $word[
'isError'] || $withPositivePointsOnly && $word[
'points'] > 0) {
 
  885                $selections[$idx] = array($idx);
 
  891        $selections = array_values($selections);
 
  902        $textarray = preg_split(
"/[\n\r]+/", $this->
getErrorText());
 
  903        foreach ($textarray as $textidx => $text) {
 
  904            $items = preg_split(
"/\s+/", $text);
 
  906            foreach ($items as $word) {
 
  908                if (strpos($word, 
'#') === 0) {
 
  910                    $errorobject = $this->errordata[$errorcounter];
 
  911                    if (is_object($errorobject)) {
 
  912                        $points = $errorobject->points;
 
  915                } elseif (($posOpeningBracket = strpos($word, 
'((')) === 0
 
  916                        || ($posClosingBracket = strpos($word, 
'))')) !== 
false 
  920                    if ($posOpeningBracket !== 
false) {
 
  921                        $passages[] = array(
'begin_pos' => $counter, 
'cnt_words' => 0);
 
  923                    } elseif ($posClosingBracket !== 
false) {
 
  925                        $cur_pidx = count($passages) - 1;
 
  926                        $passages[$cur_pidx][
'end_pos'] = $counter;
 
  928                        $errorobject = $this->errordata[$errorcounter];
 
  929                        if (is_object($errorobject)) {
 
  930                            $passages[$cur_pidx][
'score'] = $errorobject->points;
 
  935                    $cur_pidx = count($passages) - 1;
 
  936                    $passages[$cur_pidx][
'cnt_words']++;
 
  940                $words[$counter] = array(
"word" => $word, 
"points" => 
$points);
 
  947        foreach ($positions as $position) {
 
  951            $total += $words[$position][
'points'];
 
  954        foreach ($passages as $cnt => $p_data) {
 
  959            $isSelected = in_array($p_data[
'begin_pos'], $positions);
 
  961            for (
$i = 0; 
$i < $p_data[
'cnt_words']; 
$i++) {
 
  962                $current_pos = $p_data[
'begin_pos'] + 
$i;
 
  963                $isSelected = $isSelected && in_array($current_pos, $positions);
 
  966            $total += $isSelected ? $p_data[
'score'] : 0;
 
  977        $this->errordata = array();
 
  982        include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
 
 1034        if ($a_value === 
null) {
 
 1037        $this->textsize = $a_value;
 
 1057        $this->points_wrong = $a_value;
 
 1072            case "points_wrong":
 
 1076                return parent::__get($value);
 
 1093            case "points_wrong":
 
 1097                parent::__set($key, $value);
 
 1108        include_once(
"./Services/RTE/classes/class.ilRTE.php");
 
 1118            'onenotcorrect' => $this->
formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), 
false)),
 
 1119            'allcorrect' => $this->formatSAQuestion($this->feedbackOBJ->getGenericFeedbackTestPresentation($this->getId(), 
true))
 
 1123        foreach ($this->
getErrorData() as $idx => $answer_obj) {
 
 1124            array_push($answers, array(
 
 1125                "answertext_wrong" => (
string) $answer_obj->text_wrong,
 
 1126                "answertext_correct" => (
string) $answer_obj->text_correct,
 
 1127                "points" => (
float) $answer_obj->points,
 
 1128                "order" => (
int) $idx + 1
 
 1131        $result[
'correct_answers'] = $answers;
 
 1134        $textarray = preg_split(
"/[\n\r]+/", $this->
getErrorText());
 
 1135        foreach ($textarray as $textidx => $text) {
 
 1136            $items = preg_split(
"/\s+/", trim($text));
 
 1137            foreach ($items as $idx => $item) {
 
 1138                if (substr($item, 0, 1) == 
"#") {
 
 1139                    $item = substr($item, 1);
 
 1142                    foreach (
$result[
"correct_answers"] as $aidx => $answer) {
 
 1143                        if ($answer[
"answertext_wrong"] == $item && !$answer[
"pos"]) {
 
 1144                            $result[
"correct_answers"][$aidx][
"pos"] = $this->
getId() . 
"_" . $textidx . 
"_" . ($idx + 1);
 
 1149                array_push($answers, array(
 
 1151                    "order" => $this->
getId() . 
"_" . $textidx . 
"_" . ($idx + 1)
 
 1154            if ($textidx != 
sizeof($textarray) - 1) {
 
 1155                array_push($answers, array(
 
 1156                        "answertext" => 
"###",
 
 1157                        "order" => $this->
getId() . 
"_" . $textidx . 
"_" . ($idx + 2)
 
 1161        $result[
'answers'] = $answers;
 
 1179        require_once 
"./Modules/TestQuestionPool/classes/class.ilOperatorsExpressionMapping.php";
 
 1213            "SELECT value1+1 as value1 FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s AND step = ( 
 1214                                SELECT MAX(step) FROM tst_solutions WHERE active_fi = %s AND pass = %s AND question_fi = %s 
 1216            array(
"integer", 
"integer", 
"integer",
"integer", 
"integer", 
"integer"),
 
 1221            $result->addKeyValue($row[
"value1"], $row[
"value1"]);
 
 1242        $error_text_array = explode(
' ', $this->errortext);
 
 1245            if (array_key_exists(
$index, $error_text_array)) {
 
 1246                return $error_text_array[
$index];
 
 1250            return $error_text_array;
 
An exception for terminatinating execution or to throw for unit testing.
Class for error text answers.
Class for error text question exports.
Class for error text question imports.
Class for error text questions.
getErrorData()
Get error data.
toXML($a_include_header=true, $a_include_binary=true, $a_shuffle=false, $test_output=false, $force_image_references=false)
Returns a QTI xml representation of the question and sets the internal domxml variable with the DOM X...
saveWorkingData($active_id, $pass=null, $authorized=true)
Saves the learners input of the question to the database.
flushErrorData()
Flush error data.
loadFromDb($question_id)
Loads the object from the database.
getTextSize()
Set text size in percent.
getOperators($expression)
Get all available operations for a specific question.
__construct( $title='', $comment='', $author='', $owner=-1, $question='')
assErorText constructor
getAvailableAnswerOptions($index=null)
If index is null, the function returns an array with all anwser options Else it returns the specific ...
getErrorsFromText($a_text="")
__get($value)
Object getter.
createErrorTextExport($selections=null)
duplicate($for_test=true, $title="", $author="", $owner="", $testObjId=null)
Duplicates the object.
savePreviewData(ilAssQuestionPreviewSession $previewSession)
__set($key, $value)
Object setter.
getErrorText()
Get error text.
toJSON()
Returns a JSON representation of the question.
createErrorTextOutput($selections=null, $graphicalOutput=false, $correct_solution=false, $use_link_tags=true)
setTextSize($a_value)
Set text size in percent.
setErrorText($a_value)
Set error text.
getAnswerTableName()
Returns the name of the answer table in the database.
saveToDb($original_id="")
Saves a the object to the database.
setExportDetailsXLS($worksheet, $startrow, $active_id, $pass)
{Creates an Excel worksheet for the detailed cumulated results of this question.object}
saveAnswerSpecificDataToDb()
Saves the answer specific records into a question types answer table.
copyObject($target_questionpool_id, $title="")
Copies an object.
setPointsWrong($a_value)
Set wrong points.
calculateReachedPoints($active_id, $pass=null, $authorizedSolution=true, $returndetails=false)
Returns the points, a learner has reached answering the question.
calculateReachedPointsFromPreviewSession(ilAssQuestionPreviewSession $previewSession)
getErrorTokenHtml($item, $class, $useLinkTags)
getBestSelection($withPositivePointsOnly=true)
getMaximumPoints()
Returns the maximum points, a learner can reach answering the question.
getRTETextWithMediaObjects()
Collects all text in the question which could contain media objects which were created with the Rich ...
getPointsForSelectedPositions($positions)
createNewOriginalFromThisDuplicate($targetParentId, $targetQuestionTitle="")
getAdditionalTableName()
Returns the name of the additional question data table in the database.
getPointsWrong()
Get wrong points.
isTokenSelected($counter, array $selection)
isComplete()
Returns true, if a single choice question is complete for use.
getBestSolution($active_id, $pass)
Returns the best solution for a given pass of a participant.
fromXML(&$item, &$questionpool_id, &$tst_id, &$tst_object, &$question_counter, &$import_mapping)
Creates a question from a QTI file.
saveAdditionalQuestionDataToDb()
Saves the data for the additional data table.
addErrorData($text_wrong, $text_correct, $points)
getExpressionTypes()
Get all available expression types for a specific question.
getQuestionType()
Returns the question type of the question.
Abstract basic class which is to be extended by the concrete assessment question type classes.
getCurrentSolutionResultSet($active_id, $pass, $authorized=true)
Get a restulset for the current user solution for a this question by active_id and pass.
getSolutionValues($active_id, $pass=null, $authorized=true)
Loads solutions of a given user from the database an returns it.
static _getOriginalId($question_id)
Returns the original id of a question.
formatSAQuestion($a_q)
Format self assessment question.
setId($id=-1)
Sets the id of the assQuestion object.
setOriginalId($original_id)
setObjId($obj_id=0)
Set the object id of the container object.
getSolutionMaxPass($active_id)
Returns the maximum pass a users question solution.
saveQuestionDataToDb($original_id="")
getHtmlQuestionContentPurifier()
getId()
Gets the id of the assQuestion object.
saveCurrentSolution($active_id, $pass, $value1, $value2, $authorized=true, $tstamp=null)
getObjId()
Get the object id of the container object.
setTitle($title="")
Sets the title string of the assQuestion object.
setOwner($owner="")
Sets the creator/owner ID of the assQuestion object.
setEstimatedWorkingTime($hour=0, $min=0, $sec=0)
Sets the estimated working time of a question from given hour, minute and second.
deductHintPointsFromReachedPoints(ilAssQuestionPreviewSession $previewSession, $reachedPoints)
static logAction($logtext="", $active_id="", $question_id="")
Logs an action into the Test&Assessment log.
removeCurrentSolution($active_id, $pass, $authorized=true)
setAuthor($author="")
Sets the authors name of the assQuestion object.
getShuffle()
Gets the shuffle flag.
setLifecycle(ilAssQuestionLifecycle $lifecycle)
getTitle()
Gets the title string of the assQuestion object.
setPoints($a_points)
Sets the maximum available points for the question.
setComment($comment="")
Sets the comment string of the assQuestion object.
setNrOfTries($a_nr_of_tries)
getQuestion()
Gets the question string of the question object.
setAdditionalContentEditingMode($additinalContentEditingMode)
setter for additional content editing mode for this question
setQuestion($question="")
Sets the question string of the question object.
ensureNonNegativePoints($points)
static getDraftInstance()
static getInstance($identifier)
getParticipantsSolution()
setParticipantsSolution($participantSolution)
static _getLogLanguage()
retrieve the log language for assessment logging
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static getOperatorsByExpression($expression)
static _replaceMediaObjectImageSrc($a_text, $a_direction=0, $nic=IL_INST_ID)
Replaces image source from mob image urls with the mob id or replaces mob id with the correct image s...
Base Exception for all Exceptions relating to Modules/Test.
Class ilUserQuestionResult.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
Class iQuestionCondition.
const PercentageResultExpression
getUserQuestionResult($active_id, $pass)
Get the user solution for a question by active_id and the test pass.
const EmptyAnswerExpression
const ExclusiveResultExpression
const NumberOfResultExpression
Interface ilObjAnswerScoringAdjustable.
Interface ilObjQuestionScoringAdjustable.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc