Skip to content

Commit

Permalink
bugfixes (Doenet#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
dqnykamp authored Mar 8, 2023
1 parent f2d878d commit 1a51537
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
1 change: 1 addition & 0 deletions cypress/e2e/AssignedActivity/multipageActivities.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,7 @@ describe('Multipage activity tests', function () {

cy.get('[data-test="Assign Activity"]').click();
cy.get('[data-test="Unassign Activity"]').should('be.visible')
cy.wait(100);

cy.signin({ userId: studentUserId })

Expand Down
20 changes: 10 additions & 10 deletions cypress/e2e/DoenetML/tagSpecific/samplerandomnumbers.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ describe('SampleRandomNumbers Tag Tests', function () {
expect(me.math.variance(sample1numbers, 'uncorrected')).closeTo(10 ** 2 / 12, 3)

expect(me.math.mean(sample2numbers)).closeTo(0, 1)
expect(me.math.variance(sample2numbers, 'uncorrected')).closeTo(16, 4)
expect(me.math.variance(sample2numbers, 'uncorrected')).closeTo(16, 6)

});

Expand Down Expand Up @@ -2039,7 +2039,7 @@ describe('SampleRandomNumbers Tag Tests', function () {

cy.get('#\\/_text1').should('have.text', 'a') //wait for page to load


cy.window().then(async (win) => {
let stateVariables = await win.returnAllStateVariables1();

Expand All @@ -2048,15 +2048,15 @@ describe('SampleRandomNumbers Tag Tests', function () {
let n3 = stateVariables["/n3"].stateValues.value;
let n4 = stateVariables["/n4"].stateValues.value;

cy.get('#\\/n1').should('have.text', String(Math.round(n1*10**8)/10**8))
cy.get('#\\/n2').should('have.text', String(Math.round(n2*10**1)/10**1))
cy.get('#\\/n3').should('have.text', String(Math.round(n3*10**3)/10**3))
cy.get('#\\/n4').should('have.text', String(n4)+".0")
cy.get('#\\/n1').should('have.text', String(Math.round(n1 * 10 ** 8) / 10 ** 8))
cy.get('#\\/n2').should('have.text', String(Math.round(n2 * 10 ** 1) / 10 ** 1))
cy.get('#\\/n3').should('have.text', String(Math.round(n3 * 10 ** 3) / 10 ** 3))
cy.get('#\\/n4').should('have.text', String(n4) + ".0")

cy.get('#\\/n1a').should('have.text', String(Math.round(n1*10**8)/10**8))
cy.get('#\\/n2a').should('have.text', String(Math.round(n2*10**1)/10**1))
cy.get('#\\/n3a').should('have.text', String(Math.round(n3*10**3)/10**3))
cy.get('#\\/n4a').should('have.text', String(n4)+".0")
cy.get('#\\/n1a').should('have.text', String(Math.round(n1 * 10 ** 8) / 10 ** 8))
cy.get('#\\/n2a').should('have.text', String(Math.round(n2 * 10 ** 1) / 10 ** 1))
cy.get('#\\/n3a').should('have.text', String(Math.round(n3 * 10 ** 3) / 10 ** 3))
cy.get('#\\/n4a').should('have.text', String(n4) + ".0")

});

Expand Down
2 changes: 1 addition & 1 deletion src/Viewer/renderers/mathInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ export default function MathInput(props) {
textareaRef.current.disabled = SVs.disabled;
textareaRef.current.addEventListener("focusout", (e) => {
let keyboard = document.getElementById("keyboard");
if (keyboard.contains(e.relatedTarget)) {
if (keyboard?.contains(e.relatedTarget)) {
e.target.focus();
} else {
// remove focus
Expand Down
2 changes: 1 addition & 1 deletion src/_utils/activityUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export function parseActivityDefinition(activityDefDoenetML) {
}

if (page.children.length > 0) {
let pageDoenetML = activityDefDoenetML.slice(page.range.openEnd + 1, page.range.closeBegin);
let pageDoenetML = activityDefDoenetML.slice(page.range.openEnd, page.range.closeBegin);

if (page.children[0].componentType?.toLowerCase() !== "document") {
// add <docoument> around page
Expand Down

0 comments on commit 1a51537

Please sign in to comment.