Skip to content

Commit

Permalink
Merge pull request #23 from catalyst/hardocdedstrings
Browse files Browse the repository at this point in the history
Hardocdedstrings
  • Loading branch information
dmitriim authored Apr 2, 2024
2 parents 3881c46 + b04486a commit af203ab
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions lang/en/gradingform_rubric_ranges.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
$string['leveldelete'] = 'Delete level {$a}';
$string['leveldefinition'] = 'Level {$a} definition';
$string['levelempty'] = 'Click to edit level';
$string['levelrange'] = '{$a->rangestart} to {$a->rangeend}';
$string['levelsgroup'] = 'Levels group';
$string['lockzeropoints'] = 'Calculate grade having a minimum score of the minimum achievable grade for the rubric';
$string['lockzeropoints_help'] = 'This setting only applies if the sum of the minimum number of points for each criterion is greater than 0. If ticked, the minimum score of the activity will be the minimum achievable grade for the rubric. If unticked, the minimum possible score for the rubric will be mapped to the minimum grade available for the activity (which is 0 unless a scale is used).';
Expand Down
27 changes: 21 additions & 6 deletions renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -666,14 +666,29 @@ public function display_range_score($mode, $levels, $sortlevels, $isranged = fal
}

foreach ($levelsonly as $levelkey => $level) {
$a = new stdClass();
if ($rangecheck == $levelkey) {
$levels[$level['id']]['score'] = ($sortlevels)
? '0 to '. $level['score']
: $level['score'].' to 0';
if ($sortlevels) {
$a->rangestart = '0';
$a->rangeend = $level['score'];
$levels[$level['id']]['score'] = get_string('levelrange', 'gradingform_rubric_ranges', $a);
} else {
$a->rangestart = $level['score'];
$a->rangeend = '0';
$levels[$level['id']]['score'] = get_string('levelrange', 'gradingform_rubric_ranges', $a);
}
} else {
$levels[$level['id']]['score'] = ($sortlevels)
? ($levelsonly[$levelkey - 1]['score'] + 1).' to '. $level['score']
: $level['score'].' to '. ($levelsonly[$levelkey + 1]['score'] + 1);
if ($sortlevels) {
$previousScore = $levelsonly[$levelkey - 1]['score'] + 1;
$a->rangestart = $previousScore;
$a->rangeend = $level['score'];
$levels[$level['id']]['score'] = get_string('levelrange', 'gradingform_rubric_ranges', $a);
} else {
$nextScore = $levelsonly[$levelkey + 1]['score'] + 1;
$a->rangestart = $level['score'];
$a->rangeend = $nextScore;
$levels[$level['id']]['score'] = get_string('levelrange', 'gradingform_rubric_ranges', $a);
}
}
}
return $levels;
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
defined('MOODLE_INTERNAL') || die();

$plugin->component = 'gradingform_rubric_ranges';
$plugin->version = 2024012201; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 2024012201; // Match release exactly to version.
$plugin->version = 2024012202; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 2024012202; // Match release exactly to version.
$plugin->requires = 2020060900;
$plugin->maturity = MATURITY_STABLE;
$plugin->supported = [39, 401]; // Available as of Moodle 3.9.0 or later.

0 comments on commit af203ab

Please sign in to comment.