Insert image in Multiple Choice question?

52 views
Skip to first unread message

jst...@buffalo.edu

unread,
Jan 25, 2019, 5:25:39 PM1/25/19
to General Open edX discussion
How do I insert a simple image into a Multiple Choice question?   Also, what are the best resources to learn these simple operations of Open edX?

Mohd Khalid

unread,
Feb 25, 2019, 6:23:07 AM2/25/19
to General Open edX discussion
1) Upload your image using 'Files and uplaods' option in CMS.
2) Copy the web URL of the image added.
3) Go to MCQ edit option and use the <img> tag to insert image into question as follows:

                              [YOUR QUESTION TEXT]

                                      <img src="web URL of image to be inserted without IP address">
                                             e.g. <img src="/asset...........image31.png" height="250" width="500"/><br/><br/>

                               (  )    Option A
                               (x)    Option B
                               (  )    Option C
                               (  )    Option D
   
                                [explanation]
                                            write any explanation here if needed.
 
                                [explanation]

Matthieu Pinard

unread,
Feb 26, 2019, 11:21:21 AM2/26/19
to edx-...@googlegroups.com
Hi,

it looks like the tag img is not supported with MCQ. If the question has an image, I would ask the question in a HTML component and list the choices in a MCQ component below the html one.

Cheers,
Matthieu

--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/da751958-37fe-4e65-bf26-60a1a81b209d%40googlegroups.com.

Mohd Khalid

unread,
Feb 26, 2019, 2:07:27 PM2/26/19
to edx-...@googlegroups.com
By default there are no options in the MCQ component using which we can add an image. Although, if we want to add one, we have to manually write <img src="/asset.........xyz.png"/> HTML tag within the MCQ component as I mentioned in the trailing mail. 
 
There is no need to add an extra HTML component for doing the same. 

Thanks and regards 
Khalid 

You received this message because you are subscribed to a topic in the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/9DD9876A-CF26-460C-8289-C3B6C9BD084D%40pinard.no.

Colin Fredericks

unread,
Feb 26, 2019, 5:20:16 PM2/26/19
to General Open edX discussion
Switch to the Advanced editor. Add the image tag into the XML. Works just fine.

<problem>
<multiplechoiceresponse>
  <p>You can use this template as a guide to the simple editor markdown and OLX markup to use for multiple choice problems. Edit this component to replace this template with your own assessment.</p>
  <p><img src="/static/imagename.png" alt="description" /></p>
<label>Add the question text, or prompt, here. This text is required.</label>
<description>You can add an optional tip or note related to the prompt like this. </description>
<choicegroup type="MultipleChoice">
    <choice correct="false">an incorrect answer</choice>
    <choice correct="true">the correct answer</choice>
    <choice correct="false">an incorrect answer</choice>
  </choicegroup>
<solution>
<div class="detailed-solution">
<p>Explanation</p>

<p>Short explanation</p>

</div>
</solution>
</multiplechoiceresponse>
</problem>



XML reference for MCQs:

This also works in every other problem type.
Reply all
Reply to author
Forward
0 new messages