Skip to content

Commit

Permalink
piecewise function (Doenet#1998)
Browse files Browse the repository at this point in the history
  • Loading branch information
dqnykamp authored Mar 31, 2023
1 parent 0c09423 commit 8d61204
Show file tree
Hide file tree
Showing 7 changed files with 1,714 additions and 18 deletions.
26 changes: 13 additions & 13 deletions cypress/e2e/DoenetML/assignNames/collections.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2321,17 +2321,17 @@ describe('Collection assignName Tests', function () {

cy.log('Move point all three points');
cy.window().then(async (win) => {
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p1",
args: { x: 1, y: 2 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p2",
args: { x: 3, y: 4 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p3",
args: { x: 5, y: 6 }
Expand Down Expand Up @@ -2741,32 +2741,32 @@ describe('Collection assignName Tests', function () {

cy.log('Move point all six points');
cy.window().then(async (win) => {
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/q1",
args: { x: -1, y: -9 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/q2",
args: { x: -2, y: -8 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/q3",
args: { x: -3, y: -7 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/q4",
args: { x: -4, y: -6 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/q5",
args: { x: -5, y: -5 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/q6",
args: { x: -6, y: -4 }
Expand Down Expand Up @@ -3211,22 +3211,22 @@ describe('Collection assignName Tests', function () {

cy.window().then(async (win) => {

await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p1",
args: { x: 4, y: -5 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p2",
args: { x: 3, y: -6 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p3",
args: { x: 2, y: -7 }
});
await win.callAction1({
win.callAction1({
actionName: "movePoint",
componentName: "/p4",
args: { x: 1, y: -8 }
Expand Down
6 changes: 5 additions & 1 deletion cypress/e2e/DoenetML/tagSpecific/feedback.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2280,6 +2280,7 @@ describe('Feedback Tag Tests', function () {
doenetML: `
<text>a</text>
<p>
<graph />
<ul>
<li>
x: <answer name="ans"><mathinput name="mi" />x</answer>
Expand All @@ -2302,7 +2303,10 @@ describe('Feedback Tag Tests', function () {

cy.get("#\\/fb").should('not.exist');

cy.get('#\\/mi textarea').type("y{enter}", { force: true });
// Note: added 100 ms delay because otherwise when Enter key event was received,
// the renderer had not yet gotten signal from core that answer blank was unvalidated,
// which is a necessary condition for Enter to lead to a submitAnswer
cy.get('#\\/mi textarea').type("y{enter}", { force: true, delay: 100 });

cy.get('#\\/_li2 .mjx-mrow').should('contain.text', 'y');
cy.get("#\\/fb").should('have.text', 'You answered at least twice');
Expand Down
Loading

0 comments on commit 8d61204

Please sign in to comment.