From bf7018b6bd239a168b13e32895242ea84d64e385 Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Tue, 5 Nov 2019 12:59:03 +0800 Subject: [PATCH 01/11] MDL-66893 grade: update marking guide template for grader --- .../grades/grader/gradingpanel.mustache | 121 +++++++++++------- lang/en/grades.php | 2 + theme/boost/scss/moodle/forms.scss | 1 + theme/boost/scss/moodle/grade.scss | 36 ++++-- theme/boost/style/moodle.css | 38 +++--- theme/classic/style/moodle.css | 38 +++--- 6 files changed, 128 insertions(+), 108 deletions(-) diff --git a/grade/grading/form/guide/templates/grades/grader/gradingpanel.mustache b/grade/grading/form/guide/templates/grades/grader/gradingpanel.mustache index 7d816e66af1..8b5fc972353 100644 --- a/grade/grading/form/guide/templates/grades/grader/gradingpanel.mustache +++ b/grade/grading/form/guide/templates/grades/grader/gradingpanel.mustache @@ -61,19 +61,35 @@
{{#criterion}} -
-
- {{name}} -
+ + +
{{{description}}} @@ -83,52 +99,59 @@ {{/descriptionmarkers}}
-
- - - {{#str}}grade_help, gradingform_guide{{/str}} -
-
- -
- - {{#hascomments}} - - {{/hascomments}} +
+
+ + + {{#str}}grade_help, gradingform_guide{{/str}}
- {{#hascomments}} -
-
-
- {{#comments}} - - {{/comments}} +
+ +
+ + {{#hascomments}} + + {{/hascomments}} +
+ {{#hascomments}} +
+
+
{{#str}}comments, gradingform_guide{{/str}}
+
+ {{#comments}} + + {{/comments}} +
-
- {{/hascomments}} - {{#str}}grade_help, gradingform_guide{{/str}} + {{/hascomments}} + {{#str}}grade_help, gradingform_guide{{/str}} +
{{/criterion}} {{#js}} -require(['gradingform_guide/grades/grader/gradingpanel/comments'], function(Comments) { +require(['gradingform_guide/grades/grader/gradingpanel/comments', 'core/auto_rows'], function(Comments, AutoRows) { Comments.init('gradingform_guide-{{uniqid}}'); + AutoRows.init(document.getElementById('gradingform_guide-{{uniqid}}')); }); {{/js}} diff --git a/lang/en/grades.php b/lang/en/grades.php index 8afc3ed4bc7..7a8ecb76375 100644 --- a/lang/en/grades.php +++ b/lang/en/grades.php @@ -118,6 +118,7 @@ $string['categoryname'] = 'Category name'; $string['categorytotal'] = 'Category total'; $string['categorytotalname'] = 'Category total name'; $string['categorytotalfull'] = '{$a->category} total'; +$string['collapsecriterion'] = 'Collapse criterion'; $string['combo'] = 'Tabs and drop-down menu'; $string['compact'] = 'Compact'; $string['componentcontrolsvisibility'] = 'Whether this grade item is hidden is controlled by the activity settings.'; @@ -207,6 +208,7 @@ $string['eventusergraded'] = 'User graded'; $string['excluded'] = 'Excluded'; $string['excluded_help'] = 'If ticked, the grade will not be included in any aggregation.'; $string['expand'] = 'Expand category'; +$string['expandcriterion'] = 'Expand criterion'; $string['export'] = 'Export'; $string['exportalloutcomes'] = 'Export all outcomes'; $string['exportfeedback'] = 'Include feedback in export'; diff --git a/theme/boost/scss/moodle/forms.scss b/theme/boost/scss/moodle/forms.scss index 78724df6cfa..d6ddd543568 100644 --- a/theme/boost/scss/moodle/forms.scss +++ b/theme/boost/scss/moodle/forms.scss @@ -366,6 +366,7 @@ select[size="1"] { textarea[data-auto-rows] { overflow-x: hidden; + resize: none; } /** Display elements under labels in vertical forms regardless of the screen size. */ diff --git a/theme/boost/scss/moodle/grade.scss b/theme/boost/scss/moodle/grade.scss index 8f5b35f35d2..a29c0d8c382 100644 --- a/theme/boost/scss/moodle/grade.scss +++ b/theme/boost/scss/moodle/grade.scss @@ -240,20 +240,30 @@ } } -.criterion button.collapse[aria-expanded="true"]:before { - content: $fa-var-angle-down; - margin-right: 0; - @include fa-icon(); - font-size: 16px; - width: 16px; -} +.criterion { + .description { + font-size: 1rem; + } -.criterion button.collapse[aria-expanded="false"]:before { - content: $fa-var-angle-up; - margin-right: 0; - @include fa-icon(); - font-size: 16px; - width: 16px; + .criterion-toggle { + .expanded-icon { + display: block; + } + + .collapsed-icon { + display: none; + } + + &.collapsed { + .expanded-icon { + display: none; + } + + .collapsed-icon { + display: block; + } + } + } } // Set up grades layout. diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index f2d44583799..88d73e64894 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -16067,7 +16067,8 @@ select[size="1"] { overflow: visible; } textarea[data-auto-rows] { - overflow-x: hidden; } + overflow-x: hidden; + resize: none; } /** Display elements under labels in vertical forms regardless of the screen size. */ .mform.full-width-labels .fitem.row { @@ -17407,29 +17408,20 @@ p.arrow_button { margin-left: 5px; margin-right: 12px; } -.criterion button.collapse[aria-expanded="true"]:before { - content: ""; - margin-right: 0; - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 16px; - width: 16px; } +.criterion .description { + font-size: 1rem; } -.criterion button.collapse[aria-expanded="false"]:before { - content: ""; - margin-right: 0; - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 16px; - width: 16px; } +.criterion .criterion-toggle .expanded-icon { + display: block; } + +.criterion .criterion-toggle .collapsed-icon { + display: none; } + +.criterion .criterion-toggle.collapsed .expanded-icon { + display: none; } + +.criterion .criterion-toggle.collapsed .collapsed-icon { + display: block; } .path-grade-edit-tree .setup-grades h4 { margin: 0; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 0cc729a5706..2e5f9653264 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -16338,7 +16338,8 @@ select[size="1"] { overflow: visible; } textarea[data-auto-rows] { - overflow-x: hidden; } + overflow-x: hidden; + resize: none; } /** Display elements under labels in vertical forms regardless of the screen size. */ .mform.full-width-labels .fitem.row { @@ -17683,29 +17684,20 @@ p.arrow_button { margin-left: 5px; margin-right: 12px; } -.criterion button.collapse[aria-expanded="true"]:before { - content: ""; - margin-right: 0; - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 16px; - width: 16px; } +.criterion .description { + font-size: 1rem; } -.criterion button.collapse[aria-expanded="false"]:before { - content: ""; - margin-right: 0; - display: inline-block; - font: normal normal normal 14px/1 FontAwesome; - font-size: inherit; - text-rendering: auto; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-size: 16px; - width: 16px; } +.criterion .criterion-toggle .expanded-icon { + display: block; } + +.criterion .criterion-toggle .collapsed-icon { + display: none; } + +.criterion .criterion-toggle.collapsed .expanded-icon { + display: none; } + +.criterion .criterion-toggle.collapsed .collapsed-icon { + display: block; } .path-grade-edit-tree .setup-grades h4 { margin: 0; } From 4e53672929708e399583edc95c6e5633978fa5ba Mon Sep 17 00:00:00 2001 From: Ryan Wyllie Date: Tue, 5 Nov 2019 13:02:25 +0800 Subject: [PATCH 02/11] MDL-66893 grade: update rubric template for grader --- .../grades/grader/gradingpanel.mustache | 100 +++++--- lang/en/grades.php | 1 + .../local/grader/grade_placeholder.mustache | 235 +++++++++++++++++- 3 files changed, 286 insertions(+), 50 deletions(-) diff --git a/grade/grading/form/rubric/templates/grades/grader/gradingpanel.mustache b/grade/grading/form/rubric/templates/grades/grader/gradingpanel.mustache index 94845f15866..a3d31cbda0d 100644 --- a/grade/grading/form/rubric/templates/grades/grader/gradingpanel.mustache +++ b/grade/grading/form/rubric/templates/grades/grader/gradingpanel.mustache @@ -57,49 +57,71 @@
{{#criteria}} -
-
{{{description}}}
- -
-
- {{#levels}} -
- -