Special handling for attachment archiving for T&Q and user files
Description
Attachments
Activity

Andrea Schmidt September 19, 2024 at 11:52 PM
Passing this for the T&Q portion on 23x and will retest for 22x.
The Lessons portion of this ticket has been added to .

Andrea Schmidt September 14, 2024 at 8:28 PM
If the Lessons portion of the test plan is removed, this passes. deals with Lessons, so maybe that part of the test can be added there?

Andrea Schmidt September 13, 2024 at 10:58 PMEdited
Retested on 23x: https://qa23-maria.nightly.sakaiproject.org/, build: d864b8a1 and Lessons still fails.
Am attaching a copy of the archive zipfile success - notice there are no attachments listed for Lessons.
I tested on trunk….there is no “attachment.xml” (I only did the Lessons test) but the files are listed in lessonbuilder.xml. 23x also has the files listed in lessonbuilder.xml, but not in attachment.xml

Andrea Schmidt June 9, 2024 at 2:58 PM
This fails for me on 23x: https://qa23-maria.nightly.sakaiproject.org/, build: 0884c1d7 also
23x does not seem to have an attachment.xml

Andrea Schmidt May 31, 2024 at 10:21 PM
This is failing for me on 22x: https://qa22-mysql.nightly.sakaiproject.org/, build: 2490a75c
I added an image and then a URL to a different image in Lessons from the user’s home > resources.
I added PDF2.pdf to a quiz question and see it in the qti file, but cannot find it in the attachments file.
I’m attaching my zip file
There are 2 cases where references to attachment files archived in attachment.xml do not match between what’s archived by the tool, and the ids in attachment.xml
Tests & Quizzes: the QTI archiving code removes spaces from attachment paths for unclear reasons here: perhaps spaces in paths may not be supported in that version of the QTI spec
References to files in user workspaces (e.g. in HTML content) have the form /access/content/user/EID/somefile whereas they are archived with /access/content/user/ID/somefile. These may not be possible to resolve correctly if the user concerned is not part of the site being archived (otherwise it would require a full archive of the entire user base to map EID to ID).
To allow the archives to be internally consistent, the cleanest solution here is to change the paths of the resource ids in attachment.xml to match how they are referenced from tool archive files. This needs to be done in BaseContentService, which seems like it shouldn’t need to be concerned with this detail, but there doesn’t appear to be a cleaner solution without much larger code changes.