Skip to content

Commit

Permalink
add media to test-cypress and test-viewer
Browse files Browse the repository at this point in the history
  • Loading branch information
dqnykamp committed Oct 3, 2023
1 parent 0df3cbe commit a17adf7
Show file tree
Hide file tree
Showing 21 changed files with 974 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ describe("CobwebPolyline Tag Tests", function () {
<function name="f">2x-x^2/3</function>
</setup>
<copy uri="doenet:cid=bafkreic2ntu5jyvhrm5wnfxngtao35dupv6so547rw32y5hnb4dn2gt4um" name="gradedApplet" function="$f" xmin="-0.8" xmax="7" ymin="-1" ymax="4" width="320px" height="200px" attractThreshold="0.2" showNavigation="false" numIterationsRequired="3" initialValueDx="0.2" x0="1" />
<copy uri="doenet:cid=bafkreiatwotzdmrphuof5j4gsr42jvt266ourxqlpukspkedwe7kfwflze" name="gradedApplet" function="$f" xmin="-0.8" xmax="7" ymin="-1" ymax="4" width="320px" height="200px" attractThreshold="0.2" showNavigation="false" numIterationsRequired="3" initialValueDx="0.2" x0="1" />
`,
},
Expand Down Expand Up @@ -2394,7 +2394,7 @@ describe("CobwebPolyline Tag Tests", function () {
.should("not.exist");
});

it("cobweb intro tutorial", () => {
it.only("cobweb intro tutorial", () => {
cy.window().then(async (win) => {
win.postMessage(
{
Expand Down
16 changes: 8 additions & 8 deletions packages/test-cypress/cypress/e2e/tagSpecific/copy.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -11946,7 +11946,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<copy uri="doenet:cid=bafkreiewcn63sugv6o6ernb2vljtt4d36zqn5pjxxy77qwfz2frejwnzhm" name="greetings" />
<copy uri="doenet:cid=bafkreifbeoxzphrpufrirccso2l4rtqgbcgli2bhbdzmccaopj3u6fkmdy" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>

Expand Down Expand Up @@ -11992,7 +11992,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<copy uri="doenet:cid=bafkreidpoi2m2sr52dm7hca3zlnnpm4vdgmtse7jx74zfvaee2ogfxnyqy" name="greetings" />
<copy uri="doenet:cid=bafkreici7lwt3yywhf75ypbcu62bumszzrxqgukaetwywajjbbnh45zfqa" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>

Expand Down Expand Up @@ -12056,7 +12056,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<section copyFromURI="doenet:cid=bafkreidpoi2m2sr52dm7hca3zlnnpm4vdgmtse7jx74zfvaee2ogfxnyqy" name="greetings" />
<section copyFromURI="doenet:cid=bafkreici7lwt3yywhf75ypbcu62bumszzrxqgukaetwywajjbbnh45zfqa" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>

Expand Down Expand Up @@ -12120,7 +12120,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<copy uri="doenet:cid=bafkreickzviscuc3v3bodp73qfgarfexcasf6txflg5huseru2qdpylaou" name="greetings" />
<copy uri="doenet:cid=bafkreigqo7xagr2hyfacifhzyrlnzbrd3aqpgs2rvt5ednsm3qdbk7aduy" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>

Expand Down Expand Up @@ -12213,7 +12213,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<section copyFromURI="doenet:cid=bafkreickzviscuc3v3bodp73qfgarfexcasf6txflg5huseru2qdpylaou" name="greetings" />
<section copyFromURI="doenet:cid=bafkreigqo7xagr2hyfacifhzyrlnzbrd3aqpgs2rvt5ednsm3qdbk7aduy" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>

Expand Down Expand Up @@ -12306,7 +12306,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<copy uri="doenet:cid=bafkreiccroxlq6rumheoxcs2vfze2h6u6ybi3yx4snhn7asbidbbit6wqa" name="greet" />
<copy uri="doenet:cid=bafkreiblfl6xriye7uuiik6xlnuj3suf3xo236enwidz5wyeew7pcec3ba" name="greet" />

<p>Don't get this 2: <text name="hi">Leave</text></p>

Expand Down Expand Up @@ -12360,7 +12360,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<copy uri="doenet:cid=bafkreic2z7kam3hnfbbpscwurh5lidhmtxmdlxcv7xtewp5mkqq32envae" name="greet" />
<copy uri="doenet:cid=bafkreiatlgd6rb5reyd33tba62rpgpkyy33edxc4z2wkvcgluuqo2gbenu" name="greet" />

<p>Don't get this 2: <text name="hi">Leave</text></p>

Expand Down Expand Up @@ -12420,7 +12420,7 @@ describe("Copy Tag Tests", function () {
{
doenetML: `
<text>a</text>
<section copyfromuri="doenet:cid=bafkreic2z7kam3hnfbbpscwurh5lidhmtxmdlxcv7xtewp5mkqq32envae" name="greet" />
<section copyfromuri="doenet:cid=bafkreiatlgd6rb5reyd33tba62rpgpkyy33edxc4z2wkvcgluuqo2gbenu" name="greet" />

<p>Don't get this 2: <text name="hi">Leave</text></p>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<p name="p">The <alert>DoenetML</alert> of a graph:</p>

<pre><displayDoenetML>
<graph>
<point name="P" />
</graph>
</displayDoenetML></pre>

<p>The DoenetML of the p:</p>
<pre>$p.doenetML</pre>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<variantControl numVariants="2" variantNames="first last" />
<select>
<option selectForVariants="first">first</option>
<option selectForVariants="last">last</option>
</select>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<section>
<section copyFromUri="doenet:cid=bafkreici7lwt3yywhf75ypbcu62bumszzrxqgukaetwywajjbbnh45zfqa" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<section boxed>
<title>Copied content</title>
<copy uri="doenet:cid=bafkreia3r7nyo7bvh3xnx47jvrb7y755a2xg3yhayg5jllknuedks4oalm"
name="external"/>
</section>

<p>Grab the DoenetML from external p:</p>

<pre>$(external/p.doenetML)</pre>

<p>DoenetML of single line:</p>
<pre><displayDoenetML>
<text>hi</text>
</displayDoenetML></pre>
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<module name="cobwebAppletGraded">
<setup>
<customAttribute componentType="function" attribute="function" defaultValue="x(4-x)"
assignNames="f" />
<customAttribute componentType="number" attribute="x0" defaultValue="1" assignNames="x0" />
<customAttribute componentType="number" attribute="initialInitialValue" defaultValue="0"
assignNames="initialInitialValue" />
<customAttribute componentType="number" attribute="initialValueDx" defaultValue="0.5"
assignNames="initialValueDx" />
<customAttribute componentType="number" attribute="initialValueOffset" defaultValue="0"
assignNames="initialValueOffset" />
<customAttribute componentType="number" attribute="numIterationsRequired" defaultValue="0"
assignNames="numIterationsRequired" />
<customAttribute componentType="_componentSize" attribute="width" defaultValue="300px"
assignNames="width" />
<customAttribute componentType="_componentSize" attribute="height" defaultValue="300px"
assignNames="height" />
<customAttribute componentType="number" attribute="xmin" defaultValue="-10" assignNames="xmin" />
<customAttribute componentType="number" attribute="xmax" defaultValue="10" assignNames="xmax" />
<customAttribute componentType="number" attribute="ymin" defaultValue="-10" assignNames="ymin" />
<customAttribute componentType="number" attribute="ymax" defaultValue="10" assignNames="ymax" />
<customAttribute componentType="boolean" attribute="showNavigation" defaultValue="true"
assignNames="showNavigation" />
<customAttribute componentType="number" attribute="attractThreshold" defaultValue="0.5"
assignNames="attractThreshold" />
<customAttribute componentType="math" attribute="variable" defaultValue="x"
assignNames="variable" />
<customAttribute componentType="math" attribute="timeVariable" defaultValue="n"
assignNames="timeVariable" />
<customAttribute componentType="boolean" attribute="checkInitialCondition" defaultValue="true"
assignNames="checkInitialCondition" />
<customAttribute componentType="number" attribute="initialConditionWeight" defaultValue="1"
assignNames="initialConditionWeight" />
<customAttribute componentType="number" attribute="cobwebbingWeight" defaultValue="1"
assignNames="cobwebbingWeight" />
<customAttribute componentType="boolean" attribute="showCalculatedValues" defaultValue="true"
assignNames="showCalculatedValues" />
<customAttribute componentType="text" attribute="grid" defaultValue="none" assignNames="grid" />
<customAttribute componentType="point" attribute="defaultPoint" defaultValue=""
assignNames="defaultPoint" />
</setup>

<copy
uri="doenet:cid=bafkreighf6sivfiy44rjw6ogye222eugueeg2lxuijobo4bvyyjxxceaqy&doenetId=2dnQm1B4zsbGzreEn0GKa"
name="cobwebApplet" function="$f" x0="$x0" initialInitialValue="$initialInitialValue"
initialValueDx="$initialValueDx" initialValueOffset="$initialValueOffset"
numIterationsRequired="$numIterationsRequired" width="$width" height="$height" xmin="$xmin"
xmax="$xmax" ymin="$ymin" ymax="$ymax" showNavigation="$showNavigation"
attractThreshold="$attractThreshold" variable="$variable" timeVariable="$timeVariable"
showCalculatedValues="$showCalculatedValues" grid="$grid" defaultPoint="$defaultPoint" />

<conditionalContent condition="$checkInitialCondition">
<p>Initial condition: <answer name="initialCorrect" weight="$initialConditionWeight">
<award>
<when>
<copy source="cobwebApplet/initialCorrect" />
</when>
</award>
<considerAsResponses>
<copy source="cobwebApplet/initialPoint" />
<copy source="cobwebApplet/atLeastOnePoint" />
</considerAsResponses>
</answer>
</p>
</conditionalContent>

<p>Correct cobwebbing: <answer name="correctCobwebbing" weight="$cobwebbingWeight">
<award credit="$(cobwebApplet/fractionCorrectCobweb)">
<when>true</when>
</award>
<considerAsResponses>
<copy prop="numIterateValues" source="cobwebApplet/cobwebPolyline" />
<and>
<copy prop="correctVertices" source="cobwebApplet/cobwebPolyline" />
</and>
<copy prop="vertices" source="cobwebApplet/cobwebPolyline" />
</considerAsResponses>
</answer>
</p>
<feedback condition="$(correctCobwebbing.submittedResponse1) = 1" name="startFeedback">
To start cobwebbing, click the "Add line" button and move the point at the end of the line.
</feedback>
<feedback condition="$(correctCobwebbing.submittedResponse2) = false" name="incorrectFeedback">
At least one point on cobweb plot is incorrect.
</feedback>
<feedback
condition="$(correctCobwebbing.submittedResponse2) = true and $(correctCobwebbing.submittedResponse1) > 1 and $(correctCobwebbing.submittedResponse1) <= $numIterationsRequired"
name="insufficientFeedback"> For full credit, calculate at least $numIterationsRequired iterates
(i.e., to <m>x_{$numIterationsRequired}</m>). </feedback>

</module>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<copy uri="doenet:cid=bafkreifbeoxzphrpufrirccso2l4rtqgbcgli2bhbdzmccaopj3u6fkmdy" name="greetings" />

<p>Don't get this: <text name="hi">Bye</text></p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<section><title>Outer</title>
<p>Intended target: <text name="hi">Hello</text></p>

<p>Five copies:
<copy source="hi" name="c1" />
<copy source="/hi" name="c2" />
<copy source="../hi" name="c3" />
<copy source="../../hi" name="c4" />
<copy source="../../../hi" name="c5" />
</p>

<section name="s" newNamespace><title>New namespace</title>
<p>Local target: <text name="hi">Hola</text></p>
<p>Five copies of local:
<copy source="hi" name="l1" />
<copy source="/s/hi" name="l2" />
<copy source="../s/hi" name="l3" />
<copy source="../../s/hi" name="l4" />
<copy source="../../../s/hi" name="l5" />
</p>
<p>Five copies of base:
<copy source="/hi" name="c1" />
<copy source="../hi" name="c2" />
<copy source="../../hi" name="c3" />
<copy source="../../../hi" name="c4" />
<copy source="../../../../hi" name="c5" />
</p>

<subsection name="s" newNamespace><title>Another new namespace</title>
<p>Local target: <text name="hi">Marhaban</text></p>
<p>Five copies of local:
<copy source="hi" name="l1" />
<copy source="/s/s/hi" name="l2" />
<copy source="../s/hi" name="l3" />
<copy source="../../s/s/hi" name="l4" />
<copy source="../../../s/s/hi" name="l5" />
</p>
<p>Five copies of middle:
<copy source="/s/hi" name="m1" />
<copy source="../hi" name="m2" />
<copy source="../../s/hi" name="m3" />
<copy source="../../../s/hi" name="m4" />
<copy source="../../../../s/hi" name="m5" />
</p>
<p>Five copies of base:
<copy source="/hi" name="c1" />
<copy source="../../hi" name="c2" />
<copy source="../../../hi" name="c3" />
<copy source="../../../../hi" name="c4" />
<copy source="../../../../../hi" name="c5" />
</p>
</subsection>

</section>
</section>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

<copy name="problem1" uri="doenet:CID=bafkreifgmyjuw4m6odukznenshkyfupp3egx6ep3jgnlo747d6s5v7nznu" />

<copy name="problem2" uri="doenet:CID=bafkreide4mismb45mxved2ibfh5jnj75kty7vjz7w6zo7goyxpwr2e7wti" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<problem name="derivativeProblem" newNamespace >
<title>Derivative problem</title>

<p>What is the derivative of <math name="expr">x^2</math>?
<answer>
<award>
<derivative>$expr</derivative>
</award>
</answer>
</p>


</problem>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<title>Animal sounds</title>

<variantControl nvariants="4" variantNames="cat dog mouse fish"/>

<select assignNames="(animal sound)" hide>
<option selectForVariantNames="cat">
<text>cat</text><text>meow</text>
</option>
<option selectForVariantNames="dog">
<text>dog</text><text>woof</text>
</option>
<option selectForVariantNames="mouse">
<text>mouse</text><text>squeak</text>
</option>
<option selectForVariantNames="fish">
<text>fish</text><text>blub</text>
</option>
</select>

<p>What does the $animal say?</p>
<answer name="ans">
<choiceinput randomizeOrder>
<choice credit="$animal=cat" >meow</choice>
<choice credit="$animal=dog" >woof</choice>
<choice credit="$animal=mouse" >squeak</choice>
<choice credit="$animal=fish" >blub</choice>
</choiceinput>
</answer>

<feedback condition="$ans=$sound"><p>That's right, the $animal goes $sound!</p></feedback>
<feedback condition="$ans!=$sound"><p>Try again.</p></feedback>
Loading

0 comments on commit a17adf7

Please sign in to comment.