Skip to content

fix(studentView): Standardize grader's student view to match actual student experience #8000

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ncduy0303
Copy link
Contributor

@ncduy0303 ncduy0303 commented Jun 27, 2025

Description

image

Currently, the student's view feature for graders do not accurately represent what the student is actually seeing at the same time. What students actually see is due to what data is returned from back end, while what graders' student view see is due to the conditional check in the front end (through the graderView state)

Changes made

  • Make rubric panel to be not editable in answer details view.
  • Add missing access control for rubric-based response view, preventing category grades from being sent to students.
  • Standardize the grader's student view to match actual student experience. It is mainly in 3 parts:
    1. question-specific information:
      • assessment settings (students can see this data when both the submission is published and the setting is on):
        • showPrivateTestCases
        • showEvaluationTestCases
        • showMcqMrqSolution
        • showRubricBreakdown
      • course settings (students can see these information when the setting is on):
        • showPublicTestCasesOutput
        • showStdoutAndStderr
    2. comments and annotations:
      • students should only see the published comments and annotations at all times
      • only graders can seeCodaveri, delayed, draft comments
    3. past attempts view (through the "All answers" button):
      • same standard as question-specific information, but this part affects the AnswerDetails component which is also used in the assessment statistics page through LastAttempt

…sitive fields

Students should only see the rubric when the submission is published and the assessment setting is on.
…tual student experience

Ensures that grader's student view accurately reflects what students are seeing at the same time for the following assessment features:

- Private test cases
- Evaluation test cases
- MCQ/MRQ solutions
- Rubric breakdown

These features are only visible to students when the submission is published and the corresponding assessment setting is enabled.
…tual student experience

Ensures that grader's student view accurately reflects what students are seeing at the same time for the different kind of comments.

Students should only see published comments or annotations.
…tual student experience

Ensures that grader's student view accurately reflects what students are seeing at the same time for past attempts view (using the "All Answers" button)

Add display settings props to AnswerDetails component to control visibility of various answer elements like test cases, rubric breakdown, and MCQ/MRQ solutions.
@ncduy0303 ncduy0303 force-pushed the ncduy0303/fix-student-view branch from 91e3888 to bea80f9 Compare June 27, 2025 12:03
@ncduy0303 ncduy0303 requested a review from Copilot July 2, 2025 07:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR aligns the grader’s “student view” with the actual student experience by centralizing visibility flags, enforcing read-only views for students, and conditioning JSON output on grading permissions and publish state.

  • Introduced a DisplaySettings type and propagated published/readOnly flags through answer components
  • Made rubric panels non-editable in student-view contexts and hid unpublished annotations
  • Updated view components and JSON builders to conditionally expose rubric categories, test cases, and annotations based on graderView, published, and course/assessment settings

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
client/app/types/course/assessment/submission/question/types.ts Made aiGradingEnabled optional and categoryGrades optional
client/app/bundles/course/assessment/submission/types.ts Added DisplaySettings interface and passed displaySettings
client/app/bundles/course/assessment/submission/containers/QuestionContent.tsx Computed and passed published flag alongside graderView
client/app/bundles/course/assessment/submission/containers/ReadOnlyEditor.jsx Filtered out unpublished annotations based on graderView/posts
client/app/bundles/course/assessment/submission/components/AllAttempts/AllAttemptsTimelineView.tsx Populated displaySettings for past attempts view
app/views/course/assessment/question/rubric_based_responses/_rubric_based_response.json.jbuilder Conditionally output rubric categories based on permissions
Comments suppressed due to low confidence (4)

client/app/bundles/course/assessment/submission/containers/ReadOnlyEditor.jsx:61

  • annotations is an object, not an array, so it doesn't have a length property. To detect changes, use Object.keys(annotations).length or track the filtered annotations array length instead.
    }

client/app/bundles/course/assessment/submission/pages/SubmissionEditIndex/components/QuestionContent.tsx:50

  • The published property is passed down but not declared in the component's Props interface. Please update the Props type to include published: boolean to ensure type safety.
  const published = workflowState === workflowStates.Published;

client/app/bundles/course/assessment/submission/containers/QuestionGrade.tsx:95

  • The variable published is used here but not defined in this scope. Introduce const published = submission.workflowState === workflowStates.Published; before using it.
    (graderView || (published && assessment.showRubricToStudents));

client/app/bundles/course/assessment/submission/components/AllAttempts/AllAttemptsTimelineView.tsx:115

  • The property assessment.showEvaluation does not exist on the assessment object. If you intended to check the display flag, use the correct field name, e.g. assessment.showEvaluationTestCases.
              graderView || (published && assessment.showEvaluation),

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

Successfully merging this pull request may close these issues.

1 participant