diff --git a/course_grader_vue/components/convert/calculator.vue b/course_grader_vue/components/convert/calculator.vue index fc7b9cb..cf38a06 100644 --- a/course_grader_vue/components/convert/calculator.vue +++ b/course_grader_vue/components/convert/calculator.vue @@ -122,10 +122,10 @@ export default { CalculatorRow, GradeScaleRow, BButton, + BLink, }, setup() { const calculatorStore = useCalculatorStore(); - return { calculatorStore, }; @@ -136,19 +136,14 @@ export default { scaleValues: [], }; }, - methods: { - initializeCalculator: function () { - this.calculatorValues = this.calculatorStore.calculatorValues; - this.scaleValues = this.calculatorStore.scaleValues; - - this.calculatorStore.$subscribe((mutation, state) => { - this.calculatorValues = state.calculatorValues; - this.scaleValues = state.scaleValues; - }); - }, - }, created() { - this.initializeCalculator(); + this.calculatorValues = this.calculatorStore.calculatorValues; + this.scaleValues = this.calculatorStore.scaleValues; + + this.calculatorStore.$subscribe((mutation, state) => { + this.calculatorValues = state.calculatorValues; + this.scaleValues = state.scaleValues; + }); }, }; diff --git a/course_grader_vue/components/grade/input.vue b/course_grader_vue/components/grade/input.vue index 9feb27c..c419347 100644 --- a/course_grader_vue/components/grade/input.vue +++ b/course_grader_vue/components/grade/input.vue @@ -182,21 +182,14 @@ export default { this.menuOpen = true; }, updateGradeChoices: function () { - var i, - len, - grade, - valid = []; - for (i = 0, len = this.gradeChoices.length; i < len; i++) { - grade = - i === 0 && this.gradeChoices[i] === "" - ? gettext("x_no_grade_now") - : this.gradeChoices[i]; - + var valid = []; + this.gradeChoices.forEach((gc, idx) => { + let grade = (idx === 0 && gc === "") ? gettext("x_no_grade_now") : gc; if (this.incomplete && incompleteBlocklist.includes(grade)) { - continue; + return; } valid.push(grade); - } + }); this.actualChoices = valid; }, incompleteChanged: function (checked) { @@ -255,7 +248,6 @@ export default { this.updateGradeStatus(); }) .catch((error) => { - console.log(error.message); this.gradeError = error.message; }) .finally(() => { diff --git a/course_grader_vue/components/grade/static.vue b/course_grader_vue/components/grade/static.vue index 87f94c3..ef88805 100644 --- a/course_grader_vue/components/grade/static.vue +++ b/course_grader_vue/components/grade/static.vue @@ -4,12 +4,16 @@ diff --git a/course_grader_vue/components/workflow/confirm-grades.vue b/course_grader_vue/components/workflow/confirm-grades.vue index 7d15d3e..2a4109a 100644 --- a/course_grader_vue/components/workflow/confirm-grades.vue +++ b/course_grader_vue/components/workflow/confirm-grades.vue @@ -85,33 +85,13 @@ class="small" > - {{ - interpolate( - ngettext( - "Grades submitted, but one grade had an error.", - "Grades submitted, but %(failed_submission_count)s grades had errors.", - appState.graderoster.failed_submission_count - ), - appState.graderoster, - true - ) - }} + {{ partialGradeErrorText }} - {{ - interpolate( - ngettext( - "Grade submitted with error.", - "Grades submitted with errors.", - appState.graderoster.failed_submission_count - ), - appState.graderoster, - true - ) - }} + {{ allGradeErrorText }} @@ -175,57 +155,57 @@ -
+ @@ -274,24 +254,34 @@ export default { }, data() { return { - selectedGradeScale: null, - lowestValidGrade: null, + importConversion: null, }; }, + computed: { + partialGradeErrorText() { + return interpolate(ngettext( + "Grades submitted, but one grade had an error.", + "Grades submitted, but %(failed_submission_count)s grades had errors.", + this.appState.graderoster.failed_submission_count + ), this.appState.graderoster, true); + }, + allGradeErrorText() { + return interpolate(ngettext( + "Grade submitted with error.", + "Grades submitted with errors.", + this.appState.graderoster.failed_submission_count + ), this.appState.graderoster, true); + }, + }, methods: { - showGradeScale (ev) { - var idx = (ev.target.value) ? ev.target.value : 0, - conversion; - - if (appState.graderoster.submissions[idx]) { - conversion = appState.graderoster.submissions[idx].import_conversion; - this.selectedGradeScale = conversion.grade_scale; - this.lowestValidGrade = conversion.lowest_valid_grade; + showImportConversion () { + let submission = this.appState.graderoster.submissions[0]; + if (submission && submission.grade_import) { + this.importConversion = submission.grade_import.import_conversion; } }, - hideGradeScale () { - this.selectedGradeScale = null; - this.lowestValidGrade = null; + hideImportConversion () { + this.importConversion = null; }, }, }; diff --git a/course_grader_vue/layouts/default.vue b/course_grader_vue/layouts/default.vue index 9600912..b427b6c 100644 --- a/course_grader_vue/layouts/default.vue +++ b/course_grader_vue/layouts/default.vue @@ -28,7 +28,7 @@ " aria-controls="gettingStartedCollapse" > - Previous + Previous Terms
{ + term.is_selected = (term.url === url) ? true : false; + }); }, }, }); diff --git a/course_grader_vue/stores/state.js b/course_grader_vue/stores/state.js index fdc42d7..2162085 100644 --- a/course_grader_vue/stores/state.js +++ b/course_grader_vue/stores/state.js @@ -58,6 +58,9 @@ export const useWorkflowStateStore = defineStore({ setGradeImport (gradeImport) { this.gradeImport = gradeImport; }, + resetGradeImport () { + this.gradeImport = null; + }, setGraderoster (graderoster) { this.graderoster = graderoster; this.unsubmitted = graderoster.students.filter(