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

theme/boost/scss/moodle.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,4 @@ $breadcrumb-divider-rtl: "◀" !default;
5656
@import "moodle/moodlenet";
5757
@import "moodle/dropdown";
5858
@import "moodle/deprecated";
59+
@import "moodle/task-indicator";
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.task-indicator {
2+
padding-top: 2rem;
3+
4+
img.icon {
5+
width: 145px;
6+
height: 145px;
7+
max-height: 145px;
8+
max-width: 145px;
9+
font-size: 145px;
10+
padding-bottom: 2rem;
11+
}
12+
13+
.progressbar_container {
14+
padding-top: 2rem;
15+
}
16+
}

theme/boost/style/moodle.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39147,6 +39147,21 @@ body.behat-site .path-course-view li.activity form.togglecompletion::before,
3914739147
max-width: none; /* The width is 0 so ensure we don't end up with a relative max-width */
3914839148
}
3914939149

39150+
.task-indicator {
39151+
padding-top: 2rem;
39152+
}
39153+
.task-indicator img.icon {
39154+
width: 145px;
39155+
height: 145px;
39156+
max-height: 145px;
39157+
max-width: 145px;
39158+
font-size: 145px;
39159+
padding-bottom: 2rem;
39160+
}
39161+
.task-indicator .progressbar_container {
39162+
padding-top: 2rem;
39163+
}
39164+
3915039165
body {
3915139166
-webkit-font-smoothing: antialiased;
3915239167
-moz-osx-font-smoothing: grayscale;

theme/classic/style/moodle.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39081,6 +39081,21 @@ body.behat-site .path-course-view li.activity form.togglecompletion::before,
3908139081
max-width: none; /* The width is 0 so ensure we don't end up with a relative max-width */
3908239082
}
3908339083

39084+
.task-indicator {
39085+
padding-top: 2rem;
39086+
}
39087+
.task-indicator img.icon {
39088+
width: 145px;
39089+
height: 145px;
39090+
max-height: 145px;
39091+
max-width: 145px;
39092+
font-size: 145px;
39093+
padding-bottom: 2rem;
39094+
}
39095+
.task-indicator .progressbar_container {
39096+
padding-top: 2rem;
39097+
}
39098+
3908439099
body {
3908539100
-webkit-font-smoothing: antialiased;
3908639101
-moz-osx-font-smoothing: grayscale;

0 commit comments

Comments
 (0)