@doenet/v06-to-v07 0.7.0-beta4 → 0.7.0-beta6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +104 -24
- package/index.js.map +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -80628,9 +80628,8 @@ class SectioningComponent extends BlockComponent {
|
|
|
80628
80628
|
let attributes = super.createAttributesObject();
|
|
80629
80629
|
attributes.aggregateScores = {
|
|
80630
80630
|
createComponentOfType: "boolean",
|
|
80631
|
-
createStateVariable: "
|
|
80632
|
-
defaultValue: false
|
|
80633
|
-
public: true
|
|
80631
|
+
createStateVariable: "aggregateScoresPreliminary",
|
|
80632
|
+
defaultValue: false
|
|
80634
80633
|
};
|
|
80635
80634
|
attributes.weight = {
|
|
80636
80635
|
createComponentOfType: "number",
|
|
@@ -81088,6 +81087,29 @@ class SectioningComponent extends BlockComponent {
|
|
|
81088
81087
|
return { setValue: { level } };
|
|
81089
81088
|
}
|
|
81090
81089
|
};
|
|
81090
|
+
stateVariableDefinitions.aggregateScores = {
|
|
81091
|
+
public: true,
|
|
81092
|
+
shadowingInstructions: {
|
|
81093
|
+
createComponentOfType: "boolean"
|
|
81094
|
+
},
|
|
81095
|
+
returnDependencies: () => ({
|
|
81096
|
+
aggregateScoresPreliminary: {
|
|
81097
|
+
dependencyType: "stateVariable",
|
|
81098
|
+
variableName: "aggregateScoresPreliminary"
|
|
81099
|
+
},
|
|
81100
|
+
sectionWideCheckWork: {
|
|
81101
|
+
dependencyType: "stateVariable",
|
|
81102
|
+
variableName: "sectionWideCheckWork"
|
|
81103
|
+
}
|
|
81104
|
+
}),
|
|
81105
|
+
definition({ dependencyValues }) {
|
|
81106
|
+
return {
|
|
81107
|
+
setValue: {
|
|
81108
|
+
aggregateScores: dependencyValues.aggregateScoresPreliminary || dependencyValues.sectionWideCheckWork
|
|
81109
|
+
}
|
|
81110
|
+
};
|
|
81111
|
+
}
|
|
81112
|
+
};
|
|
81091
81113
|
stateVariableDefinitions.creditAchieved = {
|
|
81092
81114
|
public: true,
|
|
81093
81115
|
shadowingInstructions: {
|
|
@@ -81371,10 +81393,6 @@ class SectioningComponent extends BlockComponent {
|
|
|
81371
81393
|
dependencyType: "stateVariable",
|
|
81372
81394
|
variableName: "sectionWideCheckWork"
|
|
81373
81395
|
},
|
|
81374
|
-
aggregateScores: {
|
|
81375
|
-
dependencyType: "stateVariable",
|
|
81376
|
-
variableName: "aggregateScores"
|
|
81377
|
-
},
|
|
81378
81396
|
sectionAncestor: {
|
|
81379
81397
|
dependencyType: "ancestor",
|
|
81380
81398
|
componentType: "_sectioningComponent",
|
|
@@ -81386,22 +81404,15 @@ class SectioningComponent extends BlockComponent {
|
|
|
81386
81404
|
variableNames: ["suppressAnswerSubmitButtons"]
|
|
81387
81405
|
}
|
|
81388
81406
|
}),
|
|
81389
|
-
definition({ dependencyValues
|
|
81407
|
+
definition({ dependencyValues }) {
|
|
81390
81408
|
let warnings = [];
|
|
81391
81409
|
let createSubmitAllButton = false;
|
|
81392
81410
|
let suppressAnswerSubmitButtons = false;
|
|
81393
81411
|
if (dependencyValues.documentAncestor.stateValues.suppressAnswerSubmitButtons || dependencyValues.sectionAncestor && dependencyValues.sectionAncestor.stateValues.suppressAnswerSubmitButtons) {
|
|
81394
81412
|
suppressAnswerSubmitButtons = true;
|
|
81395
81413
|
} else if (dependencyValues.sectionWideCheckWork) {
|
|
81396
|
-
|
|
81397
|
-
|
|
81398
|
-
suppressAnswerSubmitButtons = true;
|
|
81399
|
-
} else {
|
|
81400
|
-
warnings.push({
|
|
81401
|
-
message: `Cannot create submit all button for <section> because it doesn't aggregate scores.`,
|
|
81402
|
-
level: 1
|
|
81403
|
-
});
|
|
81404
|
-
}
|
|
81414
|
+
createSubmitAllButton = true;
|
|
81415
|
+
suppressAnswerSubmitButtons = true;
|
|
81405
81416
|
}
|
|
81406
81417
|
return {
|
|
81407
81418
|
setValue: {
|
|
@@ -100352,6 +100363,8 @@ class Input extends InlineComponent {
|
|
|
100352
100363
|
"justSubmitted",
|
|
100353
100364
|
"creditAchieved",
|
|
100354
100365
|
"showCorrectness",
|
|
100366
|
+
"submitLabel",
|
|
100367
|
+
"submitLabelNoCorrectness",
|
|
100355
100368
|
"numAttemptsLeft",
|
|
100356
100369
|
"creditIsReducedByAttempt",
|
|
100357
100370
|
"numIncorrectSubmissions",
|
|
@@ -100482,6 +100495,42 @@ class Input extends InlineComponent {
|
|
|
100482
100495
|
return { setValue: { showCorrectness } };
|
|
100483
100496
|
}
|
|
100484
100497
|
};
|
|
100498
|
+
stateVariableDefinitions.submitLabel = {
|
|
100499
|
+
forRenderer: true,
|
|
100500
|
+
returnDependencies: () => ({
|
|
100501
|
+
answerAncestor: {
|
|
100502
|
+
dependencyType: "stateVariable",
|
|
100503
|
+
variableName: "answerAncestor"
|
|
100504
|
+
}
|
|
100505
|
+
}),
|
|
100506
|
+
definition({ dependencyValues }) {
|
|
100507
|
+
let submitLabel;
|
|
100508
|
+
if (dependencyValues.answerAncestor) {
|
|
100509
|
+
submitLabel = dependencyValues.answerAncestor.stateValues.submitLabel;
|
|
100510
|
+
} else {
|
|
100511
|
+
submitLabel = "";
|
|
100512
|
+
}
|
|
100513
|
+
return { setValue: { submitLabel } };
|
|
100514
|
+
}
|
|
100515
|
+
};
|
|
100516
|
+
stateVariableDefinitions.submitLabelNoCorrectness = {
|
|
100517
|
+
forRenderer: true,
|
|
100518
|
+
returnDependencies: () => ({
|
|
100519
|
+
answerAncestor: {
|
|
100520
|
+
dependencyType: "stateVariable",
|
|
100521
|
+
variableName: "answerAncestor"
|
|
100522
|
+
}
|
|
100523
|
+
}),
|
|
100524
|
+
definition({ dependencyValues }) {
|
|
100525
|
+
let submitLabelNoCorrectness;
|
|
100526
|
+
if (dependencyValues.answerAncestor) {
|
|
100527
|
+
submitLabelNoCorrectness = dependencyValues.answerAncestor.stateValues.submitLabelNoCorrectness;
|
|
100528
|
+
} else {
|
|
100529
|
+
submitLabelNoCorrectness = "";
|
|
100530
|
+
}
|
|
100531
|
+
return { setValue: { submitLabelNoCorrectness } };
|
|
100532
|
+
}
|
|
100533
|
+
};
|
|
100485
100534
|
stateVariableDefinitions.numAttemptsLeft = {
|
|
100486
100535
|
forRenderer: true,
|
|
100487
100536
|
returnDependencies: () => ({
|
|
@@ -123221,7 +123270,7 @@ function returnStandardAnswerAttributes() {
|
|
|
123221
123270
|
disableAfterCorrect: {
|
|
123222
123271
|
createComponentOfType: "boolean",
|
|
123223
123272
|
createStateVariable: "disableAfterCorrect",
|
|
123224
|
-
defaultValue:
|
|
123273
|
+
defaultValue: true,
|
|
123225
123274
|
public: true
|
|
123226
123275
|
},
|
|
123227
123276
|
submitLabel: {
|
|
@@ -130669,10 +130718,8 @@ let Graph$1 = class Graph extends BlockComponent {
|
|
|
130669
130718
|
};
|
|
130670
130719
|
attributes.fixAxes = {
|
|
130671
130720
|
createComponentOfType: "boolean",
|
|
130672
|
-
createStateVariable: "
|
|
130673
|
-
defaultValue: false
|
|
130674
|
-
public: true,
|
|
130675
|
-
forRenderer: true
|
|
130721
|
+
createStateVariable: "fixAxesPreliminary",
|
|
130722
|
+
defaultValue: false
|
|
130676
130723
|
};
|
|
130677
130724
|
attributes.grid = {
|
|
130678
130725
|
createComponentOfType: "text",
|
|
@@ -130692,6 +130739,13 @@ let Graph$1 = class Graph extends BlockComponent {
|
|
|
130692
130739
|
defaultValue: false,
|
|
130693
130740
|
public: true
|
|
130694
130741
|
};
|
|
130742
|
+
attributes.description = {
|
|
130743
|
+
createComponentOfType: "text",
|
|
130744
|
+
createStateVariable: "description",
|
|
130745
|
+
defaultValue: "",
|
|
130746
|
+
public: true,
|
|
130747
|
+
forRenderer: true
|
|
130748
|
+
};
|
|
130695
130749
|
return attributes;
|
|
130696
130750
|
}
|
|
130697
130751
|
static returnChildGroups() {
|
|
@@ -130740,6 +130794,30 @@ let Graph$1 = class Graph extends BlockComponent {
|
|
|
130740
130794
|
stateVariableDefinitions,
|
|
130741
130795
|
returnRoundingStateVariableDefinitions()
|
|
130742
130796
|
);
|
|
130797
|
+
stateVariableDefinitions.fixAxes = {
|
|
130798
|
+
forRenderer: true,
|
|
130799
|
+
public: true,
|
|
130800
|
+
shadowingInstructions: {
|
|
130801
|
+
createComponentOfType: "boolean"
|
|
130802
|
+
},
|
|
130803
|
+
returnDependencies: () => ({
|
|
130804
|
+
fixAxesPreliminary: {
|
|
130805
|
+
dependencyType: "stateVariable",
|
|
130806
|
+
variableName: "fixAxesPreliminary"
|
|
130807
|
+
},
|
|
130808
|
+
fixed: {
|
|
130809
|
+
dependencyType: "stateVariable",
|
|
130810
|
+
variableName: "fixed"
|
|
130811
|
+
}
|
|
130812
|
+
}),
|
|
130813
|
+
definition({ dependencyValues }) {
|
|
130814
|
+
return {
|
|
130815
|
+
setValue: {
|
|
130816
|
+
fixAxes: dependencyValues.fixAxesPreliminary || dependencyValues.fixed
|
|
130817
|
+
}
|
|
130818
|
+
};
|
|
130819
|
+
}
|
|
130820
|
+
};
|
|
130743
130821
|
stateVariableDefinitions.xLabel = {
|
|
130744
130822
|
forRenderer: true,
|
|
130745
130823
|
public: true,
|
|
@@ -205463,14 +205541,16 @@ let PublicDoenetMLCore$1 = class PublicDoenetMLCore2 {
|
|
|
205463
205541
|
this.core?.handleNavigatingToComponent({ componentIdx: componentIdx2, hash });
|
|
205464
205542
|
}
|
|
205465
205543
|
/**
|
|
205466
|
-
* Call submitAnswer on all answers in the document
|
|
205544
|
+
* Call submitAnswer on all answers in the document,
|
|
205545
|
+
* then immediately save all document state to the database
|
|
205467
205546
|
*/
|
|
205468
205547
|
async submitAllAnswers() {
|
|
205469
|
-
|
|
205548
|
+
await this.core?.requestAction({
|
|
205470
205549
|
componentIdx: this.core.documentIdx,
|
|
205471
205550
|
actionName: "submitAllAnswers",
|
|
205472
205551
|
args: {}
|
|
205473
205552
|
});
|
|
205553
|
+
await this.core?.saveImmediately();
|
|
205474
205554
|
}
|
|
205475
205555
|
/**
|
|
205476
205556
|
* Immediately save all document state to the database,
|