Adding an image to a Quiz Question?

Adding an image to a Quiz Question?

by Mark McCall -
Number of replies: 16
I am not sure if this still under development or currently a bug. But, in the current 2.0 release it is impossible to add an image to a quiz question unless you have the URL for the image.

The insert image of the Text Edit Toolbar is not showing the option to find or upload an image. (See attachment)

The drop down box used to add images is disabled because there are no course files. However, I have tried (as admin) to add a file to all of the folders in the course and it still is not active. Does the drop down box map to a specific directory in 2.0 instead of the traditional course files?


Attachment Upload_Quiz.png
Average of ratings: -
In reply to Mark McCall

Re: Adding an image to a Quiz Question?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
That is because MDL-16094 / Development:File_storage_conversion_Quiz_and_Questions has not been done yet.
In reply to Tim Hunt

Re: Adding an image to a Quiz Question?

by Mark McCall -
Thanks for the update.
In reply to Mark McCall

Re: Adding an image to a Quiz Question?

by Dobby Spencer -

Hi,

I am using Moodle 2.0 and the images are not appearing in the matching question type. All I see are the image place holders. When I check the properties of the place holder in the browser I see a URL such as this, http://localhost/pluginfile.php/47/qtype_match/subquestion/3/24/5/Magazine.gif. When I am composing the question I can see the images in the question editor but they are not appearing when the quiz is previewed or attempted. If I paste the URL in another browser window I get a message that the file cannot be found. Has anyone else encountered this problem? Where in the directory structure would these images be stored? If I know I could have a work around by copying the image there. 

In reply to Dobby Spencer

Re: Adding an image to a Quiz Question?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Dobby "I am using Moodle 2.0 and the images are not appearing in the matching question type."
When you create your matching question, how do you actually put an image in your question's choices? Please provide a step-by-step (and, if possible, some screenshots).
Joseph
In reply to Joseph Rézeau

Re: Adding an image to a Quiz Question?

by Dobby Spencer -

On the Edit a Matching Question pages, I use the Insert/edit Image icon from the html editor for each question. When the Insert/edit image dialog appears, I use the upload file option and chose the file from the file system. The image is inserted and I can see it in the html editor.

I have attached screenshots of the inserted image in the question editor and the preview page.

Attachment Inserted_image_and_preview.JPG
In reply to Dobby Spencer

Re: Adding an image to a Quiz Question?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi Dobby,

1.- You had originally posted your question to the Lesson module forum, where I advised you to post it to this Testing and QA forum since it is related to Moodle 2.0 Preview version. Actually I see from your screenshots that you are talking about the Quiz module matching question, not the Lesson module. Please respect the Moodle terminology when posting to these forums, it really helps people help you.wink

2.- I have tried to reproduce the problem you describe but could not. Inserting images in the left column of pairs to be matched works fine (see attached screenshot).

3.- When you preview your matching question, are you in the same teacher role as when you create/edit the question? Or have you switched from teacher to student role?

4.- In preview mode, what information do you see about those missing images when you right-click on the missing image icon? For example, using Firefox, right-click on icon, select Image Properties and you should see something like the following (for my Denmark flag pic):

http://localhost/moodle/pluginfile.php/14/qtype_match/subquestion/0/3/2/denmark.jpg

ATB

Joseph

Attachment image01.jpg
In reply to Joseph Rézeau

Re: Adding an image to a Quiz Question?

by Dobby Spencer -

Joseph,

I am logged in as Admin when I create and preview the question. When I preview I just see the image place holders but the images are not appearing. When I show the properties on one of the image I get the following URL:

http://localhost/pluginfile.php/47/qtype_match/subquestion/5/24/5/Magazine.gif

In reply to Dobby Spencer

Re: Adding an image to a Quiz Question?

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Dobby - can you see any images on your Moodle 2.0 site?
In reply to Mary Cooch

Re: Adding an image to a Quiz Question?

by Dobby Spencer -

Mary,

I can see all other images without any issues. Should I upgrade? The information below was taken from the version.php file.

$version = 2010080901;

$release = '2.0 Preview 4+ (Build: 20100818)';

In reply to Dobby Spencer

Re: Adding an image to a Quiz Question?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Dobby,
Have you tried with JPEG images (instead of GIF)? Can you insert images in the other quiz question types? Is it only with the matching question type that you are having a problem?
Try to upgrade to the very latest Moodle 2.0 Preview version.
Joseph
In reply to Joseph Rézeau

Re: Adding an image to a Quiz Question?

by Dobby Spencer -

Joseph,

I have used both gif and jpg images and none are appearing. I also did an upgrade to Moodle 2.0 Preview 4+ (Build: 20100908) but nothing has changed; I still am not seeing the images. Could it be that the URL that it is trying to locate the image in is incorrect? How does the sample URLs below translate to the physical location of the file?

http://localhost/pluginfile.php/47/qtype_match/subquestion/9/24/5/Magazine.gif

http://localhost/pluginfile.php/47/qtype_match/subquestion/9/24/6/PresentArmsSquadThreeFront.jpg

Is there some kind of log that will show why it isunable to find the file?

Dobby

In reply to Dobby Spencer

Re: Adding an image to a Quiz Question?

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Dobby, you have not answered my question:
"Can you insert images in the other quiz question types? Is it only with the matching question type that you are having a problem?"
Joseph
In reply to Joseph Rézeau

Re: Adding an image to a Quiz Question?

by Dobby Spencer -

Joseph,

I apologize for missing the second question. I can insert images in other quiz question types and they all show ok. I have tested True/False, Short Answer and Multiple Choice. I noticed that the URL for the images under the matching question type looks slightly different from the others:

Question Type URL

True/False

http://localhost/pluginfile.php/47/question/questiontext/0/30/30/Sunset.jpg

Short Answer

http://localhost/pluginfile.php/47/question/questiontext/0/31/31/Magazine.gif

Multiple Choice

http://localhost/pluginfile.php/47/question/questiontext/0/32/32/Upper%20Receiver.gif

Matching

http://localhost/pluginfile.php/47/qtype_match/subquestion/0/33/8/Sunset.jpg

For the matching question type, the URL has /qtype_match/subquestion whilt the others have /question/questiontext. Not sure if this is a factor but I thought I'd mention it.

In reply to Dobby Spencer

Re: Adding an image to a Quiz Question?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
This is a known bug that Dongsheng fixed the other day. Try upgrading.
In reply to Tim Hunt

Re: Adding an image to a Quiz Question?

by Dobby Spencer -
Thank you Tim. I will do the upgrade and advise on the outcome.