Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ json.assessment do
# If submitting with incorrect answers is not allowed, we must show the answer to students regardless
json.showMcqAnswer !@assessment.allow_partial_submission || @assessment.show_mcq_answer
json.showEvaluation @assessment.show_evaluation
json.blockStudentViewingAfterSubmitted @assessment.block_student_viewing_after_submitted
Comment thread
adi-herwana-nus marked this conversation as resolved.
json.questionIds @submission.questions.pluck(:id)
json.passwordProtected @assessment.session_password_protected?
json.gamified @assessment.course.gamified?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component } from 'react';
import { FormattedMessage, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import { Lock } from '@mui/icons-material';
import InsertDriveFile from '@mui/icons-material/InsertDriveFile';
import {
Card,
Expand Down Expand Up @@ -158,16 +159,35 @@ class VisibleSubmissionEditIndex extends Component {
}

render() {
const { isSubmissionBlocked, isLoading } = this.props;
const { assessment, isSubmissionBlocked, isLoading, submission } =
this.props;

if (isLoading) return <LoadingIndicator />;
if (isSubmissionBlocked) return <BlockedSubmission />;

const isBlockedInStudentView =
!submission.graderView &&
assessment.blockStudentViewingAfterSubmitted &&
submission.workflowState !== workflowStates.Attempting &&
submission.workflowState !== workflowStates.Published;

return (
<Page className="space-y-5">
{this.renderTimeLimitBanner()}
{this.renderAssessment()}
{this.renderProgress()}
{this.renderContent()}
{isBlockedInStudentView ? (
<div className="flex flex-col items-center py-16">
<Lock className="text-9xl" />
<Typography>
<FormattedMessage {...translations.submissionBlocked} />
</Typography>
</div>
) : (
<>
{this.renderProgress()}
{this.renderContent()}
</>
)}
</Page>
);
}
Expand Down