Skip to content

Commit

Permalink
add logic for showing submitted date
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaney committed Oct 28, 2024
1 parent e3b2900 commit 25080f9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
12 changes: 10 additions & 2 deletions course_grader_vue/components/grade/static.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,25 @@
</template>

<script>
import { useWorkflowStateStore } from "@/stores/state";
export default {
props: {
student: {
type: Object,
required: true,
},
},
data() {
setup() {
const appState = useWorkflowStateStore();
return {
showDateGraded: false,
appState,
};
},
computed: {
showDateGraded() {
return this.appState.unsubmittedCount > 0 ? true : false;
},
},
};
</script>
1 change: 1 addition & 0 deletions course_grader_vue/components/import/upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ export default {
},
methods: {
fileSelected(files) {
this.errorResponse = null;
this.file = files[0];
},
uploadFile() {
Expand Down
10 changes: 5 additions & 5 deletions course_grader_vue/components/student.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
<div>
<div class="fs-4 text-uppercase">{{ student.student_lastname }}, {{ student.student_firstname }}</div>
<div class="small text-muted">
<span class="visually-hidden">Section:</span> {{ student.section_id }},
<span class="visually-hidden">{{ gettext("section") }}:</span> {{ student.section_id }},
<span v-if="student.student_credits">
<span class="visually-hidden">Student credits:</span>
<span class="visually-hidden">{{ gettext("student_credits") }}:</span>
{{ student.student_credits }} CR,
</span>
<span class="visually-hidden">Student number:</span>
<span class="visually-hidden">{{ gettext("student_number") }}:</span>
{{ student.student_number }}
<template v-if="student.duplicate_code">
<span class="visually-hidden">Duplicate code:</span>
<abbr title="Duplicate Code" class="badge rounded-pill text-bg-secondary">
<span class="visually-hidden">{{ gettext("duplicate_code") }}:</span>
<abbr :title="gettext('duplicate_code')" class="badge rounded-pill text-bg-secondary">
{{ student.duplicate_code }}</abbr>
</template>
</div>
Expand Down
2 changes: 1 addition & 1 deletion course_grader_vue/components/workflow/edit-grades.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div v-if="section">
<GradeImportOptions
:section="section"
:expected-grade-count="appState.unsubmitted"
:expected-grade-count="appState.unsubmittedCount"
/>
</div>

Expand Down
6 changes: 3 additions & 3 deletions course_grader_vue/stores/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const useWorkflowStateStore = defineStore({
name: "workflowState",
_workflowState: null,
graderoster: null,
unsubmitted: 0,
unsubmittedCount: 0,
gradeImport: null,
};
},
Expand Down Expand Up @@ -63,11 +63,11 @@ export const useWorkflowStateStore = defineStore({
},
setGraderoster (graderoster) {
this.graderoster = graderoster;
this.unsubmitted = graderoster.students.filter(
this.unsubmittedCount = graderoster.students.filter(
(s) => s.grade_url !== null).length

// Initialize workflow state
if (this.unsubmitted > 0) {
if (this.unsubmittedCount > 0) {
this.editGrades();
} else {
this.confirmGrades();
Expand Down

0 comments on commit 25080f9

Please sign in to comment.