Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement for Submission Status logic #3033

Open
GabrielCWT opened this issue Aug 29, 2024 · 1 comment
Open

Improvement for Submission Status logic #3033

GabrielCWT opened this issue Aug 29, 2024 · 1 comment

Comments

@GabrielCWT
Copy link
Contributor

GabrielCWT commented Aug 29, 2024

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.

@GabrielCWT
Copy link
Contributor Author

One issue with this solution is we will not be able to know if a bug has occured i.e. Autopublished but grading not done since it will just show as published.

I am open to suggestions regarding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant