T&Q: Import stacktrace if images are in a resources subfolder which contains a space in the name or the image name contains a space
Description
Attachments
- 13 Jun 2021, 09:15 AM
- 13 Jun 2021, 09:13 AM
- 13 Jun 2021, 09:13 AM
- 13 Jun 2021, 09:13 AM
- 13 Jun 2021, 09:13 AM
- 13 Jun 2021, 09:13 AM
- 13 Jun 2021, 09:13 AM
- 13 Jun 2021, 09:13 AM
is duplicated by
Activity
Tiffany Stull June 9, 2021 at 11:39 AM
In UVA's Sakai 20 instance, I'm (fortunately) not experiencing these issues. I was able to successfully export a quiz with images using Content Packaging from UVA's Sakai 11 instance and import it into both UVA's Sakai 20 instance and nightly QA 20 server. I was also able to successfully export a quiz from UVA's Sakai 20 instance and into another site in the same instance. However, I could NOT import the quiz exported from UVA's Sakai 20 into nightly QA 20.
UVA had a few local fixes to export/import of assessments with images that might have fixed it there.
Issue #1: The URLs to file attachments in the zip file were being munged. It was trying to import the file paths for the image attachments as being in a folder named Tests%20_%20Quizzes instead of Tests _ Quizzes, and thus failing to import. Steps for verifying that issue:
Create 3 sites with Tests & Quizzes; in at least one site, also include Resources.
In Site #1 with Tests & Quizzes and Resources, upload an image to Resources.
Go to Tests & Quizzes > Question Pools > create a question pool.
Add a question in the question pool, and in the question text, embed the image from Resources using CKEditor.
Create a new quiz, and use Add Question > Copy from Question Pool to copy in the question with the image.
Edit the question and note that the image URL has Tests _ Quizzes instead of Tests%20_%20Quizzes (correct behavior).
Export the quiz as ZIP.
Import the quiz to Site #2. It should import successfully with the embedded image included.
Edit the imported quiz, edit the question and check the Source in the editor.
Make sure the image was included, and image URL is pointing to an attachment in the current site. Note that the image URL should include Tests _ Quizzes instead of Tests%20_%20Quizzes.
Export the quiz from Site #2 as ZIP.
Import the newly-exported quiz to Site #3. It should import successfully with the embedded image included.
Edit the imported quiz, edit the question and check the Source in the editor.
Make sure the image was included, and image URL is pointing to an attachment in the current site.
Issue #2: An instructor created a project site that contained a folder where the content was publicly available. He uploaded images to the public folder. He then embedded the images from this folder into a quiz in one of his course sites. Upon attempting to export the quiz with Content Packaging from the course site, the files were not correctly included in the export file because the URLs were pointing to the project site. This caused the import to fail with the "not properly formatted QTI" error. Testing steps for that issue:
Create a project site with Resources.
Add a folder to the project site, where you Edit Details on the folder and enable the publicly viewable setting on the files.
Add another folder to the project site, where you Edit Details and enable the all logged-in users access setting on the files.
Upload several images to each folder.
Create a course site with Tests & Quizzes.
Create a quiz with several questions (any type of question). In question, answer, or feedback text for each question, use the CKEditor Browse Server option to embed one of the images from the project site's public or logged-in users image folders.
Export the quiz from the course site as Content Packaging.
Import the quiz back into the same site or any other course site. The quiz should import successfully.
Edit the imported quiz and edit each question. The questions should include the images, and if you switch to Source code, you should find the image URLs include the site ID of the current site.
Issue #3: https://sakaiproject.atlassian.net/browse/SAK-40552#icft=SAK-40552
Hopefully this information will help developers to find the issue.
Totally rewrote steps and description. The stacktraces display if there is a space in the folder name that contains the Tests & Quizzes images, or if there is a space in the image name.
Both the space in the folder name and the space in the image name have the following in the stacktrace: java.lang.RuntimeException: resourceId is null
Attaching quizzes for each part of the test plan, stacktraces for both, and images with/without spaces that can be used for testing.