31 if (is_array($a_value) && is_array($a_value[
'correctness'])) {
32 foreach ($this->values as $index =>
$value) {
33 if (isset($a_value[
'correctness'][$index])) {
34 $this->values[$index]->setCorrectness((
bool) $a_value[
'correctness'][$index]);
36 $this->values[$index]->setCorrectness(null);
49 if (is_array($foundvalues)) {
50 if (!isset($foundvalues[
'correctness']) || count($foundvalues[
'correctness']) < count($this->values)) {
64 $tpl =
new ilTemplate(
"tpl.prop_kprimchoicecorrection_input.html",
true,
true,
"Modules/TestQuestionPool");
66 foreach ($this->values as
$value) {
71 if ($value->getImageFile() !== null
72 && $value->getImageFile() !==
'') {
73 $imagename = $value->getImageWebPath();
75 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
76 if (@file_exists($value->getThumbFsPath())) {
77 $imagename = $value->getThumbWebPath();
81 $tpl->setCurrentBlock(
'image');
82 $tpl->setVariable(
'SRC_IMAGE', $imagename);
83 $tpl->setVariable(
'IMAGE_NAME', $value->getImageFile());
85 $tpl->parseCurrentBlock();
88 $tpl->setCurrentBlock(
"row");
90 $tpl->setVariable(
"ANSWER", $value->getAnswertext());
93 $tpl->setVariable(
"ROW_NUMBER", $value->getPosition());
94 $tpl->setVariable(
"ID", $this->
getPostVar() .
"[answer][{$value->getPosition()}]");
97 "CORRECTNESS_TRUE_ID",
98 $this->
getPostVar() .
"[correctness][{$value->getPosition()}][true]" 101 "CORRECTNESS_FALSE_ID",
102 $this->
getPostVar() .
"[correctness][{$value->getPosition()}][false]" 104 $tpl->setVariable(
"CORRECTNESS_TRUE_VALUE", 1);
105 $tpl->setVariable(
"CORRECTNESS_FALSE_VALUE", 0);
107 if ($value->getCorrectness() !== null) {
108 if ($value->getCorrectness()) {
109 $tpl->setVariable(
'CORRECTNESS_TRUE_SELECTED',
' checked="checked"');
111 $tpl->setVariable(
'CORRECTNESS_FALSE_SELECTED',
' checked="checked"');
116 $tpl->setVariable(
"DISABLED_CORRECTNESS",
" disabled=\"disabled\"");
119 $tpl->parseCurrentBlock();
122 $tpl->setVariable(
"TRUE_TEXT", $this->qstObject->getTrueOptionLabelTranslation($this->lng, $this->qstObject->getOptionLabel()));
123 $tpl->setVariable(
"FALSE_TEXT", $this->qstObject->getFalseOptionLabelTranslation($this->lng, $this->qstObject->getOptionLabel()));
126 $tpl->setVariable(
"DELETE_IMAGE_HEADER", $this->
lng->txt(
'delete_image_header'));
127 $tpl->setVariable(
"DELETE_IMAGE_QUESTION", $this->
lng->txt(
'delete_image_question'));
128 $tpl->setVariable(
"ANSWER_TEXT", $this->
lng->txt(
'answer'));
130 $tpl->setVariable(
"OPTIONS_TEXT", $this->
lng->txt(
'options'));
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)