Test & Quizzes: Images access in quizzes are not accurately represented in preview
Description
Attachments
is incorporated by
is related to
relates to
Activity

Tiffany Stull July 20, 2021 at 1:20 PM
from what I'm seeing in the testing comments and screenshots, it is not at all clear to me as a user what the work in is actually intended to do, and how it helps with the problem of an image used in an assessment should stay within the assessment and only within the assessment so it works properly within the context of the assessment and cannot be seen outside of it.
Per SAK-45537, the affected image is still in Resources and still referenced. This does not solve the problem as it was discussed here or in T&L. Creating new complexity and locks on things in way where it is not transparent to users what is going on does not help.
Earle Nietzel July 20, 2021 at 1:01 PM
Hi Tiffany,
I don't think this Jira is representative any more of the actual issues discussed in them, there is just to much going on here.
I propose creating a new issue and link it to this one that is concise i.e. "Samigo files should be stored as attachments to the assessment".
As far as links go that is much more difficult to control as a user can still add any link they wish. If someone chose to link to something vs adding it as an attachment then that is on the user. There is just no easy way of controlling that and nor should it be prevented.
The work that was done was specific to securing files so that students could only see them while actually taking the assessment.

Tiffany Stull July 20, 2021 at 10:56 AMEdited
Per the discussion in comments above, any files in an assessment should not have to be stored in Resources at all. Once embedded in an assessment, the files should "live" in the assessment's attachments area and not be tied to any other tool. In other words, the following behavior is desired:
Create a folder in Resources where you Edit Details and make it hidden but allow access to contents.
Upload an image in the folder.
Create a quiz from scratch.
Add a question (e.g., true false or multiple choice) where you embed the image in the assessment question using Rich-Text Editor > Image > Browse Server > Select image from within folder in step 1. Save question.
Edit question 1 and check the URL of the image. Image should be stored in an attachments folder with a URL like the following: https://experimental.nightly.sakaiproject.org/access/content/attachment/siteID/Tests _ Quizzes/4988fe1e-cb73-4c8c-9cfd-84531c1a80b5/sakaiger.png
Where "siteID" is the ID of the current Sakai site. I'm not sure what the second ID folder name is after the "Tests _ Quizzes" folder, but my guess is it's the question ID.Add another question (any type) where you use the Add Attachments button to add a file attachment to the question.
Copy or inspect the URL are of the file added using Add Attachments. File location should similarly be within the attachments area of Tests & Quizzes.
Go to Resources, delete the image uploaded there.
Go to Trash in Resources and hard delete the image.
Go to Tests & Quizzes, publish quiz.
Clear cache, close browser completely.
Log in as student and take quiz. You should be able to see images, and inspecting their URLs, the images have the appropriate file attachments URLs.
Similarly, when a question is copied to a question pool or an assessment is exported from the site using Content Packaging (ZIP) and imported into another site, URLs to all included files should be stored within Tests & Quizzes attachments area, with the current site ID shown, and NOT Resources.
I should also point out that you can obtain the desired behavior of having all assessment images kept within the attachments area of the quiz in Sakai 20 right now (without the change here added) by simply exporting the quiz with Content Packaging after embedding the image and importing it back in to the site. The fix requested here was to simply make the same behavior (making a copy of the image native to the assessment) be obtained during the initial embed process, and make it consistent for all question types (including those that are incapable of being exported to zip file).

Curtis Van Osch July 20, 2021 at 10:06 AM
The access tokens implemented by work well, but still don't indicate to the quiz author that the images are not visible to the students. Maybe an icon indicating that the secure access option is enabled for the image (in the preview and authoring view) would make it clear that the image will definitely be accessible?

Andrea Schmidt June 10, 2021 at 6:27 PMEdited
I've done the following testing on 22x: https://trunk-mysql.nightly.sakaiproject.org/, build: e6f1396e
Created a hidden folder in Resources called "Hidden" (you cannot have spaces in the folder name or it will fail currently when exporting/importing)
Added images to every field that supports the rich text editor for the following question types:
File Upload
Fill in the Blank
Short Answer/Essay
True/False Question
Audio Response
Numeric Response
Calculated Question
Single Correct
Multiple correct, single selection
Multiple correct, multiple selection
Matching
Images showed up for the instructor in the following cases:
Preview
Print
Grading by student
Grading by question
Statistics
Had students take the quiz through T&Q,, Lessons and by URL:
images displayed in the quiz
images displayed in feedback
images displayed in statistics
I did duplicate the quiz and then released it to anonymous users, but the anonymous user did not see the images.
When the teacher use the preview to check a quiz, the images are shown according to his permissions, not the students'. So if the images are stored in a folder that is not accessible to the student, we only figure it out during the test.
The teachers don't want the students to see the images before the quiz, so they put them in separate folders, and sometimes they used the wrong permissions on the folder, or worst, they put them in their personnal folders. Also, we had the problem when a test was copied from a previous session and the teacher used the preview to make sure the images were ok. But they were not for the students.