Skip to content

Improvement for Submission Status logic #3033

Open
@GabrielCWT

Description

@GabrielCWT
export const backendParamsToProgressStatus = (
  isManuallyGraded: boolean,
  isGradingPublished: boolean,
  submissionStatus: AssessmentStatus,
  numGraded: number,
  numQuestions: number
): ProgressStatus => {
  if (!isManuallyGraded) {
    return ProgressStatuses.autograded;
  } else if (submissionStatus !== AssessmentStatuses.submitted) {
    return submissionStatus;
  } else if (numGraded < numQuestions) {
    return ProgressStatuses.submitted;
  } else if (!isGradingPublished) {
    return ProgressStatuses.graded;
  } else {
    return ProgressStatuses.published;
  }
};

With the current implementation of getting the submission status, there is no way to manually unsubmit/unpublish something if there is a bug with the backend. For example: If the backend somehow publishes a submission when isManuallyGraded is true, the progress will be ProgressStatuses.submitted because there was no manual grading done, therefore numGraded < numQuestions.

When the status is submitted, the frontend hides the buttons for unpublishing and therefore we cannot unsubmit since we must unpublish before unsubmitting.

I propose we check for isGradingPublished as the 2nd priority behind autograded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions