Merge branch 'MDL-70874-master_take2' of git://github.com/lucaboesch/moodle

This commit is contained in:
Jun Pataleta 2021-10-06 22:49:03 +08:00
commit d9f53b70be
5 changed files with 39 additions and 17 deletions

View File

@ -387,7 +387,7 @@ class grade_report_user extends grade_report {
* @param $element - An array containing the table data for the current row.
*/
private function fill_table_recursive(&$element) {
global $DB, $CFG;
global $DB, $CFG, $OUTPUT;
$type = $element['type'];
$depth = $element['depth'];
@ -577,10 +577,23 @@ class grade_report_user extends grade_report {
true);
}
} else {
$data['grade']['class'] = $class;
$data['grade']['content'] = grade_format_gradevalue($gradeval,
$grade_grade->grade_item,
true);
$gradestatusclass = '';
$gradepassicon = '';
$ispassinggrade = $grade_grade->is_passed($grade_grade->grade_item);
if (!is_null($ispassinggrade)) {
$gradestatusclass = $ispassinggrade ? 'gradepass' : 'gradefail';
if ($ispassinggrade) {
$gradepassicon = $OUTPUT->pix_icon('i/valid', get_string('pass', 'grades'), null,
array('class' => 'inline'));
} else {
$gradepassicon = $OUTPUT->pix_icon('i/invalid', get_string('fail', 'grades'), null,
array('class' => 'inline'));
}
}
$data['grade']['class'] = "{$class} {$gradestatusclass}";
$data['grade']['content'] = $gradepassicon . grade_format_gradevalue($gradeval,
$grade_grade->grade_item, true);
$gradeitemdata['graderaw'] = $gradeval;
}
$data['grade']['headers'] = "$header_cat $header_row grade";

View File

@ -21,11 +21,11 @@ Feature: View the user report as the student will see it
| Sub category 1 | C1 |
| Sub category 2 | C1 |
And the following "activities" exist:
| activity | course | idnumber | name | intro | gradecategory| grade |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 | 100 |
| assign | C1 | a2 | Test assignment two | Submit something! | Sub category 1 | 100 |
| assign | C1 | a3 | Test assignment three | Submit something! | Sub category 2 | 100 |
| assign | C1 | a4 | Test assignment four | Submit something! | Sub category 2 | 100 |
| activity | course | idnumber | name | intro | gradecategory | grade | gradepass |
| assign | C1 | a1 | Test assignment one | Submit something! | Sub category 1 | 100 | 50 |
| assign | C1 | a2 | Test assignment two | Submit something! | Sub category 1 | 100 | 50 |
| assign | C1 | a3 | Test assignment three | Submit something! | Sub category 2 | 100 | |
| assign | C1 | a4 | Test assignment four | Submit something! | Sub category 2 | 100 | |
And the following "activities" exist:
| activity | course | idnumber | name | intro | grade |
| assign | C1 | a5 | Test assignment five | Submit something! | 100 |
@ -74,6 +74,8 @@ Feature: View the user report as the student will see it
| Sub category 1 total | 33.33 % | - | 0200 | - | - |
| Test assignment five | - | 21.00 | 0100 | 21.00 % | - |
| Course total | - | - | 0600 | - | - |
And "//i[@aria-label='Pass']" "xpath_element" should exist in the "Test assignment one" "table_row"
And "//i[@aria-label='Fail']" "xpath_element" should exist in the "Test assignment two" "table_row"
And the following should not exist in the "user-grade" table:
| Grade item |
| Test assignment three |
@ -91,6 +93,8 @@ Feature: View the user report as the student will see it
| Sub category 1 total | 33.33 % | - | 0200 | - | - |
| Test assignment five | - | 21.00 | 0100 | 21.00 % | - |
| Course total | - | - | 0600 | - | - |
And "//i[@aria-label='Pass']" "xpath_element" should exist in the "Test assignment one" "table_row"
And "//i[@aria-label='Fail']" "xpath_element" should exist in the "Test assignment two" "table_row"
And the following should not exist in the "user-grade" table:
| Grade item |
| Test assignment three |

View File

@ -52,11 +52,12 @@
}
}
.path-grade-report-grader {
span.gradepass {
.path-grade-report-grader,
.path-grade-report-user {
.gradepass {
color: $success;
}
span.gradefail {
.gradefail {
color: $danger;
}
}

View File

@ -18725,10 +18725,12 @@ p.arrow_button {
width: 100%;
clear: both; }
.path-grade-report-grader span.gradepass {
.path-grade-report-grader .gradepass,
.path-grade-report-user .gradepass {
color: #357a32; }
.path-grade-report-grader span.gradefail {
.path-grade-report-grader .gradefail,
.path-grade-report-user .gradefail {
color: #ca3120; }
#page-grade-grading-manage #activemethodselector label {

View File

@ -18725,10 +18725,12 @@ p.arrow_button {
width: 100%;
clear: both; }
.path-grade-report-grader span.gradepass {
.path-grade-report-grader .gradepass,
.path-grade-report-user .gradepass {
color: #357a32; }
.path-grade-report-grader span.gradefail {
.path-grade-report-grader .gradefail,
.path-grade-report-user .gradefail {
color: #ca3120; }
#page-grade-grading-manage #activemethodselector label {