Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch away from deprecated grade to gradenoun string. #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ function hotpot_print_overview($courses, &$htmlarray) {
$grade = $grade[$USER->id];
$href = new moodle_url('/mod/hotpot/report.php', array('hp' => $hotpot->id));
if ($hotpot->gradeweighting) {
$str .= '<div class="info">'.get_string('grade', 'grades').': '.'<a href="'.$href.'">'.$grade->rawgrade.'%</a></div>';
$str .= '<div class="info">'.get_string('gradenoun').': '.'<a href="'.$href.'">'.$grade->rawgrade.'%</a></div>';
}
$str .= '<div class="info">'.get_string('status', 'hotpot').': '.'<a href="'.$href.'">'.hotpot::format_status($grade->maxstatus).'</a></div>';
}
Expand Down
4 changes: 1 addition & 3 deletions report/tablelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,8 @@ function header_grade() {

// In Moodle >= 2.7, we use the "modgrade" string.
// In Moodle <= 2.6, we use simply "grade".
$modgrade = get_string_manager()->string_exists('modgrade', 'grades');
$modgrade = get_string($modgrade ? 'modgrade' : 'grade', 'grades');
$br = html_writer::empty_tag('br');
return $modgrade.$br.'('.$grademethod.')';
return get_string('gradenoun').$br.'('.$grademethod.')';
}

/**
Expand Down
5 changes: 1 addition & 4 deletions report/userfiltering.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ function get_field($fieldname, $advanced) {
case 'grouping':
return new hotpot_filter_group($fieldname, $advanced, $default);
case 'grade':
// In Moodle >= 2.7, we use the "modgrade" string.
// In Moodle <= 2.6, we use simply "grade".
$modgrade = get_string_manager()->string_exists('modgrade', 'grades');
$label = get_string($modgrade ? 'modgrade' : 'grade', 'grades');
$label = get_string('gradenoun');
return new hotpot_filter_grade($fieldname, $label, $advanced, $default);
case 'timemodified':
$label = get_string('time', 'quiz');
Expand Down