43 if (is_array($a_value)) {
44 if (is_array($a_value[
'points'])) {
45 foreach ($a_value[
'points'] as $idx => $term) {
46 $this->pairs[$idx]->withPoints($a_value[
'points'][$idx]);
55 if (is_array($foundvalues)) {
57 foreach ($foundvalues[
'points'] as $val) {
62 $this->
setAlert($this->
lng->txt(
"msg_input_is_required"));
67 $this->
setAlert($this->
lng->txt(
"enter_enough_positive_points"));
72 $this->
setAlert($this->
lng->txt(
"msg_input_is_required"));
82 $tpl =
new ilTemplate(
"tpl.prop_matchingpaircorrection_input.html",
true,
true,
"Modules/TestQuestionPool");
87 foreach ($this->pairs as $pair) {
88 $tpl->setCurrentBlock(
'row');
90 foreach ($this->terms as $term) {
91 if ($pair->getTerm()->getIdentifier() !== $term->getIdentifier()) {
94 $term_ids[] = $term->getIdentifier();
95 if ($term->getText() !==
'') {
98 if ($term->getPicture() !==
'') {
99 $tpl->setCurrentBlock(
'term_image');
100 $tpl->setVariable(
'THUMBNAIL_HREF', $this->path_including_prefix . $term->getPicture());
101 $tpl->setVariable(
'THUMB_ALT', $this->
lng->txt(
'image'));
102 $tpl->setVariable(
'THUMB_TITLE', $this->
lng->txt(
'image'));
103 $tpl->parseCurrentBlock();
104 $tpl->setCurrentBlock(
'row');
108 foreach ($this->definitions as $definition) {
109 if ($pair->getDefinition()->getIdentifier() !== $definition->getIdentifier()) {
112 $definition_ids[] = $definition->getIdentifier();
113 if ($definition->getText() !==
'') {
116 if ($definition->getPicture() !==
'') {
117 $tpl->setCurrentBlock(
'definition_image');
118 $tpl->setVariable(
'THUMBNAIL_HREF', $this->path_including_prefix . $definition->getPicture());
119 $tpl->setVariable(
'THUMB_ALT', $this->
lng->txt(
'image'));
120 $tpl->setVariable(
'THUMB_TITLE', $this->
lng->txt(
'image'));
121 $tpl->parseCurrentBlock();
122 $tpl->setCurrentBlock(
'row');
127 $tpl->setVariable(
'POINTS_VALUE', $pair->getPoints());
128 $tpl->setVariable(
'ROW_NUMBER',
$i);
133 $tpl->parseCurrentBlock();
138 $tpl->setCurrentBlock(
'term_ids');
140 $tpl->setVariable(
'TERM_IDS', join(
',', $term_ids));
141 $tpl->parseCurrentBlock();
143 $tpl->setCurrentBlock(
'definition_ids');
145 $tpl->setVariable(
'DEFINITION_IDS', join(
',', $definition_ids));
146 $tpl->parseCurrentBlock();
149 $tpl->setVariable(
'TEXT_POINTS', $this->
lng->txt(
'points'));
150 $tpl->setVariable(
'TEXT_DEFINITION', $this->
lng->txt(
'definition'));
151 $tpl->setVariable(
'TEXT_TERM', $this->
lng->txt(
'term'));
152 $tpl->setVariable(
'TEXT_ACTIONS', $this->
lng->txt(
'actions'));
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setVariable($variable, $value='')
Sets a variable value.
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl