Skip to content
Snippets Groups Projects
Commit a01a83b4 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

prevent php8 warnings, fixes #2579

Closes #2579

Merge request studip/studip!1736
parent d2355538
No related branches found
No related tags found
No related merge requests found
...@@ -1093,7 +1093,7 @@ class Course_MembersController extends AuthenticatedController ...@@ -1093,7 +1093,7 @@ class Course_MembersController extends AuthenticatedController
$users = []; $users = [];
if ($cmd === 'singleuser') { if ($cmd === 'singleuser') {
$users[] = $user_id; $users[] = $user_id;
} else { } elseif (isset($this->flash['users']) && is_array($this->flash['users'])) {
// create a usable array // create a usable array
foreach ($this->flash['users'] as $user => $val) { foreach ($this->flash['users'] as $user => $val) {
if ($val) { if ($val) {
......
<?php
/**
* @var Course_Gradebook_StudentsController $controller
* @var float $total
* @var string[] $categories
* @var float[] $subtotals
* @var array<string, Grading\Definition> $groupedDefinitions
*/
?>
<article class="gradebook-student"> <article class="gradebook-student">
<header> <header>
<h1><?= _("Gesamt") ?></h1> <h1><?= _("Gesamt") ?></h1>
...@@ -31,7 +40,7 @@ ...@@ -31,7 +40,7 @@
<tbody> <tbody>
<? <?
foreach ($groupedDefinitions[$category] as $definition) { foreach ($groupedDefinitions[$category] as $definition) {
$instance = $groupedInstances[$definition->id]; $instance = $groupedInstances[$definition->id] ?? null;
$grade = $controller->formatAsPercent($instance ? $instance->rawgrade : 0); $grade = $controller->formatAsPercent($instance ? $instance->rawgrade : 0);
$feedback = $instance ? $instance->feedback : ''; $feedback = $instance ? $instance->feedback : '';
?> ?>
......
...@@ -93,7 +93,7 @@ rsort($ordered_results); ...@@ -93,7 +93,7 @@ rsort($ordered_results);
title="<?= _('Zeige wieder alle Ergebnisse ohne Filterung an.') ?>" title="<?= _('Zeige wieder alle Ergebnisse ohne Filterung an.') ?>"
onclick="STUDIP.Questionnaire.removeFilter('<?= htmlReady($vote['questionnaire_id']) ?>'); return false;"> onclick="STUDIP.Questionnaire.removeFilter('<?= htmlReady($vote['questionnaire_id']) ?>'); return false;">
<?= Icon::create('filter2', Icon::ROLE_CLICKABLE)->asImg(16, ['class' => 'text-bottom']) ?> <?= Icon::create('filter2', Icon::ROLE_CLICKABLE)->asImg(16, ['class' => 'text-bottom']) ?>
(<?= $percentage ?>% | <?= (int) $results[$key] ?>/<?= $countAnswers ?>) (<?= $percentage ?>% | <?= (int) ($results[$key] ?? 0) ?>/<?= $countAnswers ?>)
</a> </a>
<? else : ?> <? else : ?>
<a href="" <a href=""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment