Merge branch 'MDL-74812-master' of https://github.com/junpataleta/moodle

This commit is contained in:
Shamim Rezaie 2022-06-30 13:34:17 +10:00
commit d380bec38e
8 changed files with 250 additions and 251 deletions

View file

@ -86,7 +86,7 @@ $string['save'] = 'Save';
$string['saverubric'] = 'Save rubric and make it ready';
$string['saverubricdraft'] = 'Save as draft';
$string['scoreinputforlevel'] = 'Score input for level {$a}';
$string['scorepostfix'] = '{$a}points';
$string['scorepostfix'] = '{$a} points';
$string['showdescriptionstudent'] = 'Display rubric description to those being graded';
$string['showdescriptionteacher'] = 'Display rubric description during evaluation';
$string['showremarksstudent'] = 'Show remarks to those being graded';

View file

@ -120,7 +120,14 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
// Levels table.
$levelsrowparams = array('id' => '{NAME}-criteria-{CRITERION-id}-levels');
if ($mode != gradingform_rubric_controller::DISPLAY_EDIT_FULL) {
// Add radiogroup role only when not previewing or editing.
$isradiogroup = !in_array($mode, [
gradingform_rubric_controller::DISPLAY_EDIT_FULL,
gradingform_rubric_controller::DISPLAY_EDIT_FROZEN,
gradingform_rubric_controller::DISPLAY_PREVIEW,
gradingform_rubric_controller::DISPLAY_PREVIEW_GRADED,
]);
if ($isradiogroup) {
$levelsrowparams['role'] = 'radiogroup';
}
$levelsrow = html_writer::tag('tr', $levelsstr, $levelsrowparams);
@ -225,10 +232,10 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
// Template for one level within one criterion
$tdattributes = array(
'id' => '{NAME}-criteria-{CRITERION-id}-levels-{LEVEL-id}',
'class' => 'level' . $level['class']
'class' => 'text-break level' . $level['class']
);
if (isset($level['tdwidth'])) {
$tdattributes['width'] = round($level['tdwidth']).'%';
$tdattributes['style'] = "width: " . round($level['tdwidth']).'%;';
}
$leveltemplate = html_writer::start_tag('div', array('class' => 'level-wrapper'));
@ -319,7 +326,7 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
$displayscore = false;
}
if ($displayscore) {
$scoreclass = 'score';
$scoreclass = 'score d-inline';
if (isset($level['error_score'])) {
$scoreclass .= ' error';
}

View file

@ -135,23 +135,6 @@
color: #aaa;
}
.gradingform_rubric.editor .criterion .levels .level .delete {
position: absolute;
right: 0;
}
.gradingform_rubric .criterion .levels .level .score {
font-style: italic;
color: #575;
font-weight: bold;
margin-top: 5px;
white-space: nowrap;
}
.gradingform_rubric .criterion .levels .level .score .scorevalue {
padding-right: 5px;
}
/* Make invisible the buttons 'Move up' for the first criterion and
'Move down' for the last, because those buttons will make no change */
.gradingform_rubric.editor .criterion.first .controls .moveup input,
@ -159,20 +142,6 @@
display: none;
}
/* evaluation */
.gradingform_rubric .criterion .levels .level.currentchecked {
background: #fff0f0;
}
.gradingform_rubric .criterion .levels .level.checked {
background: #d0ffd0;
border: 1px solid #555;
}
.gradingform_rubric.evaluate .criterion .levels .level:hover {
background: #30ff30;
}
/* replace buttons with images */
.gradingform_rubric.editor .delete input,
.gradingform_rubric.editor .duplicate input,