MDL-74812 gradingform_rubric: Fix text overlap in rubric levels

This commit is contained in:
Jun Pataleta 2022-06-20 18:46:54 +08:00
parent b912f84d5f
commit cf77cd6665
5 changed files with 15 additions and 29 deletions

View file

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

View file

@ -225,7 +225,7 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
// Template for one level within one criterion // Template for one level within one criterion
$tdattributes = array( $tdattributes = array(
'id' => '{NAME}-criteria-{CRITERION-id}-levels-{LEVEL-id}', 'id' => '{NAME}-criteria-{CRITERION-id}-levels-{LEVEL-id}',
'class' => 'level' . $level['class'] 'class' => 'text-break level' . $level['class']
); );
if (isset($level['tdwidth'])) { if (isset($level['tdwidth'])) {
$tdattributes['style'] = "width: " . round($level['tdwidth']).'%;'; $tdattributes['style'] = "width: " . round($level['tdwidth']).'%;';
@ -319,7 +319,7 @@ class gradingform_rubric_renderer extends plugin_renderer_base {
$displayscore = false; $displayscore = false;
} }
if ($displayscore) { if ($displayscore) {
$scoreclass = 'score'; $scoreclass = 'score d-inline';
if (isset($level['error_score'])) { if (isset($level['error_score'])) {
$scoreclass .= ' error'; $scoreclass .= ' error';
} }

View file

@ -141,14 +141,11 @@
} }
.score { .score {
position: relative;
float: left;
margin-top: 5px; margin-top: 5px;
margin-right: 28px; margin-right: 28px;
font-style: italic; font-style: italic;
font-weight: bold; font-weight: bold;
color: #{theme-color-level('success', 2)}; color: #{theme-color-level('success', 2)};
white-space: nowrap;
input { input {
margin-bottom: 0; margin-bottom: 0;
@ -193,7 +190,6 @@
} }
.scorevalue { .scorevalue {
padding-right: 5px;
input { input {
// Should handle at least three chars with room to spare. // Should handle at least three chars with room to spare.
float: none; float: none;

View file

@ -19387,14 +19387,11 @@ p.arrow_button {
width: 80%; width: 80%;
margin-bottom: 0; } margin-bottom: 0; }
.gradingform_rubric .criterion .score { .gradingform_rubric .criterion .score {
position: relative;
float: left;
margin-top: 5px; margin-top: 5px;
margin-right: 28px; margin-right: 28px;
font-style: italic; font-style: italic;
font-weight: bold; font-weight: bold;
color: #2d662a; color: #2d662a; }
white-space: nowrap; }
.gradingform_rubric .criterion .score input { .gradingform_rubric .criterion .score input {
margin-bottom: 0; } margin-bottom: 0; }
.gradingform_rubric .criterion .level { .gradingform_rubric .criterion .level {
@ -19422,13 +19419,11 @@ p.arrow_button {
margin: 0; } margin: 0; }
.gradingform_rubric .criterion .level .delete input:hover { .gradingform_rubric .criterion .level .delete input:hover {
background-color: #ddd; } background-color: #ddd; }
.gradingform_rubric .criterion .scorevalue { .gradingform_rubric .criterion .scorevalue input {
padding-right: 5px; } float: none;
.gradingform_rubric .criterion .scorevalue input { width: 2em; }
float: none; .gradingform_rubric .criterion .scorevalue input.hiddenelement, .gradingform_rubric .criterion .scorevalue input.pseudotablink {
width: 2em; } width: 0; }
.gradingform_rubric .criterion .scorevalue input.hiddenelement, .gradingform_rubric .criterion .scorevalue input.pseudotablink {
width: 0; }
.gradingform_rubric .criterion .addlevel { .gradingform_rubric .criterion .addlevel {
vertical-align: top; vertical-align: top;
padding-top: 6px; } padding-top: 6px; }

View file

@ -19387,14 +19387,11 @@ p.arrow_button {
width: 80%; width: 80%;
margin-bottom: 0; } margin-bottom: 0; }
.gradingform_rubric .criterion .score { .gradingform_rubric .criterion .score {
position: relative;
float: left;
margin-top: 5px; margin-top: 5px;
margin-right: 28px; margin-right: 28px;
font-style: italic; font-style: italic;
font-weight: bold; font-weight: bold;
color: #2d662a; color: #2d662a; }
white-space: nowrap; }
.gradingform_rubric .criterion .score input { .gradingform_rubric .criterion .score input {
margin-bottom: 0; } margin-bottom: 0; }
.gradingform_rubric .criterion .level { .gradingform_rubric .criterion .level {
@ -19422,13 +19419,11 @@ p.arrow_button {
margin: 0; } margin: 0; }
.gradingform_rubric .criterion .level .delete input:hover { .gradingform_rubric .criterion .level .delete input:hover {
background-color: #ddd; } background-color: #ddd; }
.gradingform_rubric .criterion .scorevalue { .gradingform_rubric .criterion .scorevalue input {
padding-right: 5px; } float: none;
.gradingform_rubric .criterion .scorevalue input { width: 2em; }
float: none; .gradingform_rubric .criterion .scorevalue input.hiddenelement, .gradingform_rubric .criterion .scorevalue input.pseudotablink {
width: 2em; } width: 0; }
.gradingform_rubric .criterion .scorevalue input.hiddenelement, .gradingform_rubric .criterion .scorevalue input.pseudotablink {
width: 0; }
.gradingform_rubric .criterion .addlevel { .gradingform_rubric .criterion .addlevel {
vertical-align: top; vertical-align: top;
padding-top: 6px; } padding-top: 6px; }