Skip to content

Commit

Permalink
Additional tests for MediaInteraction.
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Sep 26, 2016
1 parent d106300 commit 6165ec2
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,15 @@ public function testRenderingProvider()
GoldilocksRenderingEngine::STYLESHEET_INLINE,
GoldilocksRenderingEngine::CSSCLASS_CONCRETE
),
// mediaInteraction-2
array(
self::samplesDir() . 'custom/items/media_image.xml',
self::samplesDir() . 'rendering/goldilocks/rendered/mediaInteraction-2.html',
GoldilocksRenderingEngine::CONTEXT_STATIC,
GoldilocksRenderingEngine::XMLBASE_IGNORE,
GoldilocksRenderingEngine::STYLESHEET_INLINE,
GoldilocksRenderingEngine::CSSCLASS_CONCRETE
),
);
}

Expand All @@ -277,10 +286,10 @@ public function testRenderingProvider()
$engine->setCssClassPolicy($cssClassPolicy);
$doc = new XmlDocument();
$doc->load(self::samplesDir() . 'custom/items/media_video.xml');
$doc->load(self::samplesDir() . 'custom/items/media_image.xml');
$rendered = $engine->render($doc->getDocumentComponent());
$strRendered = $rendered->saveXML($rendered->documentElement);
file_put_contents(self::samplesDir() . 'rendering/goldilocks/rendered/mediaInteraction-1.html', $strRendered . "\n");
file_put_contents(self::samplesDir() . 'rendering/goldilocks/rendered/mediaInteraction-2.html', $strRendered . "\n");
}*/
}
13 changes: 13 additions & 0 deletions test/samples/custom/items/media_image.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<assessmentItem xmlns="http://www.imsglobal.org/xsd/imsqti_v2p1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imsqti_v2p1 http://www.imsglobal.org/xsd/qti/qtiv2p1/imsqti_v2p1.xsd"
identifier="media-image" title="Media with Image" adaptive="false" timeDependent="false">
<responseDeclaration identifier="RESPONSE" cardinality="single" baseType="integer"/>
<itemBody>
<p>A Media Interaction with some images.</p>
<mediaInteraction responseIdentifier="RESPONSE" autostart="true" minPlays="1" maxPlays="1" loop="false">
<object type="image/jpeg" data="image.jpg" width="640" height="480"/>
</mediaInteraction>
</itemBody>
</assessmentItem>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<div data-identifier="media-image" data-title="Media with Image" data-adaptive="false" data-time-dependent="false" class="qti-assessmentItem"><div class="qti-itemBody"><p class="qti-p">A Media Interaction with some images.</p><div data-response-identifier="RESPONSE" data-autostart="true" data-min-plays="1" data-max-plays="1" data-loop="false" class="qti-mediaInteraction"><img src="image.jpg" width="640" height="480"/></div></div></div>

0 comments on commit 6165ec2

Please sign in to comment.