diff --git a/app/views/my_courses/groups.php b/app/views/my_courses/groups.php index fef5cd6f1d4b8ea6fe8f01879283ae7afe3e2356..c562d97db8e9fb1ca8a408e3f35ee586b2365730 100644 --- a/app/views/my_courses/groups.php +++ b/app/views/my_courses/groups.php @@ -1,7 +1,7 @@ -<form method="post" action="<?= $controller->url_for('my_courses/store_groups/'.$studygroups) ?>" class="default"> +<form method="post" action="<?= $controller->link_for('my_courses/store_groups/'.$studygroups) ?>" class="default"> <?= CSRFProtection::tokenTag() ?> - <input type="hidden" name="cid" value="<?= $cid ?>"> + <input type="hidden" name="cid" value="<?= htmlReady($cid) ?>"> <table class="default collapsable"> <caption><?= _('Gruppenzuordnung') ?></caption> <colgroup> @@ -17,7 +17,7 @@ </tr> </thead> <? foreach ($groups as $group_id => $group_members): ?> - <tbody class="<?= $current_semester != $semesters[$group_id]['semester_id'] ? 'collapsed' : ''?>"> + <tbody <? if (isset($semesters[$group_id]['semester_id']) && $current_semester != $semesters[$group_id]['semester_id']) echo 'class="collapsed"'; ?>> <? if ($group_field !== 'not_grouped'): ?> <tr class="table_header header-row"> diff --git a/app/views/questionnaire/question_types/vote/vote_evaluation.php b/app/views/questionnaire/question_types/vote/vote_evaluation.php index cce7f3e2da5f62e614142f6f478b1f541fcbc3ab..e654a327abc241518d40b0a17902e20748e70702 100644 --- a/app/views/questionnaire/question_types/vote/vote_evaluation.php +++ b/app/views/questionnaire/question_types/vote/vote_evaluation.php @@ -21,6 +21,14 @@ if ($numTaskAnswers > 0) { } } else { if (isset($answer['answerdata']['answers'])) { + if (!isset($results[(int) $answer['answerdata']['answers']])) { + $results[(int) $answer['answerdata']['answers']] = 0; + } + $results[(int) $answer['answerdata']['answers']]++; + + if (!isset($results_users[(int) $answer['answerdata']['answers']])) { + $results_users[(int) $answer['answerdata']['answers']] = []; + } $results[(int) $answer['answerdata']['answers']]++; $results_users[(int) $answer['answerdata']['answers']][] = $answer['user_id']; } @@ -76,7 +84,7 @@ rsort($ordered_results); <? $countAnswers = $vote->questionnaire->countAnswers() ?> <? foreach ($options as $key => $answer) : ?> <tr> - <? $percentage = $countAnswers ? round((int) $results[$key] / $countAnswers * 100) : 0 ?> + <? $percentage = ($countAnswers && isset($results[$key])) ? round((int) $results[$key] / $countAnswers * 100) : 0 ?> <td style="text-align: right; background-size: <?= $percentage ?>% 100%; background-position: right center; background-image: url('<?= Assets::image_path("vote_lightgrey.png") ?>'); background-repeat: no-repeat;" width="50%"> <strong><?= formatReady($answer) ?></strong> diff --git a/templates/shared/pagechooser.php b/templates/shared/pagechooser.php index d4416bb5c6445478f31bc6b0688d802f3e439934..618c921934e5b3cf3fcced46f90fac87de3f4240 100644 --- a/templates/shared/pagechooser.php +++ b/templates/shared/pagechooser.php @@ -22,7 +22,7 @@ aria-labelledby="pagination-label-<?= $random_id ?>"> <? if ($cur_page > 1): ?> <li class="prev"> - <a class="pagination--link" href="<?= URLHelper::getLink(sprintf($pagelink, $cur_page - 1), $pageparams) ?>" rel="prev" <?= $dialog ?: ''?>> + <a class="pagination--link" href="<?= URLHelper::getLink(sprintf($pagelink, $cur_page - 1), $pageparams) ?>" rel="prev" <?= $dialog ?? '' ?>> <span class="audible"><?= _('Eine Seite') ?></span> <?= _('zurück') ?> </a>