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

Quiz exercises: Simplify drag-and-drop image upload #7259

Merged
merged 21 commits into from
Oct 27, 2023

Conversation

julian-christl
Copy link
Member

@julian-christl julian-christl commented Sep 24, 2023

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).
  • 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 and ensured that the layout is responsive.
  • I added multiple integration tests (Jest) related to the features (with a high test coverage), while following the test guidelines.
  • 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

Follow-up of #5733 and #5427 to replace the file upload before entity persistence with a multipart file and entity upload.
Reimplementation after #6456 got reverted. After implementing the file service, the original issue got resolved.

Description

The changes only affect the drag-and-drop section of the quizzes. But because the quiz editor allows creating all different types of quiz questions, I had to make the component saving the entity to retrieve the files from potential drag-and-drop question children and upload them together with the files.

It affects the Creation, Update, Re-evaluation and Import of quiz exercises. Additionally, it also affects the creation of drag-and-drop mode quizzes. However, those use the same creation endpoint.

Steps for Testing

We need to fully test the quiz functionalities, including:

  • Creation of a normal quiz
  • Creation of a Drag and Drop Model Quiz
  • Edit
  • Import
  • Reevaluation
  • Adding existing questions (bottom of the editor) to a quiz exercise

During all of these five checks, it makes sense to work

  • with and without dnd questions
  • with and without background
  • with and without picture drag and drop items
  • with and without text drag and drop items
  • with both drag and drop items
  • with adding, removing, and replacing Drag Items and Questions to make sure the files get cleared up and not sent to the server
  • try editing steps after a fresh reload as well as continuously editing and saving without a reload

Always check if the quiz gets rendered as expected.

Exam Mode Testing

Most of the changes are unrelated to the exam mode. I do not think testing is necessary to test the exam mode as extensively. However, it makes sense to just test the normal quiz exam workflow (creation and conduction) to be sure.

The only change that does require testing here is the import functionality of an existing exercise.

Review Progress

I squashed all changes from #6456 that already got approved, so technically, it should be enough to review the rest.

Code Review

  • Review 1
  • Review 2

Manual Tests

  • Test 1
  • Test 2

Exam Mode Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
FileService.java 87.0%
QuizExerciseImportService.java 93.7%
QuizExerciseService.java 97.7%
ExamImportService.java 95.5%
QuizExerciseResource.java 93.6%
quiz-exercise-generator.ts 89.6%
drag-and-drop-question-edit.component.ts 91.6%
quiz-exercise-detail.component.ts 92.8%
quiz-question-list-edit.component.ts 94.8%
quiz-question-list-edit-existing.component.ts 98.9%
re-evaluate-drag-and-drop-question.component.ts 100%
quiz-re-evaluate.component.ts 86.1%
quiz-exercise.service.ts 100%
quiz-re-evaluate.service.ts 100%
file.service.ts 63.0%

Screenshots

Upload background before (before changes):
1409d1ba0c797661134ab989845ec831
Upload Background before (after changes):
e050fc2202937de46c2976423242c873

Upload background after (before changes):
80251aeeb77554f93832507fce51ee06
Upload background after (after changes):
3557ddaac548194325b3defb284e7f34

Upload picture drag item after (before changes):
593948ae5992864d34e4832ef35d9341
Upload picture drag item after (after changes):
f7deccf1b245d6010fb76aa3a1abbff3

@julian-christl julian-christl self-assigned this Sep 24, 2023
@artemis-bot artemis-bot added this to In progress in Artemis Development Sep 24, 2023
@github-actions github-actions bot added tests server Pull requests that update Java code. (Added Automatically!) client Pull requests that update TypeScript code. (Added Automatically!) cypress Pull requests that update cypress tests. (Added Automatically!) labels Sep 24, 2023
@julian-christl julian-christl temporarily deployed to artemis-test4.artemis.cit.tum.de September 24, 2023 22:44 — with GitHub Actions Inactive
@pal03377 pal03377 temporarily deployed to artemis-test4.artemis.cit.tum.de September 26, 2023 13:22 — with GitHub Actions Inactive
Artemis Development automation moved this from In progress to Review in progress Sep 26, 2023
Copy link
Contributor

@pal03377 pal03377 left a comment

Choose a reason for hiding this comment

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

The DND quiz preview breaks for me with draggable image items. The video shows the current behavior on the left (develop, running locally) and the behavior with this PR on the right (on TS4). Note that the image already seems to break while dragging it.

screenshot-2023-09-26_001986.mp4

@artemis-bot artemis-bot moved this from Review in progress to In progress in Artemis Development Sep 26, 2023
Artemis Development automation moved this from In progress to Review in progress Sep 26, 2023
Copy link
Contributor

@Kroko-fant Kroko-fant left a comment

Choose a reason for hiding this comment

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

I tested uploading files a bit and was able to consistently reproduce a bug that occurs, when I edit a quiz, stay on the page.

  1. Upload at least one file
  2. Press "Save"
  3. Delete any (could be the one you uploaded could be another file that previously was uploaded)
  4. Try to save the changes
Desktop.2023.09.27.-.00.19.28.06.mp4

@julian-christl julian-christl force-pushed the feature/reimplement-quiz-image-upload branch from 8ccb845 to c211afd Compare September 29, 2023 20:43
@julian-christl
Copy link
Member Author

@pal03377 Fixed the your first issue in d8d3e22, the second in 052d639

@Kroko-fant Fixed in c211afd

(not yet ready for a retest, need to fix something else first)

@artemis-bot artemis-bot moved this from Review in progress to In progress in Artemis Development Sep 29, 2023
Artemis Development automation moved this from In progress to Review in progress Sep 29, 2023
@github-actions
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.

Copy link
Contributor

@max-bergmann max-bergmann left a comment

Choose a reason for hiding this comment

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

Tested in testing session - quizzes worked as expected

@egekurt123 egekurt123 requested review from egekurt123 and removed request for SolizerCodes and tunargs October 19, 2023 10:58
Copy link
Contributor

@egekurt123 egekurt123 left a comment

Choose a reason for hiding this comment

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

Tested in testing session - Multiple choice / Single choice and "Fill in the blanks" exercises work as expected.
Re-evalution works as expected.

Copy link
Contributor

@milljoniaer milljoniaer left a comment

Choose a reason for hiding this comment

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

Tested in testing session, works as expected

Copy link
Contributor

@Strohgelaender Strohgelaender 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, all previusly found issues are now resolved. code lgtm.

Copy link
Contributor

@Santia-go Santia-go left a comment

Choose a reason for hiding this comment

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

I created a quiz with a question (DnD). Works perfect.
However, I created another quiz in the same course, and when I look for the question (the recently created one) to import into this new quiz, it does not appear in the list.

Copy link
Contributor

@laadvo laadvo left a comment

Choose a reason for hiding this comment

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

Code looks good 👍

@Santia-go Santia-go added the maintainer-approved The feature maintainer has approved the PR label Oct 26, 2023
@krusche krusche added this to the 6.6.3 milestone Oct 26, 2023
@krusche krusche merged commit d23fe17 into develop Oct 27, 2023
26 of 32 checks passed
@krusche krusche deleted the feature/reimplement-quiz-image-upload branch October 27, 2023 18:49
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!) enhancement maintainer-approved The feature maintainer has approved the PR ready to merge refactoring server Pull requests that update Java code. (Added Automatically!) tests
Projects
No open projects
Artemis Development
  
Ready for review
Development

Successfully merging this pull request may close these issues.

None yet

10 participants