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

Programming Exercise: Add student view button to the programming exercises details page #7905

Conversation

nilsreichardt
Copy link

@nilsreichardt nilsreichardt commented Jan 17, 2024

Checklist

General

Server

  • Important: I implemented the changes with a very good performance and prevented too many (unnecessary) database calls.
  • I followed the coding and design guidelines.
  • I added multiple integration tests (Spring) related to the features (with a high test coverage).
  • I added pre-authorization annotations according to the guidelines and checked the course groups for all new REST Calls (security).
  • I documented the Java code using JavaDoc style.

Client

  • Important: I implemented the changes with a very good performance, prevented too many (unnecessary) REST calls and made sure the UI is responsive, even with large data.
  • I followed the coding and design guidelines.
  • Following the theming guidelines, I specified colors only in the theming variable files and checked that the changes look consistent in both the light and the dark theme.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • I added authorities to all new routes and checked the course groups for displaying navigation elements (links, buttons).
  • I documented the TypeScript code using JSDoc style.
  • I added multiple screenshots/screencasts of my UI changes.
  • I translated all newly inserted strings into English and German.

Changes affecting Programming Exercises

  • I tested all changes and their related features with all corresponding user types on Test Server 1 (Atlassian Suite).
  • I tested all changes and their related features with all corresponding user types on Test Server 2 (Jenkins and Gitlab).

Motivation and Context

Description

This PR adds the student view button (first introduced in #7597) to the exercise detail page. This allows instructors to easily switch to the student view of this exercise.

Closes #7902

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 2 Students
  • 1 Programming Exercise with Complaints enabled
  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Open an exercise
  4. Click "Student View"
  5. You should be redirected to the student view of this exercise

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked







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
  • I (as a reviewer) confirm that the server changes (in particular related to database calls) are implemented with a very good performance

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Test

  • Test 1
  • Test 2

Test Coverage

Screenshots

Video:

StudentView.mp4

Screenshot:

image

Summary by CodeRabbit

  • New Features
    • Added a direct link to the student view for programming exercises.

@nilsreichardt nilsreichardt requested a review from a team as a code owner January 17, 2024 23:56
Copy link

coderabbitai bot commented Jan 17, 2024

Walkthrough

The recent update introduces a "Student View" button on the Exercise Details page of a web application. This addition enhances the user experience by providing instructors with a direct link to view the programming exercise as a student, ensuring a streamlined navigation experience within the Cloud Software Engineering Lab environment.

Changes

File Change Summary
.../programming-exercise-detail.component.html Added a "Student View" button linking to the student perspective of the exercise.

Assessment against linked issues

Objective Addressed Explanation
Add a "Student View" button to the Exercise Details page (#7902)
The button should link to the student view of the respective exercise (#7902)
The button should be visually consistent with the existing interface (#7902) The change summary does not provide information on visual consistency.
Streamline the process of navigating between instructor and student views (#7902)

Poem

A hop, a skip, a code merge done,
Now "Student View" shines like the sun.
Instructors delight, with a click so bright,
Behold the student's sight, in a new light! 🐰✨

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jan 17, 2024
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between e5fce7f and f2e6201.
Files ignored due to path filters (2)
  • src/main/webapp/i18n/de/programmingExercise.json is excluded by: !**/*.json
  • src/main/webapp/i18n/en/programmingExercise.json is excluded by: !**/*.json
Files selected for processing (1)
  • src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.html (1 hunks)
Additional comments: 1
src/main/webapp/app/exercises/programming/manage/programming-exercise-detail.component.html (1)
  • 104-106: The "Student View" button has been added as expected. Ensure that the routerLink directive is correctly bound to an array of route segments and that the programmingExercise.course.id and programmingExercise.id are guaranteed to be non-null where this template is used.

@nilsreichardt
Copy link
Author

Hi Artemis Dev Team 👋

This is my first contribution to Artemis and I would appreciate it if you could help me to write a test for this button. I already took a look in the tests of #7597 but I wasn't able to write a test in programming-exercise-detail.component.spec.ts (I have no experience in Angular).

Additionally, should we use the color from the screenshot or a different one? Should we add an icon? If yes, which one?

@nilsreichardt nilsreichardt marked this pull request as draft January 18, 2024 00:10
@MaximilianAnzinger
Copy link
Collaborator

@rabeatwork as you're now responsible for our new UI could you comment/give your feedback on that PR?

Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 31, 2024
@rabeatwork
Copy link
Contributor

Hi Nils,
Thank you for your patience. The mention of Max unfortunately got lost in all the GitHub emails and I just happened to see it.
As for the color: We already have a student view button on the course overview page. This button is colored grey. So I would stick with gray as the color.
Tests: I think the tests from #7597 are a good help. If you have a specific question, contact me. Otherwise it's hard to help.

@@ -189,6 +189,7 @@
"createBehavioralSolutionEntriesTooltip": "Erstellt Lösungs Codeschnipsel für alle Verhaltenstests dieser Aufgabe.",
"createBehavioralSolutionEntriesTitle": "Erstelle verhaltensweise Lösungs Codeschnipsel",
"createBehavioralSolutionEntriesSuccess": "Verhaltensweise Lösungs Codeschnipsel wurden erfolgreich erstellt",
"studentView": "Studentenansicht",
Copy link
Contributor

Choose a reason for hiding this comment

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

The translation was also added for the button in the course overview (#7597 ). Since we use this translation multiple times in different views, I would remove both and add a single entry in global.json --> entity --> action

@@ -101,6 +101,9 @@ <h2><span jhiTranslate="artemisApp.programmingExercise.detail.title">Programming
<fa-icon [icon]="faChartBar"></fa-icon>&nbsp;<span jhiTranslate="statistics.statistics-title">Statistics</span>
</a>
}
<a [routerLink]="['/courses', programmingExercise.course!.id!, 'exercises', programmingExercise.id!]" class="btn btn-info btn-sm">
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not use the non-null assertion operator (the exclamation mark). Because by doing so you're telling the compiler that this expression can't be null or undefined and the compiler should stop complaining about it! But in case it is undefined for whatever reason, this would completely crash the view.

@nilsreichardt
Copy link
Author

Thanks for the review! Because of the upcoming exams, I plan to complete this PR in March 👍

@github-actions github-actions bot removed the stale label Feb 1, 2024
@krusche krusche added the too-long-open !!! This is an antipattern, we should aim for small PRs that are only open for a short time !!! label Feb 4, 2024
Copy link

There hasn't been any activity on this pull request recently. Therefore, this pull request has been automatically marked as stale and will be closed if no further activity occurs within seven days. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 12, 2024
@github-actions github-actions bot closed this Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Pull requests that update TypeScript code. (Added Automatically!) stale too-long-open !!! This is an antipattern, we should aim for small PRs that are only open for a short time !!!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a button to the Student View on the Exercise page
4 participants