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

General: Allow to publish example solutions for modeling, text and file upload exercises on a specific date #4328

Merged
merged 45 commits into from
Feb 25, 2022

Conversation

akesfeden
Copy link
Contributor

@akesfeden akesfeden commented Nov 18, 2021

Checklist

General

Server

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

Client

  • I followed the coding and design guidelines.
  • I added multiple unit tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • (No new routes) 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.

Motivation and Context

This PR solves #16 for the modeling, text and file upload exercises. It allows example solutions (previously called "sample solution") to be published to the students after a predefined date.

This functionality will be added to the programming exercises in a follow-up PR.

Description

Note: Contains a database migration.

This PR adds example_solution_publication_date to Exercise model and allows instructors to set a date to make the example solution that is already present in the database available to the students for modeling, text and file upload exercises. Currently presenting example solutions is explicitly disabled for exam exercises, it is planned to extend this feature to include them in a follow-up PR. Also, sampleSolution (and similar) fields, attributes, translation strings, etc. are renamed to exampleSolution (and similar) for Modeling, Text and File Upload Exercises because "Example solution" term is preferred over "Sample solution".

Steps for Testing

Contains a migration so please deploy only to TS1 or TS3 (new).
Prerequisites:

  • 1 Instructor
  • 1 Students
  • 1 Modeling Exercise with a Example Solution
  • 1 Text Exercise with a Example Solution
  • 1 File Upload Exercise with a Example Solution

Instructor:

  1. Log in to Artemis
  2. Navigate to Course Administration
  3. Go to the Edit page of the prerequisite Modeling Exercise.
  4. Ensure current Example Solution Publication Date is empty or after current time.

Student:

  1. Log in to Artemis
  2. Navigate to the prerequisite Modeling Exercise's detail page.
  3. Ensure example solution is not visible.

Instructor:

  1. Change Example Solution Publication Date of the exercise to a time before current time.

Student:

  1. Ensure example solution is visible.

  2. Ensure the term "Example solution" is used instead "Sample solution".

  3. Repeat steps 1-9 with Modeling Exercise replaced with Text Exercise and File Upload Exercise.

Instructor:

  1. Import an existing Modeling Exercise with Example Solution Publication Date set to a non-null date.

  2. Ensure new exercise has Example Solution Publication Date set to null.

  3. Repeat steps 12-13 with Modeling Exercise replaced with Text Exercise.

Review Progress

Code Review

  • Review 1
  • Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

File: Branches % | Lines %

BaseExercise.java: 86% | 99%
FileUploadExercise.java: 100% | 100%
TextExercise.java: 100% | 100%
ModelingExercise.java: 100% | 89%
course-exercise-details.component.ts : 59.23% | 79.6%
modeling-exercise-update.component.ts: 81.92% | 92.07%

Screenshots

Course Management View (For Modeling Exercise)

image

image

Course Exercise Detail

Modeling Exercise

image

image

Text Exercise

image

File Upload Exercise

image

@github-actions github-actions bot added client Pull requests that update TypeScript code. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. server Pull requests that update Java code. (Added Automatically!) tests labels Nov 18, 2021
@akesfeden akesfeden changed the title Feature/modeling exercises/present sample solution Development: Present Sample Solution for Modeling Exercises. Nov 18, 2021
@akesfeden akesfeden changed the title Development: Present Sample Solution for Modeling Exercises. Development: Present Sample Solution for Modeling Exercises. Nov 18, 2021
@akesfeden akesfeden marked this pull request as ready for review November 24, 2021 09:53
@akesfeden akesfeden requested a review from a team as a code owner November 24, 2021 09:53
@krusche krusche modified the milestones: 5.5.5, 5.6.0 Feb 15, 2022
…nd set it to null when importing. Add relevant tests.
MerlinMehmed
MerlinMehmed previously approved these changes Feb 19, 2022
Copy link
Contributor

@MerlinMehmed MerlinMehmed left a comment

Choose a reason for hiding this comment

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

Code changes look good

Copy link
Contributor

@canberkanar canberkanar left a comment

Choose a reason for hiding this comment

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

I noticed a small client bug although the functionality on the backend is implemented correctly.

  • Create a modeling exercise and enter release date of sample solution.
  • Re-import the same exercise.
  • The sample solution release date of the new exercise should be emptied out but it is not done on the frontend.
  • When the imported exercise is saved this way the correct behavior is seen in the backend however I think the date should be cleared as well.

Copy link
Contributor

@willergeorg willergeorg 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 TS3. Checked the bug @canberkanar mentioned, it is fixed now. I also followed your testing steps for a modeling and a text exercise and checked the in exam mode. Did not encounter any problems. Nice work! 👍

Copy link
Contributor

@canberkanar canberkanar left a comment

Choose a reason for hiding this comment

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

The client-side issue seen when importing exercises has been resolved.

Copy link
Contributor

@ole-ve ole-ve 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 TS1, works as described and expected 👍
Code changes also look good to me.

Copy link
Contributor

@MerlinMehmed MerlinMehmed left a comment

Choose a reason for hiding this comment

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

Code changes look good

Copy link
Member

@bassner bassner left a comment

Choose a reason for hiding this comment

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

Code: 👍

@krusche krusche changed the title Development: Present Example Solution for Modeling, Text and File Upload Exercises. Development Allow instructors to present example solution for modeling, text and file upload exercises Feb 25, 2022
@krusche krusche changed the title Development Allow instructors to present example solution for modeling, text and file upload exercises Development: Allow instructors to present example solution for modeling, text and file upload exercises Feb 25, 2022
@krusche krusche changed the title Development: Allow instructors to present example solution for modeling, text and file upload exercises General: Allow instructors to present example solution for modeling, text and file upload exercises Feb 25, 2022
@krusche krusche changed the title General: Allow instructors to present example solution for modeling, text and file upload exercises General: Add possibility to publish example solutions for modeling, text and file upload exercises on a specific date Feb 25, 2022
@krusche krusche changed the title General: Add possibility to publish example solutions for modeling, text and file upload exercises on a specific date General: Allow to publish example solutions for modeling, text and file upload exercises on a specific date Feb 25, 2022
@krusche krusche merged commit d002739 into develop Feb 25, 2022
@krusche krusche deleted the feature/modeling-exercises/present-sample-solution branch February 25, 2022 17:38
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!) cypress Pull requests that update cypress tests. (Added Automatically!) database Pull requests that update the database. (Added Automatically!). Require a CRITICAL deployment. ready to merge server Pull requests that update Java code. (Added Automatically!) tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.