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: Export images of quiz exercises #8841

Merged
merged 18 commits into from
Jun 27, 2024

Conversation

EneaGore
Copy link
Contributor

@EneaGore EneaGore commented Jun 21, 2024

Checklist

General

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 strictly followed the client 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.

Motivation and Context

When a quiz is deleted, so are the assets. A previously imported json file of a quiz can no longer be used to import that quiz. This PR exports assets(images) in a zip file.
Adress issue 7682
At the moment importing a quiz through a json file does not work if the images have been deleted. A follow up PR will allow to import the quiz with the exported zip folder and a json file.

Description

For drag and drop questions the background and drag items are pulled and zipped. For images embedded in the text/MC Options a regex expression fetches the file name and path and zips the image.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 quiz
  1. Log in to Artemis
  2. Create a Quiz with different type of questions
  3. Add image in the text/ MC Options / Drag and Drop questions etc.
  4. Export quiz
  5. If there are no images a single json file of the quiz structure is downloaded
  6. If there are images, a zip file with the images and a json file of the quiz structure is downloaded

Testserver States

Note

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







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

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
quiz-exercise.service.ts 96.19%

Screenshots

assetsInQuiz
jsonAndImage

Summary by CodeRabbit

  • New Features

    • Enhanced quiz export functionality to include images in markdown and assets from drag-and-drop exercises.
    • Added the ability to download a ZIP file containing exported quiz assets.
  • Tests

    • Introduced new test cases to verify the export of images and assets from various quiz question types.

@EneaGore EneaGore self-assigned this Jun 21, 2024
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jun 21, 2024
@EneaGore EneaGore added feature component:Quiz deploy:artemis-test4 and removed client Pull requests that update TypeScript code. (Added Automatically!) labels Jun 21, 2024
@github-actions github-actions bot added deployment-error Added by deployment workflows if an error occured and removed deploy:artemis-test4 labels Jun 21, 2024
@EneaGore EneaGore added deploy:artemis-test4 and removed deployment-error Added by deployment workflows if an error occured labels Jun 21, 2024
@EneaGore EneaGore temporarily deployed to artemis-test4.artemis.cit.tum.de June 21, 2024 17:34 — with GitHub Actions Inactive
@github-actions github-actions bot added the client Pull requests that update TypeScript code. (Added Automatically!) label Jun 21, 2024
@ls1intum ls1intum deleted a comment from github-actions bot Jun 21, 2024
Copy link
Contributor

@coolchock coolchock left a comment

Choose a reason for hiding this comment

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

re-approve

Copy link
Contributor

@kaancayli kaancayli left a comment

Choose a reason for hiding this comment

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

Reapprove

Copy link
Contributor

@undernagruzez undernagruzez left a comment

Choose a reason for hiding this comment

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

re approve

Copy link
Contributor

@FelixTJDietrich FelixTJDietrich 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 TS6 and it is now one zip containing everything. Code changes also look good

image

Copy link
Contributor

@marlon-luca-bu marlon-luca-bu left a comment

Choose a reason for hiding this comment

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

Changes look good to me

@krusche krusche merged commit d900a9e into develop Jun 27, 2024
44 of 49 checks passed
@krusche krusche deleted the feature/quiz-exercises/export-assets-and-json branch June 27, 2024 18:16
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!) component:Quiz feature maintainer-approved The feature maintainer has approved the PR ready to merge tests
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

None yet