This area will be used by the assessor to leave comments related to this criterion.
diff --git a/app/jsx/rubrics/__tests__/__snapshots__/Criterion.test.js.snap b/app/jsx/rubrics/__tests__/__snapshots__/Criterion.test.js.snap
index b5a13c678c7..707308ccb9b 100644
--- a/app/jsx/rubrics/__tests__/__snapshots__/Criterion.test.js.snap
+++ b/app/jsx/rubrics/__tests__/__snapshots__/Criterion.test.js.snap
@@ -33,7 +33,7 @@ exports[`Free-form Rubric with a custom criterion by default renders the root co
-
+
|
@@ -72,7 +72,7 @@ exports[`Free-form Rubric with a custom criterion when assessing renders the roo
|
-
+
|
@@ -111,7 +111,7 @@ exports[`Free-form Rubric with a custom criterion without an assessment renders
|
-
+
|
@@ -177,7 +177,7 @@ exports[`Free-form Rubric with a outcome criterion by default renders the root c
|
-
+
|
@@ -243,7 +243,7 @@ exports[`Free-form Rubric with a outcome criterion when assessing renders the ro
|
-
+
|
@@ -309,7 +309,7 @@ exports[`Free-form Rubric with a outcome criterion without an assessment renders
|
-
+
|
@@ -348,7 +348,7 @@ exports[`Point Rubric with a custom criterion by default renders the root compon
|
-
+
|
@@ -387,7 +387,7 @@ exports[`Point Rubric with a custom criterion when assessing renders the root co
|
-
+
|
@@ -433,7 +433,7 @@ exports[`Point Rubric with a custom criterion without an assessment renders the
|
-
+
|
@@ -499,7 +499,7 @@ exports[`Point Rubric with a outcome criterion by default renders the root compo
|
-
+
|
@@ -565,7 +565,7 @@ exports[`Point Rubric with a outcome criterion when assessing renders the root c
|
-
+
|
@@ -638,7 +638,7 @@ exports[`Point Rubric with a outcome criterion without an assessment renders the
|
-
+
|
diff --git a/app/jsx/rubrics/__tests__/__snapshots__/Ratings.test.js.snap b/app/jsx/rubrics/__tests__/__snapshots__/Ratings.test.js.snap
index fe1ce59ca4d..d6bd7a7c5eb 100644
--- a/app/jsx/rubrics/__tests__/__snapshots__/Ratings.test.js.snap
+++ b/app/jsx/rubrics/__tests__/__snapshots__/Ratings.test.js.snap
@@ -1,5 +1,45 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
+exports[`The Ratings component only renders the single selected Rating with a footer in summary mode 1`] = `
+"
+
+
+ Meh
+
+
+
+ More Verbosity
+
+
+
+ "
+`;
+
+exports[`The Ratings component renders a default rating if none of the ratings are selected 1`] = `
+"
+
+
+ No details
+
+
+
+
+
+ "
+`;
+
exports[`The Ratings component renders the Rating sub-components as expected when range rating enabled 1`] = `
"
@@ -61,8 +101,8 @@ exports[`The Ratings component renders the Rating sub-components as expected whe
exports[`The Ratings component renders the root component as expected 1`] = `
"
-
-
-
+
+
+
"
`;
diff --git a/app/jsx/rubrics/__tests__/__snapshots__/Rubric.test.js.snap b/app/jsx/rubrics/__tests__/__snapshots__/Rubric.test.js.snap
index 1eda4dc6a22..620c2d3c794 100644
--- a/app/jsx/rubrics/__tests__/__snapshots__/Rubric.test.js.snap
+++ b/app/jsx/rubrics/__tests__/__snapshots__/Rubric.test.js.snap
@@ -17,8 +17,8 @@ exports[`the Rubric component hides the score total when needed 1`] = `
-
-
+
+
@@ -48,8 +48,8 @@ exports[`the Rubric component renders as expected 1`] = `
|
-
-
+
+
@@ -81,8 +81,8 @@ exports[`the Rubric component renders properly with no assessment 1`] = `
|
-
-
+
+
@@ -114,8 +114,8 @@ exports[`the Rubric component updates the total score when an individual criteri
|
-
-
+
+
diff --git a/app/stylesheets/components/_rubric.scss b/app/stylesheets/components/_rubric.scss
index 45c4c922a9c..5415d042ccf 100644
--- a/app/stylesheets/components/_rubric.scss
+++ b/app/stylesheets/components/_rubric.scss
@@ -109,6 +109,10 @@
position: relative;
}
+.react-rubric .rating-tier .rating-footer {
+ padding-bottom: 1rem;
+}
+
.react-rubric .rating-tier.selected {
.shader {
width: 100%;
@@ -137,4 +141,5 @@
.react-rubric .graded-points {
white-space: nowrap;
+ text-align: end;
}
diff --git a/public/javascripts/rubric_assessment.js b/public/javascripts/rubric_assessment.js
index 8cf73ae183a..0ed5d29b4eb 100644
--- a/public/javascripts/rubric_assessment.js
+++ b/public/javascripts/rubric_assessment.js
@@ -276,11 +276,16 @@ window.rubricAssessment = {
},
fillAssessment: function(rubric, partialAssessment) {
+ const fillText = (c) => ({
+ pointsText: _.isNil(c.points) && _.isUndefined(c.pointsText) ? '--' : c.pointsText,
+ ...c
+ })
+ const defaultCriteria = (id) => ({ criterion_id: id, pointsText: '' })
const prior = _.keyBy(_.cloneDeep(partialAssessment.data), (c) => c.criterion_id)
return {
score: 0,
...partialAssessment,
- data: rubric.criteria.map((c) => (prior[c.id] || { criterion_id: c.id, score: null }))
+ data: rubric.criteria.map((c) => fillText(prior[c.id] || defaultCriteria(c.id)))
}
},
@@ -374,6 +379,29 @@ window.rubricAssessment = {
}
},
+ populateNewRubricSummary: function(container, assessment, rubricAssociation, editData) {
+ if (ENV.nonScoringRubrics && ENV.rubric) {
+ if(assessment) {
+ const filled = rubricAssessment.fillAssessment(ENV.rubric, assessment || {})
+ ReactDOM.render(React.createElement(Rubric, {
+ customRatings: ENV.outcome_proficiency ? ENV.outcome_proficiency.ratings : [],
+ rubric: ENV.rubric,
+ rubricAssessment: filled,
+ rubricAssociation,
+ isSummary: true
+ }, null), container.get(0))
+ } else {
+ container.get(0).innerHTML = ''
+ }
+ } else {
+ rubricAssessment.populateRubricSummary(
+ container,
+ assessment,
+ editData
+ )
+ }
+ },
+
populateRubricSummary: function($rubricSummary, data, editing_data) {
$rubricSummary.find(".criterion_points").text("").end()
.find(".rating_custom").text("");
diff --git a/public/javascripts/speed_grader.js b/public/javascripts/speed_grader.js
index 3eac0c31b6d..8856cdbff12 100644
--- a/public/javascripts/speed_grader.js
+++ b/public/javascripts/speed_grader.js
@@ -837,9 +837,10 @@ function initRubricStuff(){
selectors.get('#rubric_assessments_select').change(() => {
const editingData = rubricAssessment.assessmentData($("#rubric_full"))
var selectedAssessment = getSelectedAssessment();
- rubricAssessment.populateRubricSummary(
+ rubricAssessment.populateNewRubricSummary(
$("#rubric_summary_holder .rubric_summary"),
selectedAssessment,
+ jsonData.rubric_association,
editingData
);
});
| |