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

Exam mode: Fix assessment button on student exam overview page #10463

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

Conversation

coolchock
Copy link
Contributor

@coolchock coolchock commented Mar 11, 2025

Checklist

General

Client

Motivation and Context

Currently, we are facing a bug in production where the Assessment button on the student exam overview page doesn't redirect to the assessment of a programming exercise if either manual assessment is enabled or complaints on automatic assessment are enabled. This change fixes that issue.

Description

I have extended the condition to check for SEMI_AUTOMATIC and MANUAL assessment types. The button will not be displayed if the programming exercise is meant to be graded fully automatically or if there is no submission.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Student
  • 1 Exam with a programming exercise
  1. As a student, participate in the exam, submit a programming exercise, and hand in the exam.
  2. As an instructor, navigate to Course Management -> Exams -> Select an Exam -> Exercise Groups.
  3. Click Edit on the programming exercise and set the assessment type to Automatic (see screenshots).
  4. Go to Student Exams -> Click View on the exam that you previously submitted.
  5. Verify that the Assessment button does not appear for the programming exercise.
  6. Edit the exercise again and set the assessment type to Automatic with complaints enabled (see screenshots).
  7. Verify that the Assessment button appears for the programming exercise and correctly redirects you to the assessment.
  8. Edit the exercise again and set the assessment type to Manual (see screenshots).
  9. Verify that the Assessment button appears for the programming exercise and correctly redirects you to the assessment.

Testserver States

You can manage test servers using Helios. Check environment statuses in the environment list. To deploy to a test server, go to the CI/CD page, find your PR or branch, and trigger the deployment.

Review Progress

Performance Review

  • I (as a reviewer) confirm that the client changes (in particular related to REST calls and UI responsiveness) are implemented with a very good performance even for very large courses with more than 2000 students.
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance even for very large courses with more than 2000 students.

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Screenshots

Fully automatic assessment:
image
Automatic assessment with complaints enabled:
image

Manual assessment:
image

Summary by CodeRabbit

  • New Features
    • The exam detail view has been enhanced to display additional exam submission details. Manual assessments now appear alongside semi-automatic assessments, providing a more comprehensive and accurate view of exam submissions. This update ensures users have access to a complete and reliable display of exam information across various assessment types.
    • A new public property for AssessmentType has been added, improving access to assessment type information within the component.
    • Conditional rendering logic for programming exercises has been expanded, allowing for broader scenarios in which the associated details are displayed.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Mar 11, 2025
@coolchock coolchock marked this pull request as ready for review March 11, 2025 18:58
@coolchock coolchock requested a review from a team as a code owner March 11, 2025 18:58
Copy link

coderabbitai bot commented Mar 11, 2025

Walkthrough

The changes update the student exam detail table row component by enhancing its conditional rendering logic and modifying property access. The HTML template now checks for submission truthiness, exercise.type being PROGRAMMING, and exercise.assessmentType being either SEMI_AUTOMATIC or AUTOMATIC with allowComplaintsForAutomaticAssessments true. In the TypeScript file, the AssessmentType property is declared as a public readonly member instead of protected. No public entity declarations have been altered beyond this change.

Changes

File(s) Change Summary
src/main/webapp/app/exam/manage/student-exams/.../student-exam-detail-table-row.component.html Modified the conditional rendering logic: the check now passes if submission is truthy, exercise.type is PROGRAMMING, and exercise.assessmentType is either SEMI_AUTOMATIC or AUTOMATIC with allowComplaintsForAutomaticAssessments true.
src/main/webapp/app/exam/manage/student-exams/.../student-exam-detail-table-row.component.ts Adjusted the AssessmentType property: removed the protected readonly declaration and added a public readonly declaration, exposing it to the component's instances.

Possibly related PRs

  • Exam mode: Display problem statement in result summary for unsubmitted exercises #9070: The changes in the main PR enhance the conditional rendering logic for programming exercises based on submission status, while the retrieved PR modifies the conditional rendering logic for displaying problem statements in the exam result summary based on submission status; both PRs involve similar logic adjustments related to submission checks in their respective components.

Suggested labels

tests, component:Exam Mode

Suggested reviewers

  • SimonEntholzer
  • krusche
  • HanyangXu0508
  • az108
  • pzdr7

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1027d78 and 7291f20.

📒 Files selected for processing (1)
  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.html
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: Call Build Workflow / Build .war artifact
  • GitHub Check: Call Build Workflow / Build and Push Docker Image
  • GitHub Check: client-style
  • GitHub Check: Analyse
  • GitHub Check: server-style
  • GitHub Check: client-tests-selected
  • GitHub Check: client-tests
  • GitHub Check: server-tests

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.html (1)

72-79: ⚠️ Potential issue

Remove duplicate assessment button

There are two identical buttons with the same functionality, text, and styling. This appears to be an accidental duplication that should be removed.

<div>
    <a [class.disabled]="busy" [routerLink]="getAssessmentLink(exercise, submission)" class="btn btn-primary btn-sm mb-1">
        <fa-icon [fixedWidth]="true" [icon]="faFolderOpen" />
        {{ 'artemisApp.examManagement.assessmentDashboard' | artemisTranslate }}
    </a>
-   <a [class.disabled]="busy" [routerLink]="getAssessmentLink(exercise, submission)" class="btn btn-primary btn-sm mb-1">
-       <fa-icon [fixedWidth]="true" [icon]="faFolderOpen" />
-       {{ 'artemisApp.examManagement.assessmentDashboard' | artemisTranslate }}
-   </a>
</div>
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 06f2da4 and 96b5553.

📒 Files selected for processing (4)
  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.html (1 hunks)
  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.ts (2 hunks)
  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.html (1 hunks)
  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`src/main/webapp/**/*.html`: @if and @for are new and valid ...

src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.html
`src/main/webapp/**/*.ts`: angular_style:https://angular.io/...

src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

  • src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (1)
src/main/webapp/app/exam/manage/student-exams/student-exam-detail-table-row/student-exam-detail-table-row.component.ts (1)

37-37: Approve: Enhance template accessibility by making AssessmentType public

The change from a protected to public readonly property enables proper access to AssessmentType in the HTML template, which is necessary for the conditional rendering logic.

coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 11, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de March 11, 2025 19:13 Inactive
coderabbitai[bot]
coderabbitai bot previously approved these changes Mar 11, 2025
@helios-aet helios-aet bot temporarily deployed to artemis-test2.artemis.cit.tum.de March 11, 2025 21:04 Inactive
Copy link
Contributor

@KonstiAnon KonstiAnon left a comment

Choose a reason for hiding this comment

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

Buttons now behave as expected

Copy link
Contributor

@dmytropolityka dmytropolityka left a comment

Choose a reason for hiding this comment

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

tested on ts2, thanks for fixing the issue quickly
now works as described

Copy link
Contributor

@cremertim cremertim left a comment

Choose a reason for hiding this comment

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

Code

Copy link
Member

@BBesrour BBesrour left a comment

Choose a reason for hiding this comment

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

code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix client Pull requests that update TypeScript code. (Added Automatically!) ready to merge small
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

5 participants