Skip to content

Commit e6e256f

Browse files
authored
Refactor copies and composites (#2316)
* working toward phasing out copy - macros and copies behave the same way - combine plain macro and plain copy attributes into implicit prop attribute - if no prop, name applies to replacement (no assignNames) - if prop, still applies to copy, use assignNames for pieces * the ability to copy componentIndex from non-standard composites * updateValue, animateFromSequence handle target subnames and subnames component index * Actions always await performUpdate and similar * render composite replacements with commas * assignNames, componentIndex skip only blank children * correctly copy with no-link copies of a prop * aslist attribute for additional composites
1 parent 7d59374 commit e6e256f

File tree

193 files changed

+26161
-24708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+26161
-24708
lines changed

cypress/e2e/AssignedActivity/singlepageActivities.cy.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,9 +1630,9 @@ describe("Single page activity tests", function () {
16301630
const doenetML = `
16311631
<title>A video</title>
16321632
<video youtube="tJ4ypc5L6uU" width="640px" height="360px" name="v" />
1633-
<p>State: <copy prop="state" source="v" assignNames="state" /></p>
1634-
<p>Time: <copy prop="time" source="v" assignNames="time" /></p>
1635-
<p>Duration: <copy prop="duration" source="v" assignNames="duration" /></p>
1633+
<p>State: $v.state{assignNames="state"}</p>
1634+
<p>Time: $v.time{assignNames="time"}</p>
1635+
<p>Duration: $v.duration{assignNames="duration"}</p>
16361636
<p>
16371637
<callAction target="v" actionName="playVideo" name="playAction"><label>Play action</label></callAction>
16381638
<callAction target="v" actionName="pauseVideo" name="pauseAction"><label>Pause action</label></callAction>

cypress/e2e/DoenetML/answerValidation/errorinnumbers.cy.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ describe("Allow error in numbers validation tests", function () {
1515
<p><math>log(32x+c)</math>
1616
<answer>
1717
<award allowederrorinnumbers="0.00001">
18-
<copy target="_math1" />
18+
$_math1
1919
</award>
2020
<award credit="0.8" allowederrorinnumbers="0.0001">
21-
<copy target="_math1" />
21+
$_math1
2222
</award>
2323
<award credit="0.6" allowederrorinnumbers="0.001">
24-
<copy target="_math1" />
24+
$_math1
2525
</award>
2626
</answer>
2727
</p>
@@ -179,13 +179,13 @@ describe("Allow error in numbers validation tests", function () {
179179
<p><math>log(32x+c)</math>
180180
<answer>
181181
<award allowederrorinnumbers="0.00001" allowederrorisabsolute="true">
182-
<copy target="_math1" />
182+
$_math1
183183
</award>
184184
<award credit="0.8" allowederrorinnumbers="0.0001" allowederrorisabsolute="true">
185-
<copy target="_math1" />
185+
$_math1
186186
</award>
187187
<award credit="0.6" allowederrorinnumbers="0.001" allowederrorisabsolute="true">
188-
<copy target="_math1" />
188+
$_math1
189189
</award>
190190
</answer>
191191
</p>
@@ -336,10 +336,10 @@ describe("Allow error in numbers validation tests", function () {
336336
<p><math simplify>10 exp(7x^2/(3-sqrt(y)))</math>
337337
<answer>
338338
<award allowederrorinnumbers="0.0000001">
339-
<copy target="_math1" />
339+
$_math1
340340
</award>
341341
<award credit="0.6" allowederrorinnumbers="0.0001">
342-
<copy target="_math1" />
342+
$_math1
343343
</award>
344344
</answer>
345345
</p>
@@ -416,15 +416,15 @@ describe("Allow error in numbers validation tests", function () {
416416
<p><math>10x^2-4</math>
417417
<answer>
418418
<award allowederrorinnumbers="0.0001">
419-
<copy target="_math1" />
419+
$_math1
420420
</award>
421421
</answer>
422422
</p>
423423
424424
<p>Allow for error in exponents
425425
<answer>
426426
<award allowederrorinnumbers="0.0001" includeerrorinnumberexponents>
427-
<copy target="_math1" />
427+
$_math1
428428
</award>
429429
</answer>
430430
</p>
@@ -547,13 +547,13 @@ describe("Allow error in numbers validation tests", function () {
547547
<p><math>log(32x+c)</math>
548548
<answer>
549549
<award symbolicequality="true" allowederrorinnumbers="0.00001" simplifyOnCompare>
550-
<copy target="_math1" />
550+
$_math1
551551
</award>
552552
<award credit="0.8" symbolicequality="true" allowederrorinnumbers="0.0001" simplifyOnCompare>
553-
<copy target="_math1" />
553+
$_math1
554554
</award>
555555
<award credit="0.6" symbolicequality="true" allowederrorinnumbers="0.001" simplifyOnCompare>
556-
<copy target="_math1" />
556+
$_math1
557557
</award>
558558
</answer>
559559
</p>
@@ -853,13 +853,13 @@ describe("Allow error in numbers validation tests", function () {
853853
<p><math>10000 exp(7x^2/(0.00003-sqrt(y)))</math>
854854
<answer symbolicequality simplifyOnCompare>
855855
<award allowederrorinnumbers="0.0000001" >
856-
<copy target="_math1" />
856+
$_math1
857857
</award>
858858
<award credit="0.8" allowederrorinnumbers="0.000001">
859-
<copy target="_math1" />
859+
$_math1
860860
</award>
861861
<award credit="0.6" allowederrorinnumbers="0.00001">
862-
<copy target="_math1" />
862+
$_math1
863863
</award>
864864
</answer>
865865
</p>
@@ -990,13 +990,13 @@ describe("Allow error in numbers validation tests", function () {
990990
<p><math simplify>10000 exp(7x^2/(0.00003-sqrt(y)))</math>
991991
<answer>
992992
<award symbolicequality="true" allowederrorinnumbers="0.0000001" allowederrorisabsolute simplifyOnCompare>
993-
<copy target="_math1" />
993+
$_math1
994994
</award>
995995
<award symbolicequality="true" credit="0.8" allowederrorinnumbers="0.000001" allowederrorisabsolute simplifyOnCompare>
996-
<copy target="_math1" />
996+
$_math1
997997
</award>
998998
<award symbolicequality="true" credit="0.6" allowederrorinnumbers="0.00001" allowederrorisabsolute simplifyOnCompare>
999-
<copy target="_math1" />
999+
$_math1
10001000
</award>
10011001
</answer>
10021002
</p>
@@ -1137,15 +1137,15 @@ describe("Allow error in numbers validation tests", function () {
11371137
<p><math simplify>10x^2-4</math>
11381138
<answer>
11391139
<award symbolicequality="true" allowederrorinnumbers="0.0001" simplifyOnCompare>
1140-
<copy target="_math1" />
1140+
$_math1
11411141
</award>
11421142
</answer>
11431143
</p>
11441144
11451145
<p>Allow for error in exponents
11461146
<answer>
11471147
<award symbolicequality="true" allowederrorinnumbers="0.0001" includeerrorinnumberexponents simplifyOnCompare>
1148-
<copy target="_math1" />
1148+
$_math1
11491149
</award>
11501150
</answer>
11511151
</p>
@@ -1268,7 +1268,7 @@ describe("Allow error in numbers validation tests", function () {
12681268
<p><math>2.15234262pi+e*25.602348230</math>
12691269
<answer>
12701270
<award symbolicequality="true" allowederrorinnumbers="0.001">
1271-
<copy target="_math1" />
1271+
$_math1
12721272
</award>
12731273
</answer>
12741274
</p>
@@ -1390,7 +1390,7 @@ describe("Allow error in numbers validation tests", function () {
13901390
<p><math>sin(2pi+1x+4x+pi+6)</math>
13911391
<answer>
13921392
<award symbolicequality="true" allowederrorinnumbers="0.001" simplifyOnCompare="numbersPreserveOrder">
1393-
<copy target="_math1" />
1393+
$_math1
13941394
</award>
13951395
</answer>
13961396
</p>
@@ -1500,7 +1500,7 @@ describe("Allow error in numbers validation tests", function () {
15001500
<p><math>sin(2pi+1x+4x+pi+6)</math>
15011501
<answer>
15021502
<award symbolicequality="true" allowederrorinnumbers="0.001" simplifyOnCompare="numbers">
1503-
<copy target="_math1" />
1503+
$_math1
15041504
</award>
15051505
</answer>
15061506
</p>
@@ -1611,7 +1611,7 @@ describe("Allow error in numbers validation tests", function () {
16111611
<p><math>sin(2pi+1x+4x+pi+6)</math>
16121612
<answer>
16131613
<award symbolicequality="true" allowederrorinnumbers="0.001" simplifyOnCompare="full">
1614-
<copy target="_math1" />
1614+
$_math1
16151615
</award>
16161616
</answer>
16171617
</p>
@@ -1722,7 +1722,7 @@ describe("Allow error in numbers validation tests", function () {
17221722
<p><math>(log(32x+c), 42)</math>
17231723
<answer matchPartial>
17241724
<award allowederrorinnumbers="0.001">
1725-
<copy target="_math1" />
1725+
$_math1
17261726
</award>
17271727
</answer>
17281728
</p>
@@ -1824,7 +1824,7 @@ describe("Allow error in numbers validation tests", function () {
18241824
<p><math unordered>(42, log(32x+c))</math>
18251825
<answer matchPartial>
18261826
<award allowederrorinnumbers="0.001">
1827-
<copy target="_math1" />
1827+
$_math1
18281828
</award>
18291829
</answer>
18301830
</p>

0 commit comments

Comments
 (0)