42 foreach ($this->forms_helper->transformPoints($a_value) as $index =>
$value) {
47 $this->pairs[$index] = $this->pairs[$index]->withPoints(
$value);
54 $result = $this->forms_helper->checkPointsInput(
$data, $this->
getRequired());
56 if (!is_array($result)) {
61 if (max($result) <= 0) {
62 $this->
setAlert($this->
lng->txt(
'enter_enough_positive_points'));
71 $tpl =
new ilTemplate(
'tpl.prop_matchingpaircorrection_input.html',
true,
true,
'components/ILIAS/TestQuestionPool');
75 foreach ($this->pairs as $pair) {
76 $tpl->setCurrentBlock(
'row');
78 foreach ($this->terms as $term) {
79 if ($pair->getTerm()->getIdentifier() !== $term->getIdentifier()) {
82 $term_ids[] = $term->getIdentifier();
83 if ($term->getText() !==
'') {
86 if ($term->getPicture() !==
'') {
87 $tpl->setCurrentBlock(
'term_image');
88 $tpl->setVariable(
'THUMBNAIL_HREF', $this->path_including_prefix . $term->getPicture());
89 $tpl->setVariable(
'THUMB_ALT', $this->
lng->txt(
'image'));
90 $tpl->setVariable(
'THUMB_TITLE', $this->
lng->txt(
'image'));
91 $tpl->parseCurrentBlock();
92 $tpl->setCurrentBlock(
'row');
96 foreach ($this->definitions as $definition) {
97 if ($pair->getDefinition()->getIdentifier() !== $definition->getIdentifier()) {
100 $definition_ids[] = $definition->getIdentifier();
101 if ($definition->getText() !==
'') {
104 if ($definition->getPicture() !==
'') {
105 $tpl->setCurrentBlock(
'definition_image');
106 $tpl->setVariable(
'THUMBNAIL_HREF', $this->path_including_prefix . $definition->getPicture());
107 $tpl->setVariable(
'THUMB_ALT', $this->
lng->txt(
'image'));
108 $tpl->setVariable(
'THUMB_TITLE', $this->
lng->txt(
'image'));
109 $tpl->parseCurrentBlock();
110 $tpl->setCurrentBlock(
'row');
115 $tpl->setVariable(
'POINTS_VALUE', $pair->getPoints());
116 $tpl->setVariable(
'ROW_NUMBER', $i);
118 $tpl->setVariable(
'ID', $this->
getPostVar() .
"[$i]");
119 $tpl->setVariable(
'POST_VAR', $this->
getPostVar());
121 $tpl->parseCurrentBlock();
126 $tpl->setCurrentBlock(
'term_ids');
127 $tpl->setVariable(
'POST_VAR', $this->
getPostVar());
128 $tpl->setVariable(
'TERM_IDS', join(
',', $term_ids));
129 $tpl->parseCurrentBlock();
131 $tpl->setCurrentBlock(
'definition_ids');
132 $tpl->setVariable(
'POST_VAR', $this->
getPostVar());
133 $tpl->setVariable(
'DEFINITION_IDS', join(
',', $definition_ids));
134 $tpl->parseCurrentBlock();
136 $tpl->setVariable(
'ELEMENT_ID', $this->
getPostVar());
137 $tpl->setVariable(
'TEXT_POINTS', $this->
lng->txt(
'points'));
138 $tpl->setVariable(
'TEXT_DEFINITION', $this->
lng->txt(
'definition'));
139 $tpl->setVariable(
'TEXT_TERM', $this->
lng->txt(
'term'));
140 $tpl->setVariable(
'TEXT_ACTIONS', $this->
lng->txt(
'actions'));
setVariable($variable, $value='')
Sets a variable value.
special template class to simplify handling of ITX/PEAR
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)