Authoring / Export / Inline images with spaces in the file or containing folder name are not included in content packaging export

Description

If you have a Resources directory with a space in the name, and include an image from that directory in one of your question's rich text areas, then export the assignment, that image will not be included in the downloaded exportAssessment.zip. This issue also occurs if you have a space in your file's name.

To reproduce:
1) Create a folder in your site resources that has a space in the name.
2) Upload an image to that folder.
3) Create a new Assessment in Test & Surveys Beta.
4) Add a fill in the blank question. Use the rich text editor to add the uploaded image to the question text.
5) Export the Assessment as Content Packaging and view the contents of the zip folder. There will not be a group folder containing the folder tree with the image.

Expected Results: In the exportAssessement.zip file, the directory structure for the image, along with the image, should be included.

Attachments

7

Activity

Hui Tsao March 14, 2014 at 7:17 PM

I just confirmed what Andrea said. After Yuki's patch, the files are all included in the zip. However, for the file with spaces in its name, the spaces are removed all the places but not exportAssessment.xml. For example, a file with name test space.JPG

In imsmanifes.xml:
<file href="/user/ktsao/testspace.JPG"></file>

The image file name:
testspace.JPB

However, in exportAssessment.xml:
<img alt="" src="http://localhost:8080/access/content/user/ktsao/test%20space.JPG"...

And this caused a FileNotFoundException.

Sam Ottenhoff February 10, 2014 at 8:40 AM

This was committed in r110693

Andrea Schmidt June 12, 2013 at 7:46 AM

If these failures should be in a new Jira, please let me know

Andrea Schmidt June 12, 2013 at 7:39 AM
Edited

Tested again and it seems spaces in folder/file name are breaking. Am attaching the exports for each test completed. All failed imports displayed the message "There was an error importing this assignment. Ensure that the file is correctly formatted IMS QTI."
http://nightly2.sakaiproject.org:8082/
trunk on Oracle - Built: 06/12/13 08:00 - Sakai Revision: 125660 (Kernel 1.4.0-SNAPSHOT)

Trunk_SAM-1297A: no images
Trunk_SAM-1297B: image, no spaces (asters.jpg)

FAILED
Trunk_SAM-1297C: image with spaces (rose with space.jpg)
Trunk_SAM-1297D: folder with spaces, image no spaces (My Folder -> aussietreefrog12.jpg)
Trunk_SAM-1297E: folder with spaces, image with spaces (My Folder -> lion sm spaces.jpg)

Andrea Schmidt June 11, 2013 at 3:27 PM

Tested on trunk, was able to export the assessment, but when I tried to import I received the following error: There was an error importing this assignment. Ensure that the file is correctly formatted IMS QTI.

Not sure if this is related, so I will do some more testing. Am attaching the export file.

Fixed

Details

Priority

Affects versions

Fix versions

Components

Assignee

Reporter

Created July 26, 2011 at 4:57 AM
Updated April 17, 2018 at 8:38 AM
Resolved February 10, 2014 at 8:40 AM