diff --git a/packages/doenetml/src/Viewer/DocViewer.tsx b/packages/doenetml/src/Viewer/DocViewer.tsx index f5cb7c4ff..1bb4c2ea8 100644 --- a/packages/doenetml/src/Viewer/DocViewer.tsx +++ b/packages/doenetml/src/Viewer/DocViewer.tsx @@ -36,7 +36,7 @@ export function DocViewer({ userId, activityId = "a", docId = "1", - rendered = true, + render = true, hidden = false, attemptNumber = 1, forceDisable = false, @@ -61,7 +61,7 @@ export function DocViewer({ userId?: string; activityId?: string; docId?: string; - rendered?: boolean; + render?: boolean; hidden?: boolean; attemptNumber?: number; forceDisable?: boolean; @@ -75,18 +75,12 @@ export function DocViewer({ updateCreditAchievedCallback?: Function; setIsInErrorState?: Function; prefixForIds?: string; - render?: boolean; - isCurrent?: boolean; - hideWhenNotCurrent?: boolean; - addVirtualKeyboard?: boolean; - externalVirtualKeyboardProvided?: boolean; location?: any; navigate?: any; linkSettings?: { viewURL: string; editURL: string }; scrollableContainer?: HTMLDivElement | Window; darkMode?: "dark" | "light"; showAnswerTitles?: boolean; - includeVariantSelector?: boolean; }) { const updateRendererSVsWithRecoil = useRecoilCallback( ({ snapshot, set }) => @@ -559,7 +553,7 @@ export function DocViewer({ }, [location, hash, coreCreated.current, coreWorker]); useEffect(() => { - if (hash && documentRenderer && rendered) { + if (hash && documentRenderer && render) { let anchor = hash.slice(1); if ( (!previousLocationKeys.current.includes(location.key) || @@ -571,7 +565,7 @@ export function DocViewer({ } previousLocationKeys.current.push(location.key); } - }, [location, hash, documentRenderer, rendered]); + }, [location, hash, documentRenderer, render]); useEffect(() => { callAction({ @@ -1099,7 +1093,7 @@ export function DocViewer({ //Guard against the possibility that parameters changed while waiting if (coreIdWhenCalled === coreId.current) { - if (rendered) { + if (render) { startCore(initialPass); } else { setStage("readyToCreateCore"); @@ -1334,7 +1328,7 @@ export function DocViewer({ // if we are just starting and the document isn't being rendered, // don't do anything more - if (initialPass && !rendered) { + if (initialPass && !render) { return null; } @@ -1409,9 +1403,9 @@ export function DocViewer({ return null; } - if (stage === "readyToCreateCore" && rendered) { + if (stage === "readyToCreateCore" && render) { startCore(); - } else if (stage === "waitingOnCore" && !rendered && !coreCreated.current) { + } else if (stage === "waitingOnCore" && !render && !coreCreated.current) { // we've moved off this doc, but core is still being created // so reinitialize core reinitializeCoreAndTerminateAnimations(); @@ -1419,7 +1413,7 @@ export function DocViewer({ setStage("readyToCreateCore"); } - if (hidden || !rendered) { + if (hidden || !render) { return null; } diff --git a/packages/doenetml/src/doenetml.tsx b/packages/doenetml/src/doenetml.tsx index 523563297..b7d6c1a9b 100644 --- a/packages/doenetml/src/doenetml.tsx +++ b/packages/doenetml/src/doenetml.tsx @@ -100,7 +100,7 @@ export function DoenetViewer({ prefixForIds = "", userId, attemptNumber = 1, - rendered = true, + render = true, hidden = false, requestedVariantIndex, updateCreditAchievedCallback, @@ -128,7 +128,7 @@ export function DoenetViewer({ prefixForIds?: string; userId?: string; attemptNumber?: number; - rendered?: boolean; + render?: boolean; hidden?: boolean; requestedVariantIndex?: number; updateCreditAchievedCallback?: Function; @@ -242,7 +242,7 @@ export function DoenetViewer({ prefixForIds={prefixForIds} userId={userId} attemptNumber={attemptNumber} - rendered={rendered} + render={render} hidden={hidden} requestedVariantIndex={variantIndex.current} updateCreditAchievedCallback={updateCreditAchievedCallback} diff --git a/packages/test-cypress/cypress/e2e/DocViewer/docViewerAttributes.cy.js b/packages/test-cypress/cypress/e2e/DocViewer/docViewerAttributes.cy.js index a1bf61d23..b6b8773bc 100644 --- a/packages/test-cypress/cypress/e2e/DocViewer/docViewerAttributes.cy.js +++ b/packages/test-cypress/cypress/e2e/DocViewer/docViewerAttributes.cy.js @@ -20,7 +20,7 @@ describe("PageViewer Attribute Tests", function () { }); cy.get("#testRunner_toggleControls").click(); - cy.get("#testRunner_rendered").click(); + cy.get("#testRunner_render").click(); cy.wait(100); cy.get("#testRunner_toggleControls").click(); diff --git a/packages/test-cypress/src/CypressTest.tsx b/packages/test-cypress/src/CypressTest.tsx index a3d349a76..6751e17b9 100644 --- a/packages/test-cypress/src/CypressTest.tsx +++ b/packages/test-cypress/src/CypressTest.tsx @@ -18,7 +18,7 @@ export function CypressTest() { allowSaveSubmissions: boolean; allowSaveEvents: boolean; autoSubmit: boolean; - rendered: boolean; + render: boolean; darkMode: "light" | "dark"; showEditor: boolean; viewerLocation: "left" | "right" | "bottom" | "top"; @@ -36,7 +36,7 @@ export function CypressTest() { allowSaveSubmissions: false, allowSaveEvents: false, autoSubmit: false, - rendered: true, + render: true, darkMode: "light", showEditor: false, viewerLocation: "right", @@ -89,7 +89,7 @@ export function CypressTest() { testSettings.allowSaveEvents, ); const [autoSubmit, setAutoSubmit] = useState(testSettings.autoSubmit); - const [rendered, setRendered] = useState(testSettings.rendered); + const [render, setRender] = useState(testSettings.render); const [showEditor, setShowEditor] = useState(testSettings.showEditor); const [viewerLocation, setViewerLocation] = useState( @@ -411,20 +411,20 @@ export function CypressTest() {
@@ -526,7 +526,7 @@ export function CypressTest() { attemptNumber={attemptNumber} requestedVariantIndex={requestedVariantIndex.current} activityId="activityIdFromCypress" - rendered={rendered} + render={render} location={location} navigate={navigate} linkSettings={{ diff --git a/packages/test-viewer/src/test/testViewer.tsx b/packages/test-viewer/src/test/testViewer.tsx index d6b2c7f06..691ee5b40 100644 --- a/packages/test-viewer/src/test/testViewer.tsx +++ b/packages/test-viewer/src/test/testViewer.tsx @@ -12,7 +12,7 @@ export default function TestViewer() { readOnly: boolean; showFeedback: boolean; showHints: boolean; - rendered: boolean; + render: boolean; showEditor: boolean; viewerLocation: "left" | "right" | "bottom" | "top"; } = { @@ -21,7 +21,7 @@ export default function TestViewer() { readOnly: false, showFeedback: true, showHints: true, - rendered: true, + render: true, showEditor: false, viewerLocation: "right", }; @@ -36,7 +36,7 @@ export default function TestViewer() { readOnly, showFeedback, showHints, - rendered, + render, showEditor, viewerLocation, } = testSettings; @@ -140,17 +140,17 @@ export default function TestViewer() { {" "} { setTestSettings((was) => { let newObj = { ...was }; - newObj.rendered = !was.rendered; + newObj.render = !was.render; return newObj; }); setUpdateNumber((was) => was + 1); }} /> - Rendered + Render
@@ -225,7 +225,7 @@ export default function TestViewer() { autoSubmit: false, }} activityId="" - rendered={rendered} + render={render} addVirtualKeyboard={true} /> );