17 if (is_array($a_value) && is_array($a_value[
'correctness'])) {
19 if (isset($a_value[
'correctness'][
$index])) {
20 $this->values[
$index]->setCorrectness((
bool) $a_value[
'correctness'][$index]);
22 $this->values[
$index]->setCorrectness(null);
33 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
44 if (is_array($foundvalues)) {
46 if (!isset($foundvalues[
'correctness']) || count($foundvalues[
'correctness']) < count($this->values)) {
58 public function insert($a_tpl)
60 $tpl =
new ilTemplate(
"tpl.prop_kprimchoicecorrection_input.html",
true,
true,
"Modules/TestQuestionPool");
62 foreach ($this->values as
$value) {
67 if (strlen($value->getImageFile())) {
68 $imagename = $value->getImageWebPath();
70 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
71 if (@file_exists($value->getThumbFsPath())) {
72 $imagename = $value->getThumbWebPath();
76 $tpl->setCurrentBlock(
'image');
77 $tpl->setVariable(
'SRC_IMAGE', $imagename);
78 $tpl->setVariable(
'IMAGE_NAME', $value->getImageFile());
80 $tpl->parseCurrentBlock();
83 $tpl->setCurrentBlock(
"row");
85 $tpl->setVariable(
"ANSWER", $value->getAnswertext());
88 $tpl->setVariable(
"ROW_NUMBER", $value->getPosition());
89 $tpl->setVariable(
"ID", $this->
getPostVar() .
"[answer][{$value->getPosition()}]");
92 "CORRECTNESS_TRUE_ID",
93 $this->
getPostVar() .
"[correctness][{$value->getPosition()}][true]" 96 "CORRECTNESS_FALSE_ID",
97 $this->
getPostVar() .
"[correctness][{$value->getPosition()}][false]" 99 $tpl->setVariable(
"CORRECTNESS_TRUE_VALUE", 1);
100 $tpl->setVariable(
"CORRECTNESS_FALSE_VALUE", 0);
102 if ($value->getCorrectness() !== null) {
103 if ($value->getCorrectness()) {
104 $tpl->setVariable(
'CORRECTNESS_TRUE_SELECTED',
' checked="checked"');
106 $tpl->setVariable(
'CORRECTNESS_FALSE_SELECTED',
' checked="checked"');
111 $tpl->setVariable(
"DISABLED_CORRECTNESS",
" disabled=\"disabled\"");
114 $tpl->parseCurrentBlock();
117 $tpl->setVariable(
"TRUE_TEXT", $this->qstObject->getTrueOptionLabelTranslation($this->lng, $this->qstObject->getOptionLabel()));
118 $tpl->setVariable(
"FALSE_TEXT", $this->qstObject->getFalseOptionLabelTranslation($this->lng, $this->qstObject->getOptionLabel()));
121 $tpl->setVariable(
"DELETE_IMAGE_HEADER", $this->lng->txt(
'delete_image_header'));
122 $tpl->setVariable(
"DELETE_IMAGE_QUESTION", $this->lng->txt(
'delete_image_question'));
123 $tpl->setVariable(
"ANSWER_TEXT", $this->lng->txt(
'answer'));
125 $tpl->setVariable(
"OPTIONS_TEXT", $this->lng->txt(
'options'));
127 $a_tpl->setCurrentBlock(
"prop_generic");
128 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
129 $a_tpl->parseCurrentBlock();
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
static _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
special template class to simplify handling of ITX/PEAR
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.