oat-sa / qti-sdk

A QTI (Question & Test Interoperability) Software Development Kit for PHP
http://www.taotesting.com
GNU General Public License v2.0
82 stars 32 forks source link

img tags do not appear when converted in HTML #196

Open QuentinBeneylu opened 4 years ago

QuentinBeneylu commented 4 years ago

When using the XhtmlRenderingEngine to render this XML in HTML, the img tags disappear.

XML :

<?xml version="1.0" encoding="UTF-8"?>
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p2" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p2 http://www.imsglobal.org/xsd/qti/qtiv2p2/imsqti_v2p2.xsd" identifier="i15931796724230158" title="tableau à double entrée" label="tableau à double entrée" xml:lang="en-US" adaptive="false" timeDependent="false" toolName="TAO" toolVersion="3.3.0-sprint73">
  <responseDeclaration identifier="RESPONSE" cardinality="multiple" baseType="directedPair"/>
  <outcomeDeclaration identifier="SCORE" cardinality="single" baseType="float" normalMaximum="0"/>
  <outcomeDeclaration identifier="MAXSCORE" cardinality="single" baseType="float">
    <defaultValue>
      <value>0</value>
    </defaultValue>
  </outcomeDeclaration>
  <itemBody>
    <div class="grid-row">
      <div class="col-12">
        <matchInteraction responseIdentifier="RESPONSE" shuffle="false" maxAssociations="0" minAssociations="0">
          <prompt>Consigne</prompt>
          <simpleMatchSet>
            <simpleAssociableChoice identifier="choice_1" fixed="false" showHide="show" matchMax="0" matchMin="0">test</simpleAssociableChoice>
            <simpleAssociableChoice identifier="choice_2" fixed="false" showHide="show" matchMax="0" matchMin="0">
              <img src="/api/media-files/dbba3437-b7ba-11ea-87ea-c4c9a5dc6151" alt="8d0db8228088942bc288f9a2740fa8fd.png"/>
            </simpleAssociableChoice>
          </simpleMatchSet>
          <simpleMatchSet>
            <simpleAssociableChoice identifier="choice_3" fixed="false" showHide="show" matchMax="0" matchMin="0">
              <img src="/api/media-files/dbba6d25-b7ba-11ea-87ea-c4c9a5dc6151" alt="8d0db8228088942bc288f9a2740fa8fd.png"/>
            </simpleAssociableChoice>
            <simpleAssociableChoice identifier="choice_4" fixed="false" showHide="show" matchMax="0" matchMin="0">
              <img src="/api/media-files/dbba8074-b7ba-11ea-87ea-c4c9a5dc6151" alt="8d0db8228088942bc288f9a2740fa8fd.png"/>
            </simpleAssociableChoice>
            <simpleAssociableChoice identifier="choice_5" fixed="false" showHide="show" matchMax="0" matchMin="0">
              <img src="/api/media-files/dbbaac06-b7ba-11ea-87ea-c4c9a5dc6151" alt="8d0db8228088942bc288f9a2740fa8fd.png"/>
            </simpleAssociableChoice>
          </simpleMatchSet>
        </matchInteraction>
      </div>
    </div>
  </itemBody>
  <responseProcessing template="http://www.imsglobal.org/question/qti_v2p2/rptemplates/match_correct"/>
</assessmentItem>

HTML :

<div data-identifier="i15931796724230158" data-title="tableau &agrave; double entr&eacute;e" data-label="tableau &agrave; double entr&eacute;e" data-adaptive="false" data-time-dependent="false" class="qti-assessmentItem"><div class="qti-itemBody"><div class="qti-div grid-row">
      <div class="qti-div col-12">
        <div data-response-identifier="RESPONSE" data-shuffle="false" data-max-associations="0" data-min-associations="0" class="qti-matchInteraction"><p class="qti-prompt">Consigne</p><table><tr><th></th><th data-identifier="choice_3" data-fixed="false" data-match-max="0" data-match-min="0" class="qti-simpleAssociableChoice">
              </th><th data-identifier="choice_4" data-fixed="false" data-match-max="0" data-match-min="0" class="qti-simpleAssociableChoice">
              </th><th data-identifier="choice_5" data-fixed="false" data-match-max="0" data-match-min="0" class="qti-simpleAssociableChoice">
              </th></tr><tr><th data-identifier="choice_1" data-fixed="false" data-match-max="0" data-match-min="0" class="qti-simpleAssociableChoice">test</th><td><input type="checkbox"></td><td><input type="checkbox"></td><td><input type="checkbox"></td></tr><tr><th data-identifier="choice_2" data-fixed="false" data-match-max="0" data-match-min="0" class="qti-simpleAssociableChoice">
              </th><td><input type="checkbox"></td><td><input type="checkbox"></td><td><input type="checkbox"></td></tr></table></div>
      </div>
    </div></div></div>
bugalot commented 4 years ago

Hello @QuentinBeneylu is it limited to matchInteraction or more?

QuentinBeneylu commented 4 years ago

I tried with choiceInteraction and textEntryInteraction and it's working.

bugalot commented 4 years ago

Interesting @QuentinBeneylu thanks for reporting this. It seems that we have an isolated bug that we will try to solve as soon as possible.

We are very happy you are using our SDK. I am curious, what is your usage of it? :smiley: