Skip to content

Commit 6069f99

Browse files
committed
fixup! MDL-81714 grades: Add regrading progress indicator to grade reports
1 parent d581376 commit 6069f99

File tree

14 files changed

+69
-19
lines changed

14 files changed

+69
-19
lines changed

grade/report/grader/index.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,13 @@
122122

123123
$reportname = get_string('pluginname', 'gradereport_grader');
124124
$regradetask = \core_course\task\regrade_final_grades::create($courseid);
125-
$indicatorheader = get_string('recalculatinggrades', 'grades');
125+
$indicatorheading = get_string('recalculatinggrades', 'grades');
126126
$indicatormessage = get_string('recalculatinggradesadhoc', 'grades');
127-
$indictoricon = new pix_icon('i/grades', '');
128-
$taskindicator = new \core\output\task_indicator($regradetask, $indicatorheader, $indicatormessage, $indictoricon, $PAGE->url);
127+
$taskindicator = new \core\output\task_indicator($regradetask, $indicatorheading, $indicatormessage, $PAGE->url);
129128
if (!$taskindicator->has_task_record()) {
130129
// Do this check just before printing the grade header (and only do it once).
131130
grade_regrade_final_grades_if_required($course);
132-
$taskindicator = new \core\output\task_indicator($regradetask, $indicatorheader, $indicatormessage, $indictoricon, $PAGE->url);
131+
$taskindicator = new \core\output\task_indicator($regradetask, $indicatorheading, $indicatormessage, $PAGE->url);
133132
}
134133

135134
//Initialise the grader report object that produces the table

grade/report/outcomes/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@
4646
// First make sure we have proper final grades.
4747
$regradetask = \core_course\task\regrade_final_grades::create($courseid);
4848
$indicatormessage = get_string('recalculatinggradesadhoc', 'grades');
49-
$taskindicator = new \core\output\task_indicator($regradetask, $indicatormessage);
49+
$indicatorheading = get_string('recalculatinggrades', 'grades');
50+
$taskindicator = new \core\output\task_indicator($regradetask, $indicatorheading, $indicatormessage, $PAGE->url);
5051
if (!$taskindicator->has_task_record()) {
5152
grade_regrade_final_grades_if_required($course);
52-
$taskindicator = new \core\output\task_indicator($regradetask, $indicatormessage);
53+
$taskindicator = new \core\output\task_indicator($regradetask, $indicatorheading, $indicatormessage, $PAGE->url);
5354
}
5455

5556
// Grab all outcomes used in course.

grade/report/overview/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
\core_course\task\regrade_final_grades::create($courseid),
9595
get_string('recalculatinggrades', 'grades'),
9696
get_string('recalculatinggradesadhoc', 'grades'),
97-
new \core\output\pix_icon('i/grades', ''),
9897
$PAGE->url,
9998
);
10099

grade/report/singleview/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@
153153
\core_course\task\regrade_final_grades::create($courseid),
154154
get_string('recalculatinggrades', 'grades'),
155155
get_string('recalculatinggradesadhoc', 'grades'),
156-
new \core\output\pix_icon('i/grades', ''),
157156
$PAGE->url,
158157
);
159158

grade/report/summary/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
\core_course\task\regrade_final_grades::create($courseid),
5050
get_string('recalculatinggrades', 'grades'),
5151
get_string('recalculatinggradesadhoc', 'grades'),
52-
new \core\output\pix_icon('i/grades', ''),
5352
$PAGE->url,
5453
);
5554

grade/report/user/index.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
\core_course\task\regrade_final_grades::create($courseid),
9090
get_string('recalculatinggrades', 'grades'),
9191
get_string('recalculatinggradesadhoc', 'grades'),
92-
new \core\output\pix_icon('i/grades', ''),
9392
$PAGE->url,
9493
);
9594

grade/report/user/lib.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ function grade_report_user_profilereport(object $course, object $user, bool $vie
180180
\core_course\task\regrade_final_grades::create($course->id),
181181
get_string('recalculatinggrades', 'grades'),
182182
get_string('recalculatinggradesadhoc', 'grades'),
183-
new \core\output\pix_icon('i/grades', ''),
184183
new \core\url('/course/user.php', ['mode' => 'grade', 'id' => $course->id, 'user' => $user->id]),
185184
);
186185

lib/classes/output/task_indicator.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class task_indicator implements renderable, templatable {
4545
* @param adhoc_task $task The task whose progress is being indicated. The task class must use stored_progress_task_trait.
4646
* @param string $heading The header text for the indicator.
4747
* @param string $message A message to explain what is happening while the task is running.
48-
* @param ?pix_icon $icon An optional icon to display with the heading.
4948
* @param ?url $redirecturl An optional URL to redirect to when the task completes.
49+
* @param ?pix_icon $icon An optional icon to display with the heading.
5050
* @param array $extraclasses Extra class names to apply to the indicator's container.
5151
* @throws \coding_exception
5252
*/
@@ -57,10 +57,10 @@ public function __construct(
5757
protected string $heading,
5858
/** @var string $message A message to explain what is happening while the task is running. */
5959
protected string $message,
60-
/** @var ?pix_icon $icon An optional icon to display with the heading. */
61-
protected ?pix_icon $icon = null,
6260
/** @var ?url $redirecturl An optional URL to redirect to when the task completes. */
6361
protected ?url $redirecturl = null,
62+
/** @var ?pix_icon $icon An optional icon to display with the heading. */
63+
protected ?pix_icon $icon = new pix_icon('i/timer', ''),
6464
/** @var array $extraclasses Extra class names to apply to the indicator's container. */
6565
protected array $extraclasses = [],
6666
) {
@@ -73,7 +73,6 @@ public function __construct(
7373
$idnumber = stored_progress_bar::convert_to_idnumber($this->task::class, $this->task->get_id());
7474
$this->progressbar = stored_progress_bar::get_by_idnumber($idnumber);
7575
}
76-
$this->icon->attributes['class'] .= 'iconsize-big';
7776
}
7877

7978
/**

lib/templates/task_indicator.mustache

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,10 @@
4141
<div class="task-indicator {{extraclasses}}">
4242
{{#icon}}
4343
<div class="text-center">
44-
<div class="icon-circle">
45-
{{>core/pix_icon}}
46-
</div>
44+
{{>core/pix_icon}}
4745
</div>
4846
{{/icon}}
49-
<h2 class="text-center">{{heading}}</h2>
47+
<h3 class="text-center">{{heading}}</h3>
5048
<p class="text-center">{{message}}</p>
5149
{{#progress}}
5250
{{>core/progress_bar}}

pix/i/timer.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)