From 3a3ab63895eb889a36d36e50d0f3f7f98e43ee23 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Mon, 24 Jul 2023 18:12:09 +0800 Subject: Show submitted assignments only if configured to --- contents/ui/main.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'contents/ui/main.qml') diff --git a/contents/ui/main.qml b/contents/ui/main.qml index 6f14c65..ad62fd1 100644 --- a/contents/ui/main.qml +++ b/contents/ui/main.qml @@ -133,6 +133,10 @@ Item { callApi(`/courses/${course.id}/assignments`, 50, assignments => { assignments.forEach(assignment => { callApi(`/courses/${course.id}/assignments/${assignment.id}/submissions/${userId}`, 0, submission => { + const submitted = submission.workflow_state == "submitted" || + submission.workflow_state == "graded" + if (submitted && !showSubmittedAssignments) return // discard this + const info = { type: "assignment", activityId: assignment.id, @@ -140,7 +144,7 @@ Item { course: course.code, title: assignment.name, dueAt: assignment.due_at || "", // if null, use empty string to suppress errors - submitted: submission.workflow_state != "unsubmitted", // "graded" counts as submitted + submitted: submitted, url: assignment.html_url, important: plasmoid.configuration.importantAssignments.includes(assignment.id.toString()), finished: plasmoid.configuration.finishedAssignments.includes(assignment.id.toString()), -- cgit v1.2.3