From b77b5780e7e4597839522ea160785ae3d17e24e7 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Wed, 18 Dec 2024 10:53:39 -0600 Subject: [PATCH 1/2] Use h2 --- src/components/Card.tsx | 4 +-- .../__snapshots__/Card.spec.tsx.snap | 30 +++++++------------ .../__snapshots__/Exercise.spec.tsx.snap | 30 +++++++------------ 3 files changed, 22 insertions(+), 42 deletions(-) diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 2559642..e16d4d4 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -243,13 +243,13 @@ const StepCard = ({
{leftHeaderChildren} -
+

{headerTitleChildren} {formattedQuestionNumber} {showTotalQuestions ?  / {numberOfQuestions} : null} | ID: {questionId} -

+
{availablePoints || rightHeaderChildren ?
{availablePoints &&
{availablePoints} Points
} diff --git a/src/components/__snapshots__/Card.spec.tsx.snap b/src/components/__snapshots__/Card.spec.tsx.snap index 6c640be..c2731f0 100644 --- a/src/components/__snapshots__/Card.spec.tsx.snap +++ b/src/components/__snapshots__/Card.spec.tsx.snap @@ -11,10 +11,8 @@ exports[`StepCard matches snapshot 1`] = ` className="sc-dkzDqf hbFgnH" >
-
Question 1 @@ -29,7 +27,7 @@ exports[`StepCard matches snapshot 1`] = ` > ID: -
+
-
Questions 1 - 3 @@ -84,7 +80,7 @@ exports[`StepCard matches snapshot with more than one question 1`] = ` > ID: -
+
-
Question 1 @@ -135,7 +129,7 @@ exports[`TaskStepCard can optionally provide task 1`] = ` ID: 1234@1 -
+
-
Question 1 @@ -176,7 +168,7 @@ exports[`TaskStepCard can optionally provide type 1`] = ` ID: 1234@1 -
+
-
Question 1 @@ -217,7 +207,7 @@ exports[`TaskStepCard matches snapshot 1`] = ` ID: 1234@1 -
+
-
Question 1 @@ -40,7 +38,7 @@ exports[`Exercise using step data matches snapshot 1`] = ` ID: 1234@4 -
+
-
Question 1 @@ -227,7 +223,7 @@ exports[`Exercise with question state data matches snapshot 1`] = ` ID: 1234@5 -
+
-
Question 1 @@ -468,7 +462,7 @@ exports[`Exercise with question state data renders header icons with multiple ch ID: 1234@5 -
+
-
Question 1 @@ -795,7 +787,7 @@ exports[`Exercise with question state data renders header icons with two-step ex ID: 1234@5 -
+
-
Question 1 @@ -1108,7 +1098,7 @@ exports[`Exercise with question state data shows a detailed solution 1`] = ` ID: 1234@5 -
+
Date: Wed, 18 Dec 2024 11:07:09 -0600 Subject: [PATCH 2/2] Dist --- dist/index.js | 2 + dist/index.js.map | 1 + dist/index.modern.mjs | 916 ++++++++++++++++++ dist/index.modern.mjs.map | 1 + dist/index.module.js | 2 + dist/index.module.js.map | 1 + dist/index.umd.js | 2 + dist/index.umd.js.map | 1 + dist/scripts/download-json.d.ts | 1 + ...enerate-chapter-reading-homework-pdfs.d.ts | 1 + dist/scripts/generate-pdf.d.ts | 1 + dist/src/assets/flag.d.ts | 2 + dist/src/components/Answer.d.ts | 26 + dist/src/components/Answer.spec.d.ts | 1 + dist/src/components/Answer.stories.d.ts | 4 + dist/src/components/AnswersTable.d.ts | 23 + dist/src/components/AnswersTable.spec.d.ts | 1 + dist/src/components/AnswersTable.stories.d.ts | 5 + dist/src/components/Button.d.ts | 11 + dist/src/components/Button.spec.d.ts | 1 + dist/src/components/Button.stories.d.ts | 3 + dist/src/components/Card.d.ts | 38 + dist/src/components/Card.spec.d.ts | 1 + dist/src/components/Card.stories.d.ts | 2 + dist/src/components/CompletionStatus.d.ts | 7 + .../src/components/CompletionStatus.spec.d.ts | 1 + .../components/CompletionStatus.stories.d.ts | 3 + dist/src/components/Content.d.ts | 10 + dist/src/components/Content.spec.d.ts | 1 + dist/src/components/Exercise.d.ts | 85 ++ dist/src/components/Exercise.spec.d.ts | 1 + dist/src/components/Exercise.stories.d.ts | 10 + dist/src/components/ExerciseHeaderIcons.d.ts | 6 + .../components/ExerciseHeaderIcons.spec.d.ts | 1 + dist/src/components/ExerciseQuestion.d.ts | 45 + .../src/components/ExerciseQuestion.spec.d.ts | 1 + .../components/ExerciseQuestion.stories.d.ts | 5 + dist/src/components/ExerciseToolbar.d.ts | 8 + dist/src/components/ExerciseToolbar.spec.d.ts | 1 + .../components/ExerciseToolbar.stories.d.ts | 2 + dist/src/components/Feedback.d.ts | 10 + dist/src/components/Feedback.stories.d.ts | 1 + dist/src/components/FreeResponseInput.d.ts | 24 + .../components/FreeResponseInput.spec.d.ts | 1 + .../components/FreeResponseInput.stories.d.ts | 3 + dist/src/components/Loader.d.ts | 1 + dist/src/components/Loader.spec.d.ts | 1 + dist/src/components/Loader.stories.d.ts | 1 + dist/src/components/Print.stories.d.ts | 1 + dist/src/components/ProgressBar.d.ts | 24 + dist/src/components/ProgressBar.spec.d.ts | 1 + dist/src/components/ProgressBar.stories.d.ts | 4 + dist/src/components/Question.d.ts | 35 + dist/src/components/Question.spec.d.ts | 1 + dist/src/components/Question.stories.d.ts | 5 + dist/src/components/StepCardFooter.d.ts | 1 + dist/src/constants.d.ts | 2 + dist/src/helpers/mathjax.d.ts | 9 + dist/src/hooks/useTypesetMath.d.ts | 3 + dist/src/index.d.ts | 10 + dist/src/test/fixtures.d.ts | 1 + dist/src/test/utils.d.ts | 2 + dist/src/theme.d.ts | 242 +++++ dist/src/types/index.d.ts | 136 +++ dist/src/utils.d.ts | 7 + dist/src/utils.spec.d.ts | 1 + 66 files changed, 1761 insertions(+) create mode 100644 dist/index.js create mode 100644 dist/index.js.map create mode 100644 dist/index.modern.mjs create mode 100644 dist/index.modern.mjs.map create mode 100644 dist/index.module.js create mode 100644 dist/index.module.js.map create mode 100644 dist/index.umd.js create mode 100644 dist/index.umd.js.map create mode 100644 dist/scripts/download-json.d.ts create mode 100644 dist/scripts/generate-chapter-reading-homework-pdfs.d.ts create mode 100644 dist/scripts/generate-pdf.d.ts create mode 100644 dist/src/assets/flag.d.ts create mode 100644 dist/src/components/Answer.d.ts create mode 100644 dist/src/components/Answer.spec.d.ts create mode 100644 dist/src/components/Answer.stories.d.ts create mode 100644 dist/src/components/AnswersTable.d.ts create mode 100644 dist/src/components/AnswersTable.spec.d.ts create mode 100644 dist/src/components/AnswersTable.stories.d.ts create mode 100644 dist/src/components/Button.d.ts create mode 100644 dist/src/components/Button.spec.d.ts create mode 100644 dist/src/components/Button.stories.d.ts create mode 100644 dist/src/components/Card.d.ts create mode 100644 dist/src/components/Card.spec.d.ts create mode 100644 dist/src/components/Card.stories.d.ts create mode 100644 dist/src/components/CompletionStatus.d.ts create mode 100644 dist/src/components/CompletionStatus.spec.d.ts create mode 100644 dist/src/components/CompletionStatus.stories.d.ts create mode 100644 dist/src/components/Content.d.ts create mode 100644 dist/src/components/Content.spec.d.ts create mode 100644 dist/src/components/Exercise.d.ts create mode 100644 dist/src/components/Exercise.spec.d.ts create mode 100644 dist/src/components/Exercise.stories.d.ts create mode 100644 dist/src/components/ExerciseHeaderIcons.d.ts create mode 100644 dist/src/components/ExerciseHeaderIcons.spec.d.ts create mode 100644 dist/src/components/ExerciseQuestion.d.ts create mode 100644 dist/src/components/ExerciseQuestion.spec.d.ts create mode 100644 dist/src/components/ExerciseQuestion.stories.d.ts create mode 100644 dist/src/components/ExerciseToolbar.d.ts create mode 100644 dist/src/components/ExerciseToolbar.spec.d.ts create mode 100644 dist/src/components/ExerciseToolbar.stories.d.ts create mode 100644 dist/src/components/Feedback.d.ts create mode 100644 dist/src/components/Feedback.stories.d.ts create mode 100644 dist/src/components/FreeResponseInput.d.ts create mode 100644 dist/src/components/FreeResponseInput.spec.d.ts create mode 100644 dist/src/components/FreeResponseInput.stories.d.ts create mode 100644 dist/src/components/Loader.d.ts create mode 100644 dist/src/components/Loader.spec.d.ts create mode 100644 dist/src/components/Loader.stories.d.ts create mode 100644 dist/src/components/Print.stories.d.ts create mode 100644 dist/src/components/ProgressBar.d.ts create mode 100644 dist/src/components/ProgressBar.spec.d.ts create mode 100644 dist/src/components/ProgressBar.stories.d.ts create mode 100644 dist/src/components/Question.d.ts create mode 100644 dist/src/components/Question.spec.d.ts create mode 100644 dist/src/components/Question.stories.d.ts create mode 100644 dist/src/components/StepCardFooter.d.ts create mode 100644 dist/src/constants.d.ts create mode 100644 dist/src/helpers/mathjax.d.ts create mode 100644 dist/src/hooks/useTypesetMath.d.ts create mode 100644 dist/src/index.d.ts create mode 100644 dist/src/test/fixtures.d.ts create mode 100644 dist/src/test/utils.d.ts create mode 100644 dist/src/theme.d.ts create mode 100644 dist/src/types/index.d.ts create mode 100644 dist/src/utils.d.ts create mode 100644 dist/src/utils.spec.d.ts diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..2826304 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,2 @@ +var e=require("react/jsx-runtime"),n=require("classnames"),t=require("react"),r=require("styled-components"),a=require("scroll-to-element"),o=require("lodash"),i=require("lodash/fp.js"),s=require("weak-map"),l=require("@fortawesome/react-fontawesome"),c=require("@fortawesome/free-solid-svg-icons"),d=require("@fortawesome/free-solid-svg-icons/faBookOpen"),u=require("@fortawesome/free-solid-svg-icons/faTriangleExclamation"),p=require("@fortawesome/free-solid-svg-icons/faCircleInfo"),m=require("@fortawesome/free-solid-svg-icons/faCheck"),f=require("@fortawesome/free-solid-svg-icons/faXmark"),h=require("react-content-loader");function x(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=/*#__PURE__*/x(n),g=/*#__PURE__*/x(t),w=/*#__PURE__*/x(r),v=/*#__PURE__*/x(a),y=/*#__PURE__*/x(s);function j(){return j=Object.assign?Object.assign.bind():function(e){for(var n=1;n=0||(a[t]=e[t]);return a}function C(e,n){return n||(n=e.slice(0)),e.raw=n,e}function _(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t .content {\n padding: "," ",";\n }\n "])),ee.resetText(),"1px",K.popover.borderColor,K.palette.white,"325px","8px","1rem",K.palette.neutralThin,"16px","8px","9px","8px","16px","8px","16px",K.popover.borderColor,"1px",K.palette.white,"9px","1px","9px","1rem","0.8rem")},visuallyHidden:function(){return r.css(R||(R=C(["\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n "])))}},ne=w.default.div(Q||(Q=C(["\n color: ",";\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n"])),function(e){return e.state?K.answer.correct:K.answer.incorrect}),te=function(n){var t=n.isCorrect,r=n.isIncorrect;if(!t&&!r)return null;var a=t||!1===r;return e.jsxs(ne,{state:a,children:[a?"Correct":"Incorrect"," Answer"]})},re=function(n){var t=n.answer,r=t.content_html,a=t.feedback_html,o=n.contentRenderer,i=n.show_all_feedback,s=n.tableFeedbackEnabled;return e.jsxs("div",{className:"answer-answer",children:[e.jsx(te,{isCorrect:n.isCorrect,isIncorrect:n.isIncorrect}),e.jsx(D,{className:"answer-content",component:o,html:r}),i&&a&&!s&&e.jsx(W,{contentRenderer:o,children:a},"question-mc-feedback")]})},ae=function(n){var t=n.answer,r=n.answered_count,a=n.isCorrect,o=n.contentRenderer,i=n.iter,s=n.show_all_feedback,l=n.tableFeedbackEnabled,c=t.selected_count&&r?Math.round(t.selected_count/r*100):0;return e.jsxs("div",{className:"review-wrapper",children:[e.jsxs("div",{className:b.default("review-count",{green:a,red:!a}),children:[e.jsx("span",{className:"selected-count","data-percent":""+c,children:t.selected_count}),e.jsx("span",{className:b.default("letter",{green:a,red:!a}),children:N[i]})]}),e.jsx(re,{answer:t,contentRenderer:o,show_all_feedback:s,tableFeedbackEnabled:l})]})},oe=function(n){var t,r=n.type,a=n.iter,o=n.answer,i=n.disabled,s=n.onKeyPress,l=n.qid,c=n.contentRenderer,d=n.feedbackId,u=n.isSelected,p=n.isCorrect,m=n.isIncorrect,f=n.show_all_feedback,h=n.tableFeedbackEnabled,x=(u?"Selected ":"")+"Choice "+N[a]+":";return n.hasCorrectAnswer||"teacher-review"===r||"teacher-preview"===r||"student-mpp"===r||(t=n.onChangeAnswer),e.jsxs(e.Fragment,{children:["teacher-preview"===r&&e.jsx("div",{className:"correct-incorrect",children:p&&n.correctIncorrectIcon}),e.jsx("input",{type:"radio",className:"answer-input-box",checked:u,id:l+"-option-"+a,name:l+"-options",onChange:function(){return t&&t(o)},disabled:i||!t,"aria-details":d}),e.jsxs("label",{onKeyPress:s,htmlFor:l+"-option-"+a,className:"answer-label",children:[e.jsx("span",{className:"answer-letter-wrapper","aria-label":x,"data-answer-choice":N[a],"data-test-id":"answer-choice-"+N[a]}),e.jsx(re,{answer:o,contentRenderer:c,show_all_feedback:f,tableFeedbackEnabled:h,isCorrect:p,isIncorrect:m})]})]})},ie=function(n){return e.jsx("teacher-review"===n.type?ae:oe,j({},n))},se=function(n){var t=n.type,r=n.answer,a=n.disabled,o=n.answerId,i=n.correctAnswerId,s=n.incorrectAnswerId,l=function(e,n){return e.id==n}(r,o),c=function(e,n){if(!e.id&&!n)return e.isCorrect;var t=e.id===n;return null!=e.correctness&&(t="1.0"===e.correctness),t}(r,i),d=q(r,s),u=l||void 0===o&&(!s&&c||d),p=b.default("answers-answer",{disabled:a,"answer-selected":u,"answer-correct":c&&"student-mpp"!==t,"answer-incorrect":s&&q(r,s)});return e.jsx("div",{className:"openstax-answer",children:e.jsx("section",{className:p,children:e.jsx(ie,j({},n,{isCorrect:c,isSelected:u,isIncorrect:d}))})})};se.displayName="OSAnswer";var le,ce,de,ue,pe,me,fe,he,xe,be,ge,we,ve=function(n){var t=0,r=n.question,a=n.type,o=n.correct_answer_id,i=n.incorrectAnswerId,s=n.feedback_html,l=n.correct_answer_feedback_html,c=n.show_all_feedback,d=void 0!==c&&c,u=n.tableFeedbackEnabled,p=n.answerIdOrder,m=n.instructions;if(n.hideAnswers)return null;var f,h=[],x={qid:r.id||"auto-"+t++,answerId:n.answer_id,correctAnswerId:o,incorrectAnswerId:i,hasCorrectAnswer:n.hasCorrectAnswer,onChangeAnswer:n.onChangeAnswer,type:void 0===a?"student":a,answered_count:n.answered_count,disabled:!n.choicesEnabled,show_all_feedback:d,tableFeedbackEnabled:u,onKeyPress:n.onKeyPress},b=(p?(f=p,r.answers.slice().sort(function(e,n){return f.indexOf(e.id)-f.indexOf(n.id)})):r.answers).map(function(n,t){var a,c,p={answer:j({},n,{question_id:"string"==typeof r.id?parseInt(r.id,10):r.id}),iter:t,key:x.qid+"-option-"+t},m=Object.assign({},p,x);return d&&n.feedback_html&&u?a=n.feedback_html:n.id===i&&s?a=s:n.id===o&&l&&(a=l),a&&h.push({index:t,html:a,id:c="feedback-"+x.qid+"-"+t}),e.jsx(se,j({feedbackId:c},m))});return h.forEach(function(t,r){var a=t.index+r+1;b.splice(a,0,e.jsx(Z,{id:t.id,contentRenderer:n.contentRenderer,children:t.html},a))}),e.jsxs("div",{role:"radiogroup","aria-label":"Answer choices",className:"answers-table",children:[m,b]})},ye=["questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","className","children","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren"],je=["step","questionNumber","numberOfQuestions","children","className"],ke=w.default.div(le||(le=C(["\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ",";\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ","\n"])),K.palette.light,$(ce||(ce=C(["\n max-width: 1000px;\n "])))),Ce=w.default.div(de||(de=C(["\n padding: ",";\n\n ","\n"])),"2rem",Y(ue||(ue=C(["\n padding: 0;\n "])))),_e=w.default.div(pe||(pe=C(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ",";\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ",";\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ","\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ","\n\n ","\n"])),K.card.header.background,K.palette.gray,$(me||(me=C(["\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n "]))),X(fe||(fe=C(["\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n button.ox-icon-angle-right {\n margin-left: ",";\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n "])),"24px","24px"),Y(he||(he=C(["\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n "])),"8px","8px"));_e.displayName="StepCardHeader";var Ne=w.default.div(xe||(xe=C(["\n .step-card-body {\n ","\n overflow: auto;\n background: ",";\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ","\n\n .reading-step & {\n padding: 0;\n }\n\n ","\n\n ","\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n"])),ee.stepCardPadding(),K.card.body.background,function(){return r.css(E||(E=C(["@media(max-width: ","px) { "," }"])),600,r.css.apply(void 0,[].slice.call(arguments)))}(be||(be=C(["\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n "]))),$(ge||(ge=C(["\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n "]))),Y(we||(we=C(["\n .openstax-exercise-badges svg {\n margin-right: ",";\n }\n "])),"8px")),qe=function(n){var t=n.questionNumber,r=n.numberOfQuestions,a=n.showTotalQuestions,o=n.stepType,i=n.isHomework,s=n.availablePoints,l=n.unpadded,c=n.className,d=n.children,u=n.questionId,p=n.multipartBadge,m=n.leftHeaderChildren,f=n.rightHeaderChildren,h=n.headerTitleChildren,x=k(n,ye);return e.jsxs(Ce,j({},x,{children:[p,e.jsxs(ke,{className:c,children:[t&&i&&"exercise"===o&&e.jsxs(_e,{children:[e.jsxs("div",{children:[m,e.jsxs("h2",{className:"question-info",children:[h,e.jsx("span",{children:r>1?"Questions "+t+" - "+(t+r-1):"Question "+t}),a?e.jsxs("span",{className:"num-questions",children:[" / ",r]}):null,e.jsx("span",{className:"separator",children:"|"}),e.jsxs("span",{className:"question-id",children:["ID: ",u]})]})]}),s||f?e.jsxs("div",{children:[s&&e.jsxs("div",{className:"points",children:[s," Points"]}),f]}):null]}),e.jsx(Ne,{unpadded:l,children:d})]})]}))};qe.displayName="OSStepCard";var Se=function(n){var t=n.step,r=n.questionNumber,a=n.numberOfQuestions,o=n.children,i=n.className,s=k(n,je);return e.jsx(qe,j({},s,{unpadded:!0,questionNumber:r,numberOfQuestions:a,stepType:"type"in t?t.type:"exercise",isHomework:!("task"in t)||void 0===t.task||"homework"===t.task.type,"data-task-step-id":t.id,className:b.default(("type"in t?t.type:"exercise")+"-step",i),questionId:t.uid,children:o}))};Se.displayName="OSTaskStepCard";var Ae,Ie,Me,Ee,Te,Oe,He,Fe,Pe,ze,Le,Be,Re,Qe,Je,Ve=["disabled","isWaiting","waitingText","children"],De=w.default.button(Ae||(Ae=C(["\n background-color: ",";\n color: ",";\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ","\n }\n &:active {\n background: ","\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n"])),K.button.background,K.palette.white,K.button.backgroundHover,K.button.backgroundActive),Ue=function(n){var t=n.disabled,r=n.isWaiting,a=n.waitingText,o=n.children,i=k(n,Ve);return e.jsx(De,j({},i,{disabled:r||t,children:r&&a||o}))},We=r.createGlobalStyle(Ie||(Ie=C(["\n :root {\n --content-text-scale: 1;\n }\n"]))),Ze=w.default(ke)(Me||(Me=C(["\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n"]))),Ge=w.default.h2(Ee||(Ee=C(["\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n"]))),Ke=w.default(function(n){var t=n.numberOfQuestions,r=n.numberCompleted,a=n.handleClick,o=n.className,i=t===r,s=r>0,l=i?"Next":s?"Continue":"Start";return e.jsxs(e.Fragment,{children:[e.jsx(We,{}),e.jsxs(Ze,{className:o,children:[e.jsx(Ge,{children:i?"You are done.":s?"Quiz is partially complete.":"No questions have been answered."}),e.jsx("p",{children:i?"Great job answering all the questions.":s?"You've completed "+r+" of "+t+" questions.":"Begin working on the quiz."}),e.jsx(Ue,{"data-test-id":l.split(" ")[0].toLowerCase()+"-btn",onClick:function(){return a()},children:l})]})]})})(Te||(Te=C([""]))),Ye=w.default.div(Oe||(Oe=C(["\n&.step-card-body {\n ",";\n}\n\n&.openstax-question {\n border-top: 1px solid ",";\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ",";\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ",";\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: "," ",";\n margin: "," 0 "," ",";\n border-left: "," solid ",";\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ",";\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ",";\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ",";\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: "," 0 0 0;\n margin: 0;\n transition: color ",";\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ","\n }\n }\n\n .answer-input-box {\n ","\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ",";\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ",";\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ",";\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ",";\n }\n }\n\n &.answer-correct {\n .answer-label {\n ",";\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ","\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ","\n }\n &.answer-selected.answer-incorrect {\n ","\n }\n }\n }\n\n .question-feedback {\n ","\n max-width: ",";\n .question-feedback-content {\n padding: "," ",";\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n"])),ee.stepCardPadding(),K.palette.pale,K.palette.neutral,K.palette.neutralLightBlue,"1rem","2.5rem","1rem","1rem","1rem","1rem",K.palette.neutralLighter,K.palette.neutralLightest,ee.answer(),"1rem","1rem","0.1s ease-in-out",ee.answerHover(),ee.visuallyHidden(),ee.answerChecked(),K.answer.checked,ee.answerChecked(),ee.answerIncorrect(),ee.answerCorrect(!0),ee.answerCorrectAnswer(),ee.answerIncorrect(),ee.answerIncorrect(!0),ee.popover(),"370px","0.9rem","1.1rem"),Xe=g.default.forwardRef(function(n,t){var r,a,o=n.question,i=n.exercise_uid,s=n.questionNumber,l=n.context,c=n.task,d=n.hidePreambles,u=o.stem_html,p=o.collaborator_solutions,m=void 0===p?[]:p,f=o.formats,h=o.stimulus_html,x=!!n.correct_answer_id,g=b.default("openstax-question",n.className,{"has-correct-answer":x&&!((null!=c?c.is_deleted:void 0)&&"homework"===(null!=c?c.type:void 0)),"has-incorrect-answer":!!n.incorrectAnswerId});return null!=i&&(r=e.jsx("div",{className:"exercise-uid",children:i})),function(){var e=o.collaborator_solutions,t=void 0===e?[]:e;return n.displaySolution&&t&&t.find(function(e){return void 0!==e.content_html})}()&&(a=e.jsxs("div",{className:"detailed-solution",children:[e.jsx("div",{className:"header",children:"Detailed solution:"}),e.jsx(D,{className:"solution",block:!0,html:m.map(function(e){return e.content_html}).join("")})]})),e.jsxs(Ye,{ref:t,className:g,"data-question-number":s,"data-test-id":"question",children:[e.jsx($e,{type:"context",html:l,hidden:d}),e.jsx($e,{type:"stimulus",html:h,hidden:d}),e.jsx($e,{type:"stem",html:u,hidden:d,questionNumber:s}),n.children,e.jsx(ve,j({},n,{onChangeAnswer:n.onChange,hasCorrectAnswer:x})),a,n.displayFormats?e.jsx(en,{formats:f}):void 0,r]})}),$e=function(n){var t=n.html,r=void 0===t?"":t;return!0!==n.hidden&&r.length>0?e.jsx(D,{html:r,"data-question-number":n.questionNumber,className:"question-"+n.type,block:!0}):null},en=function(n){var t=n.formats,r=void 0===t?[]:t;return e.jsxs("div",{className:"formats-listing",children:[e.jsx("div",{className:"header",children:"Formats:"}),r.map(function(n,t){return e.jsx("span",{children:n},t)})]})},nn=w.default.div(He||(He=C(["\n ","\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ",";\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ",";\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ","\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ","\n"])),ee.stepCardPadding(),K.card.body.background,K.palette.pale,Y(Fe||(Fe=C(["\n flex-wrap: wrap;\n "]))),$(Pe||(Pe=C(["\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n "])))),tn=r.css(ze||(ze=C(["\n background-color: #f5e9ea;\n"]))),rn=w.default.div(Le||(Le=C(["\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ","\n }\n"])),ee.stepCardPadding()),an=w.default.div(Be||(Be=C(["\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n"]))),on=w.default.div(Re||(Re=C(["\n margin: 8px 0;\n display: flex;\n justify-content: ",";\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ",";\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ",";\n"])),function(e){return e.hasChildren?"space-between":"flex-end"},K.palette.danger,K.palette.neutralThin),sn=w.default.textarea(Qe||(Qe=C(["\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ",";\n color: ",";\n ",";\n ","\n background-color: ",";\n"])),K.palette.neutral,K.palette.neutralDark,function(e){return e.isOverWordLimit&&tn},function(e){return e.isOverWordLimit&&r.css(Je||(Je=C(["\n border: 2px solid ",";\n "])),K.palette.danger)},function(e){return e.readOnly&&K.palette.neutralCool});sn.displayName="OSFreeResponseTextArea";var ln=function(n){return e.jsx(Ue,j({},n,{children:"Cancel"}))},cn=function(n){var t=n.availablePoints,r=n.cancelHandler,a=n.defaultValue,o=n.infoRowChildren,i=n.isSubmitDisabled,s=n.question,l=n.questionNumber,c=n.saveHandler,d=n.submitBtnLabel,u=n.textHasChanged,p=n.wordLimit,m=S(a)>p,f={};return l&&(f["data-question-number"]=l),e.jsxs(rn,{"data-test-id":"student-free-response",children:[e.jsxs("div",{className:"step-card-body",children:[e.jsx(an,j({},f,{children:s.stem_html&&e.jsx($e,{type:"stem",html:s.stem_html,hidden:!1})})),e.jsx(sn,j({},n,{isOverWordLimit:m,"data-test-id":"free-response-box",placeholder:"Enter your response...","aria-label":"question response text box"})),e.jsxs(on,{hasChildren:!!o,children:[o,e.jsxs("div",{children:[e.jsxs("span",{children:[S(a)," words"]}),m&&e.jsxs("span",{className:"word-limit-error-info",children:["Maximum ",p," words"]})]})]})]}),e.jsxs(nn,{children:[t?e.jsx("div",{className:"points",role:"status",children:e.jsxs("strong",{children:["Points: ",t]})}):null,e.jsxs("div",{className:"controls",children:[e.jsx(ln,{disabled:!u,onClick:r}),e.jsx(Ue,{"data-test-id":"submit-answer-btn",disabled:i||m,onClick:c,children:d})]})]})]})};cn.displayName="OSFreeResponse";var dn=function(n){var t=n.count;return e.jsxs("div",{children:[t," attempt",1===t?"":"s"," left"]})},un=function(n){var t=n.published_comments;return t?e.jsxs("div",{children:[e.jsx("strong",{children:"Feedback:"})," ",t]}):null},pn=function(n){return e.jsx(Ue,j({},n,{waitingText:"Saving…",isWaiting:n.isWaiting,"data-test-id":"submit-answer-btn",children:n.willContinue?"Submit & continue":0==n.attempt_number?"Submit":"Re-submit"}))},mn=function(n){return e.jsx(Ue,j({},n,{"data-test-id":"continue-btn",children:n.canUpdateCurrentStep?"Continue":"Next"}))},fn=function(n){var t=n.free_response;return t?e.jsx(e.Fragment,{children:e.jsx("div",{className:"free-response",children:t})}):null},hn=g.default.forwardRef(function(n,t){var r=n.question,a=n.task,o=n.answer_id_order,i=n.onAnswerChange,s=n.feedback_html,l=n.correct_answer_feedback_html,c=n.is_completed,d=n.correct_answer_id,u=n.incorrectAnswerId,p=n.choicesEnabled,m=n.questionNumber,f=n.answer_id,h=n.hasMultipleAttempts,x=n.attempts_remaining,b=n.published_comments,w=n.detailedSolution,v=n.canAnswer,y=n.needsSaved,j=n.attempt_number,k=n.apiIsPending,C=n.onAnswerSave,_=n.onNextStep,N=n.canUpdateCurrentStep,q=n.displaySolution,S=n.available_points,A=n.free_response,I=n.show_all_feedback,M=n.tableFeedbackEnabled,E=n.hasFeedback,T=g.default.useState(!1),O=T[0],H=T[1];return g.default.useEffect(function(){O&&c&&(_(m-1),H(!1))},[_,m,O,c]),e.jsxs("div",{"data-test-id":"student-exercise-question",children:[e.jsx(Xe,{ref:t,task:a,question:r,answerIdOrder:o,choicesEnabled:p,answer_id:f,questionNumber:m,onChange:i,feedback_html:s,correct_answer_feedback_html:l,correct_answer_id:c?d:null,incorrectAnswerId:u,className:"step-card-body",hideAnswers:!1,displayFormats:!1,displaySolution:q,show_all_feedback:I,tableFeedbackEnabled:M,children:e.jsx(fn,{free_response:A})}),e.jsx(nn,{className:"step-card-footer",children:e.jsxs("div",{className:"step-card-footer-inner",children:[e.jsxs("div",{className:"points",role:"status",children:[S?e.jsxs("strong",{children:["Points: ",S]}):null,e.jsx("span",{className:"attempts-left",children:h&&x>0&&e.jsx(dn,{count:x})}),e.jsx(un,{published_comments:b}),w&&e.jsxs("div",{children:[e.jsx("strong",{children:"Detailed solution:"})," ",e.jsx(D,{html:w})]})]}),e.jsx("div",{className:"controls",children:v&&y||O?e.jsx(pn,{disabled:k||!f||O,isWaiting:k||O,attempt_number:j,onClick:function(){var e;C("string"==typeof(e=r.id)?parseInt(e,10):e),E||H(!0)},willContinue:!E}):e.jsx(mn,{onClick:function(){return _(m-1)},canUpdateCurrentStep:N})})]})})]})}),xn={extensions:[],showProcessingMessages:!1,skipStartupTypeset:!0,styles:{"#MathJax_MSIE_Frame":{left:"",right:0,visibility:"hidden"},"#MathJax_Message":{left:"",right:0,visibility:"hidden"}},tex2jax:{displayMath:[["‌‌‌","‌‌‌"]],inlineMath:[["​​​","​​​"]]}},bn=function(e){var n=function(e){return Array.from(e.querySelectorAll(".MathJax math"))}(e);return Array.from(e.querySelectorAll("math")).filter(function(e){return-1===n.indexOf(e)})},gn=function(e){for(var n=[],t=0,r=Array.from(e.querySelectorAll("[data-math]:not(.math-rendered)"));t0&&(gn(n).length||bn(n).length)?setTimeout(function(){e(n,t,r-1)},200):t()},vn=function(e,n){return new Promise(function(t){(function(e,n){var t=gn(e);n.MathJax.Hub.Queue(function(e,n){return function(){i.isEmpty(e)||n.MathJax.Hub.Queue(function(){return n.MathJax.Hub.Typeset(e)},function(e){return function(){for(var n,t=[],r=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return _(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(e,n):void 0}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=r()).done;)t.push(n.value.className+=" math-rendered")}}(e))}}(t,n),function(e,n){return function(){var t=bn(e);i.isEmpty(t)||n.MathJax.Hub.Queue(function(){return n.MathJax.Hub.Typeset(e)})}}(e,n))})(e,n),n.MathJax.Hub.Queue(function(){wn(e,t)})})},yn=i.memoize(function(e,n){return o.debounce(vn,100,{leading:!0,trailing:!1}).bind(null,e,n)});yn.cache=new y.default;var jn,kn,Cn,_n,Nn,qn,Sn,An,In,Mn,En,Tn,On,Hn,Fn,Pn,zn,Ln,Bn,Rn,Qn,Jn,Vn,Dn,Un,Wn,Zn,Gn,Kn,Yn,Xn,$n,et,nt,tt,rt=o.once(function(e){return void 0===e&&(e=window),new Promise(function(n){var t=function(){e.MathJax.HTML.Cookie.prefix="mathjax",e.MathJax.Hub.Configured(),e.MathJax.Hub.Register.StartupHook("End",function(){n()})};if(!document.getElementById("MathJax-Script")){var r=document.createElement("script");r.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured",r.id="MathJax-Script",r.async=!0,document.head.appendChild(r)}e.MathJax&&e.MathJax.Hub?(e.MathJax.Hub.Config(xn),e.MathJax.Hub.processSectionDelay=0,t()):(xn.AuthorInit=t,e.MathJax=xn)})}),at=w.default.div(jn||(jn=C(["\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ",";\n background: #fff;\n margin: "," 0 0 ",";\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ",";\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ",";\n }\n\n span {\n display: block;\n }\n }\n }\n\n ","\n\n ","\n"])),K.palette.light,"2rem","2rem",K.palette.neutral,K.palette.neutralDarker,K.palette.neutralDarker,function(e){return!e.desktop&&r.css(kn||(kn=C(["\n ","\n ","\n "])),$(Cn||(Cn=C(["\n display: none;\n "]))),X(_n||(_n=C(["\n display: none;\n "]))))},function(e){return e.mobile&&Y(Nn||(Nn=C(["\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ",";\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ",";\n }\n }\n "])),K.palette.neutral,K.palette.light)}),ot=function(n){var t,r,a=n.icons;if(!a)return null;var o=Object.values(a),i=o.some(function(e){var n,t,r=e.location;return null==(n=null==r||null==(t=r.toolbar)?void 0:t.mobile)||n}),s=o.some(function(e){var n,t,r=e.location;return null!=(n=null==r||null==(t=r.toolbar)?void 0:t.desktop)&&n}),d=null==(t=a.topic)?void 0:t.url,u=null==(r=a.errata)?void 0:r.url;return e.jsxs(at,j({},{mobile:i,desktop:s},{children:[d?e.jsxs("a",{href:d,target:"_blank",children:[e.jsx(l.FontAwesomeIcon,{icon:c.faBookOpen}),e.jsx("span",{children:"View topic in textbook"})]}):null,u?e.jsxs("a",{href:u,target:"_blank",children:[e.jsx(l.FontAwesomeIcon,{icon:c.faTriangleExclamation}),e.jsx("span",{children:"Suggest a correction"})]}):null]}))},it=w.default.div(qn||(qn=C(["\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ",";}\n .popover { display: flex; }\n }\n ","\n ","\n"])),K.palette.mediumBlue,function(e){return!e.desktop&&r.css(Sn||(Sn=C(["\n ","\n ","\n "])),$(An||(An=C(["\n display: none;\n "]))),X(In||(In=C(["\n display: none;\n "]))))},function(e){return!e.mobile&&Y(Mn||(Mn=C(["\n display: none;\n "])))}),st=w.default.div(En||(En=C(["\n position: relative;\n display: flex;\n"]))),lt=w.default.div(Tn||(Tn=C(["\n ","\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n"])),ee.popover),ct=function(n){return e.jsx(it,j({},n.wrapperProps,{mobile:n.mobile,desktop:n.desktop,"aria-label":n.text,children:e.jsxs(st,{children:[n.children,e.jsxs(lt,{className:"popover right",children:[e.jsx("div",{className:"arrow"}),e.jsx("div",{className:"content",children:n.text})]})]})}))},dt=w.default.div(On||(On=C(["\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n"]))),ut=w.default(l.FontAwesomeIcon)(Hn||(Hn=C(["\n color: ",";\n height: 1em;\n"])),K.palette.darkGray),pt=function(n){var t,r,a,o,i=n.exercise,s=n.icons,l={desktop:!0,mobile:!1},c=[],m=i.questions.every(function(e){return e.answers.length>0});return m&&i.questions.find(function(e){return e.formats.includes("free-response")})?t="In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. Recalling the answer to a question from memory helps you to retain things longer.":m&&(t="Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts."),s.topic&&c.push(e.jsx(ct,j({text:"View topic in textbook",wrapperProps:{as:"a",href:s.topic.url,target:"_blank"}},(null==(r=s.topic.location)?void 0:r.header)||l,{children:e.jsx(ut,{icon:d.faBookOpen})}),"topic")),s.errata&&c.push(e.jsx(ct,j({text:"Suggest a correction",wrapperProps:{as:"a",href:s.errata.url,target:"_blank"}},(null==(a=s.errata.location)?void 0:a.header)||l,{children:e.jsx(ut,{icon:u.faTriangleExclamation})}),"errata")),s.info&&t&&c.push(e.jsx(ct,j({text:t},(null==(o=s.info.location)?void 0:o.header)||l,{children:e.jsx(ut,{icon:p.faCircleInfo,height:"16px",width:"16px"})}),"type")),e.jsx(dt,{children:c})},mt=["numberOfQuestions","questionNumber","step","exercise","show_all_feedback","scrollToQuestion","exerciseIcons"],ft=w.default(Se)(Fn||(Fn=C(["\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n"]))),ht=r.createGlobalStyle(Pn||(Pn=C(["\n :root {\n --content-text-scale: 1;\n }\n"]))),xt=w.default.div(zn||(zn=C(["\n ","\n\n ","\n"])),function(e){return e.desktopToolbarEnabled&&r.css(Ln||(Ln=C(["\n ","\n ","\n ","\n "])),$(Bn||(Bn=C(["\n "," {\n margin-left: 6.8rem;\n }\n "])),ft),X(Rn||(Rn=C(["\n "," {\n margin-left: 4.8rem;\n }\n "])),ft),Y(Qn||(Qn=C(["\n "," {\n margin-left: 0;\n }\n "])),ft))},function(e){return e.mobileToolbarEnabled&&r.css(Jn||(Jn=C(["\n ","\n "])),Y(Vn||(Vn=C(["\n "," + "," "," {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n "])),at,Ce,ke))}),bt=function(n){return e.jsxs(xt,{desktopToolbarEnabled:n.desktopToolbarEnabled,mobileToolbarEnabled:n.mobileToolbarEnabled,children:[e.jsx(ot,{icons:n.exerciseIcons}),e.jsx(ft,j({},n))]})},gt=function(n){var t=n.exercise;return e.jsxs(e.Fragment,{children:[t.context&&e.jsx(D,{className:"step-card-body exercise-context",block:!0,html:t.context}),t.stimulus_html&&e.jsx(D,{className:"step-card-body exercise-stimulus",block:!0,html:t.stimulus_html})]})},wt=w.default(function(n){var r=n.numberOfQuestions,a=n.questionNumber,o=n.step,i=n.exercise,s=n.show_all_feedback,l=n.scrollToQuestion,c=n.exerciseIcons,d=k(n,mt),u="feedback_html"in o,p=g.default.useRef([]),m=g.default.useRef(null),f=g.default.useCallback(function(){m.current&&function(e,n){try{void 0===n&&(n=window),Promise.resolve(rt()).then(function(){return n&&n.MathJax&&n.MathJax.Hub?e.querySelector("[data-math]:not(.math-rendered), math:not(.math-rendered)")?yn(e,n)():Promise.resolve():(console.warn("Warning: Expected MathJax to be initialized."),Promise.resolve())})}catch(e){return Promise.reject(e)}}(m.current)},[]);g.default.useEffect(function(){var e=l&&p.current[l];e&&v.default(e)},[l,i]);var h=Object.values(c||{}).some(function(e){var n,t=e.location;return null==t||null==(n=t.toolbar)?void 0:n.desktop}),x=Object.values(c||{}).some(function(e){var n,t=e.location;return null==t||null==(n=t.toolbar)?void 0:n.mobile});return e.jsxs(J.Provider,{value:f,children:[e.jsx(ht,{}),e.jsx(bt,j({step:o,questionNumber:a,numberOfQuestions:u?r:i.questions.length,rightHeaderChildren:c?e.jsx(pt,{exercise:i,icons:c}):null,showTotalQuestions:u,desktopToolbarEnabled:h,mobileToolbarEnabled:x},c?{exerciseIcons:c}:null,{className:d.className,children:e.jsxs("div",{ref:m,children:[e.jsx(gt,{exercise:i}),i.questions.map(function(e,n){var r,l=j({},u?o:d.questionStates[e.id]);return t.createElement(hn,j({},d,j({},l,{available_points:void 0}),{ref:function(e){return p.current[a+n]=e},exercise_uid:i.uid,key:e.id,question:e,questionNumber:a+n,choicesEnabled:l.canAnswer,displaySolution:!0,detailedSolution:null==(r=l.solution)?void 0:r.content_html,show_all_feedback:s,tableFeedbackEnabled:s&&!u,canUpdateCurrentStep:"canUpdateCurrentStep"in d?d.canUpdateCurrentStep:!(n+1===i.questions.length)}))})]})}))]})})(Dn||(Dn=C(["\n"]))),vt=function(){return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M14.556 2.09149C15.2296 1.78355 16 2.26721 16 2.99824V10.5951C16 10.9241 15.8362 11.2328 15.5605 11.4188C14.4229 12.1864 13.2007 12.6956 11.6715 12.6956C9.53267 12.6956 8.12768 11.6087 6.42651 11.6087C4.81213 11.6087 3.69241 11.923 2.79365 12.3V15.25C2.79365 15.6642 2.45254 16 2.03175 16H1.52381C1.10302 16 0.761905 15.6642 0.761905 15.25V3.18577C0.301492 2.86952 0 2.34455 0 1.74999C0 0.75924 0.836349 -0.0391985 1.852 0.00148899C2.75575 0.0376765 3.49578 0.75049 3.55203 1.63912C3.56854 1.8998 3.52632 2.1488 3.43819 2.37543C4.09648 2.13699 4.80613 1.99999 5.59835 1.99999C7.73718 1.99999 9.14216 3.08696 10.8433 3.08696C12.1289 3.08696 13.4659 2.5899 14.556 2.09149ZM2.79365 4.20718V6.40999C3.71429 6.07656 4.41841 5.85281 5.13016 5.75656V3.51999C4.38413 3.5878 3.84635 3.82593 2.79365 4.20718ZM9.80317 4.49437C8.96454 4.34837 8.21949 4.05752 7.46667 3.82749V5.93437C8.23413 6.14393 8.9767 6.44824 9.80317 6.63156V4.49437ZM5.13016 5.75656V7.94531C6.1713 7.85224 6.84159 7.92546 7.46667 8.06406V5.93437C6.66517 5.71452 5.98791 5.6399 5.13016 5.75656ZM7.46667 10.2012C8.30279 10.3466 9.04546 10.6365 9.80317 10.8681V8.76156C9.03248 8.55074 8.29397 8.24749 7.46667 8.06406V10.2012ZM2.79365 10.6906C3.54349 10.4284 4.31079 10.2581 5.13016 10.1731V7.94531C4.30127 8.01874 3.62667 8.19656 2.79365 8.48781V10.6906ZM14.4762 3.76562C13.8 4.04218 12.9971 4.31687 12.1397 4.4678V6.71499C13.0067 6.57874 13.7279 6.27437 14.4762 5.96843V3.76562ZM14.4762 10.3269V8.12406C13.7717 8.56781 12.9276 8.83062 12.1397 8.93718V11.1741C12.9356 11.0997 13.679 10.8291 14.4762 10.3269ZM9.80317 6.63156V8.76156C10.6179 8.9845 11.283 9.05349 12.1397 8.93718V6.71499C11.3143 6.84584 10.5542 6.79862 9.80317 6.63156Z",fill:"currentColor"})})},yt=w.default.nav(Un||(Un=C(["\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ","\n"])),Y(Wn||(Wn=C(["\n padding: 1.6rem 0.8rem;\n "])))),jt=w.default.span(Zn||(Zn=C(["\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n"]))),kt="box-shadow: 0px 1px 4px 0px #00000066;",Ct=w.default.button($n||($n=C(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: ",";\n height: ",";\n border: 0;\n border-radius: 50%;\n margin: ",";\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ",";\n ","\n ","\n &:hover {\n ","\n }\n"])),function(e){return e.isActive?"4rem":"3.2rem"},function(e){return e.isActive?"4rem":"3.2rem"},function(e){return e.isActive?"0":"0 0.3rem"},K.palette.neutralDarker,function(e){return e.isActive?r.css(et||(et=C(["\n ","\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n "])),kt):null},function(e){return function(e){switch(e){case"isStatus":return r.css(Gn||(Gn=C(["\n background-color: ",";\n "])),K.palette.neutralBright);case"isCorrect":return r.css(Kn||(Kn=C(["\n color: ",";\n background-color: #E8F4D8;\n "])),K.answer.correct);case"isIncorrect":return r.css(Yn||(Yn=C(["\n color: ",";\n background-color: #F8E8EA;\n "])),K.answer.incorrect);default:return r.css(Xn||(Xn=C(["\n background-color: ",";\n "])),K.palette.neutralBright)}}(e.variant)},kt),_t=w.default(l.FontAwesomeIcon)(nt||(nt=C(["\n background: ",";\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n"])),function(e){return e.color}),Nt=function(n){var t=n.variant;if(!t||"isCorrect"!==t&&"isIncorrect"!==t)return null;var r={isCorrect:{icon:m.faCheck,color:K.answer.correct,label:"Correct"},isIncorrect:{icon:f.faXmark,color:K.answer.incorrect,label:"Incorrect"}}[t];return e.jsx(_t,{icon:r.icon,color:r.color,height:"16px",width:"16px","aria-label":r.label,"aria-hidden":void 0})},qt=function(n){var t=n.index,r=n.isActive,a=n.step,o=n.goToStep;return e.jsxs(jt,{children:[e.jsx(Ct,{variant:a.variant,isActive:r,onClick:function(){return o(t,a)},"aria-current":r?"location":"false","aria-label":"isStatus"===a.variant?"Assignment status":"Question "+(t+1),children:"isStatus"===a.variant?e.jsx(vt,{}):t+1}),e.jsx(Nt,{variant:a.variant})]})},St=w.default.div(tt||(tt=C(["\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ",";\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n"])),K.palette.light);exports.Answer=se,exports.AnswersTable=ve,exports.CompletionStatus=Ke,exports.Exercise=wt,exports.ExerciseToolbar=ot,exports.FreeResponseInput=cn,exports.FreeResponseTextArea=sn,exports.InnerStepCard=ke,exports.Loader=function(){return e.jsx(St,{children:e.jsx(h.BulletList,{uniqueKey:"OSLoader"})})},exports.OuterStepCard=Ce,exports.ProgressBar=function(n){var t=n.activeIndex,r=n.goToStep;return e.jsx(yt,{"aria-label":"Breadcrumbs",children:n.steps.map(function(n,a){return e.jsx(qt,{index:a,isActive:a===t,step:n,goToStep:r},a)})})},exports.ProgressBarItem=qt,exports.Question=Xe,exports.QuestionHtml=$e,exports.StepCard=qe,exports.StyledItem=Ct,exports.StyledToolbar=at,exports.TaskStepCard=Se; +//# sourceMappingURL=index.js.map diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..0cc7777 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sources":["../src/utils.ts","../src/theme.ts","../src/hooks/useTypesetMath.ts","../src/components/Content.tsx","../src/components/Feedback.tsx","../src/components/Answer.tsx","../src/constants.ts","../src/components/AnswersTable.tsx","../src/components/Card.tsx","../src/components/StepCardFooter.tsx","../src/components/Button.tsx","../src/components/CompletionStatus.tsx","../src/components/Question.tsx","../src/components/FreeResponseInput.tsx","../src/components/ExerciseQuestion.tsx","../src/helpers/mathjax.ts","../src/components/ExerciseToolbar.tsx","../src/components/ExerciseHeaderIcons.tsx","../src/components/Exercise.tsx","../src/assets/flag.tsx","../src/components/ProgressBar.tsx","../src/components/Loader.tsx"],"sourcesContent":["import { Answer, ID } from '../src/types';\n\nexport const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nconst MAX_CORRECTNESS = '1.0';\n\nexport const isAnswerCorrect = function(answer: Answer, correctAnswerId?: ID | null) {\n // if answer does not have an id, check the isCorrect property.\n if (!(answer.id || correctAnswerId)) {\n return answer.isCorrect;\n }\n let isCorrect = answer.id === correctAnswerId;\n if (answer.correctness != null) { isCorrect = (answer.correctness === MAX_CORRECTNESS); }\n\n return isCorrect;\n};\n\nexport const isAnswerIncorrect = (answer: Answer, incorrectAnswerId?: ID) =>\n // Allow multiple attempts to show incorrectness without the correct_answer_id\n answer.id === incorrectAnswerId;\n\nexport const isAnswerChecked = (answer: Answer, answerId?: ID) =>\n answer.id == answerId;\n\nexport function countWords(text: string) {\n const trimmedText = text.trim();\n //https://css-tricks.com/build-word-counter-app/\n const words = trimmedText.match(/\\b[-?(\\w+)?]+\\b/gi);\n if(!words) return 0;\n return words.length;\n}\n\nexport const numberfyId = (id: ID) => typeof id === 'string' ? parseInt(id, 10) : id;\n","import { css } from 'styled-components';\n\nconst palette = {\n red: \"#ca2026\",\n danger: \"#c2002f\",\n darkRed: \"#c22032\",\n lightRed: \"#e298a0\",\n green: \"#77af42\",\n lightGreen: \"#8bc753\",\n darkGreen: \"#63a524\",\n paleYellow: \"#ffffbb\",\n teal: \"#0dc0de\",\n blue: \"#007da4\",\n mediumBlue: \"#026AA1\",\n lightBlue: \"#34bdd8\",\n neutralLightBlue: \"#0dc0dc\",\n tangerine: \"#ffbd3e\",\n gray: \"#5e5e5e\",\n darkGray: \"#757575\",\n pale: \"#d5d5d5\",\n light: \"#e4e4e4\",\n white: \"#ffffff\",\n neutralLightest: \"#f9f9f9\", // nearly white\n neutralCool: \"#f6f7f8\", // cool bright gray\n neutralBright: \"#f5f5f5\", // bright gray\n neutralLighter: \"#f1f1f1\", // light gray\n neutralLight: \"#e5e5e5\", // light gray\n neutralMedium: \"#a0a0a0\", // light gray\n neutral: \"#818181\", // gray\n neutralThin: \"#6f6f6f\", // medium gray\n neutralDark: \"#5f6163\", // dark gray\n neutralFeedback: \"#555\", // another dark gray\n neutralDarker: \"#424242\", // very dark gray\n black: \"#000000\",\n orange: \"#D4450C\"\n};\n\nexport const colors = {\n palette: palette,\n answer: {\n neutral: palette.neutralThin,\n hover: '#026AA1',\n checked: '#026AA1',\n correct: '#0D7741',\n incorrect: '#C22032'\n },\n popover: {\n arrowOuterColor: \"rgba(0, 0, 0, 0.25)\",\n borderColor: \"rgba(0, 0, 0, 0.2)\",\n },\n card: {\n header: {\n background: \"#daf3f8\"\n },\n body: {\n background: \"#fdfdfd\"\n }\n },\n button: {\n background: palette.orange,\n backgroundHover: \"#E74B0D\",\n backgroundActive: \"#C5400B\"\n },\n freeResponse: {\n color: palette.neutralDarker,\n background:palette.neutralLighter,\n },\n};\n\nexport const layouts = {\n answer: {\n verticalSpacing: \"1rem\",\n horizontalSpacing: \"1rem\",\n horizontalBuffer: \"2.5rem\",\n bubbleSize: \"3.6rem\",\n labelSpacing: \"6.5rem\",\n feedback: {\n popover: {\n horizontalSpacing: \"1.1rem\",\n verticalSpacing: \"0.9rem\",\n maxWidth: \"370px\",\n },\n },\n },\n popover: {\n arrow: {\n width: \"16px\",\n height: \"8px\",\n edgeDistance: \"9px\",\n },\n horizontalSpacing: \"0.8rem\",\n verticalSpacing: \"1rem\",\n horizontalBuffer: \"4rem\",\n borderWidth: \"1px\",\n maxWidth: \"325px\",\n },\n card: {\n spacing: '2rem'\n }\n};\n\nexport const BREAKPOINTS = {\n mobile: 600,\n tablet: 999,\n desktop: 1000,\n large: 1600,\n};\n\nexport const breakpoints = {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n tablet(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.tablet}px) { ${css(...args)} }`;\n },\n desktop(...args: Parameters) {\n return css`@media(min-width: ${BREAKPOINTS.desktop}px) { ${css(...args)} }`;\n },\n only: {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n },\n margins: {\n mobile: '8px',\n tablet: '24px',\n },\n};\n\nexport const transitions = {\n answer: \"0.1s ease-in-out\",\n}\n\nexport const mixins = {\n answer: () => css`\n .answer-label {\n display: inline-flex;\n }\n color: ${palette.neutralDarker};\n .answer-letter-wrapper::before {\n width: ${layouts.answer.bubbleSize};\n height: ${layouts.answer.bubbleSize};\n min-width: ${layouts.answer.bubbleSize};\n min-height: ${layouts.answer.bubbleSize};\n border-radius: calc(${layouts.answer.bubbleSize} / 2);\n border-width: 2px;\n border-style: solid;\n border-color: #c6c6c6;\n color: ${colors.answer.neutral};\n transition: color ${transitions.answer}, border-color ${transitions.answer}, background-color ${transitions.answer};\n background-color: ${colors.palette.white};\n font-family: \"Neue Helvetica W01\", Helvetica, Arial, sans-serif;\n box-sizing: border-box;\n font-weight: normal;\n }\n `,\n answerColor: (\n color: string, invertBubble = false\n ) => css`\n .answer-letter-wrapper::before {\n color: ${invertBubble ? '#fff' : color};\n border-color: ${color};\n ${invertBubble ? `background-color: ${color};` : null}\n }\n `,\n answerChecked: () => mixins.answerColor(colors.answer.checked, true),\n answerCorrect: (checked?: boolean) => mixins.answerColor(colors.answer.correct, checked),\n answerIncorrect: (checked?: boolean) => mixins.answerColor(colors.answer.incorrect, checked),\n answerHover: () => css`\n ${mixins.answerColor(colors.answer.hover)};\n font-weight: bold;\n `,\n answerCorrectAnswer: () => mixins.answerColor(colors.answer.correct, false),\n resetText: () => css`\n font-family: \"Neue Helvetica W01\", Helvetica, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-style: normal;\n font-weight: 400;\n line-height: 1.6;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n `,\n stepCardPadding: () => css`\n padding: 48px 140px;\n\n ${breakpoints.tablet`\n padding: ${breakpoints.margins.tablet} ${breakpoints.margins.tablet};\n `}\n\n ${breakpoints.mobile`\n padding: calc(${breakpoints.margins.mobile} * 2) ${breakpoints.margins.mobile};\n `}\n `,\n popover: () => css`\n ${mixins.resetText()}\n\n z-index: 1;\n position: relative;\n border: ${layouts.popover.borderWidth} solid ${colors.popover.borderColor};\n background-color: ${colors.palette.white};\n background-clip: padding-box;\n max-width: ${layouts.popover.maxWidth};\n margin: calc(${layouts.popover.arrow.height} - 14px) 0 ${layouts.answer.horizontalSpacing} 8px;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);\n color: ${colors.palette.neutralThin};\n font-size: calc(1.4rem * var(--content-text-scale));\n\n .arrow {\n position: absolute;\n display: block;\n width: ${layouts.popover.arrow.width};\n height: ${layouts.popover.arrow.height};\n margin-left: ${layouts.popover.arrow.edgeDistance};\n top: calc(${layouts.popover.arrow.height} * -1);\n\n &::before,\n &::after {\n position: absolute;\n display: block;\n content: \"\";\n border-color: transparent;\n border-style: solid;\n border-width: 0 calc(${layouts.popover.arrow.width} / 2) ${layouts.popover.arrow.height} calc(${layouts.popover.arrow.width} / 2);\n }\n &::before {\n top: 0;\n border-bottom-color: ${colors.popover.borderColor};\n }\n &::after {\n top: ${layouts.popover.borderWidth};\n border-bottom-color: ${colors.palette.white};\n }\n }\n\n &.right {\n right: calc(-${layouts.popover.arrow.edgeDistance} - ${layouts.popover.borderWidth});\n .arrow { right: ${layouts.popover.arrow.edgeDistance}; }\n }\n\n\n > .content {\n padding: ${layouts.popover.verticalSpacing} ${layouts.popover.horizontalSpacing};\n }\n `,\n visuallyHidden: () => css`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n `\n};\n\nconst theme = {\n colors: colors,\n layouts: layouts,\n transitions: transitions,\n breakpoints: breakpoints,\n};\n\nexport default theme;\n","import React from \"react\";\n\nexport const TypesetMathContext = React.createContext<() => void>(() => { throw new Error('context not initialized') });\nexport const useTypesetMath = () => React.useContext(TypesetMathContext);\n","import React from \"react\";\nimport { useTypesetMath } from \"../hooks/useTypesetMath\";\n\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\ntype ComponentType = keyof JSX.IntrinsicElements | React.JSXElementConstructor;\n\nexport interface ContentProps {\n className?: string;\n component?: T extends undefined ? undefined :\n T extends ComponentType ? React.ReactComponentElement:\n never;\n html: string;\n block?: boolean;\n}\n\nexport const Content = ((\n {html, component, block = false, ...props}: ContentProps\n) => {\n const typesetMath = useTypesetMath();\n\n React.useEffect(() => {\n typesetMath();\n }, [typesetMath, html])\n\n if (component !== undefined) {\n return React.cloneElement(component, {html, ...props});\n }\n if (block) {\n return
;\n } else {\n return ;\n }\n});\n","import classnames from 'classnames';\nimport { Content } from './Content';\n\ninterface FeedbackProps {\n position?: 'top' | 'bottom' | 'left' | 'right';\n children: string;\n className?: string;\n contentRenderer?: JSX.Element;\n id: string\n}\n\nconst SimpleFeedback = (props: Pick) => (\n \n);\n\nconst Feedback = ({ id, ...props }: FeedbackProps) => {\n const position = props.position || 'bottom';\n const wrapperClasses = classnames('question-feedback', position);\n\n return (\n \n );\n};\n\nexport { Feedback, SimpleFeedback };\n","import cn from 'classnames';\nimport { ReactNode } from 'react';\nimport { ALPHABET, isAnswerChecked, isAnswerCorrect, isAnswerIncorrect } from '../utils';\nimport { Answer as AnswerType, ID } from '../types';\nimport { Content } from './Content';\nimport { SimpleFeedback } from './Feedback';\nimport styled from 'styled-components';\nimport { colors } from '../theme';\n\nconst StyledAnswerIndicator = styled.div<{ state: boolean }>`\n color: ${props => props.state ? colors.answer.correct : colors.answer.incorrect};\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n`;\n\nconst AnswerIndicator = (\n { isCorrect, isIncorrect }: { isCorrect?: boolean; isIncorrect?: boolean }\n) => {\n if (!isCorrect && !isIncorrect) {\n return null;\n }\n const state = isCorrect || isIncorrect === false;\n\n return \n {state ? 'Correct' : 'Incorrect'} Answer\n \n};\n\nexport interface AnswerProps {\n answer: AnswerType;\n iter: number;\n qid: ID;\n type: 'teacher-review' | 'teacher-preview' | 'student' | 'student-mpp';\n hasCorrectAnswer?: boolean;\n onChangeAnswer?: (answer: AnswerType) => void;\n disabled: boolean;\n answerId?: ID;\n correctAnswerId?: ID | null;\n incorrectAnswerId?: ID;\n onKeyPress?: () => void;\n answered_count?: number;\n correctIncorrectIcon?: ReactNode,\n radioBox?: ReactNode;\n contentRenderer?: JSX.Element;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n feedbackId?: string;\n}\n\ntype AnswerAnswerProps = Pick<\n AnswerBodyProps,\n 'answer' |\n 'contentRenderer' |\n 'show_all_feedback' |\n 'tableFeedbackEnabled' |\n 'isCorrect' |\n 'isIncorrect'\n>;\n\nconst AnswerAnswer = (props: AnswerAnswerProps) => {\n const {\n answer: { content_html, feedback_html },\n contentRenderer,\n show_all_feedback,\n tableFeedbackEnabled,\n isCorrect,\n isIncorrect,\n } = props;\n return (\n
\n \n \n {show_all_feedback && feedback_html && !tableFeedbackEnabled &&\n \n {feedback_html}\n }\n
\n )\n}\n\ninterface AnswerBodyProps extends AnswerProps {\n isCorrect?: boolean;\n isSelected?: boolean;\n isIncorrect?: boolean;\n}\n\nconst TeacherReview = (props: AnswerBodyProps) => {\n const {\n answer,\n answered_count,\n isCorrect,\n contentRenderer,\n iter,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const percent = answer.selected_count && answered_count\n ? Math.round((answer.selected_count / answered_count) * 100)\n : 0;\n return (\n
\n
\n \n {answer.selected_count}\n \n \n {ALPHABET[iter]}\n \n
\n \n
\n );\n}\n\nconst AnswerChoice = (props: AnswerBodyProps) => {\n const {\n type,\n iter,\n answer,\n disabled,\n onKeyPress,\n qid,\n contentRenderer,\n correctIncorrectIcon,\n feedbackId,\n isSelected,\n isCorrect,\n isIncorrect,\n hasCorrectAnswer,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const ariaLabel = `${isSelected ? 'Selected ' : ''}Choice ${ALPHABET[iter]}:`;\n let onChangeAnswer: AnswerProps['onChangeAnswer'];\n\n const onChange = () => onChangeAnswer && onChangeAnswer(answer);\n\n if (!hasCorrectAnswer\n && (type !== 'teacher-review')\n && (type !== 'teacher-preview')\n && (type !== 'student-mpp')) {\n ({ onChangeAnswer } = props);\n }\n\n return <>\n {type === 'teacher-preview' &&\n
\n {isCorrect && correctIncorrectIcon}\n
}\n \n \n \n
\n \n \n \n}\n\nconst AnswerBody = (props: AnswerBodyProps) => {\n return props.type === 'teacher-review'\n ? \n : \n}\n\nexport const Answer = (props: AnswerProps) => {\n const {\n type,\n answer,\n disabled,\n answerId,\n correctAnswerId,\n incorrectAnswerId,\n } = props;\n\n const isChecked = isAnswerChecked(answer, answerId);\n const isCorrect = isAnswerCorrect(answer, correctAnswerId);\n const isIncorrect = isAnswerIncorrect(answer, incorrectAnswerId);\n // When rendering a previous response, we can determine if it was this answer.\n // If there is no incorrectAnswerId, that means only a correct answer is present, check isCorrect.\n // If an incorrectAnswerId is present (there is only ever one, if multiple attempts are enabled,\n // it is the latest one) checking isIncorrect works because incorrectAnswerId is only set for\n // a missed attempt, meaning if an attempt is missed and then successfully re-attempted,\n // incorrectAnswerId will be empty.\n const isPreviousResponse = answerId === undefined && (!incorrectAnswerId && isCorrect || isIncorrect);\n\n const isSelected = isChecked || isPreviousResponse;\n const classes = cn('answers-answer', {\n 'disabled': disabled,\n 'answer-selected': isSelected,\n 'answer-correct': isCorrect && type !== 'student-mpp',\n 'answer-incorrect': incorrectAnswerId && isAnswerIncorrect(answer, incorrectAnswerId),\n });\n\n return (\n
\n
\n \n
\n
\n );\n}\nAnswer.displayName = 'OSAnswer';\n","import { AnswerDisplayType } from './types';\n\nexport const defaultAnswerType: AnswerDisplayType = 'student';\n","import { defaultAnswerType } from \"../constants\";\nimport { Answer as AnswerType, AnswerDisplayType, ID, ExerciseQuestionData } from \"src/types\";\nimport { Answer } from \"./Answer\";\nimport { Feedback } from \"./Feedback\";\n\nexport interface AnswersTableProps {\n question: ExerciseQuestionData;\n type?: AnswerDisplayType;\n answer_id?: ID;\n correct_answer_id?: ID | null;\n incorrectAnswerId?: ID;\n answerIdOrder?: ID[],\n feedback_html: string;\n correct_answer_feedback_html?: string;\n answered_count?: number;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n onChangeAnswer: () => void;\n hideAnswers: boolean;\n hasCorrectAnswer?: boolean;\n onChangeAttempt?: () => void;\n choicesEnabled?: boolean;\n onKeyPress?: () => void;\n contentRenderer?: JSX.Element;\n instructions?: JSX.Element;\n}\n\nexport const AnswersTable = (props: AnswersTableProps) => {\n let idCounter = 0;\n\n const {\n question, hideAnswers, type = defaultAnswerType, answered_count, choicesEnabled, correct_answer_id,\n incorrectAnswerId, answer_id, feedback_html, correct_answer_feedback_html,\n show_all_feedback = false, tableFeedbackEnabled, hasCorrectAnswer, onChangeAnswer, onKeyPress, answerIdOrder, instructions\n } = props;\n if (hideAnswers) { return null; }\n\n const { id } = question;\n\n const feedback: { index: number, html: string, id: string }[] = [];\n\n const sortedAnswersByIdOrder = (idOrder: ID[]) => {\n const { answers } = question;\n return answers.slice().sort((a, b) => idOrder.indexOf(a.id) - idOrder.indexOf(b.id));\n }\n\n const questionAnswerProps = {\n qid: id || `auto-${idCounter++}`,\n answerId: answer_id,\n correctAnswerId: correct_answer_id,\n incorrectAnswerId,\n hasCorrectAnswer,\n onChangeAnswer: onChangeAnswer,\n type,\n answered_count,\n disabled: !choicesEnabled,\n show_all_feedback,\n tableFeedbackEnabled,\n onKeyPress\n };\n\n const answers = answerIdOrder ? sortedAnswersByIdOrder(answerIdOrder) : question.answers;\n\n const answersHtml = answers.map((answer, i) => {\n const additionalProps: { answer: AnswerType, iter: number, key: string }\n = {\n answer: {\n ...answer,\n question_id: typeof question.id === 'string' ? parseInt(question.id, 10) : question.id\n },\n iter: i,\n key: `${questionAnswerProps.qid}-option-${i}`,\n };\n const answerProps = Object.assign({}, additionalProps, questionAnswerProps);\n let html: string | undefined;\n let feedbackId: string | undefined;\n\n if (show_all_feedback && answer.feedback_html && tableFeedbackEnabled) {\n html = answer.feedback_html;\n } else if (answer.id === incorrectAnswerId && feedback_html) {\n html = feedback_html;\n } else if (answer.id === correct_answer_id && correct_answer_feedback_html) {\n html = correct_answer_feedback_html;\n }\n\n if (html) {\n feedbackId = `feedback-${questionAnswerProps.qid}-${i}`\n feedback.push({ index: i, html, id: feedbackId });\n }\n\n return (\n \n );\n });\n\n feedback.forEach((item, i) => {\n const spliceIndex = item.index + i + 1;\n answersHtml.splice(spliceIndex, 0, (\n \n {item.html}\n \n ));\n });\n\n return (\n
\n {instructions}\n {answersHtml}\n
\n );\n}\n","import { ReactNode } from \"react\";\nimport { breakpoints, colors, layouts, mixins } from \"../theme\";\nimport { AvailablePoints, StepBase, StepWithData } from \"../types\";\nimport styled from \"styled-components\";\nimport cn from \"classnames\";\n\nexport const InnerStepCard = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ${breakpoints.desktop`\n max-width: 1000px;\n `}\n`;\n\nexport const OuterStepCard = styled.div`\n padding: ${layouts.card.spacing};\n\n ${breakpoints.mobile`\n padding: 0;\n `}\n`;\n\nconst StepCardHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ${colors.card.header.background};\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ${colors.palette.gray};\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ${breakpoints.desktop`\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n `}\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ${breakpoints.tablet`\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.tablet};\n }\n button.ox-icon-angle-right {\n margin-left: ${breakpoints.margins.tablet};\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n `}\n\n ${breakpoints.mobile`\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n`;\nStepCardHeader.displayName = 'StepCardHeader';\n\nconst StepCardQuestion = styled.div<{ unpadded?: boolean }>`\n .step-card-body {\n ${mixins.stepCardPadding()}\n overflow: auto;\n background: ${colors.card.body.background};\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ${breakpoints.only.mobile`\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n `}\n\n .reading-step & {\n padding: 0;\n }\n\n ${breakpoints.desktop`\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n `}\n\n ${breakpoints.mobile`\n .openstax-exercise-badges svg {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n`;\n\ninterface SharedProps {\n questionNumber: number;\n numberOfQuestions: number;\n showTotalQuestions: boolean;\n leftHeaderChildren?: ReactNode;\n rightHeaderChildren?: ReactNode;\n headerTitleChildren?: ReactNode;\n}\n\nexport interface StepCardProps extends SharedProps {\n unpadded: boolean;\n className?: string;\n children?: ReactNode;\n stepType: StepWithData['type'];\n availablePoints?: AvailablePoints;\n questionId?: string;\n multipartBadge?: ReactNode;\n isHomework: boolean;\n}\n\nconst StepCard = ({\n questionNumber,\n numberOfQuestions,\n showTotalQuestions,\n stepType,\n isHomework,\n availablePoints,\n unpadded, // currently does nothing; may need to restore if this causes tutor stepcard regression\n className,\n children,\n questionId,\n multipartBadge,\n leftHeaderChildren,\n rightHeaderChildren,\n headerTitleChildren,\n ...otherProps }: StepCardProps) => {\n\n const formattedQuestionNumber = numberOfQuestions > 1\n ? `Questions ${questionNumber} - ${questionNumber + numberOfQuestions - 1}`\n : `Question ${questionNumber}`;\n\n return (\n \n {multipartBadge}\n \n {questionNumber && isHomework && stepType === 'exercise' &&\n \n
\n {leftHeaderChildren}\n

\n {headerTitleChildren}\n {formattedQuestionNumber}\n {showTotalQuestions ?  / {numberOfQuestions} : null}\n |\n ID: {questionId}\n

\n
\n {availablePoints || rightHeaderChildren ?
\n {availablePoints &&
{availablePoints} Points
}\n {rightHeaderChildren}\n
: null}\n
\n }\n {children}\n
\n
\n )\n};\nStepCard.displayName = 'OSStepCard';\n\nexport interface TaskStepCardProps extends SharedProps {\n className?: string;\n children?: ReactNode;\n step: StepBase | StepWithData;\n questionNumber: number;\n numberOfQuestions: number;\n}\n\nconst TaskStepCard = ({\n step,\n questionNumber,\n numberOfQuestions,\n children,\n className,\n ...otherProps\n}: TaskStepCardProps) =>\n(\n {children}\n);\n\nTaskStepCard.displayName = 'OSTaskStepCard';\n\nexport { StepCard, TaskStepCard };\n","import { colors, breakpoints, mixins } from \"../theme\";\nimport styled from \"styled-components\";\n\nexport const StepCardFooter = styled.div`\n ${mixins.stepCardPadding()}\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ${colors.card.body.background};\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ${colors.palette.pale};\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ${breakpoints.mobile`\n flex-wrap: wrap;\n `}\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ${breakpoints.desktop`\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n `}\n`;\n","import { colors } from \"../theme\";\nimport styled from \"styled-components\";\n\nconst StyledButton = styled.button`\n background-color: ${colors.button.background};\n color: ${colors.palette.white};\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ${colors.button.backgroundHover}\n }\n &:active {\n background: ${colors.button.backgroundActive}\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n`;\n\ninterface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting?: never;\n waitingText?: never;\n}\ninterface WaitingButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting: boolean;\n waitingText: string;\n}\n\nconst Button = (props: ButtonProps | WaitingButtonProps) => {\n const { disabled, isWaiting, waitingText, children, ...otherProps } = props;\n\n return (\n {(isWaiting && waitingText) || children}\n );\n}\n\nexport default Button;\n","import styled, { createGlobalStyle } from \"styled-components\";\nimport { InnerStepCard } from \"./Card\";\nimport Button from \"./Button\";\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nexport interface CompletionStatusProps {\n numberOfQuestions: number;\n numberCompleted: number;\n handleClick: () => void;\n className?: string;\n}\n\nconst CompletionStatusCard = styled(InnerStepCard)`\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n`;\n\nconst CompletionHeader = styled.h2`\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n`;\n\nexport const CompletionStatus = styled(({\n numberOfQuestions, numberCompleted, handleClick, className\n}: CompletionStatusProps) => {\n\n const allCompleted = numberOfQuestions === numberCompleted;\n const someCompleted = numberCompleted > 0;\n const buttonText = allCompleted ? 'Next' : (\n someCompleted ? 'Continue' : 'Start'\n );\n\n return <>\n \n \n {allCompleted ? 'You are done.' : (someCompleted ? 'Quiz is partially complete.' : 'No questions have been answered.')}\n

{allCompleted ? 'Great job answering all the questions.' : (someCompleted ? `You've completed ${numberCompleted} of ${numberOfQuestions} questions.` : 'Begin working on the quiz.')}

\n \n
\n \n})``;\n","import styled from 'styled-components';\nimport { mixins, colors, layouts, transitions } from '../theme';\nimport { AnswersTable } from './AnswersTable';\nimport classnames from 'classnames';\nimport { ID, ExerciseQuestionData, Task } from 'src/types';\nimport React, { ReactNode } from 'react';\nimport { Content } from './Content';\n\nconst StyledQuestion = styled.div`\n&.step-card-body {\n ${mixins.stepCardPadding()};\n}\n\n&.openstax-question {\n border-top: 1px solid ${colors.palette.pale};\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ${colors.palette.neutral};\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ${colors.palette.neutralLightBlue};\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: ${layouts.answer.horizontalSpacing} ${layouts.answer.horizontalBuffer};\n margin: ${layouts.answer.verticalSpacing} 0 ${layouts.answer.horizontalSpacing} ${layouts.answer.verticalSpacing};\n border-left: ${layouts.answer.horizontalSpacing} solid ${colors.palette.neutralLighter};\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ${colors.palette.neutralLightest};\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ${mixins.answer()};\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ${layouts.answer.horizontalSpacing};\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: ${layouts.answer.verticalSpacing} 0 0 0;\n margin: 0;\n transition: color ${transitions.answer};\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ${mixins.answerHover()}\n }\n }\n\n .answer-input-box {\n ${mixins.visuallyHidden()}\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ${colors.answer.checked};\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ${mixins.answerIncorrect()};\n }\n }\n\n &.answer-correct {\n .answer-label {\n ${mixins.answerCorrect(true)};\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ${mixins.answerCorrectAnswer()}\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ${mixins.answerIncorrect()}\n }\n &.answer-selected.answer-incorrect {\n ${mixins.answerIncorrect(true)}\n }\n }\n }\n\n .question-feedback {\n ${mixins.popover()}\n max-width: ${layouts.answer.feedback.popover.maxWidth};\n .question-feedback-content {\n padding: ${layouts.answer.feedback.popover.verticalSpacing} ${layouts.answer.feedback.popover.horizontalSpacing};\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n`;\n\nexport interface QuestionProps {\n question: ExerciseQuestionData,\n answer_id?: ID;\n task?: Task | null,\n correct_answer_id: ID | null;\n incorrectAnswerId: ID;\n hideAnswers: boolean;\n hidePreambles?: boolean,\n exercise_uid?: string;\n displayFormats: boolean,\n className: string;\n questionNumber: number;\n displaySolution: boolean;\n context?: string;\n correct_answer_feedback_html?: string;\n contentRenderer?: JSX.Element;\n feedback_html: string;\n onChange: () => void;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n children?: ReactNode;\n answerIdOrder?: ID[];\n choicesEnabled?: boolean;\n}\n\nexport const Question = React.forwardRef((props: QuestionProps, ref: React.ForwardedRef) => {\n let exerciseUid, solution;\n\n const {\n question, correct_answer_id, incorrectAnswerId, exercise_uid, className, questionNumber, context, task, hidePreambles\n } = props;\n\n const { stem_html, collaborator_solutions = [], formats, stimulus_html } = question;\n\n const hasCorrectAnswer = !!correct_answer_id;\n const hasIncorrectAnswer = !!incorrectAnswerId;\n\n const taskIsDeleted = (task != null ? task.is_deleted : undefined)\n const taskIsHomework = ((task != null ? task.type : undefined) === 'homework');\n\n const classes = classnames('openstax-question', className, {\n 'has-correct-answer': hasCorrectAnswer && !(taskIsDeleted && taskIsHomework),\n 'has-incorrect-answer': hasIncorrectAnswer,\n });\n\n const hasSolution = () => {\n const { displaySolution } = props;\n const { collaborator_solutions = [] } = question;\n\n return (\n displaySolution &&\n collaborator_solutions &&\n collaborator_solutions.find(s => s['content_html'] !== undefined)\n );\n };\n\n if (exercise_uid != null) {\n exerciseUid = (\n
\n {exercise_uid}\n
\n );\n }\n\n if (hasSolution()) {\n solution =\n
\n
\n Detailed solution:\n
\n s['content_html']).join('')} />\n
;\n }\n\n return (\n \n \n );\n});\n\ninterface QuestionHtmlProps {\n html?: string;\n type: string;\n hidden: QuestionProps['hidePreambles'];\n questionNumber?: QuestionProps['questionNumber'];\n}\n\nexport const QuestionHtml = (props: QuestionHtmlProps) => {\n const { html = '', type, hidden, questionNumber } = props;\n if (hidden === true || !(html.length > 0)) { return null; }\n\n return (\n \n );\n};\n\nconst FormatsListing = ({ formats = [] }: { formats: ExerciseQuestionData['formats'] }) => {\n return (\n
\n
Formats:
\n {formats.map((format, i) => {format})}\n
\n );\n};\n","import { MouseEventHandler, ReactNode } from 'react';\nimport { countWords } from '../utils';\nimport styled, { css } from 'styled-components';\nimport { colors, mixins } from '../theme';\nimport { AvailablePoints, ExerciseQuestionData } from 'src/types';\nimport { QuestionHtml } from './Question';\nimport Button from './Button';\nimport { StepCardFooter } from './StepCardFooter';\n\nexport interface FreeResponseProps {\n readOnly: boolean;\n wordLimit: number;\n infoRowChildren?: ReactNode;\n onChange: (event: React.ChangeEvent) => void;\n cancelHandler: MouseEventHandler;\n saveHandler: MouseEventHandler;\n defaultValue: string;\n isSubmitDisabled: boolean;\n questionNumber: number,\n question: ExerciseQuestionData,\n availablePoints?: AvailablePoints,\n textHasChanged: boolean;\n submitBtnLabel: string;\n}\n\nconst TextAreaErrorStyle = css`\n background-color: #f5e9ea;\n`;\n\nconst StyledFreeResponse = styled.div`\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ${mixins.stepCardPadding()}\n }\n`;\n\nconst SyledQuestionStem = styled.div`\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n`;\n\nconst InfoRow = styled.div<{ hasChildren: boolean }>`\n margin: 8px 0;\n display: flex;\n justify-content: ${props => props.hasChildren ? 'space-between' : 'flex-end'};\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ${colors.palette.danger};\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ${colors.palette.neutralThin};\n`;\n\nexport const FreeResponseTextArea = styled.textarea<{ isOverWordLimit: boolean } & FreeResponseProps>`\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ${colors.palette.neutral};\n color: ${colors.palette.neutralDark};\n ${props => props.isOverWordLimit && TextAreaErrorStyle};\n ${props => props.isOverWordLimit && css`\n border: 2px solid ${colors.palette.danger};\n `}\n background-color: ${props => props.readOnly && colors.palette.neutralCool};\n`;\nFreeResponseTextArea.displayName = 'OSFreeResponseTextArea';\n\nconst RevertButton = (props: {\n disabled: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n);\n\n\nexport const FreeResponseInput = (props: FreeResponseProps) => {\n const {\n availablePoints,\n cancelHandler,\n defaultValue,\n infoRowChildren,\n isSubmitDisabled,\n question,\n questionNumber,\n saveHandler,\n submitBtnLabel,\n textHasChanged,\n wordLimit,\n } = props;\n\n const isOverWordLimit = countWords(defaultValue) > wordLimit;\n\n const questionProps = {};\n if (questionNumber) { questionProps['data-question-number'] = questionNumber; }\n\n return (\n \n
\n \n {question.stem_html &&\n \n \n \n {infoRowChildren}\n
\n {countWords(defaultValue)} words\n {isOverWordLimit && Maximum {wordLimit} words}\n
\n
\n
\n \n {availablePoints\n ?
Points: {availablePoints}
\n : null}\n
\n \n \n {submitBtnLabel}\n \n
\n
\n
\n );\n}\n\nFreeResponseInput.displayName = 'OSFreeResponse';\n","import React from \"react\";\nimport { numberfyId } from \"../../src/utils\";\nimport { AvailablePoints, ID, ExerciseQuestionData, Task } from \"../types\";\nimport Button from \"./Button\";\nimport { Content } from \"./Content\";\nimport { ExerciseBaseProps } from \"./Exercise\";\nimport { Question } from './Question';\nimport { StepCardFooter } from \"./StepCardFooter\";\n\nexport interface ExerciseQuestionProps {\n task?: Task;\n question: ExerciseQuestionData;\n answer_id_order?: ID[];\n questionNumber: number;\n choicesEnabled: boolean;\n hasMultipleAttempts: boolean;\n onAnswerChange: () => void;\n onAnswerSave: ExerciseBaseProps['onAnswerSave'];\n onNextStep: ExerciseBaseProps['onNextStep'];\n feedback_html: string;\n correct_answer_feedback_html: string;\n is_completed: boolean;\n correct_answer_id: ID;\n incorrectAnswerId: ID;\n answer_id?: ID;\n attempts_remaining: number;\n published_comments?: string;\n detailedSolution?: string;\n canAnswer: boolean;\n needsSaved: boolean;\n canUpdateCurrentStep: boolean;\n attempt_number: number;\n apiIsPending: boolean;\n displaySolution: boolean;\n available_points?: AvailablePoints;\n exercise_uid: string;\n free_response?: string;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n hasFeedback?: ExerciseBaseProps['hasFeedback'];\n}\n\nconst AttemptsRemaining = ({ count }: { count: number }) => {\n return (\n
{count} attempt{count === 1 ? '' : 's'} left
\n );\n}\n\nconst PublishedComments = ({ published_comments }: { published_comments?: string }) => {\n if (!published_comments) { return null; }\n\n return (\n
\n Feedback: {published_comments}\n
\n );\n}\n\nexport const SaveButton = (props: {\n disabled: boolean, isWaiting: boolean, attempt_number: number, willContinue: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n {props.willContinue\n ? 'Submit & continue'\n : (props.attempt_number == 0 ? 'Submit' : 'Re-submit')}\n \n);\n\nexport const NextButton = (props: {\n canUpdateCurrentStep: boolean,\n} & React.ComponentPropsWithoutRef<'button'>) => {\n return (\n \n );\n}\n\nconst FreeResponseReview = ({ free_response }: Pick) => {\n if (!free_response) { return null; }\n return (\n <>\n
{free_response}
\n \n );\n}\n\nexport const ExerciseQuestion = React.forwardRef((props: ExerciseQuestionProps, ref: React.ForwardedRef) => {\n const {\n question, task, answer_id_order, onAnswerChange, feedback_html, correct_answer_feedback_html,\n is_completed, correct_answer_id, incorrectAnswerId, choicesEnabled, questionNumber,\n answer_id, hasMultipleAttempts, attempts_remaining, published_comments, detailedSolution,\n canAnswer, needsSaved, attempt_number, apiIsPending, onAnswerSave, onNextStep, canUpdateCurrentStep,\n displaySolution, available_points, free_response, show_all_feedback, tableFeedbackEnabled,\n hasFeedback\n } = props;\n\n const [shouldContinue, setShouldContinue] = React.useState(false)\n React.useEffect(() => {\n if (shouldContinue && is_completed) {\n onNextStep(questionNumber - 1);\n setShouldContinue(false);\n }\n }, [onNextStep, questionNumber, shouldContinue, is_completed]);\n\n return (\n
\n \n \n \n \n
\n
\n {available_points ? Points: {available_points} : null}\n \n {hasMultipleAttempts &&\n attempts_remaining > 0 &&\n }\n \n \n {detailedSolution && (
Detailed solution:
)}\n
\n
\n {(canAnswer && needsSaved) || shouldContinue ?\n {\n onAnswerSave(numberfyId(question.id));\n if (!hasFeedback) {\n setShouldContinue(true);\n }\n }}\n willContinue={!hasFeedback}\n /> :\n onNextStep(questionNumber - 1)} canUpdateCurrentStep={canUpdateCurrentStep} />}\n
\n
\n
\n
\n );\n})\n","import { debounce, once } from 'lodash';\nimport { isEmpty, memoize } from 'lodash/fp.js';\nimport WeakMap from 'weak-map';\n\ndeclare global {\n interface Window {\n MathJax?: any;\n __debugMathJax?: boolean;\n }\n}\n\nconst MATH_MARKER_BLOCK = '\\u200c\\u200c\\u200c'; // zero-width non-joiner\nconst MATH_MARKER_INLINE = '\\u200b\\u200b\\u200b'; // zero-width space\n\nconst MATH_RENDERED_CLASS = 'math-rendered';\nconst MATH_MARKED_CLASS = 'math-marked';\nconst MATH_DATA_SELECTOR = `[data-math]:not(.${MATH_RENDERED_CLASS})`;\nconst MATH_ML_SELECTOR = `math:not(.${MATH_RENDERED_CLASS})`;\nconst COMBINED_MATH_SELECTOR = `${MATH_DATA_SELECTOR}, ${MATH_ML_SELECTOR}`;\nconst MATHJAX_CONFIG = {\n extensions: [],\n showProcessingMessages: false,\n skipStartupTypeset: true,\n styles: {\n '#MathJax_MSIE_Frame': {\n left: '', right: 0, visibility: 'hidden',\n },\n '#MathJax_Message': {\n left: '', right: 0, visibility: 'hidden',\n },\n },\n tex2jax: {\n displayMath: [[MATH_MARKER_BLOCK, MATH_MARKER_BLOCK]],\n inlineMath: [[MATH_MARKER_INLINE, MATH_MARKER_INLINE]],\n },\n};\n\nconst findProcessedMath = (root: Element): Element[] => Array.from(root.querySelectorAll('.MathJax math'));\nconst findUnprocessedMath = (root: Element): Element[] => {\n const processedMath = findProcessedMath(root);\n return Array.from(root.querySelectorAll('math')).filter((node) => processedMath.indexOf(node) === -1);;\n};\n\nconst findLatexNodes = (root: Element): Element[] => {\n const latexNodes: Element[] = [];\n for (const node of Array.from(root.querySelectorAll(MATH_DATA_SELECTOR))) {\n const formula = node.getAttribute('data-math');\n\n // Set textContent once so that resolveOrWait calls don't\n // undo a MathJax pass before rendered class is applied\n if (!node.classList.contains(MATH_MARKED_CLASS)) {\n node.textContent = (node.tagName.toLowerCase() === 'div')\n ? `${MATH_MARKER_BLOCK}${formula}${MATH_MARKER_BLOCK}`\n : `${MATH_MARKER_INLINE}${formula}${MATH_MARKER_INLINE}`;\n node.classList.add(MATH_MARKED_CLASS);\n }\n latexNodes.push(node);\n }\n\n return latexNodes;\n};\n\nconst typesetLatexNodes = (latexNodes: Element[], windowImpl: Window) => () => {\n if (isEmpty(latexNodes)) {\n return;\n }\n\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(latexNodes),\n markLatexNodesRendered(latexNodes)\n );\n};\n\nconst typesetMathMLNodes = (root: Element, windowImpl: Window) => () => {\n const mathMLNodes = findUnprocessedMath(root);\n\n if (isEmpty(mathMLNodes)) {\n return;\n }\n\n // style the entire document because mathjax is unable to style individual math elements\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(root)\n );\n};\n\nconst markLatexNodesRendered = (latexNodes: Element[]) => () => {\n // Queue a call to mark the found nodes as rendered so are ignored if typesetting is called repeatedly\n // uses className += instead of classList because IE\n const result = [];\n for (const node of latexNodes) {\n result.push(node.className += ` ${MATH_RENDERED_CLASS}`);\n }\n};\n\n// Search document for math and [data-math] elements and then typeset them\nfunction typesetDocument(root: Element, windowImpl: Window) {\n const latexNodes = findLatexNodes(root);\n\n windowImpl.MathJax.Hub.Queue(\n typesetLatexNodes(latexNodes, windowImpl),\n typesetMathMLNodes(root, windowImpl)\n );\n}\n\nconst resolveOrWait = (root: Element, resolve: () => void, remainingTries = 5) => {\n if (\n remainingTries > 0\n && (findLatexNodes(root).length || findUnprocessedMath(root).length)\n ) {\n setTimeout(() => {\n resolveOrWait(root, resolve, remainingTries - 1);\n }, 200);\n } else {\n resolve();\n }\n};\n\nconst typesetDocumentPromise = (root: Element, windowImpl: Window): Promise => new Promise((resolve) => {\n typesetDocument(root, windowImpl);\n windowImpl.MathJax.Hub.Queue(() => {\n resolveOrWait(root, resolve);\n });\n});\n\n// memoize'd getter for typeset document function so that each node's\n// typeset has its own debounce\nconst getTypesetDocument = memoize((root, windowImpl) => {\n // Install a debounce around typesetting function so that it will only run once\n // every Xms even if called multiple times in that period\n return debounce(typesetDocumentPromise, 100, {\n leading: true,\n trailing: false,\n }).bind(null, root, windowImpl);\n});\ngetTypesetDocument.cache = new WeakMap();\n\n// typesetMath is the main exported function.\n// It's called by components like HTML after they're rendered\nconst typesetMath = async (root: Element, windowImpl = window) => {\n await startMathJax();\n\n // check if MathJax is setup\n if (!(windowImpl && windowImpl.MathJax && windowImpl.MathJax.Hub)) {\n console.warn('Warning: Expected MathJax to be initialized.');\n return Promise.resolve();\n }\n\n // schedule a Mathjax pass if there is at least one [data-math] or element present\n if (root.querySelector(COMBINED_MATH_SELECTOR)) {\n return getTypesetDocument(root, windowImpl)();\n }\n\n return Promise.resolve();\n};\n\nconst startMathJax: (windowImpl?: Window) => Promise = once((windowImpl: Window = window) => new Promise((resolve) => {\n const configuredCallback = () => {\n // there doesn't seem to be a config option for this\n windowImpl.MathJax.HTML.Cookie.prefix = 'mathjax';\n // proceed with mathjax initi\n windowImpl.MathJax.Hub.Configured();\n windowImpl.MathJax.Hub.Register.StartupHook('End', () => {\n resolve();\n });\n };\n\n if (!document.getElementById('MathJax-Script')) {\n const script = document.createElement('script');\n script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured';\n script.id = 'MathJax-Script';\n script.async = true;\n document.head.appendChild(script);\n }\n\n if (windowImpl.MathJax && windowImpl.MathJax.Hub) {\n windowImpl.MathJax.Hub.Config(MATHJAX_CONFIG);\n // Does not seem to work when passed to Config\n windowImpl.MathJax.Hub.processSectionDelay = 0;\n configuredCallback();\n } else {\n // If the MathJax.js file has not loaded yet:\n // Call MathJax.Configured once MathJax loads and\n // loads this config JSON since the CDN URL\n // says to `delayStartupUntil=configured`\n (MATHJAX_CONFIG as any).AuthorInit = configuredCallback;\n windowImpl.MathJax = MATHJAX_CONFIG;\n }\n}));\n\nexport {\n typesetMath,\n startMathJax,\n};\n","import { colors, layouts, breakpoints } from \"../../src/theme\";\nimport styled, { css } from \"styled-components\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faBookOpen, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport { ExerciseIcons } from \"./Exercise\";\n\nexport const StyledToolbar = styled.div<{\n mobile: boolean;\n desktop: boolean;\n}>`\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ${colors.palette.light};\n background: #fff;\n margin: ${layouts.card.spacing} 0 0 ${layouts.card.spacing};\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${colors.palette.neutral};\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ${colors.palette.neutralDarker};\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ${colors.palette.neutralDarker};\n }\n\n span {\n display: block;\n }\n }\n }\n\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n\n ${props => props.mobile && breakpoints.mobile`\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ${colors.palette.neutral};\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ${colors.palette.light};\n }\n }\n `}\n`;\n\nexport const ExerciseToolbar = ({ icons }: { icons?: ExerciseIcons }) => {\n if (!icons) {\n return null;\n }\n const settings = Object.values(icons);\n const mobile = settings.some(({ location }) => location?.toolbar?.mobile ?? true);\n const desktop = settings.some(({ location }) => location?.toolbar?.desktop ?? false);\n const topicUrl = icons.topic?.url;\n const errataUrl = icons.errata?.url;\n\n return \n {topicUrl ? \n \n View topic in textbook\n : null}\n {errataUrl ? \n \n Suggest a correction\n : null}\n \n};\n","import styled, { css } from 'styled-components';\nimport { breakpoints, colors, mixins } from '../../src/theme';\nimport { ExerciseData } from '../../src/types';\nimport { faBookOpen } from '@fortawesome/free-solid-svg-icons/faBookOpen';\nimport { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons/faTriangleExclamation';\nimport { faCircleInfo } from '@fortawesome/free-solid-svg-icons/faCircleInfo';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { ExerciseIcons } from './Exercise';\n\ntype ExplanationType = 'multiple-choice' | 'two-step';\n\nconst TypeExplanations: { [key in ExplanationType]: string } = {\n 'multiple-choice': 'Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts.',\n 'two-step': 'In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. \\\nRecalling the answer to a question from memory helps you to retain things longer.',\n}\n\nconst ItemWrapper = styled.div<{ mobile: boolean; desktop: boolean }>`\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ${colors.palette.mediumBlue};}\n .popover { display: flex; }\n }\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n ${props => !props.mobile && breakpoints.mobile`\n display: none;\n `}\n`;\n\nconst InnerWrapper = styled.div`\n position: relative;\n display: flex;\n`;\n\nconst Popover = styled.div`\n ${mixins.popover}\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n`;\n\ninterface PopoverItemProps {\n text: string;\n children: JSX.Element;\n wrapperProps?: {\n as: keyof JSX.IntrinsicElements;\n href?: string;\n target?: string;\n },\n mobile: boolean;\n desktop: boolean;\n}\n\nconst PopoverItem = (props: PopoverItemProps) => (\n \n \n {props.children}\n \n
\n
{props.text}
\n
\n
\n \n);\n\nconst PopoverItemsWrapper = styled.div`\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n color: ${colors.palette.darkGray};\n height: 1em;\n`;\n\nexport const ExerciseHeaderIcons = ({ exercise, icons }: {\n exercise: ExerciseData, icons: ExerciseIcons\n}) => {\n const defaultHeaderLocation = { desktop: true, mobile: false };\n const items = [];\n const isMultipleChoice = exercise.questions.every((q) => q.answers.length > 0);\n let typeExplanation;\n\n if (isMultipleChoice && exercise.questions.find((q) => q.formats.includes('free-response'))) {\n typeExplanation = TypeExplanations['two-step'];\n } else if (isMultipleChoice) {\n typeExplanation = TypeExplanations['multiple-choice'];\n }\n\n if (icons.topic) {\n items.push(\n \n \n \n );\n }\n\n if (icons.errata) {\n items.push(\n \n \n \n )\n }\n\n if (icons.info && typeExplanation) {\n items.push(\n \n \n \n )\n }\n\n return (\n \n {items}\n \n );\n};\n","import React from 'react';\nimport scrollToElement from 'scroll-to-element';\nimport styled, { createGlobalStyle, css } from 'styled-components';\nimport { Answer, ExerciseData, ID, QuestionState, StepBase, StepWithData } from '../../src/types';\nimport { InnerStepCard, OuterStepCard, TaskStepCard, TaskStepCardProps } from './Card';\nimport { Content } from './Content';\nimport { ExerciseQuestion } from './ExerciseQuestion';\nimport { typesetMath } from '../helpers/mathjax';\nimport { ExerciseToolbar, StyledToolbar } from './ExerciseToolbar';\nimport { breakpoints } from '../theme';\nimport { ExerciseHeaderIcons } from './ExerciseHeaderIcons';\nimport { TypesetMathContext } from '../hooks/useTypesetMath';\n\nconst StyledTaskStepCard = styled(TaskStepCard)`\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n`;\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nconst ToolbarWrapper = styled.div<{\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n}>`\n ${props => props.desktopToolbarEnabled && css`\n ${breakpoints.desktop`\n ${StyledTaskStepCard} {\n margin-left: 6.8rem;\n }\n `}\n ${breakpoints.tablet`\n ${StyledTaskStepCard} {\n margin-left: 4.8rem;\n }\n `}\n ${breakpoints.mobile`\n ${StyledTaskStepCard} {\n margin-left: 0;\n }\n `}\n `}\n\n ${props => props.mobileToolbarEnabled && css`\n ${breakpoints.mobile`\n ${StyledToolbar} + ${OuterStepCard} ${InnerStepCard} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n `}\n `}\n`;\n\nconst TaskStepCardWithToolbar = (props: React.PropsWithChildren &\n Pick & {\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n }\n) => \n \n \n ;\n\nconst Preamble = ({ exercise }: { exercise: ExerciseData }) => {\n return (\n <>\n {exercise.context &&\n }\n\n {exercise.stimulus_html &&\n }\n \n );\n};\n\ninterface ExerciseIconLocation {\n desktop: boolean;\n mobile: boolean;\n}\n\ninterface ExerciseIcon {\n location?: {\n /**\n * @default {\n * desktop: true,\n * mobile: false\n * }\n **/\n header?: ExerciseIconLocation;\n /**\n * @default {\n * desktop: false,\n * mobile: true\n * }\n **/\n toolbar?: ExerciseIconLocation;\n }\n}\n\nexport interface ExerciseIcons {\n /** An object containing a URL for the errata form for this exercise and settings for rendering the icon. */\n errata?: ExerciseIcon & { url: string };\n /** An object containing a URL for textbook content relevant to the exercise and settings for rendering the icon. */\n topic?: ExerciseIcon & { url: string };\n /** An object of settings for rendering the info icon that describes the exercise type (multiple-choice, two-step, etc.) */\n info?: ExerciseIcon;\n}\n\nexport interface ExerciseBaseProps {\n /** An object containing a Step ID and Exercise UID */\n step: StepBase;\n /** An exercise object from the Exercises API */\n exercise: ExerciseData;\n numberOfQuestions: number;\n /** The current question index. For multipart questions this is the first question number. */\n questionNumber: number;\n /** A boolean that enables showing the amount of attempts remaining. */\n hasMultipleAttempts: boolean;\n /** A callback with the question_id when the Submit/Re-submit button is clicked. */\n onAnswerSave: (question_id: number) => void;\n /** A callback with the current question index when the Next/Continue button is clicked. */\n onNextStep: (currentIndex: number) => void;\n /** A boolean that enables always showing every answer feedback_html field. */\n show_all_feedback?: boolean;\n /** The question number to scroll into view when the component renders. */\n scrollToQuestion?: number;\n /** An object containing data for how to render the following icons:\n * - An errata icon linking to the errata/feedback form\n * - An info icon describing the exercise type (multiple-choice, two-step, etc.)\n * - A topic icon linking to the relevant textbook location\n */\n exerciseIcons?: ExerciseIcons;\n hasFeedback?: boolean;\n}\n\nexport interface ExerciseWithStepDataProps extends ExerciseBaseProps {\n /** A Tutor Step object */\n step: StepWithData;\n canAnswer: boolean;\n needsSaved: boolean;\n apiIsPending: boolean;\n onAnswerChange: (answer: Answer) => void;\n canUpdateCurrentStep: boolean;\n answer_id_order?: ID[];\n}\n\nexport interface ExerciseWithQuestionStatesProps extends ExerciseBaseProps {\n questionStates: { [key: ID]: QuestionState };\n /** A callback with the IDs of the answer and question */\n onAnswerChange: (answer: Omit & { id: number, question_id: number }) => void;\n}\n\nexport const Exercise = styled(({\n numberOfQuestions, questionNumber, step, exercise, show_all_feedback, scrollToQuestion, exerciseIcons, ...props\n}: { className?: string } & (ExerciseWithStepDataProps | ExerciseWithQuestionStatesProps)) => {\n const legacyStepRender = 'feedback_html' in step;\n const questionsRef = React.useRef>([]);\n const container = React.useRef(null);\n\n const typesetExercise = React.useCallback(() => {\n if (container.current) {\n typesetMath(container.current);\n }\n }, []);\n\n React.useEffect(() => {\n const el = scrollToQuestion && questionsRef.current[scrollToQuestion];\n if (el) {\n scrollToElement(el);\n }\n }, [scrollToQuestion, exercise]);\n\n const desktopToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.desktop);\n const mobileToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.mobile);\n\n return \n \n : null}\n showTotalQuestions={legacyStepRender}\n desktopToolbarEnabled={desktopToolbarEnabled}\n mobileToolbarEnabled={mobileToolbarEnabled}\n {...(exerciseIcons ? { exerciseIcons: exerciseIcons } : null)}\n className={props.className}\n >\n
\n \n\n {exercise.questions.map((q, i) => {\n const state = { ...(legacyStepRender ? step : props['questionStates'][q.id]) };\n return (\n questionsRef.current[questionNumber + i] = el}\n exercise_uid={exercise.uid}\n key={q.id}\n question={q}\n questionNumber={questionNumber + i}\n choicesEnabled={state.canAnswer}\n displaySolution={true}\n detailedSolution={state.solution?.content_html}\n show_all_feedback={show_all_feedback}\n tableFeedbackEnabled={show_all_feedback && !legacyStepRender}\n canUpdateCurrentStep={\n // misleading prop name, we want to show a continue button for completed questions\n // that aren't the last question, which requires this prop to be true\n 'canUpdateCurrentStep' in props ?\n props.canUpdateCurrentStep : !(i + 1 === exercise.questions.length)\n }\n />\n )\n }\n )}\n
\n \n
;\n})`\n`;\n","const SvgComponent = () => (\n \n \n \n);\nexport default SvgComponent;\n","import styled, { css } from 'styled-components';\nimport { colors, breakpoints } from '../theme';\nimport FlagIcon from '../assets/flag';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';\nimport { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';\n\nconst ProgressBarWrapper = styled.nav`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ${breakpoints.mobile`\n padding: 1.6rem 0.8rem;\n `}\n`;\n\nconst StyledItemWrapper = styled.span`\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n`;\n\nconst handleVariant = (variant: ProgressBarItemVariant) => {\n switch (variant) {\n case 'isStatus':\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n case 'isCorrect':\n return css`\n color: ${colors.answer.correct};\n background-color: #E8F4D8;\n `;\n case 'isIncorrect':\n return css`\n color: ${colors.answer.incorrect};\n background-color: #F8E8EA;\n `;\n default:\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n }\n};\n\nconst shadowCss = 'box-shadow: 0px 1px 4px 0px #00000066;';\n\nexport const StyledItem = styled.button<{ variant: ProgressBarItemVariant, isActive: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: ${props => props.isActive ? '4rem' : '3.2rem'};\n height: ${props => props.isActive ? '4rem' : '3.2rem'};\n border: 0;\n border-radius: 50%;\n margin: ${props => props.isActive ? '0' : '0 0.3rem'};\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ${colors.palette.neutralDarker};\n ${props => props.isActive ? css`\n ${shadowCss}\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n ` : null}\n ${props => handleVariant(props.variant)}\n &:hover {\n ${shadowCss}\n }\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n background: ${props => props.color};\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n`;\n\nconst ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {\n if (!variant || variant !== 'isCorrect' && variant !== 'isIncorrect') {\n return null;\n }\n\n const variantData = {\n isCorrect: {\n icon: faCheck,\n color: colors.answer.correct,\n label: 'Correct',\n },\n isIncorrect: {\n icon: faXmark,\n color: colors.answer.incorrect,\n label: 'Incorrect',\n },\n }[variant];\n\n return ;\n}\n\nexport interface ProgressBarProps {\n steps: S[];\n activeIndex: number | null;\n goToStep: (index: number, step: S) => void;\n}\n\nexport interface ProgressBarItemProps {\n index: number;\n isActive: boolean;\n step: S;\n goToStep: (index: number, step: S) => void;\n}\n\nexport type ProgressBarItemVariant = 'isCorrect' | 'isIncorrect' | 'isStatus' | null;\n\nexport const ProgressBarItem = ({index, isActive, step, goToStep}: ProgressBarItemProps) =>\n \n goToStep(index, step)}\n aria-current={isActive ? 'location' : 'false'}\n aria-label={step.variant === 'isStatus' ? 'Assignment status' : `Question ${index + 1}` }\n >\n {step.variant === 'isStatus' ? : index + 1}\n \n \n ;\n\nexport const ProgressBar = ({ steps, activeIndex, goToStep }: ProgressBarProps) =>\n \n {steps.map((step, index) => )}\n ;\n","import { BulletList } from \"react-content-loader\";\nimport { colors } from \"../../src/theme\";\nimport styled from \"styled-components\";\n\nconst Wrapper = styled.div`\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n`;\n\nexport const Loader = () => ;\n"],"names":["ALPHABET","isAnswerIncorrect","answer","incorrectAnswerId","id","countWords","text","words","trim","match","length","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","TypesetMathContext","React","createContext","Error","Content","_ref","html","component","_ref$block","block","props","_objectWithoutPropertiesLoose","_excluded","typesetMath","useContext","useEffect","undefined","cloneElement","_extends","_jsx","jsx","dangerouslySetInnerHTML","__html","SimpleFeedback","children","contentRenderer","className","classnames","Feedback","wrapperClasses","position","_jsxs","palette","red","danger","darkRed","lightRed","green","lightGreen","darkGreen","paleYellow","teal","blue","mediumBlue","lightBlue","neutralLightBlue","tangerine","gray","darkGray","pale","light","white","neutralLightest","neutralCool","neutralBright","neutralLighter","neutralLight","neutralMedium","neutral","neutralThin","neutralDark","neutralFeedback","neutralDarker","black","orange","colors","hover","checked","correct","incorrect","popover","arrowOuterColor","borderColor","card","header","background","body","button","backgroundHover","backgroundActive","freeResponse","color","breakpoints","css","_taggedTemplateLiteralLoose","BREAKPOINTS","apply","slice","call","arguments","desktop","mixins","answerColor","invertBubble","answerChecked","answerCorrect","answerIncorrect","answerHover","answerCorrectAnswer","resetText","stepCardPadding","visuallyHidden","StyledAnswerIndicator","styled","div","state","AnswerIndicator","isCorrect","isIncorrect","AnswerAnswer","_props$answer","content_html","feedback_html","show_all_feedback","tableFeedbackEnabled","TeacherReview","answered_count","iter","percent","selected_count","Math","round","cn","AnswerChoice","onChangeAnswer","type","disabled","onKeyPress","qid","feedbackId","isSelected","ariaLabel","hasCorrectAnswer","jsxs","_Fragment","Fragment","correctIncorrectIcon","name","onChange","htmlFor","AnswerBody","Answer","answerId","correctAnswerId","isChecked","isAnswerChecked","correctness","isAnswerCorrect","classes","displayName","AnswersTable","idCounter","question","_props$type","correct_answer_id","correct_answer_feedback_html","_props$show_all_feedb","answerIdOrder","instructions","hideAnswers","idOrder","feedback","questionAnswerProps","answer_id","choicesEnabled","answersHtml","answers","sort","a","b","indexOf","map","i","additionalProps","question_id","parseInt","key","answerProps","Object","assign","push","index","forEach","item","spliceIndex","splice","role","InnerStepCard","OuterStepCard","StepCardHeader","StepCardQuestion","StepCard","questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren","otherProps","TaskStepCard","_ref2","step","_excluded2","task","uid","StyledButton","Button","isWaiting","waitingText","GlobalStyle","createGlobalStyle","CompletionStatusCard","CompletionHeader","h2","CompletionStatus","numberCompleted","handleClick","allCompleted","someCompleted","buttonText","split","toLowerCase","onClick","StyledQuestion","Question","forwardRef","ref","exerciseUid","solution","exercise_uid","context","hidePreambles","stem_html","_question$collaborato","collaborator_solutions","formats","stimulus_html","is_deleted","_question$collaborato2","displaySolution","find","s","hasSolution","join","QuestionHtml","hidden","displayFormats","FormatsListing","_props$html","_ref$formats","format","StepCardFooter","TextAreaErrorStyle","StyledFreeResponse","SyledQuestionStem","InfoRow","hasChildren","FreeResponseTextArea","textarea","isOverWordLimit","readOnly","RevertButton","FreeResponseInput","cancelHandler","defaultValue","infoRowChildren","isSubmitDisabled","saveHandler","submitBtnLabel","textHasChanged","wordLimit","questionProps","placeholder","AttemptsRemaining","count","PublishedComments","published_comments","SaveButton","willContinue","attempt_number","NextButton","canUpdateCurrentStep","FreeResponseReview","_ref3","free_response","ExerciseQuestion","answer_id_order","onAnswerChange","is_completed","hasMultipleAttempts","attempts_remaining","detailedSolution","canAnswer","needsSaved","apiIsPending","onAnswerSave","onNextStep","available_points","hasFeedback","_React$useState","useState","shouldContinue","setShouldContinue","MATHJAX_CONFIG","extensions","showProcessingMessages","skipStartupTypeset","styles","left","right","visibility","tex2jax","displayMath","inlineMath","findUnprocessedMath","root","processedMath","Array","from","querySelectorAll","findProcessedMath","filter","node","findLatexNodes","latexNodes","_i","_Array$from","formula","getAttribute","classList","contains","textContent","tagName","add","resolveOrWait","resolve","remainingTries","setTimeout","typesetDocumentPromise","windowImpl","Promise","MathJax","Hub","Queue","isEmpty","Typeset","_step","result","_iterator","_createForOfIteratorHelperLoose","done","value","markLatexNodesRendered","typesetLatexNodes","mathMLNodes","typesetMathMLNodes","typesetDocument","getTypesetDocument","memoize","debounce","leading","trailing","bind","cache","WeakMap","startMathJax","once","window","configuredCallback","HTML","Cookie","prefix","Configured","Register","StartupHook","document","getElementById","script","createElement","src","async","head","appendChild","Config","processSectionDelay","AuthorInit","StyledToolbar","mobile","ExerciseToolbar","_icons$topic","_icons$errata","icons","settings","values","some","_location$toolbar$mob","_location$toolbar","location","toolbar","_location$toolbar$des","_location$toolbar2","topicUrl","topic","url","errataUrl","errata","href","target","FontAwesomeIcon","icon","faBookOpen","faTriangleExclamation","ItemWrapper","InnerWrapper","Popover","PopoverItem","wrapperProps","PopoverItemsWrapper","StyledFontAwesomeIcon","ExerciseHeaderIcons","typeExplanation","_icons$topic$location","_icons$errata$locatio","_icons$info$location","exercise","defaultHeaderLocation","items","isMultipleChoice","questions","every","q","includes","as","info","faCircleInfo","height","width","StyledTaskStepCard","ToolbarWrapper","desktopToolbarEnabled","mobileToolbarEnabled","TaskStepCardWithToolbar","exerciseIcons","Preamble","Exercise","scrollToQuestion","legacyStepRender","questionsRef","useRef","container","typesetExercise","useCallback","current","then","querySelector","MATH_DATA_SELECTOR","console","warn","e","reject","el","scrollToElement","_ref4","Provider","_state$solution","_createElement","SvgComponent","viewBox","fill","xmlns","d","ProgressBarWrapper","nav","StyledItemWrapper","span","shadowCss","StyledItem","isActive","variant","handleVariant","ItemIcon","variantData","faCheck","label","faXmark","ProgressBarItem","goToStep","FlagIcon","Wrapper","BulletList","uniqueKey","activeIndex","steps"],"mappings":"+yCAEaA,EAAW,6BAeXC,EAAoB,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 100644 index 0000000..06b9914 --- /dev/null +++ b/dist/index.modern.mjs @@ -0,0 +1,916 @@ +import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime.js";import n from"classnames";import a,{createElement as o}from"react";import i,{css as s,createGlobalStyle as l}from"styled-components";import c from"scroll-to-element";import{debounce as d,once as p}from"lodash";import{memoize as m,isEmpty as u}from"lodash/fp.js";import h from"weak-map";import{FontAwesomeIcon as b}from"@fortawesome/react-fontawesome";import{faBookOpen as f,faTriangleExclamation as g}from"@fortawesome/free-solid-svg-icons";import{faBookOpen as w}from"@fortawesome/free-solid-svg-icons/faBookOpen";import{faTriangleExclamation as x}from"@fortawesome/free-solid-svg-icons/faTriangleExclamation";import{faCircleInfo as v}from"@fortawesome/free-solid-svg-icons/faCircleInfo";import{faCheck as $}from"@fortawesome/free-solid-svg-icons/faCheck";import{faXmark as k}from"@fortawesome/free-solid-svg-icons/faXmark";import{BulletList as y}from"react-content-loader";function C(){return C=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(a[r]=e[r]);return a}const N="ABCDEFGHIJKLMNOPQRSTUVWXYZ",q=(e,t)=>e.id===t;function S(e){const t=e.trim().match(/\b[-?(\w+)?]+\b/gi);return t?t.length:0}const A=a.createContext(()=>{throw new Error("context not initialized")}),I=["html","component","block"],M=t=>{let{html:r,component:n,block:o=!1}=t,i=_(t,I);const s=a.useContext(A);return a.useEffect(()=>{s()},[s,r]),void 0!==n?a.cloneElement(n,C({html:r},i)):e(o?"div":"span",C({dangerouslySetInnerHTML:{__html:r}},i))},E=["id"],T=t=>e("aside",{children:e(M,{component:t.contentRenderer,className:n("question-feedback-content","has-html",t.className),html:t.children,block:!0})}),H=r=>{let{id:a}=r,o=_(r,E);const i=n("question-feedback",o.position||"bottom");return t("aside",{id:a,className:i,children:[e("div",{className:"arrow","aria-label":"Answer Feedback"}),e(T,C({},o,{children:o.children}))]})};let O,j,z,P,F,L,J,R,Q,V,B,D,W,U=e=>e;const Z={red:"#ca2026",danger:"#c2002f",darkRed:"#c22032",lightRed:"#e298a0",green:"#77af42",lightGreen:"#8bc753",darkGreen:"#63a524",paleYellow:"#ffffbb",teal:"#0dc0de",blue:"#007da4",mediumBlue:"#026AA1",lightBlue:"#34bdd8",neutralLightBlue:"#0dc0dc",tangerine:"#ffbd3e",gray:"#5e5e5e",darkGray:"#757575",pale:"#d5d5d5",light:"#e4e4e4",white:"#ffffff",neutralLightest:"#f9f9f9",neutralCool:"#f6f7f8",neutralBright:"#f5f5f5",neutralLighter:"#f1f1f1",neutralLight:"#e5e5e5",neutralMedium:"#a0a0a0",neutral:"#818181",neutralThin:"#6f6f6f",neutralDark:"#5f6163",neutralFeedback:"#555",neutralDarker:"#424242",black:"#000000",orange:"#D4450C"},G={palette:Z,answer:{neutral:Z.neutralThin,hover:"#026AA1",checked:"#026AA1",correct:"#0D7741",incorrect:"#C22032"},popover:{arrowOuterColor:"rgba(0, 0, 0, 0.25)",borderColor:"rgba(0, 0, 0, 0.2)"},card:{header:{background:"#daf3f8"},body:{background:"#fdfdfd"}},button:{background:Z.orange,backgroundHover:"#E74B0D",backgroundActive:"#C5400B"},freeResponse:{color:Z.neutralDarker,background:Z.neutralLighter}},K=(...e)=>s(O||(O=U`@media(max-width: ${0}px) { ${0} }`),600,s(...e)),Y=(...e)=>s(j||(j=U`@media(max-width: ${0}px) { ${0} }`),999,s(...e)),X=(...e)=>s(z||(z=U`@media(min-width: ${0}px) { ${0} }`),1e3,s(...e)),ee={answer:()=>s(F||(F=U` + .answer-label { + display: inline-flex; + } + color: ${0}; + .answer-letter-wrapper::before { + width: ${0}; + height: ${0}; + min-width: ${0}; + min-height: ${0}; + border-radius: calc(${0} / 2); + border-width: 2px; + border-style: solid; + border-color: #c6c6c6; + color: ${0}; + transition: color ${0}, border-color ${0}, background-color ${0}; + background-color: ${0}; + font-family: "Neue Helvetica W01", Helvetica, Arial, sans-serif; + box-sizing: border-box; + font-weight: normal; + } + `),Z.neutralDarker,"3.6rem","3.6rem","3.6rem","3.6rem","3.6rem",G.answer.neutral,"0.1s ease-in-out","0.1s ease-in-out","0.1s ease-in-out",G.palette.white),answerColor:(e,t=!1)=>s(L||(L=U` + .answer-letter-wrapper::before { + color: ${0}; + border-color: ${0}; + ${0} + } + `),t?"#fff":e,e,t?`background-color: ${e};`:null),answerChecked:()=>ee.answerColor(G.answer.checked,!0),answerCorrect:e=>ee.answerColor(G.answer.correct,e),answerIncorrect:e=>ee.answerColor(G.answer.incorrect,e),answerHover:()=>s(J||(J=U` + ${0}; + font-weight: bold; + `),ee.answerColor(G.answer.hover)),answerCorrectAnswer:()=>ee.answerColor(G.answer.correct,!1),resetText:()=>s(R||(R=U` + font-family: "Neue Helvetica W01", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + font-style: normal; + font-weight: 400; + line-height: 1.6; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + white-space: normal; + line-break: auto; + `)),stepCardPadding:()=>s(Q||(Q=U` + padding: 48px 140px; + + ${0} + + ${0} + `),Y(V||(V=U` + padding: ${0} ${0}; + `),"24px","24px"),K(B||(B=U` + padding: calc(${0} * 2) ${0}; + `),"8px","8px")),popover:()=>s(D||(D=U` + ${0} + + z-index: 1; + position: relative; + border: ${0} solid ${0}; + background-color: ${0}; + background-clip: padding-box; + max-width: ${0}; + margin: calc(${0} - 14px) 0 ${0} 8px; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1); + color: ${0}; + font-size: calc(1.4rem * var(--content-text-scale)); + + .arrow { + position: absolute; + display: block; + width: ${0}; + height: ${0}; + margin-left: ${0}; + top: calc(${0} * -1); + + &::before, + &::after { + position: absolute; + display: block; + content: ""; + border-color: transparent; + border-style: solid; + border-width: 0 calc(${0} / 2) ${0} calc(${0} / 2); + } + &::before { + top: 0; + border-bottom-color: ${0}; + } + &::after { + top: ${0}; + border-bottom-color: ${0}; + } + } + + &.right { + right: calc(-${0} - ${0}); + .arrow { right: ${0}; } + } + + + > .content { + padding: ${0} ${0}; + } + `),ee.resetText(),"1px",G.popover.borderColor,G.palette.white,"325px","8px","1rem",G.palette.neutralThin,"16px","8px","9px","8px","16px","8px","16px",G.popover.borderColor,"1px",G.palette.white,"9px","1px","9px","1rem","0.8rem"),visuallyHidden:()=>s(W||(W=U` + clip: rect(0 0 0 0); + clip-path: inset(50%); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; + `))};let te;const re=i.div(te||(te=(e=>e)` + color: ${0}; + text-transform: uppercase; + font-size: calc(1.1rem * var(--content-text-scale)); + font-weight: bold; +`),e=>e.state?G.answer.correct:G.answer.incorrect),ne=({isCorrect:e,isIncorrect:r})=>{if(!e&&!r)return null;const n=e||!1===r;return t(re,{state:n,children:[n?"Correct":"Incorrect"," Answer"]})},ae=r=>{const{answer:{content_html:n,feedback_html:a},contentRenderer:o,show_all_feedback:i,tableFeedbackEnabled:s,isCorrect:l,isIncorrect:c}=r;return t("div",{className:"answer-answer",children:[e(ne,{isCorrect:l,isIncorrect:c}),e(M,{className:"answer-content",component:o,html:n}),i&&a&&!s&&e(T,{contentRenderer:o,children:a},"question-mc-feedback")]})},oe=r=>{const{answer:a,answered_count:o,isCorrect:i,contentRenderer:s,iter:l,show_all_feedback:c,tableFeedbackEnabled:d}=r,p=a.selected_count&&o?Math.round(a.selected_count/o*100):0;return t("div",{className:"review-wrapper",children:[t("div",{className:n("review-count",{green:i,red:!i}),children:[e("span",{className:"selected-count","data-percent":`${p}`,children:a.selected_count}),e("span",{className:n("letter",{green:i,red:!i}),children:N[l]})]}),e(ae,{answer:a,contentRenderer:s,show_all_feedback:c,tableFeedbackEnabled:d})]})},ie=n=>{const{type:a,iter:o,answer:i,disabled:s,onKeyPress:l,qid:c,contentRenderer:d,correctIncorrectIcon:p,feedbackId:m,isSelected:u,isCorrect:h,isIncorrect:b,hasCorrectAnswer:f,show_all_feedback:g,tableFeedbackEnabled:w}=n,x=`${u?"Selected ":""}Choice ${N[o]}:`;let v;return f||"teacher-review"===a||"teacher-preview"===a||"student-mpp"===a||({onChangeAnswer:v}=n),t(r,{children:["teacher-preview"===a&&e("div",{className:"correct-incorrect",children:h&&p}),e("input",{type:"radio",className:"answer-input-box",checked:u,id:`${c}-option-${o}`,name:`${c}-options`,onChange:()=>v&&v(i),disabled:s||!v,"aria-details":m}),t("label",{onKeyPress:l,htmlFor:`${c}-option-${o}`,className:"answer-label",children:[e("span",{className:"answer-letter-wrapper","aria-label":x,"data-answer-choice":N[o],"data-test-id":`answer-choice-${N[o]}`}),e(ae,{answer:i,contentRenderer:d,show_all_feedback:g,tableFeedbackEnabled:w,isCorrect:h,isIncorrect:b})]})]})},se=t=>e("teacher-review"===t.type?oe:ie,C({},t)),le=t=>{const{type:r,answer:a,disabled:o,answerId:i,correctAnswerId:s,incorrectAnswerId:l}=t,c=((e,t)=>e.id==t)(a,i),d=function(e,t){if(!e.id&&!t)return e.isCorrect;let r=e.id===t;return null!=e.correctness&&(r="1.0"===e.correctness),r}(a,s),p=q(a,l),m=c||void 0===i&&(!l&&d||p),u=n("answers-answer",{disabled:o,"answer-selected":m,"answer-correct":d&&"student-mpp"!==r,"answer-incorrect":l&&q(a,l)});return e("div",{className:"openstax-answer",children:e("section",{className:u,children:e(se,C({},t,{isCorrect:d,isSelected:m,isIncorrect:p}))})})};le.displayName="OSAnswer";const ce="student",de=r=>{let n=0;const{question:a,hideAnswers:o,type:i=ce,answered_count:s,choicesEnabled:l,correct_answer_id:c,incorrectAnswerId:d,answer_id:p,feedback_html:m,correct_answer_feedback_html:u,show_all_feedback:h=!1,tableFeedbackEnabled:b,hasCorrectAnswer:f,onChangeAnswer:g,onKeyPress:w,answerIdOrder:x,instructions:v}=r;if(o)return null;const{id:$}=a,k=[],y={qid:$||"auto-"+n++,answerId:p,correctAnswerId:c,incorrectAnswerId:d,hasCorrectAnswer:f,onChangeAnswer:g,type:i,answered_count:s,disabled:!l,show_all_feedback:h,tableFeedbackEnabled:b,onKeyPress:w},_=(x?(e=>{const{answers:t}=a;return t.slice().sort((t,r)=>e.indexOf(t.id)-e.indexOf(r.id))})(x):a.answers).map((t,r)=>{const n={answer:C({},t,{question_id:"string"==typeof a.id?parseInt(a.id,10):a.id}),iter:r,key:`${y.qid}-option-${r}`},o=Object.assign({},n,y);let i,s;return h&&t.feedback_html&&b?i=t.feedback_html:t.id===d&&m?i=m:t.id===c&&u&&(i=u),i&&(s=`feedback-${y.qid}-${r}`,k.push({index:r,html:i,id:s})),e(le,C({feedbackId:s},o))});return k.forEach((t,n)=>{const a=t.index+n+1;_.splice(a,0,e(H,{id:t.id,contentRenderer:r.contentRenderer,children:t.html},a))}),t("div",{role:"radiogroup","aria-label":"Answer choices",className:"answers-table",children:[v,_]})},pe=["questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","className","children","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren"],me=["step","questionNumber","numberOfQuestions","children","className"];let ue,he,be,fe,ge,we,xe,ve,$e,ke,ye,Ce,_e=e=>e;const Ne=i.div(ue||(ue=_e` + position: relative; + display: flex; + flex-direction: column; + flex: 1 1 auto; + min-height: 400px; + margin: 0 auto 5rem auto; + border: 1px solid ${0}; + border-radius: 0.25rem; + background-color: white; + overflow: hidden; + + ${0} +`),G.palette.light,X(he||(he=_e` + max-width: 1000px; + `))),qe=i.div(be||(be=_e` + padding: ${0}; + + ${0} +`),"2rem",K(fe||(fe=_e` + padding: 0; + `))),Se=i.div(ge||(ge=_e` + display: flex; + align-items: center; + justify-content: space-between; + padding: 16px 24px; + background: ${0}; + font-size: 1.8rem; + line-height: 3rem; + letter-spacing: -0.72px; + + div.question-info { + display: flex; + align-items: baseline; + font-weight: bold; + + .question-id { + font-weight: normal; + } + .ox-icon-lock { + margin-right: 1rem; + } + } + + .num-questions, .points { + display: none; + } + + .exercise-id, .separator { + font-weight: normal; + } + + .separator { + margin: 0 0.4rem; + } + + .exercise-id { + height: 28px; // Fix baseline issue + } + + button { + color: ${0}; + } + + .openstax-exercise-badges { + margin: 0; + line-height: 2rem; + svg { + display: block; + &:not(.interactive) { + margin: 0 0 0 6px !important; + } + } + } + + ${0} + + /* + 1. Show the arrows to move to previous and next question. + 2. Show the number of questions. + 3. Override box-shadow of icons when turned into a button. + */ + ${0} + + ${0} +`),G.card.header.background,G.palette.gray,X(we||(we=_e` + button.ox-icon-angle-left, button.ox-icon-angle-right { + display: none; + } + .separator { + display: inherit; + } + `)),Y(xe||(xe=_e` + font-size: 1.6rem; + line-height: 2.5rem; + + svg.ox-icon { + display: inherit; + margin: 0; + } + button.ox-icon-angle-left { + margin-right: ${0}; + } + button.ox-icon-angle-right { + margin-left: ${0}; + } + .openstax-exercise-badges svg { + display: none; + } + .num-questions, points { + display: inherit; + } + + .exercise-id { + display: none; + } + + button[class^='ox-icon-angle']:hover { + box-shadow: none; + } + `),"24px","24px"),K(ve||(ve=_e` + font-size: 1.4rem; + line-height: 2rem; + padding: 10px 8px; + + button.ox-icon-angle-left { + margin-right: ${0}; + } + button.ox-icon-angle-left { + margin-right: ${0}; + } + `),"8px","8px"));Se.displayName="StepCardHeader";const Ae=i.div($e||($e=_e` + .step-card-body { + ${0} + overflow: auto; + background: ${0}; + + &.exercise-stimulus { + display: flex; + flex-direction: column; + align-items: center; + } + } + + & + div .step-card-body { + padding-top: 0; + } + + &.exercise-context, &.exercise-stimulus, &.exercise-stem { + padding-bottom: 0; + } + + ${0} + + .reading-step & { + padding: 0; + } + + ${0} + + ${0} + + &&& { + .openstax-has-html .splash .frame-wrapper { margin-top: 0; } + } +`),ee.stepCardPadding(),G.card.body.background,((...e)=>s(P||(P=U`@media(max-width: ${0}px) { ${0} }`),600,s(...e)))(ke||(ke=_e` + && .question-feedback { + margin-left: 0; + + .arrow { margin-left: 12px; } + } + `)),X(ye||(ye=_e` + .video-step &, .interactive-step & { + .openstax-exercise-badges { + margin-right: 3.8rem; + } + } + `)),K(Ce||(Ce=_e` + .openstax-exercise-badges svg { + margin-right: ${0}; + } + `),"8px")),Ie=r=>{let{questionNumber:n,numberOfQuestions:a,showTotalQuestions:o,stepType:i,isHomework:s,availablePoints:l,unpadded:c,className:d,children:p,questionId:m,multipartBadge:u,leftHeaderChildren:h,rightHeaderChildren:b,headerTitleChildren:f}=r,g=_(r,pe);return t(qe,C({},g,{children:[u,t(Ne,{className:d,children:[n&&s&&"exercise"===i&&t(Se,{children:[t("div",{children:[h,t("h2",{className:"question-info",children:[f,e("span",{children:a>1?`Questions ${n} - ${n+a-1}`:`Question ${n}`}),o?t("span",{className:"num-questions",children:[" / ",a]}):null,e("span",{className:"separator",children:"|"}),t("span",{className:"question-id",children:["ID: ",m]})]})]}),l||b?t("div",{children:[l&&t("div",{className:"points",children:[l," Points"]}),b]}):null]}),e(Ae,{unpadded:c,children:p})]})]}))};Ie.displayName="OSStepCard";const Me=t=>{let{step:r,questionNumber:a,numberOfQuestions:o,children:i,className:s}=t,l=_(t,me);return e(Ie,C({},l,{unpadded:!0,questionNumber:a,numberOfQuestions:o,stepType:"type"in r?r.type:"exercise",isHomework:!("task"in r)||void 0===r.task||"homework"===r.task.type,"data-task-step-id":r.id,className:n(`${"type"in r?r.type:"exercise"}-step`,s),questionId:r.uid,children:i}))};Me.displayName="OSTaskStepCard";const Ee=["disabled","isWaiting","waitingText","children"];let Te;const He=i.button(Te||(Te=(e=>e)` + background-color: ${0}; + color: ${0}; + font-size: 1.6rem; + font-weight: 700; + line-height: 2rem; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + height: 4rem; + padding: 0 3rem; + border: 0; + border-radius: 5px; + box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2); + + &:not([disabled]) { + cursor: pointer; + &:hover { + background: ${0} + } + &:active { + background: ${0} + } + } + &:disabled { + opacity: 0.4; + } +`),G.button.background,G.palette.white,G.button.backgroundHover,G.button.backgroundActive),Oe=t=>{const{disabled:r,isWaiting:n,waitingText:a,children:o}=t,i=_(t,Ee);return e(He,C({},i,{disabled:n||r,children:n&&a||o}))};let je,ze,Pe,Fe,Le=e=>e;const Je=l(je||(je=Le` + :root { + --content-text-scale: 1; + } +`)),Re=i(Ne)(ze||(ze=Le` + padding: 88px 72px; + font-size: calc(1.8rem * var(--content-text-scale)); + line-height: calc(3rem * var(--content-text-scale)); + display: block; + + button { + min-width: 160px; + height: 48px; + } + + p { + margin: 16px 0 20px 0; + } +`)),Qe=i.h2(Pe||(Pe=Le` + font-size: calc(2.4rem * var(--content-text-scale)); + margin: 0; +`)),Ve=i(({numberOfQuestions:n,numberCompleted:a,handleClick:o,className:i})=>{const s=n===a,l=a>0,c=s?"Next":l?"Continue":"Start";return t(r,{children:[e(Je,{}),t(Re,{className:i,children:[e(Qe,{children:s?"You are done.":l?"Quiz is partially complete.":"No questions have been answered."}),e("p",{children:s?"Great job answering all the questions.":l?`You've completed ${a} of ${n} questions.`:"Begin working on the quiz."}),e(Oe,{"data-test-id":`${c.split(" ")[0].toLowerCase()}-btn`,onClick:()=>o(),children:c})]})]})})(Fe||(Fe=Le``));let Be;const De=i.div(Be||(Be=(e=>e)` +&.step-card-body { + ${0}; +} + +&.openstax-question { + border-top: 1px solid ${0}; + font-size: calc(1.8rem * var(--content-text-scale)); + + .detailed-solution { + margin-bottom: 1rem; + .header { + display: inline; + margin-right: 0.5rem; + color: #5e6062; + font-weight: bold; + flex-basis: 0; + } + .solution { + display: inline; + color: #6f6f6f; + } + } + + img { + display: block; + margin: auto; + max-width: 100%; + } + + .question-stem { + margin-bottom: 0; + } + + .answers-table { + margin-bottom: 20px; + font-size: calc(1.6rem * var(--content-text-scale)); + line-height: calc(2rem * var(--content-text-scale)); + } + + .instructions { + font-size: 1.4rem; + font-style: italic; + margin-top: 10px; + color: ${0}; + margin: 0; + + i { + margin-left: 5px; + } + + .text-info { + color: ${0}; + padding-left: 5px; + cursor: pointer; + font-style: normal; + } + } + + .multiple-choice-prompt { + font-weight: 600; + } + + .free-response { + padding: ${0} ${0}; + margin: ${0} 0 ${0} ${0}; + border-left: ${0} solid ${0}; + font-style: italic; + } + + &:not(.openstax-question-preview) { + .answers-answer { + width: initial; + &:not(.disabled){ + .answer-label:focus{ + background-color: ${0}; + } + } + &.answer-selected { + font-weight: bold; + } + ${0}; + } + + .answer-answer { + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + margin-left: ${0}; + * { + margin: 0; + } + } + + .answer-letter-wrapper::before { + content: attr(data-answer-choice); + text-align: center; + padding: 0; + font-size: 1.6rem; + display: flex; + justify-content: center; + align-items: center; + } + + .answer-label { + width: 100%; + padding: ${0} 0 0 0; + margin: 0; + transition: color ${0}; + } + + // a selectable answer + .answer-input-box:not([disabled]) ~ .answer-label { + cursor: pointer; + + &:hover { + ${0} + } + } + + .answer-input-box { + ${0} + } + + // a selected answer + &:not(.has-correct-answer) { + .answer-input-box { + &:checked { + + .answer-label, + + .answer-label:hover { + ${0}; + } + } + + &:focus-visible { + + .answer-label .answer-letter-wrapper::before { + outline-style: solid; + outline-width: 2px; + outline-offset: 2px; + outline-color: ${0}; + } + } + } + + .answer-selected { + .answer-label, .answer-label:hover { + ${0}; + } + } + } + + // answer that has been checked + &.has-correct-answer { + .answer-selected { + &:not(.answer-correct) { + .answer-label { + ${0}; + } + } + + &.answer-correct { + .answer-label { + ${0}; + } + } + } + + .answer-correct:not(.answer-selected) { + .answer-label { + ${0} + } + } + } + + &.has-incorrect-answer { + .answer-incorrect { + .answer-label, .answer-label:hover { + ${0} + } + &.answer-selected.answer-incorrect { + ${0} + } + } + } + + .question-feedback { + ${0} + max-width: ${0}; + .question-feedback-content { + padding: ${0} ${0}; + } + } + } + + .openstax-answer { + border-top: 1px solid #d5d5d5; + margin: 10px 0; + padding: 6px 8px; + } +} +`),ee.stepCardPadding(),G.palette.pale,G.palette.neutral,G.palette.neutralLightBlue,"1rem","2.5rem","1rem","1rem","1rem","1rem",G.palette.neutralLighter,G.palette.neutralLightest,ee.answer(),"1rem","1rem","0.1s ease-in-out",ee.answerHover(),ee.visuallyHidden(),ee.answerChecked(),G.answer.checked,ee.answerChecked(),ee.answerIncorrect(),ee.answerCorrect(!0),ee.answerCorrectAnswer(),ee.answerIncorrect(),ee.answerIncorrect(!0),ee.popover(),"370px","0.9rem","1.1rem"),We=a.forwardRef((r,a)=>{let o,i;const{question:s,correct_answer_id:l,incorrectAnswerId:c,exercise_uid:d,className:p,questionNumber:m,context:u,task:h,hidePreambles:b}=r,{stem_html:f,collaborator_solutions:g=[],formats:w,stimulus_html:x}=s,v=!!l,$=n("openstax-question",p,{"has-correct-answer":v&&!((null!=h?h.is_deleted:void 0)&&"homework"===(null!=h?h.type:void 0)),"has-incorrect-answer":!!c});return null!=d&&(o=e("div",{className:"exercise-uid",children:d})),(()=>{const{displaySolution:e}=r,{collaborator_solutions:t=[]}=s;return e&&t&&t.find(e=>void 0!==e.content_html)})()&&(i=t("div",{className:"detailed-solution",children:[e("div",{className:"header",children:"Detailed solution:"}),e(M,{className:"solution",block:!0,html:g.map(e=>e.content_html).join("")})]})),t(De,{ref:a,className:$,"data-question-number":m,"data-test-id":"question",children:[e(Ue,{type:"context",html:u,hidden:b}),e(Ue,{type:"stimulus",html:x,hidden:b}),e(Ue,{type:"stem",html:f,hidden:b,questionNumber:m}),r.children,e(de,C({},r,{onChangeAnswer:r.onChange,hasCorrectAnswer:v})),i,r.displayFormats?e(Ze,{formats:w}):void 0,o]})}),Ue=t=>{const{html:r="",type:n,hidden:a,questionNumber:o}=t;return!0!==a&&r.length>0?e(M,{html:r,"data-question-number":o,className:`question-${n}`,block:!0}):null},Ze=({formats:r=[]})=>t("div",{className:"formats-listing",children:[e("div",{className:"header",children:"Formats:"}),r.map((t,r)=>e("span",{children:t},r))]});let Ge,Ke,Ye,Xe=e=>e;const et=i.div(Ge||(Ge=Xe` + ${0} + display: flex; + flex-wrap: wrap; + justify-content: space-between; + font-size: calc(1.4rem * var(--content-text-scale)); + line-height: calc(2rem * var(--content-text-scale)); + background: ${0}; + overflow: auto; + + > * { + flex-grow: 1; + } + + button { + width: 160px; + height: 48px; + } + + .step-card-footer-inner { + border-top: 1px solid ${0}; + padding-top: 32px; + display: flex; + justify-content: space-between; + gap: 1.6rem; + + ${0} + } + + .points { + .attempts-left { + color: #B03808; + font-weight: bold; + } + } + + .controls { + display: flex; + flex-flow: column wrap-reverse; + + button + button { + margin: 0.8rem 0 0 0; + } + } + + ${0} +`),ee.stepCardPadding(),G.card.body.background,G.palette.pale,K(Ke||(Ke=Xe` + flex-wrap: wrap; + `)),X(Ye||(Ye=Xe` + padding: 0 140px 32px 140px; + flex-wrap: nowrap; + + .points { + max-width: 400px; + } + + .controls { + flex-flow: row; + justify-content: flex-end; + + button + button { + margin: 0 0 0 0.8rem; + } + } + `)));let tt,rt,nt,at,ot,it,st=e=>e;const lt=s(tt||(tt=st` + background-color: #f5e9ea; +`)),ct=i.div(rt||(rt=st` + display: flex; + flex-direction: column; + + .step-card-body { + ${0} + } +`),ee.stepCardPadding()),dt=i.div(nt||(nt=st` + font-size: 2rem; + line-height: 1.68em; + position: relative; +`)),pt=i.div(at||(at=st` + margin: 8px 0; + display: flex; + justify-content: ${0}; + line-height: 1.6rem; + + .word-limit-error-info { + color: ${0}; + } + + div > span { + font-size: 12px; + line-height: 16px; + + + span { + margin-left: 1rem; + } + } + + .last-submitted + * { + margin-top: 0.8rem; + } + + color: ${0}; +`),e=>e.hasChildren?"space-between":"flex-end",G.palette.danger,G.palette.neutralThin),mt=i.textarea(ot||(ot=st` + display: block; + font-family: inherit; + font-size: 1.8rem; + line-height: 3rem; + width: 100%; + min-height: 10.5em; + line-height: 1.5em; + margin: 2.5rem 0 0 0; + padding: 0.5em; + border: 1px solid ${0}; + color: ${0}; + ${0}; + ${0} + background-color: ${0}; +`),G.palette.neutral,G.palette.neutralDark,e=>e.isOverWordLimit&<,e=>e.isOverWordLimit&&s(it||(it=st` + border: 2px solid ${0}; + `),G.palette.danger),e=>e.readOnly&&G.palette.neutralCool);mt.displayName="OSFreeResponseTextArea";const ut=t=>e(Oe,C({},t,{children:"Cancel"})),ht=r=>{const{availablePoints:n,cancelHandler:a,defaultValue:o,infoRowChildren:i,isSubmitDisabled:s,question:l,questionNumber:c,saveHandler:d,submitBtnLabel:p,textHasChanged:m,wordLimit:u}=r,h=S(o)>u,b={};return c&&(b["data-question-number"]=c),t(ct,{"data-test-id":"student-free-response",children:[t("div",{className:"step-card-body",children:[e(dt,C({},b,{children:l.stem_html&&e(Ue,{type:"stem",html:l.stem_html,hidden:!1})})),e(mt,C({},r,{isOverWordLimit:h,"data-test-id":"free-response-box",placeholder:"Enter your response...","aria-label":"question response text box"})),t(pt,{hasChildren:!!i,children:[i,t("div",{children:[t("span",{children:[S(o)," words"]}),h&&t("span",{className:"word-limit-error-info",children:["Maximum ",u," words"]})]})]})]}),t(et,{children:[n?e("div",{className:"points",role:"status",children:t("strong",{children:["Points: ",n]})}):null,t("div",{className:"controls",children:[e(ut,{disabled:!m,onClick:a}),e(Oe,{"data-test-id":"submit-answer-btn",disabled:s||h,onClick:d,children:p})]})]})]})};ht.displayName="OSFreeResponse";const bt=({count:e})=>t("div",{children:[e," attempt",1===e?"":"s"," left"]}),ft=({published_comments:r})=>r?t("div",{children:[e("strong",{children:"Feedback:"})," ",r]}):null,gt=t=>e(Oe,C({},t,{waitingText:"Saving…",isWaiting:t.isWaiting,"data-test-id":"submit-answer-btn",children:t.willContinue?"Submit & continue":0==t.attempt_number?"Submit":"Re-submit"})),wt=t=>e(Oe,C({},t,{"data-test-id":"continue-btn",children:t.canUpdateCurrentStep?"Continue":"Next"})),xt=({free_response:t})=>t?e(r,{children:e("div",{className:"free-response",children:t})}):null,vt=a.forwardRef((r,n)=>{const{question:o,task:i,answer_id_order:s,onAnswerChange:l,feedback_html:c,correct_answer_feedback_html:d,is_completed:p,correct_answer_id:m,incorrectAnswerId:u,choicesEnabled:h,questionNumber:b,answer_id:f,hasMultipleAttempts:g,attempts_remaining:w,published_comments:x,detailedSolution:v,canAnswer:$,needsSaved:k,attempt_number:y,apiIsPending:C,onAnswerSave:_,onNextStep:N,canUpdateCurrentStep:q,displaySolution:S,available_points:A,free_response:I,show_all_feedback:E,tableFeedbackEnabled:T,hasFeedback:H}=r,[O,j]=a.useState(!1);return a.useEffect(()=>{O&&p&&(N(b-1),j(!1))},[N,b,O,p]),t("div",{"data-test-id":"student-exercise-question",children:[e(We,{ref:n,task:i,question:o,answerIdOrder:s,choicesEnabled:h,answer_id:f,questionNumber:b,onChange:l,feedback_html:c,correct_answer_feedback_html:d,correct_answer_id:p?m:null,incorrectAnswerId:u,className:"step-card-body",hideAnswers:!1,displayFormats:!1,displaySolution:S,show_all_feedback:E,tableFeedbackEnabled:T,children:e(xt,{free_response:I})}),e(et,{className:"step-card-footer",children:t("div",{className:"step-card-footer-inner",children:[t("div",{className:"points",role:"status",children:[A?t("strong",{children:["Points: ",A]}):null,e("span",{className:"attempts-left",children:g&&w>0&&e(bt,{count:w})}),e(ft,{published_comments:x}),v&&t("div",{children:[e("strong",{children:"Detailed solution:"})," ",e(M,{html:v})]})]}),e("div",{className:"controls",children:$&&k||O?e(gt,{disabled:C||!f||O,isWaiting:C||O,attempt_number:y,onClick:()=>{var e;_("string"==typeof(e=o.id)?parseInt(e,10):e),H||j(!0)},willContinue:!H}):e(wt,{onClick:()=>N(b-1),canUpdateCurrentStep:q})})]})})]})}),$t={extensions:[],showProcessingMessages:!1,skipStartupTypeset:!0,styles:{"#MathJax_MSIE_Frame":{left:"",right:0,visibility:"hidden"},"#MathJax_Message":{left:"",right:0,visibility:"hidden"}},tex2jax:{displayMath:[["‌‌‌","‌‌‌"]],inlineMath:[["​​​","​​​"]]}},kt=e=>{const t=(e=>Array.from(e.querySelectorAll(".MathJax math")))(e);return Array.from(e.querySelectorAll("math")).filter(e=>-1===t.indexOf(e))},yt=e=>{const t=[];for(const r of Array.from(e.querySelectorAll("[data-math]:not(.math-rendered)"))){const e=r.getAttribute("data-math");r.classList.contains("math-marked")||(r.textContent="div"===r.tagName.toLowerCase()?`‌‌‌${e}‌‌‌`:`​​​${e}​​​`,r.classList.add("math-marked")),t.push(r)}return t},Ct=(e,t,r=5)=>{r>0&&(yt(e).length||kt(e).length)?setTimeout(()=>{Ct(e,t,r-1)},200):t()},_t=(e,t)=>new Promise(r=>{(function(e,t){const r=yt(e);t.MathJax.Hub.Queue(((e,t)=>()=>{u(e)||t.MathJax.Hub.Queue(()=>t.MathJax.Hub.Typeset(e),(e=>()=>{const t=[];for(const r of e)t.push(r.className+=" math-rendered")})(e))})(r,t),((e,t)=>()=>{const r=kt(e);u(r)||t.MathJax.Hub.Queue(()=>t.MathJax.Hub.Typeset(e))})(e,t))})(e,t),t.MathJax.Hub.Queue(()=>{Ct(e,r)})}),Nt=m((e,t)=>d(_t,100,{leading:!0,trailing:!1}).bind(null,e,t));Nt.cache=new h;const qt=p((e=window)=>new Promise(t=>{const r=()=>{e.MathJax.HTML.Cookie.prefix="mathjax",e.MathJax.Hub.Configured(),e.MathJax.Hub.Register.StartupHook("End",()=>{t()})};if(!document.getElementById("MathJax-Script")){const e=document.createElement("script");e.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured",e.id="MathJax-Script",e.async=!0,document.head.appendChild(e)}e.MathJax&&e.MathJax.Hub?(e.MathJax.Hub.Config($t),e.MathJax.Hub.processSectionDelay=0,r()):($t.AuthorInit=r,e.MathJax=$t)}));let St,At,It,Mt,Et,Tt=e=>e;const Ht=i.div(St||(St=Tt` + position: absolute; + background: #fff; + width: 4.5rem; + border: 1px solid ${0}; + background: #fff; + margin: ${0} 0 0 ${0}; + z-index: 1; + + > * { + height: 4.7rem; + display: flex; + align-items: center; + justify-content: center; + color: ${0}; + background: #fff; + text-decoration: none; + + &:after { + border-bottom: 1px solid #f1f1f1; + } + + svg { + width: 4.3rem; + height: 1.6rem; + transition: color 150ms; + } + + span { + display: none; + flex-grow: 1; + font-size: 1.4rem; + color: ${0}; + } + + &:hover { + box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px; + width: 20rem; + + svg { + color: ${0}; + } + + span { + display: block; + } + } + } + + ${0} + + ${0} +`),G.palette.light,"2rem","2rem",G.palette.neutral,G.palette.neutralDarker,G.palette.neutralDarker,e=>!e.desktop&&s(At||(At=Tt` + ${0} + ${0} + `),X(It||(It=Tt` + display: none; + `)),Y(Mt||(Mt=Tt` + display: none; + `))),e=>e.mobile&&K(Et||(Et=Tt` + display: block; + position: relative; + width: auto; + display: flex; + flex-direction: row; + margin: 0; + + &:not(:last-child) { + border-bottom: 0; + } + + > * { + flex-direction: column; + flex-grow: 1; + align-items: center; + justify-content: center; + padding: 1rem 1.8rem 0.6rem; + height: auto; + min-height: 4.8rem; + + &:hover { + width: auto; + } + + span { + display: block; + font-size: 1rem; + margin-top: 0.2rem; + color: ${0}; + text-align: center; + } + + & + * { + border-left: 1px solid ${0}; + } + } + `),G.palette.neutral,G.palette.light)),Ot=({icons:r})=>{var n,a;if(!r)return null;const o=Object.values(r),i=o.some(({location:e})=>{var t,r;return null==(t=null==e||null==(r=e.toolbar)?void 0:r.mobile)||t}),s=o.some(({location:e})=>{var t,r;return null!=(t=null==e||null==(r=e.toolbar)?void 0:r.desktop)&&t}),l=null==(n=r.topic)?void 0:n.url,c=null==(a=r.errata)?void 0:a.url;return t(Ht,C({},{mobile:i,desktop:s},{children:[l?t("a",{href:l,target:"_blank",children:[e(b,{icon:f}),e("span",{children:"View topic in textbook"})]}):null,c?t("a",{href:c,target:"_blank",children:[e(b,{icon:g}),e("span",{children:"Suggest a correction"})]}):null]}))};let jt,zt,Pt,Ft,Lt,Jt,Rt,Qt,Vt,Bt=e=>e;const Dt=i.div(jt||(jt=Bt` + padding: 0.6rem 0.9rem; + .popover { display: none; } + &:hover { + svg path { fill: ${0};} + .popover { display: flex; } + } + ${0} + ${0} +`),G.palette.mediumBlue,e=>!e.desktop&&s(zt||(zt=Bt` + ${0} + ${0} + `),X(Pt||(Pt=Bt` + display: none; + `)),Y(Ft||(Ft=Bt` + display: none; + `))),e=>!e.mobile&&K(Lt||(Lt=Bt` + display: none; + `))),Wt=i.div(Jt||(Jt=Bt` + position: relative; + display: flex; +`)),Ut=i.div(Rt||(Rt=Bt` + ${0} + top: 3rem; + width: 20rem; + position: absolute; + font-size: 1.2rem; + line-height: 1.8rem; +`),ee.popover),Zt=r=>e(Dt,C({},r.wrapperProps,{mobile:r.mobile,desktop:r.desktop,"aria-label":r.text,children:t(Wt,{children:[r.children,t(Ut,{className:"popover right",children:[e("div",{className:"arrow"}),e("div",{className:"content",children:r.text})]})]})})),Gt=i.div(Qt||(Qt=Bt` + max-width: 200px; + display: flex; + justify-content: space-between; +`)),Kt=i(b)(Vt||(Vt=Bt` + color: ${0}; + height: 1em; +`),G.palette.darkGray),Yt=({exercise:t,icons:r})=>{const n={desktop:!0,mobile:!1},a=[],o=t.questions.every(e=>e.answers.length>0);let i;var s,l,c;return o&&t.questions.find(e=>e.formats.includes("free-response"))?i="In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. Recalling the answer to a question from memory helps you to retain things longer.":o&&(i="Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts."),r.topic&&a.push(e(Zt,C({text:"View topic in textbook",wrapperProps:{as:"a",href:r.topic.url,target:"_blank"}},(null==(s=r.topic.location)?void 0:s.header)||n,{children:e(Kt,{icon:w})}),"topic")),r.errata&&a.push(e(Zt,C({text:"Suggest a correction",wrapperProps:{as:"a",href:r.errata.url,target:"_blank"}},(null==(l=r.errata.location)?void 0:l.header)||n,{children:e(Kt,{icon:x})}),"errata")),r.info&&i&&a.push(e(Zt,C({text:i},(null==(c=r.info.location)?void 0:c.header)||n,{children:e(Kt,{icon:v,height:"16px",width:"16px"})}),"type")),e(Gt,{children:a})},Xt=["numberOfQuestions","questionNumber","step","exercise","show_all_feedback","scrollToQuestion","exerciseIcons"];let er,tr,rr,nr,ar,or,ir,sr,lr,cr,dr=e=>e;const pr=i(Me)(er||(er=dr` + font-size: calc(1.8rem * var(--content-text-scale)); + line-height: calc(2.8rem * var(--content-text-scale)); +`)),mr=l(tr||(tr=dr` + :root { + --content-text-scale: 1; + } +`)),ur=i.div(rr||(rr=dr` + ${0} + + ${0} +`),e=>e.desktopToolbarEnabled&&s(nr||(nr=dr` + ${0} + ${0} + ${0} + `),X(ar||(ar=dr` + ${0} { + margin-left: 6.8rem; + } + `),pr),Y(or||(or=dr` + ${0} { + margin-left: 4.8rem; + } + `),pr),K(ir||(ir=dr` + ${0} { + margin-left: 0; + } + `),pr)),e=>e.mobileToolbarEnabled&&s(sr||(sr=dr` + ${0} + `),K(lr||(lr=dr` + ${0} + ${0} ${0} { + border-top-left-radius: 0; + border-top-right-radius: 0; + } + `),Ht,qe,Ne))),hr=r=>t(ur,{desktopToolbarEnabled:r.desktopToolbarEnabled,mobileToolbarEnabled:r.mobileToolbarEnabled,children:[e(Ot,{icons:r.exerciseIcons}),e(pr,C({},r))]}),br=({exercise:n})=>t(r,{children:[n.context&&e(M,{className:"step-card-body exercise-context",block:!0,html:n.context}),n.stimulus_html&&e(M,{className:"step-card-body exercise-stimulus",block:!0,html:n.stimulus_html})]}),fr=i(r=>{let{numberOfQuestions:n,questionNumber:i,step:s,exercise:l,show_all_feedback:d,scrollToQuestion:p,exerciseIcons:m}=r,u=_(r,Xt);const h="feedback_html"in s,b=a.useRef([]),f=a.useRef(null),g=a.useCallback(()=>{f.current&&(async(e,t=window)=>{await qt(),t&&t.MathJax&&t.MathJax.Hub?e.querySelector("[data-math]:not(.math-rendered), math:not(.math-rendered)")?Nt(e,t)():Promise.resolve():(console.warn("Warning: Expected MathJax to be initialized."),Promise.resolve())})(f.current)},[]);a.useEffect(()=>{const e=p&&b.current[p];e&&c(e)},[p,l]);const w=Object.values(m||{}).some(({location:e})=>{var t;return null==e||null==(t=e.toolbar)?void 0:t.desktop}),x=Object.values(m||{}).some(({location:e})=>{var t;return null==e||null==(t=e.toolbar)?void 0:t.mobile});return t(A.Provider,{value:g,children:[e(mr,{}),e(hr,C({step:s,questionNumber:i,numberOfQuestions:h?n:l.questions.length,rightHeaderChildren:m?e(Yt,{exercise:l,icons:m}):null,showTotalQuestions:h,desktopToolbarEnabled:w,mobileToolbarEnabled:x},m?{exerciseIcons:m}:null,{className:u.className,children:t("div",{ref:f,children:[e(br,{exercise:l}),l.questions.map((e,t)=>{var r;const n=C({},h?s:u.questionStates[e.id]);return o(vt,C({},u,C({},n,{available_points:void 0}),{ref:e=>b.current[i+t]=e,exercise_uid:l.uid,key:e.id,question:e,questionNumber:i+t,choicesEnabled:n.canAnswer,displaySolution:!0,detailedSolution:null==(r=n.solution)?void 0:r.content_html,show_all_feedback:d,tableFeedbackEnabled:d&&!h,canUpdateCurrentStep:"canUpdateCurrentStep"in u?u.canUpdateCurrentStep:!(t+1===l.questions.length)}))})]})}))]})})(cr||(cr=dr` +`)),gr=()=>e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M14.556 2.09149C15.2296 1.78355 16 2.26721 16 2.99824V10.5951C16 10.9241 15.8362 11.2328 15.5605 11.4188C14.4229 12.1864 13.2007 12.6956 11.6715 12.6956C9.53267 12.6956 8.12768 11.6087 6.42651 11.6087C4.81213 11.6087 3.69241 11.923 2.79365 12.3V15.25C2.79365 15.6642 2.45254 16 2.03175 16H1.52381C1.10302 16 0.761905 15.6642 0.761905 15.25V3.18577C0.301492 2.86952 0 2.34455 0 1.74999C0 0.75924 0.836349 -0.0391985 1.852 0.00148899C2.75575 0.0376765 3.49578 0.75049 3.55203 1.63912C3.56854 1.8998 3.52632 2.1488 3.43819 2.37543C4.09648 2.13699 4.80613 1.99999 5.59835 1.99999C7.73718 1.99999 9.14216 3.08696 10.8433 3.08696C12.1289 3.08696 13.4659 2.5899 14.556 2.09149ZM2.79365 4.20718V6.40999C3.71429 6.07656 4.41841 5.85281 5.13016 5.75656V3.51999C4.38413 3.5878 3.84635 3.82593 2.79365 4.20718ZM9.80317 4.49437C8.96454 4.34837 8.21949 4.05752 7.46667 3.82749V5.93437C8.23413 6.14393 8.9767 6.44824 9.80317 6.63156V4.49437ZM5.13016 5.75656V7.94531C6.1713 7.85224 6.84159 7.92546 7.46667 8.06406V5.93437C6.66517 5.71452 5.98791 5.6399 5.13016 5.75656ZM7.46667 10.2012C8.30279 10.3466 9.04546 10.6365 9.80317 10.8681V8.76156C9.03248 8.55074 8.29397 8.24749 7.46667 8.06406V10.2012ZM2.79365 10.6906C3.54349 10.4284 4.31079 10.2581 5.13016 10.1731V7.94531C4.30127 8.01874 3.62667 8.19656 2.79365 8.48781V10.6906ZM14.4762 3.76562C13.8 4.04218 12.9971 4.31687 12.1397 4.4678V6.71499C13.0067 6.57874 13.7279 6.27437 14.4762 5.96843V3.76562ZM14.4762 10.3269V8.12406C13.7717 8.56781 12.9276 8.83062 12.1397 8.93718V11.1741C12.9356 11.0997 13.679 10.8291 14.4762 10.3269ZM9.80317 6.63156V8.76156C10.6179 8.9845 11.283 9.05349 12.1397 8.93718V6.71499C11.3143 6.84584 10.5542 6.79862 9.80317 6.63156Z",fill:"currentColor"})});let wr,xr,vr,$r,kr,yr,Cr,_r,Nr,qr,Sr=e=>e;const Ar=i.nav(wr||(wr=Sr` + display: flex; + justify-content: center; + flex-wrap: wrap; + gap: 1rem; + padding: 2rem; + + ${0} +`),K(xr||(xr=Sr` + padding: 1.6rem 0.8rem; + `))),Ir=i.span(vr||(vr=Sr` + display: flex; + align-items: center; + position: relative; + + &:last-child { + margin-right: 0; + } +`)),Mr="box-shadow: 0px 1px 4px 0px #00000066;",Er=i.button(_r||(_r=Sr` + display: flex; + justify-content: center; + align-items: center; + width: ${0}; + height: ${0}; + border: 0; + border-radius: 50%; + margin: ${0}; + font-size: 1.4rem; + font-weight: bold; + cursor: pointer; + color: ${0}; + ${0} + ${0} + &:hover { + ${0} + } +`),e=>e.isActive?"4rem":"3.2rem",e=>e.isActive?"4rem":"3.2rem",e=>e.isActive?"0":"0 0.3rem",G.palette.neutralDarker,e=>e.isActive?s(Nr||(Nr=Sr` + ${0} + & + [data-icon] { + bottom: 0; + right: 0; + } + `),Mr):null,e=>(e=>{switch(e){case"isStatus":return s($r||($r=Sr` + background-color: ${0}; + `),G.palette.neutralBright);case"isCorrect":return s(kr||(kr=Sr` + color: ${0}; + background-color: #E8F4D8; + `),G.answer.correct);case"isIncorrect":return s(yr||(yr=Sr` + color: ${0}; + background-color: #F8E8EA; + `),G.answer.incorrect);default:return s(Cr||(Cr=Sr` + background-color: ${0}; + `),G.palette.neutralBright)}})(e.variant),Mr),Tr=i(b)(qr||(qr=Sr` + background: ${0}; + color: #fff; + position: absolute; + bottom: 0.4rem; + right: 0.3rem; + height: 0.8rem; + width: 0.8rem; + padding: 0.1rem; + font-size: 1.2rem; + border-radius: 50%; +`),e=>e.color),Hr=({variant:t})=>{if(!t||"isCorrect"!==t&&"isIncorrect"!==t)return null;const r={isCorrect:{icon:$,color:G.answer.correct,label:"Correct"},isIncorrect:{icon:k,color:G.answer.incorrect,label:"Incorrect"}}[t];return e(Tr,{icon:r.icon,color:r.color,height:"16px",width:"16px","aria-label":r.label,"aria-hidden":void 0})},Or=({index:r,isActive:n,step:a,goToStep:o})=>t(Ir,{children:[e(Er,{variant:a.variant,isActive:n,onClick:()=>o(r,a),"aria-current":n?"location":"false","aria-label":"isStatus"===a.variant?"Assignment status":`Question ${r+1}`,children:"isStatus"===a.variant?e(gr,{}):r+1}),e(Hr,{variant:a.variant})]}),jr=({steps:t,activeIndex:r,goToStep:n})=>e(Ar,{"aria-label":"Breadcrumbs",children:t.map((t,a)=>e(Or,{index:a,isActive:a===r,step:t,goToStep:n},a))});let zr;const Pr=i.div(zr||(zr=(e=>e)` + max-width: 1000px; + @media(min-width: 960px) { + // Around the height of a multiple choice with 4 options + min-height: 53.8rem; + } + padding: 2rem; + margin: 2rem; + border: 1px solid ${0}; + border-radius: 0.25rem; + background-color: white; + display: flex; + justify-content: center; + align-items: center; + > svg { + max-width: 600px; + flex-grow: 1; + } +`),G.palette.light),Fr=()=>e(Pr,{children:e(y,{uniqueKey:"OSLoader"})});export{le as Answer,de as AnswersTable,Ve as CompletionStatus,fr as Exercise,Ot as ExerciseToolbar,ht as FreeResponseInput,mt as FreeResponseTextArea,Ne as InnerStepCard,Fr as Loader,qe as OuterStepCard,jr as ProgressBar,Or as ProgressBarItem,We as Question,Ue as QuestionHtml,Ie as StepCard,Er as StyledItem,Ht as StyledToolbar,Me as TaskStepCard}; +//# sourceMappingURL=index.modern.mjs.map diff --git a/dist/index.modern.mjs.map b/dist/index.modern.mjs.map new file mode 100644 index 0000000..86a9536 --- /dev/null +++ b/dist/index.modern.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"index.modern.mjs","sources":["../src/utils.ts","../src/hooks/useTypesetMath.ts","../src/components/Content.tsx","../src/components/Feedback.tsx","../src/theme.ts","../src/components/Answer.tsx","../src/constants.ts","../src/components/AnswersTable.tsx","../src/components/Card.tsx","../src/components/Button.tsx","../src/components/CompletionStatus.tsx","../src/components/Question.tsx","../src/components/StepCardFooter.tsx","../src/components/FreeResponseInput.tsx","../src/components/ExerciseQuestion.tsx","../src/helpers/mathjax.ts","../src/components/ExerciseToolbar.tsx","../src/components/ExerciseHeaderIcons.tsx","../src/components/Exercise.tsx","../src/assets/flag.tsx","../src/components/ProgressBar.tsx","../src/components/Loader.tsx"],"sourcesContent":["import { Answer, ID } from '../src/types';\n\nexport const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nconst MAX_CORRECTNESS = '1.0';\n\nexport const isAnswerCorrect = function(answer: Answer, correctAnswerId?: ID | null) {\n // if answer does not have an id, check the isCorrect property.\n if (!(answer.id || correctAnswerId)) {\n return answer.isCorrect;\n }\n let isCorrect = answer.id === correctAnswerId;\n if (answer.correctness != null) { isCorrect = (answer.correctness === MAX_CORRECTNESS); }\n\n return isCorrect;\n};\n\nexport const isAnswerIncorrect = (answer: Answer, incorrectAnswerId?: ID) =>\n // Allow multiple attempts to show incorrectness without the correct_answer_id\n answer.id === incorrectAnswerId;\n\nexport const isAnswerChecked = (answer: Answer, answerId?: ID) =>\n answer.id == answerId;\n\nexport function countWords(text: string) {\n const trimmedText = text.trim();\n //https://css-tricks.com/build-word-counter-app/\n const words = trimmedText.match(/\\b[-?(\\w+)?]+\\b/gi);\n if(!words) return 0;\n return words.length;\n}\n\nexport const numberfyId = (id: ID) => typeof id === 'string' ? parseInt(id, 10) : id;\n","import React from \"react\";\n\nexport const TypesetMathContext = React.createContext<() => void>(() => { throw new Error('context not initialized') });\nexport const useTypesetMath = () => React.useContext(TypesetMathContext);\n","import React from \"react\";\nimport { useTypesetMath } from \"../hooks/useTypesetMath\";\n\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\ntype ComponentType = keyof JSX.IntrinsicElements | React.JSXElementConstructor;\n\nexport interface ContentProps {\n className?: string;\n component?: T extends undefined ? undefined :\n T extends ComponentType ? React.ReactComponentElement:\n never;\n html: string;\n block?: boolean;\n}\n\nexport const Content = ((\n {html, component, block = false, ...props}: ContentProps\n) => {\n const typesetMath = useTypesetMath();\n\n React.useEffect(() => {\n typesetMath();\n }, [typesetMath, html])\n\n if (component !== undefined) {\n return React.cloneElement(component, {html, ...props});\n }\n if (block) {\n return
;\n } else {\n return ;\n }\n});\n","import classnames from 'classnames';\nimport { Content } from './Content';\n\ninterface FeedbackProps {\n position?: 'top' | 'bottom' | 'left' | 'right';\n children: string;\n className?: string;\n contentRenderer?: JSX.Element;\n id: string\n}\n\nconst SimpleFeedback = (props: Pick) => (\n \n);\n\nconst Feedback = ({ id, ...props }: FeedbackProps) => {\n const position = props.position || 'bottom';\n const wrapperClasses = classnames('question-feedback', position);\n\n return (\n \n );\n};\n\nexport { Feedback, SimpleFeedback };\n","import { css } from 'styled-components';\n\nconst palette = {\n red: \"#ca2026\",\n danger: \"#c2002f\",\n darkRed: \"#c22032\",\n lightRed: \"#e298a0\",\n green: \"#77af42\",\n lightGreen: \"#8bc753\",\n darkGreen: \"#63a524\",\n paleYellow: \"#ffffbb\",\n teal: \"#0dc0de\",\n blue: \"#007da4\",\n mediumBlue: \"#026AA1\",\n lightBlue: \"#34bdd8\",\n neutralLightBlue: \"#0dc0dc\",\n tangerine: \"#ffbd3e\",\n gray: \"#5e5e5e\",\n darkGray: \"#757575\",\n pale: \"#d5d5d5\",\n light: \"#e4e4e4\",\n white: \"#ffffff\",\n neutralLightest: \"#f9f9f9\", // nearly white\n neutralCool: \"#f6f7f8\", // cool bright gray\n neutralBright: \"#f5f5f5\", // bright gray\n neutralLighter: \"#f1f1f1\", // light gray\n neutralLight: \"#e5e5e5\", // light gray\n neutralMedium: \"#a0a0a0\", // light gray\n neutral: \"#818181\", // gray\n neutralThin: \"#6f6f6f\", // medium gray\n neutralDark: \"#5f6163\", // dark gray\n neutralFeedback: \"#555\", // another dark gray\n neutralDarker: \"#424242\", // very dark gray\n black: \"#000000\",\n orange: \"#D4450C\"\n};\n\nexport const colors = {\n palette: palette,\n answer: {\n neutral: palette.neutralThin,\n hover: '#026AA1',\n checked: '#026AA1',\n correct: '#0D7741',\n incorrect: '#C22032'\n },\n popover: {\n arrowOuterColor: \"rgba(0, 0, 0, 0.25)\",\n borderColor: \"rgba(0, 0, 0, 0.2)\",\n },\n card: {\n header: {\n background: \"#daf3f8\"\n },\n body: {\n background: \"#fdfdfd\"\n }\n },\n button: {\n background: palette.orange,\n backgroundHover: \"#E74B0D\",\n backgroundActive: \"#C5400B\"\n },\n freeResponse: {\n color: palette.neutralDarker,\n background:palette.neutralLighter,\n },\n};\n\nexport const layouts = {\n answer: {\n verticalSpacing: \"1rem\",\n horizontalSpacing: \"1rem\",\n horizontalBuffer: \"2.5rem\",\n bubbleSize: \"3.6rem\",\n labelSpacing: \"6.5rem\",\n feedback: {\n popover: {\n horizontalSpacing: \"1.1rem\",\n verticalSpacing: \"0.9rem\",\n maxWidth: \"370px\",\n },\n },\n },\n popover: {\n arrow: {\n width: \"16px\",\n height: \"8px\",\n edgeDistance: \"9px\",\n },\n horizontalSpacing: \"0.8rem\",\n verticalSpacing: \"1rem\",\n horizontalBuffer: \"4rem\",\n borderWidth: \"1px\",\n maxWidth: \"325px\",\n },\n card: {\n spacing: '2rem'\n }\n};\n\nexport const BREAKPOINTS = {\n mobile: 600,\n tablet: 999,\n desktop: 1000,\n large: 1600,\n};\n\nexport const breakpoints = {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n tablet(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.tablet}px) { ${css(...args)} }`;\n },\n desktop(...args: Parameters) {\n return css`@media(min-width: ${BREAKPOINTS.desktop}px) { ${css(...args)} }`;\n },\n only: {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n },\n margins: {\n mobile: '8px',\n tablet: '24px',\n },\n};\n\nexport const transitions = {\n answer: \"0.1s ease-in-out\",\n}\n\nexport const mixins = {\n answer: () => css`\n .answer-label {\n display: inline-flex;\n }\n color: ${palette.neutralDarker};\n .answer-letter-wrapper::before {\n width: ${layouts.answer.bubbleSize};\n height: ${layouts.answer.bubbleSize};\n min-width: ${layouts.answer.bubbleSize};\n min-height: ${layouts.answer.bubbleSize};\n border-radius: calc(${layouts.answer.bubbleSize} / 2);\n border-width: 2px;\n border-style: solid;\n border-color: #c6c6c6;\n color: ${colors.answer.neutral};\n transition: color ${transitions.answer}, border-color ${transitions.answer}, background-color ${transitions.answer};\n background-color: ${colors.palette.white};\n font-family: \"Neue Helvetica W01\", Helvetica, Arial, sans-serif;\n box-sizing: border-box;\n font-weight: normal;\n }\n `,\n answerColor: (\n color: string, invertBubble = false\n ) => css`\n .answer-letter-wrapper::before {\n color: ${invertBubble ? '#fff' : color};\n border-color: ${color};\n ${invertBubble ? `background-color: ${color};` : null}\n }\n `,\n answerChecked: () => mixins.answerColor(colors.answer.checked, true),\n answerCorrect: (checked?: boolean) => mixins.answerColor(colors.answer.correct, checked),\n answerIncorrect: (checked?: boolean) => mixins.answerColor(colors.answer.incorrect, checked),\n answerHover: () => css`\n ${mixins.answerColor(colors.answer.hover)};\n font-weight: bold;\n `,\n answerCorrectAnswer: () => mixins.answerColor(colors.answer.correct, false),\n resetText: () => css`\n font-family: \"Neue Helvetica W01\", Helvetica, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-style: normal;\n font-weight: 400;\n line-height: 1.6;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n `,\n stepCardPadding: () => css`\n padding: 48px 140px;\n\n ${breakpoints.tablet`\n padding: ${breakpoints.margins.tablet} ${breakpoints.margins.tablet};\n `}\n\n ${breakpoints.mobile`\n padding: calc(${breakpoints.margins.mobile} * 2) ${breakpoints.margins.mobile};\n `}\n `,\n popover: () => css`\n ${mixins.resetText()}\n\n z-index: 1;\n position: relative;\n border: ${layouts.popover.borderWidth} solid ${colors.popover.borderColor};\n background-color: ${colors.palette.white};\n background-clip: padding-box;\n max-width: ${layouts.popover.maxWidth};\n margin: calc(${layouts.popover.arrow.height} - 14px) 0 ${layouts.answer.horizontalSpacing} 8px;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);\n color: ${colors.palette.neutralThin};\n font-size: calc(1.4rem * var(--content-text-scale));\n\n .arrow {\n position: absolute;\n display: block;\n width: ${layouts.popover.arrow.width};\n height: ${layouts.popover.arrow.height};\n margin-left: ${layouts.popover.arrow.edgeDistance};\n top: calc(${layouts.popover.arrow.height} * -1);\n\n &::before,\n &::after {\n position: absolute;\n display: block;\n content: \"\";\n border-color: transparent;\n border-style: solid;\n border-width: 0 calc(${layouts.popover.arrow.width} / 2) ${layouts.popover.arrow.height} calc(${layouts.popover.arrow.width} / 2);\n }\n &::before {\n top: 0;\n border-bottom-color: ${colors.popover.borderColor};\n }\n &::after {\n top: ${layouts.popover.borderWidth};\n border-bottom-color: ${colors.palette.white};\n }\n }\n\n &.right {\n right: calc(-${layouts.popover.arrow.edgeDistance} - ${layouts.popover.borderWidth});\n .arrow { right: ${layouts.popover.arrow.edgeDistance}; }\n }\n\n\n > .content {\n padding: ${layouts.popover.verticalSpacing} ${layouts.popover.horizontalSpacing};\n }\n `,\n visuallyHidden: () => css`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n `\n};\n\nconst theme = {\n colors: colors,\n layouts: layouts,\n transitions: transitions,\n breakpoints: breakpoints,\n};\n\nexport default theme;\n","import cn from 'classnames';\nimport { ReactNode } from 'react';\nimport { ALPHABET, isAnswerChecked, isAnswerCorrect, isAnswerIncorrect } from '../utils';\nimport { Answer as AnswerType, ID } from '../types';\nimport { Content } from './Content';\nimport { SimpleFeedback } from './Feedback';\nimport styled from 'styled-components';\nimport { colors } from '../theme';\n\nconst StyledAnswerIndicator = styled.div<{ state: boolean }>`\n color: ${props => props.state ? colors.answer.correct : colors.answer.incorrect};\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n`;\n\nconst AnswerIndicator = (\n { isCorrect, isIncorrect }: { isCorrect?: boolean; isIncorrect?: boolean }\n) => {\n if (!isCorrect && !isIncorrect) {\n return null;\n }\n const state = isCorrect || isIncorrect === false;\n\n return \n {state ? 'Correct' : 'Incorrect'} Answer\n \n};\n\nexport interface AnswerProps {\n answer: AnswerType;\n iter: number;\n qid: ID;\n type: 'teacher-review' | 'teacher-preview' | 'student' | 'student-mpp';\n hasCorrectAnswer?: boolean;\n onChangeAnswer?: (answer: AnswerType) => void;\n disabled: boolean;\n answerId?: ID;\n correctAnswerId?: ID | null;\n incorrectAnswerId?: ID;\n onKeyPress?: () => void;\n answered_count?: number;\n correctIncorrectIcon?: ReactNode,\n radioBox?: ReactNode;\n contentRenderer?: JSX.Element;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n feedbackId?: string;\n}\n\ntype AnswerAnswerProps = Pick<\n AnswerBodyProps,\n 'answer' |\n 'contentRenderer' |\n 'show_all_feedback' |\n 'tableFeedbackEnabled' |\n 'isCorrect' |\n 'isIncorrect'\n>;\n\nconst AnswerAnswer = (props: AnswerAnswerProps) => {\n const {\n answer: { content_html, feedback_html },\n contentRenderer,\n show_all_feedback,\n tableFeedbackEnabled,\n isCorrect,\n isIncorrect,\n } = props;\n return (\n
\n \n \n {show_all_feedback && feedback_html && !tableFeedbackEnabled &&\n \n {feedback_html}\n }\n
\n )\n}\n\ninterface AnswerBodyProps extends AnswerProps {\n isCorrect?: boolean;\n isSelected?: boolean;\n isIncorrect?: boolean;\n}\n\nconst TeacherReview = (props: AnswerBodyProps) => {\n const {\n answer,\n answered_count,\n isCorrect,\n contentRenderer,\n iter,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const percent = answer.selected_count && answered_count\n ? Math.round((answer.selected_count / answered_count) * 100)\n : 0;\n return (\n
\n
\n \n {answer.selected_count}\n \n \n {ALPHABET[iter]}\n \n
\n \n
\n );\n}\n\nconst AnswerChoice = (props: AnswerBodyProps) => {\n const {\n type,\n iter,\n answer,\n disabled,\n onKeyPress,\n qid,\n contentRenderer,\n correctIncorrectIcon,\n feedbackId,\n isSelected,\n isCorrect,\n isIncorrect,\n hasCorrectAnswer,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const ariaLabel = `${isSelected ? 'Selected ' : ''}Choice ${ALPHABET[iter]}:`;\n let onChangeAnswer: AnswerProps['onChangeAnswer'];\n\n const onChange = () => onChangeAnswer && onChangeAnswer(answer);\n\n if (!hasCorrectAnswer\n && (type !== 'teacher-review')\n && (type !== 'teacher-preview')\n && (type !== 'student-mpp')) {\n ({ onChangeAnswer } = props);\n }\n\n return <>\n {type === 'teacher-preview' &&\n
\n {isCorrect && correctIncorrectIcon}\n
}\n \n \n \n
\n \n \n \n}\n\nconst AnswerBody = (props: AnswerBodyProps) => {\n return props.type === 'teacher-review'\n ? \n : \n}\n\nexport const Answer = (props: AnswerProps) => {\n const {\n type,\n answer,\n disabled,\n answerId,\n correctAnswerId,\n incorrectAnswerId,\n } = props;\n\n const isChecked = isAnswerChecked(answer, answerId);\n const isCorrect = isAnswerCorrect(answer, correctAnswerId);\n const isIncorrect = isAnswerIncorrect(answer, incorrectAnswerId);\n // When rendering a previous response, we can determine if it was this answer.\n // If there is no incorrectAnswerId, that means only a correct answer is present, check isCorrect.\n // If an incorrectAnswerId is present (there is only ever one, if multiple attempts are enabled,\n // it is the latest one) checking isIncorrect works because incorrectAnswerId is only set for\n // a missed attempt, meaning if an attempt is missed and then successfully re-attempted,\n // incorrectAnswerId will be empty.\n const isPreviousResponse = answerId === undefined && (!incorrectAnswerId && isCorrect || isIncorrect);\n\n const isSelected = isChecked || isPreviousResponse;\n const classes = cn('answers-answer', {\n 'disabled': disabled,\n 'answer-selected': isSelected,\n 'answer-correct': isCorrect && type !== 'student-mpp',\n 'answer-incorrect': incorrectAnswerId && isAnswerIncorrect(answer, incorrectAnswerId),\n });\n\n return (\n
\n
\n \n
\n
\n );\n}\nAnswer.displayName = 'OSAnswer';\n","import { AnswerDisplayType } from './types';\n\nexport const defaultAnswerType: AnswerDisplayType = 'student';\n","import { defaultAnswerType } from \"../constants\";\nimport { Answer as AnswerType, AnswerDisplayType, ID, ExerciseQuestionData } from \"src/types\";\nimport { Answer } from \"./Answer\";\nimport { Feedback } from \"./Feedback\";\n\nexport interface AnswersTableProps {\n question: ExerciseQuestionData;\n type?: AnswerDisplayType;\n answer_id?: ID;\n correct_answer_id?: ID | null;\n incorrectAnswerId?: ID;\n answerIdOrder?: ID[],\n feedback_html: string;\n correct_answer_feedback_html?: string;\n answered_count?: number;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n onChangeAnswer: () => void;\n hideAnswers: boolean;\n hasCorrectAnswer?: boolean;\n onChangeAttempt?: () => void;\n choicesEnabled?: boolean;\n onKeyPress?: () => void;\n contentRenderer?: JSX.Element;\n instructions?: JSX.Element;\n}\n\nexport const AnswersTable = (props: AnswersTableProps) => {\n let idCounter = 0;\n\n const {\n question, hideAnswers, type = defaultAnswerType, answered_count, choicesEnabled, correct_answer_id,\n incorrectAnswerId, answer_id, feedback_html, correct_answer_feedback_html,\n show_all_feedback = false, tableFeedbackEnabled, hasCorrectAnswer, onChangeAnswer, onKeyPress, answerIdOrder, instructions\n } = props;\n if (hideAnswers) { return null; }\n\n const { id } = question;\n\n const feedback: { index: number, html: string, id: string }[] = [];\n\n const sortedAnswersByIdOrder = (idOrder: ID[]) => {\n const { answers } = question;\n return answers.slice().sort((a, b) => idOrder.indexOf(a.id) - idOrder.indexOf(b.id));\n }\n\n const questionAnswerProps = {\n qid: id || `auto-${idCounter++}`,\n answerId: answer_id,\n correctAnswerId: correct_answer_id,\n incorrectAnswerId,\n hasCorrectAnswer,\n onChangeAnswer: onChangeAnswer,\n type,\n answered_count,\n disabled: !choicesEnabled,\n show_all_feedback,\n tableFeedbackEnabled,\n onKeyPress\n };\n\n const answers = answerIdOrder ? sortedAnswersByIdOrder(answerIdOrder) : question.answers;\n\n const answersHtml = answers.map((answer, i) => {\n const additionalProps: { answer: AnswerType, iter: number, key: string }\n = {\n answer: {\n ...answer,\n question_id: typeof question.id === 'string' ? parseInt(question.id, 10) : question.id\n },\n iter: i,\n key: `${questionAnswerProps.qid}-option-${i}`,\n };\n const answerProps = Object.assign({}, additionalProps, questionAnswerProps);\n let html: string | undefined;\n let feedbackId: string | undefined;\n\n if (show_all_feedback && answer.feedback_html && tableFeedbackEnabled) {\n html = answer.feedback_html;\n } else if (answer.id === incorrectAnswerId && feedback_html) {\n html = feedback_html;\n } else if (answer.id === correct_answer_id && correct_answer_feedback_html) {\n html = correct_answer_feedback_html;\n }\n\n if (html) {\n feedbackId = `feedback-${questionAnswerProps.qid}-${i}`\n feedback.push({ index: i, html, id: feedbackId });\n }\n\n return (\n \n );\n });\n\n feedback.forEach((item, i) => {\n const spliceIndex = item.index + i + 1;\n answersHtml.splice(spliceIndex, 0, (\n \n {item.html}\n \n ));\n });\n\n return (\n
\n {instructions}\n {answersHtml}\n
\n );\n}\n","import { ReactNode } from \"react\";\nimport { breakpoints, colors, layouts, mixins } from \"../theme\";\nimport { AvailablePoints, StepBase, StepWithData } from \"../types\";\nimport styled from \"styled-components\";\nimport cn from \"classnames\";\n\nexport const InnerStepCard = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ${breakpoints.desktop`\n max-width: 1000px;\n `}\n`;\n\nexport const OuterStepCard = styled.div`\n padding: ${layouts.card.spacing};\n\n ${breakpoints.mobile`\n padding: 0;\n `}\n`;\n\nconst StepCardHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ${colors.card.header.background};\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ${colors.palette.gray};\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ${breakpoints.desktop`\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n `}\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ${breakpoints.tablet`\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.tablet};\n }\n button.ox-icon-angle-right {\n margin-left: ${breakpoints.margins.tablet};\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n `}\n\n ${breakpoints.mobile`\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n`;\nStepCardHeader.displayName = 'StepCardHeader';\n\nconst StepCardQuestion = styled.div<{ unpadded?: boolean }>`\n .step-card-body {\n ${mixins.stepCardPadding()}\n overflow: auto;\n background: ${colors.card.body.background};\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ${breakpoints.only.mobile`\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n `}\n\n .reading-step & {\n padding: 0;\n }\n\n ${breakpoints.desktop`\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n `}\n\n ${breakpoints.mobile`\n .openstax-exercise-badges svg {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n`;\n\ninterface SharedProps {\n questionNumber: number;\n numberOfQuestions: number;\n showTotalQuestions: boolean;\n leftHeaderChildren?: ReactNode;\n rightHeaderChildren?: ReactNode;\n headerTitleChildren?: ReactNode;\n}\n\nexport interface StepCardProps extends SharedProps {\n unpadded: boolean;\n className?: string;\n children?: ReactNode;\n stepType: StepWithData['type'];\n availablePoints?: AvailablePoints;\n questionId?: string;\n multipartBadge?: ReactNode;\n isHomework: boolean;\n}\n\nconst StepCard = ({\n questionNumber,\n numberOfQuestions,\n showTotalQuestions,\n stepType,\n isHomework,\n availablePoints,\n unpadded, // currently does nothing; may need to restore if this causes tutor stepcard regression\n className,\n children,\n questionId,\n multipartBadge,\n leftHeaderChildren,\n rightHeaderChildren,\n headerTitleChildren,\n ...otherProps }: StepCardProps) => {\n\n const formattedQuestionNumber = numberOfQuestions > 1\n ? `Questions ${questionNumber} - ${questionNumber + numberOfQuestions - 1}`\n : `Question ${questionNumber}`;\n\n return (\n \n {multipartBadge}\n \n {questionNumber && isHomework && stepType === 'exercise' &&\n \n
\n {leftHeaderChildren}\n

\n {headerTitleChildren}\n {formattedQuestionNumber}\n {showTotalQuestions ?  / {numberOfQuestions} : null}\n |\n ID: {questionId}\n

\n
\n {availablePoints || rightHeaderChildren ?
\n {availablePoints &&
{availablePoints} Points
}\n {rightHeaderChildren}\n
: null}\n
\n }\n {children}\n
\n
\n )\n};\nStepCard.displayName = 'OSStepCard';\n\nexport interface TaskStepCardProps extends SharedProps {\n className?: string;\n children?: ReactNode;\n step: StepBase | StepWithData;\n questionNumber: number;\n numberOfQuestions: number;\n}\n\nconst TaskStepCard = ({\n step,\n questionNumber,\n numberOfQuestions,\n children,\n className,\n ...otherProps\n}: TaskStepCardProps) =>\n(\n {children}\n);\n\nTaskStepCard.displayName = 'OSTaskStepCard';\n\nexport { StepCard, TaskStepCard };\n","import { colors } from \"../theme\";\nimport styled from \"styled-components\";\n\nconst StyledButton = styled.button`\n background-color: ${colors.button.background};\n color: ${colors.palette.white};\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ${colors.button.backgroundHover}\n }\n &:active {\n background: ${colors.button.backgroundActive}\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n`;\n\ninterface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting?: never;\n waitingText?: never;\n}\ninterface WaitingButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting: boolean;\n waitingText: string;\n}\n\nconst Button = (props: ButtonProps | WaitingButtonProps) => {\n const { disabled, isWaiting, waitingText, children, ...otherProps } = props;\n\n return (\n {(isWaiting && waitingText) || children}\n );\n}\n\nexport default Button;\n","import styled, { createGlobalStyle } from \"styled-components\";\nimport { InnerStepCard } from \"./Card\";\nimport Button from \"./Button\";\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nexport interface CompletionStatusProps {\n numberOfQuestions: number;\n numberCompleted: number;\n handleClick: () => void;\n className?: string;\n}\n\nconst CompletionStatusCard = styled(InnerStepCard)`\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n`;\n\nconst CompletionHeader = styled.h2`\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n`;\n\nexport const CompletionStatus = styled(({\n numberOfQuestions, numberCompleted, handleClick, className\n}: CompletionStatusProps) => {\n\n const allCompleted = numberOfQuestions === numberCompleted;\n const someCompleted = numberCompleted > 0;\n const buttonText = allCompleted ? 'Next' : (\n someCompleted ? 'Continue' : 'Start'\n );\n\n return <>\n \n \n {allCompleted ? 'You are done.' : (someCompleted ? 'Quiz is partially complete.' : 'No questions have been answered.')}\n

{allCompleted ? 'Great job answering all the questions.' : (someCompleted ? `You've completed ${numberCompleted} of ${numberOfQuestions} questions.` : 'Begin working on the quiz.')}

\n \n
\n \n})``;\n","import styled from 'styled-components';\nimport { mixins, colors, layouts, transitions } from '../theme';\nimport { AnswersTable } from './AnswersTable';\nimport classnames from 'classnames';\nimport { ID, ExerciseQuestionData, Task } from 'src/types';\nimport React, { ReactNode } from 'react';\nimport { Content } from './Content';\n\nconst StyledQuestion = styled.div`\n&.step-card-body {\n ${mixins.stepCardPadding()};\n}\n\n&.openstax-question {\n border-top: 1px solid ${colors.palette.pale};\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ${colors.palette.neutral};\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ${colors.palette.neutralLightBlue};\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: ${layouts.answer.horizontalSpacing} ${layouts.answer.horizontalBuffer};\n margin: ${layouts.answer.verticalSpacing} 0 ${layouts.answer.horizontalSpacing} ${layouts.answer.verticalSpacing};\n border-left: ${layouts.answer.horizontalSpacing} solid ${colors.palette.neutralLighter};\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ${colors.palette.neutralLightest};\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ${mixins.answer()};\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ${layouts.answer.horizontalSpacing};\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: ${layouts.answer.verticalSpacing} 0 0 0;\n margin: 0;\n transition: color ${transitions.answer};\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ${mixins.answerHover()}\n }\n }\n\n .answer-input-box {\n ${mixins.visuallyHidden()}\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ${colors.answer.checked};\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ${mixins.answerIncorrect()};\n }\n }\n\n &.answer-correct {\n .answer-label {\n ${mixins.answerCorrect(true)};\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ${mixins.answerCorrectAnswer()}\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ${mixins.answerIncorrect()}\n }\n &.answer-selected.answer-incorrect {\n ${mixins.answerIncorrect(true)}\n }\n }\n }\n\n .question-feedback {\n ${mixins.popover()}\n max-width: ${layouts.answer.feedback.popover.maxWidth};\n .question-feedback-content {\n padding: ${layouts.answer.feedback.popover.verticalSpacing} ${layouts.answer.feedback.popover.horizontalSpacing};\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n`;\n\nexport interface QuestionProps {\n question: ExerciseQuestionData,\n answer_id?: ID;\n task?: Task | null,\n correct_answer_id: ID | null;\n incorrectAnswerId: ID;\n hideAnswers: boolean;\n hidePreambles?: boolean,\n exercise_uid?: string;\n displayFormats: boolean,\n className: string;\n questionNumber: number;\n displaySolution: boolean;\n context?: string;\n correct_answer_feedback_html?: string;\n contentRenderer?: JSX.Element;\n feedback_html: string;\n onChange: () => void;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n children?: ReactNode;\n answerIdOrder?: ID[];\n choicesEnabled?: boolean;\n}\n\nexport const Question = React.forwardRef((props: QuestionProps, ref: React.ForwardedRef) => {\n let exerciseUid, solution;\n\n const {\n question, correct_answer_id, incorrectAnswerId, exercise_uid, className, questionNumber, context, task, hidePreambles\n } = props;\n\n const { stem_html, collaborator_solutions = [], formats, stimulus_html } = question;\n\n const hasCorrectAnswer = !!correct_answer_id;\n const hasIncorrectAnswer = !!incorrectAnswerId;\n\n const taskIsDeleted = (task != null ? task.is_deleted : undefined)\n const taskIsHomework = ((task != null ? task.type : undefined) === 'homework');\n\n const classes = classnames('openstax-question', className, {\n 'has-correct-answer': hasCorrectAnswer && !(taskIsDeleted && taskIsHomework),\n 'has-incorrect-answer': hasIncorrectAnswer,\n });\n\n const hasSolution = () => {\n const { displaySolution } = props;\n const { collaborator_solutions = [] } = question;\n\n return (\n displaySolution &&\n collaborator_solutions &&\n collaborator_solutions.find(s => s['content_html'] !== undefined)\n );\n };\n\n if (exercise_uid != null) {\n exerciseUid = (\n
\n {exercise_uid}\n
\n );\n }\n\n if (hasSolution()) {\n solution =\n
\n
\n Detailed solution:\n
\n s['content_html']).join('')} />\n
;\n }\n\n return (\n \n \n );\n});\n\ninterface QuestionHtmlProps {\n html?: string;\n type: string;\n hidden: QuestionProps['hidePreambles'];\n questionNumber?: QuestionProps['questionNumber'];\n}\n\nexport const QuestionHtml = (props: QuestionHtmlProps) => {\n const { html = '', type, hidden, questionNumber } = props;\n if (hidden === true || !(html.length > 0)) { return null; }\n\n return (\n \n );\n};\n\nconst FormatsListing = ({ formats = [] }: { formats: ExerciseQuestionData['formats'] }) => {\n return (\n
\n
Formats:
\n {formats.map((format, i) => {format})}\n
\n );\n};\n","import { colors, breakpoints, mixins } from \"../theme\";\nimport styled from \"styled-components\";\n\nexport const StepCardFooter = styled.div`\n ${mixins.stepCardPadding()}\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ${colors.card.body.background};\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ${colors.palette.pale};\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ${breakpoints.mobile`\n flex-wrap: wrap;\n `}\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ${breakpoints.desktop`\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n `}\n`;\n","import { MouseEventHandler, ReactNode } from 'react';\nimport { countWords } from '../utils';\nimport styled, { css } from 'styled-components';\nimport { colors, mixins } from '../theme';\nimport { AvailablePoints, ExerciseQuestionData } from 'src/types';\nimport { QuestionHtml } from './Question';\nimport Button from './Button';\nimport { StepCardFooter } from './StepCardFooter';\n\nexport interface FreeResponseProps {\n readOnly: boolean;\n wordLimit: number;\n infoRowChildren?: ReactNode;\n onChange: (event: React.ChangeEvent) => void;\n cancelHandler: MouseEventHandler;\n saveHandler: MouseEventHandler;\n defaultValue: string;\n isSubmitDisabled: boolean;\n questionNumber: number,\n question: ExerciseQuestionData,\n availablePoints?: AvailablePoints,\n textHasChanged: boolean;\n submitBtnLabel: string;\n}\n\nconst TextAreaErrorStyle = css`\n background-color: #f5e9ea;\n`;\n\nconst StyledFreeResponse = styled.div`\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ${mixins.stepCardPadding()}\n }\n`;\n\nconst SyledQuestionStem = styled.div`\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n`;\n\nconst InfoRow = styled.div<{ hasChildren: boolean }>`\n margin: 8px 0;\n display: flex;\n justify-content: ${props => props.hasChildren ? 'space-between' : 'flex-end'};\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ${colors.palette.danger};\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ${colors.palette.neutralThin};\n`;\n\nexport const FreeResponseTextArea = styled.textarea<{ isOverWordLimit: boolean } & FreeResponseProps>`\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ${colors.palette.neutral};\n color: ${colors.palette.neutralDark};\n ${props => props.isOverWordLimit && TextAreaErrorStyle};\n ${props => props.isOverWordLimit && css`\n border: 2px solid ${colors.palette.danger};\n `}\n background-color: ${props => props.readOnly && colors.palette.neutralCool};\n`;\nFreeResponseTextArea.displayName = 'OSFreeResponseTextArea';\n\nconst RevertButton = (props: {\n disabled: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n);\n\n\nexport const FreeResponseInput = (props: FreeResponseProps) => {\n const {\n availablePoints,\n cancelHandler,\n defaultValue,\n infoRowChildren,\n isSubmitDisabled,\n question,\n questionNumber,\n saveHandler,\n submitBtnLabel,\n textHasChanged,\n wordLimit,\n } = props;\n\n const isOverWordLimit = countWords(defaultValue) > wordLimit;\n\n const questionProps = {};\n if (questionNumber) { questionProps['data-question-number'] = questionNumber; }\n\n return (\n \n
\n \n {question.stem_html &&\n \n \n \n {infoRowChildren}\n
\n {countWords(defaultValue)} words\n {isOverWordLimit && Maximum {wordLimit} words}\n
\n
\n
\n \n {availablePoints\n ?
Points: {availablePoints}
\n : null}\n
\n \n \n {submitBtnLabel}\n \n
\n
\n
\n );\n}\n\nFreeResponseInput.displayName = 'OSFreeResponse';\n","import React from \"react\";\nimport { numberfyId } from \"../../src/utils\";\nimport { AvailablePoints, ID, ExerciseQuestionData, Task } from \"../types\";\nimport Button from \"./Button\";\nimport { Content } from \"./Content\";\nimport { ExerciseBaseProps } from \"./Exercise\";\nimport { Question } from './Question';\nimport { StepCardFooter } from \"./StepCardFooter\";\n\nexport interface ExerciseQuestionProps {\n task?: Task;\n question: ExerciseQuestionData;\n answer_id_order?: ID[];\n questionNumber: number;\n choicesEnabled: boolean;\n hasMultipleAttempts: boolean;\n onAnswerChange: () => void;\n onAnswerSave: ExerciseBaseProps['onAnswerSave'];\n onNextStep: ExerciseBaseProps['onNextStep'];\n feedback_html: string;\n correct_answer_feedback_html: string;\n is_completed: boolean;\n correct_answer_id: ID;\n incorrectAnswerId: ID;\n answer_id?: ID;\n attempts_remaining: number;\n published_comments?: string;\n detailedSolution?: string;\n canAnswer: boolean;\n needsSaved: boolean;\n canUpdateCurrentStep: boolean;\n attempt_number: number;\n apiIsPending: boolean;\n displaySolution: boolean;\n available_points?: AvailablePoints;\n exercise_uid: string;\n free_response?: string;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n hasFeedback?: ExerciseBaseProps['hasFeedback'];\n}\n\nconst AttemptsRemaining = ({ count }: { count: number }) => {\n return (\n
{count} attempt{count === 1 ? '' : 's'} left
\n );\n}\n\nconst PublishedComments = ({ published_comments }: { published_comments?: string }) => {\n if (!published_comments) { return null; }\n\n return (\n
\n Feedback: {published_comments}\n
\n );\n}\n\nexport const SaveButton = (props: {\n disabled: boolean, isWaiting: boolean, attempt_number: number, willContinue: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n {props.willContinue\n ? 'Submit & continue'\n : (props.attempt_number == 0 ? 'Submit' : 'Re-submit')}\n \n);\n\nexport const NextButton = (props: {\n canUpdateCurrentStep: boolean,\n} & React.ComponentPropsWithoutRef<'button'>) => {\n return (\n \n );\n}\n\nconst FreeResponseReview = ({ free_response }: Pick) => {\n if (!free_response) { return null; }\n return (\n <>\n
{free_response}
\n \n );\n}\n\nexport const ExerciseQuestion = React.forwardRef((props: ExerciseQuestionProps, ref: React.ForwardedRef) => {\n const {\n question, task, answer_id_order, onAnswerChange, feedback_html, correct_answer_feedback_html,\n is_completed, correct_answer_id, incorrectAnswerId, choicesEnabled, questionNumber,\n answer_id, hasMultipleAttempts, attempts_remaining, published_comments, detailedSolution,\n canAnswer, needsSaved, attempt_number, apiIsPending, onAnswerSave, onNextStep, canUpdateCurrentStep,\n displaySolution, available_points, free_response, show_all_feedback, tableFeedbackEnabled,\n hasFeedback\n } = props;\n\n const [shouldContinue, setShouldContinue] = React.useState(false)\n React.useEffect(() => {\n if (shouldContinue && is_completed) {\n onNextStep(questionNumber - 1);\n setShouldContinue(false);\n }\n }, [onNextStep, questionNumber, shouldContinue, is_completed]);\n\n return (\n
\n \n \n \n \n
\n
\n {available_points ? Points: {available_points} : null}\n \n {hasMultipleAttempts &&\n attempts_remaining > 0 &&\n }\n \n \n {detailedSolution && (
Detailed solution:
)}\n
\n
\n {(canAnswer && needsSaved) || shouldContinue ?\n {\n onAnswerSave(numberfyId(question.id));\n if (!hasFeedback) {\n setShouldContinue(true);\n }\n }}\n willContinue={!hasFeedback}\n /> :\n onNextStep(questionNumber - 1)} canUpdateCurrentStep={canUpdateCurrentStep} />}\n
\n
\n
\n
\n );\n})\n","import { debounce, once } from 'lodash';\nimport { isEmpty, memoize } from 'lodash/fp.js';\nimport WeakMap from 'weak-map';\n\ndeclare global {\n interface Window {\n MathJax?: any;\n __debugMathJax?: boolean;\n }\n}\n\nconst MATH_MARKER_BLOCK = '\\u200c\\u200c\\u200c'; // zero-width non-joiner\nconst MATH_MARKER_INLINE = '\\u200b\\u200b\\u200b'; // zero-width space\n\nconst MATH_RENDERED_CLASS = 'math-rendered';\nconst MATH_MARKED_CLASS = 'math-marked';\nconst MATH_DATA_SELECTOR = `[data-math]:not(.${MATH_RENDERED_CLASS})`;\nconst MATH_ML_SELECTOR = `math:not(.${MATH_RENDERED_CLASS})`;\nconst COMBINED_MATH_SELECTOR = `${MATH_DATA_SELECTOR}, ${MATH_ML_SELECTOR}`;\nconst MATHJAX_CONFIG = {\n extensions: [],\n showProcessingMessages: false,\n skipStartupTypeset: true,\n styles: {\n '#MathJax_MSIE_Frame': {\n left: '', right: 0, visibility: 'hidden',\n },\n '#MathJax_Message': {\n left: '', right: 0, visibility: 'hidden',\n },\n },\n tex2jax: {\n displayMath: [[MATH_MARKER_BLOCK, MATH_MARKER_BLOCK]],\n inlineMath: [[MATH_MARKER_INLINE, MATH_MARKER_INLINE]],\n },\n};\n\nconst findProcessedMath = (root: Element): Element[] => Array.from(root.querySelectorAll('.MathJax math'));\nconst findUnprocessedMath = (root: Element): Element[] => {\n const processedMath = findProcessedMath(root);\n return Array.from(root.querySelectorAll('math')).filter((node) => processedMath.indexOf(node) === -1);;\n};\n\nconst findLatexNodes = (root: Element): Element[] => {\n const latexNodes: Element[] = [];\n for (const node of Array.from(root.querySelectorAll(MATH_DATA_SELECTOR))) {\n const formula = node.getAttribute('data-math');\n\n // Set textContent once so that resolveOrWait calls don't\n // undo a MathJax pass before rendered class is applied\n if (!node.classList.contains(MATH_MARKED_CLASS)) {\n node.textContent = (node.tagName.toLowerCase() === 'div')\n ? `${MATH_MARKER_BLOCK}${formula}${MATH_MARKER_BLOCK}`\n : `${MATH_MARKER_INLINE}${formula}${MATH_MARKER_INLINE}`;\n node.classList.add(MATH_MARKED_CLASS);\n }\n latexNodes.push(node);\n }\n\n return latexNodes;\n};\n\nconst typesetLatexNodes = (latexNodes: Element[], windowImpl: Window) => () => {\n if (isEmpty(latexNodes)) {\n return;\n }\n\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(latexNodes),\n markLatexNodesRendered(latexNodes)\n );\n};\n\nconst typesetMathMLNodes = (root: Element, windowImpl: Window) => () => {\n const mathMLNodes = findUnprocessedMath(root);\n\n if (isEmpty(mathMLNodes)) {\n return;\n }\n\n // style the entire document because mathjax is unable to style individual math elements\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(root)\n );\n};\n\nconst markLatexNodesRendered = (latexNodes: Element[]) => () => {\n // Queue a call to mark the found nodes as rendered so are ignored if typesetting is called repeatedly\n // uses className += instead of classList because IE\n const result = [];\n for (const node of latexNodes) {\n result.push(node.className += ` ${MATH_RENDERED_CLASS}`);\n }\n};\n\n// Search document for math and [data-math] elements and then typeset them\nfunction typesetDocument(root: Element, windowImpl: Window) {\n const latexNodes = findLatexNodes(root);\n\n windowImpl.MathJax.Hub.Queue(\n typesetLatexNodes(latexNodes, windowImpl),\n typesetMathMLNodes(root, windowImpl)\n );\n}\n\nconst resolveOrWait = (root: Element, resolve: () => void, remainingTries = 5) => {\n if (\n remainingTries > 0\n && (findLatexNodes(root).length || findUnprocessedMath(root).length)\n ) {\n setTimeout(() => {\n resolveOrWait(root, resolve, remainingTries - 1);\n }, 200);\n } else {\n resolve();\n }\n};\n\nconst typesetDocumentPromise = (root: Element, windowImpl: Window): Promise => new Promise((resolve) => {\n typesetDocument(root, windowImpl);\n windowImpl.MathJax.Hub.Queue(() => {\n resolveOrWait(root, resolve);\n });\n});\n\n// memoize'd getter for typeset document function so that each node's\n// typeset has its own debounce\nconst getTypesetDocument = memoize((root, windowImpl) => {\n // Install a debounce around typesetting function so that it will only run once\n // every Xms even if called multiple times in that period\n return debounce(typesetDocumentPromise, 100, {\n leading: true,\n trailing: false,\n }).bind(null, root, windowImpl);\n});\ngetTypesetDocument.cache = new WeakMap();\n\n// typesetMath is the main exported function.\n// It's called by components like HTML after they're rendered\nconst typesetMath = async (root: Element, windowImpl = window) => {\n await startMathJax();\n\n // check if MathJax is setup\n if (!(windowImpl && windowImpl.MathJax && windowImpl.MathJax.Hub)) {\n console.warn('Warning: Expected MathJax to be initialized.');\n return Promise.resolve();\n }\n\n // schedule a Mathjax pass if there is at least one [data-math] or element present\n if (root.querySelector(COMBINED_MATH_SELECTOR)) {\n return getTypesetDocument(root, windowImpl)();\n }\n\n return Promise.resolve();\n};\n\nconst startMathJax: (windowImpl?: Window) => Promise = once((windowImpl: Window = window) => new Promise((resolve) => {\n const configuredCallback = () => {\n // there doesn't seem to be a config option for this\n windowImpl.MathJax.HTML.Cookie.prefix = 'mathjax';\n // proceed with mathjax initi\n windowImpl.MathJax.Hub.Configured();\n windowImpl.MathJax.Hub.Register.StartupHook('End', () => {\n resolve();\n });\n };\n\n if (!document.getElementById('MathJax-Script')) {\n const script = document.createElement('script');\n script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured';\n script.id = 'MathJax-Script';\n script.async = true;\n document.head.appendChild(script);\n }\n\n if (windowImpl.MathJax && windowImpl.MathJax.Hub) {\n windowImpl.MathJax.Hub.Config(MATHJAX_CONFIG);\n // Does not seem to work when passed to Config\n windowImpl.MathJax.Hub.processSectionDelay = 0;\n configuredCallback();\n } else {\n // If the MathJax.js file has not loaded yet:\n // Call MathJax.Configured once MathJax loads and\n // loads this config JSON since the CDN URL\n // says to `delayStartupUntil=configured`\n (MATHJAX_CONFIG as any).AuthorInit = configuredCallback;\n windowImpl.MathJax = MATHJAX_CONFIG;\n }\n}));\n\nexport {\n typesetMath,\n startMathJax,\n};\n","import { colors, layouts, breakpoints } from \"../../src/theme\";\nimport styled, { css } from \"styled-components\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faBookOpen, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport { ExerciseIcons } from \"./Exercise\";\n\nexport const StyledToolbar = styled.div<{\n mobile: boolean;\n desktop: boolean;\n}>`\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ${colors.palette.light};\n background: #fff;\n margin: ${layouts.card.spacing} 0 0 ${layouts.card.spacing};\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${colors.palette.neutral};\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ${colors.palette.neutralDarker};\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ${colors.palette.neutralDarker};\n }\n\n span {\n display: block;\n }\n }\n }\n\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n\n ${props => props.mobile && breakpoints.mobile`\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ${colors.palette.neutral};\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ${colors.palette.light};\n }\n }\n `}\n`;\n\nexport const ExerciseToolbar = ({ icons }: { icons?: ExerciseIcons }) => {\n if (!icons) {\n return null;\n }\n const settings = Object.values(icons);\n const mobile = settings.some(({ location }) => location?.toolbar?.mobile ?? true);\n const desktop = settings.some(({ location }) => location?.toolbar?.desktop ?? false);\n const topicUrl = icons.topic?.url;\n const errataUrl = icons.errata?.url;\n\n return \n {topicUrl ? \n \n View topic in textbook\n : null}\n {errataUrl ? \n \n Suggest a correction\n : null}\n \n};\n","import styled, { css } from 'styled-components';\nimport { breakpoints, colors, mixins } from '../../src/theme';\nimport { ExerciseData } from '../../src/types';\nimport { faBookOpen } from '@fortawesome/free-solid-svg-icons/faBookOpen';\nimport { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons/faTriangleExclamation';\nimport { faCircleInfo } from '@fortawesome/free-solid-svg-icons/faCircleInfo';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { ExerciseIcons } from './Exercise';\n\ntype ExplanationType = 'multiple-choice' | 'two-step';\n\nconst TypeExplanations: { [key in ExplanationType]: string } = {\n 'multiple-choice': 'Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts.',\n 'two-step': 'In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. \\\nRecalling the answer to a question from memory helps you to retain things longer.',\n}\n\nconst ItemWrapper = styled.div<{ mobile: boolean; desktop: boolean }>`\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ${colors.palette.mediumBlue};}\n .popover { display: flex; }\n }\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n ${props => !props.mobile && breakpoints.mobile`\n display: none;\n `}\n`;\n\nconst InnerWrapper = styled.div`\n position: relative;\n display: flex;\n`;\n\nconst Popover = styled.div`\n ${mixins.popover}\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n`;\n\ninterface PopoverItemProps {\n text: string;\n children: JSX.Element;\n wrapperProps?: {\n as: keyof JSX.IntrinsicElements;\n href?: string;\n target?: string;\n },\n mobile: boolean;\n desktop: boolean;\n}\n\nconst PopoverItem = (props: PopoverItemProps) => (\n \n \n {props.children}\n \n
\n
{props.text}
\n
\n
\n \n);\n\nconst PopoverItemsWrapper = styled.div`\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n color: ${colors.palette.darkGray};\n height: 1em;\n`;\n\nexport const ExerciseHeaderIcons = ({ exercise, icons }: {\n exercise: ExerciseData, icons: ExerciseIcons\n}) => {\n const defaultHeaderLocation = { desktop: true, mobile: false };\n const items = [];\n const isMultipleChoice = exercise.questions.every((q) => q.answers.length > 0);\n let typeExplanation;\n\n if (isMultipleChoice && exercise.questions.find((q) => q.formats.includes('free-response'))) {\n typeExplanation = TypeExplanations['two-step'];\n } else if (isMultipleChoice) {\n typeExplanation = TypeExplanations['multiple-choice'];\n }\n\n if (icons.topic) {\n items.push(\n \n \n \n );\n }\n\n if (icons.errata) {\n items.push(\n \n \n \n )\n }\n\n if (icons.info && typeExplanation) {\n items.push(\n \n \n \n )\n }\n\n return (\n \n {items}\n \n );\n};\n","import React from 'react';\nimport scrollToElement from 'scroll-to-element';\nimport styled, { createGlobalStyle, css } from 'styled-components';\nimport { Answer, ExerciseData, ID, QuestionState, StepBase, StepWithData } from '../../src/types';\nimport { InnerStepCard, OuterStepCard, TaskStepCard, TaskStepCardProps } from './Card';\nimport { Content } from './Content';\nimport { ExerciseQuestion } from './ExerciseQuestion';\nimport { typesetMath } from '../helpers/mathjax';\nimport { ExerciseToolbar, StyledToolbar } from './ExerciseToolbar';\nimport { breakpoints } from '../theme';\nimport { ExerciseHeaderIcons } from './ExerciseHeaderIcons';\nimport { TypesetMathContext } from '../hooks/useTypesetMath';\n\nconst StyledTaskStepCard = styled(TaskStepCard)`\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n`;\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nconst ToolbarWrapper = styled.div<{\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n}>`\n ${props => props.desktopToolbarEnabled && css`\n ${breakpoints.desktop`\n ${StyledTaskStepCard} {\n margin-left: 6.8rem;\n }\n `}\n ${breakpoints.tablet`\n ${StyledTaskStepCard} {\n margin-left: 4.8rem;\n }\n `}\n ${breakpoints.mobile`\n ${StyledTaskStepCard} {\n margin-left: 0;\n }\n `}\n `}\n\n ${props => props.mobileToolbarEnabled && css`\n ${breakpoints.mobile`\n ${StyledToolbar} + ${OuterStepCard} ${InnerStepCard} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n `}\n `}\n`;\n\nconst TaskStepCardWithToolbar = (props: React.PropsWithChildren &\n Pick & {\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n }\n) => \n \n \n ;\n\nconst Preamble = ({ exercise }: { exercise: ExerciseData }) => {\n return (\n <>\n {exercise.context &&\n }\n\n {exercise.stimulus_html &&\n }\n \n );\n};\n\ninterface ExerciseIconLocation {\n desktop: boolean;\n mobile: boolean;\n}\n\ninterface ExerciseIcon {\n location?: {\n /**\n * @default {\n * desktop: true,\n * mobile: false\n * }\n **/\n header?: ExerciseIconLocation;\n /**\n * @default {\n * desktop: false,\n * mobile: true\n * }\n **/\n toolbar?: ExerciseIconLocation;\n }\n}\n\nexport interface ExerciseIcons {\n /** An object containing a URL for the errata form for this exercise and settings for rendering the icon. */\n errata?: ExerciseIcon & { url: string };\n /** An object containing a URL for textbook content relevant to the exercise and settings for rendering the icon. */\n topic?: ExerciseIcon & { url: string };\n /** An object of settings for rendering the info icon that describes the exercise type (multiple-choice, two-step, etc.) */\n info?: ExerciseIcon;\n}\n\nexport interface ExerciseBaseProps {\n /** An object containing a Step ID and Exercise UID */\n step: StepBase;\n /** An exercise object from the Exercises API */\n exercise: ExerciseData;\n numberOfQuestions: number;\n /** The current question index. For multipart questions this is the first question number. */\n questionNumber: number;\n /** A boolean that enables showing the amount of attempts remaining. */\n hasMultipleAttempts: boolean;\n /** A callback with the question_id when the Submit/Re-submit button is clicked. */\n onAnswerSave: (question_id: number) => void;\n /** A callback with the current question index when the Next/Continue button is clicked. */\n onNextStep: (currentIndex: number) => void;\n /** A boolean that enables always showing every answer feedback_html field. */\n show_all_feedback?: boolean;\n /** The question number to scroll into view when the component renders. */\n scrollToQuestion?: number;\n /** An object containing data for how to render the following icons:\n * - An errata icon linking to the errata/feedback form\n * - An info icon describing the exercise type (multiple-choice, two-step, etc.)\n * - A topic icon linking to the relevant textbook location\n */\n exerciseIcons?: ExerciseIcons;\n hasFeedback?: boolean;\n}\n\nexport interface ExerciseWithStepDataProps extends ExerciseBaseProps {\n /** A Tutor Step object */\n step: StepWithData;\n canAnswer: boolean;\n needsSaved: boolean;\n apiIsPending: boolean;\n onAnswerChange: (answer: Answer) => void;\n canUpdateCurrentStep: boolean;\n answer_id_order?: ID[];\n}\n\nexport interface ExerciseWithQuestionStatesProps extends ExerciseBaseProps {\n questionStates: { [key: ID]: QuestionState };\n /** A callback with the IDs of the answer and question */\n onAnswerChange: (answer: Omit & { id: number, question_id: number }) => void;\n}\n\nexport const Exercise = styled(({\n numberOfQuestions, questionNumber, step, exercise, show_all_feedback, scrollToQuestion, exerciseIcons, ...props\n}: { className?: string } & (ExerciseWithStepDataProps | ExerciseWithQuestionStatesProps)) => {\n const legacyStepRender = 'feedback_html' in step;\n const questionsRef = React.useRef>([]);\n const container = React.useRef(null);\n\n const typesetExercise = React.useCallback(() => {\n if (container.current) {\n typesetMath(container.current);\n }\n }, []);\n\n React.useEffect(() => {\n const el = scrollToQuestion && questionsRef.current[scrollToQuestion];\n if (el) {\n scrollToElement(el);\n }\n }, [scrollToQuestion, exercise]);\n\n const desktopToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.desktop);\n const mobileToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.mobile);\n\n return \n \n : null}\n showTotalQuestions={legacyStepRender}\n desktopToolbarEnabled={desktopToolbarEnabled}\n mobileToolbarEnabled={mobileToolbarEnabled}\n {...(exerciseIcons ? { exerciseIcons: exerciseIcons } : null)}\n className={props.className}\n >\n
\n \n\n {exercise.questions.map((q, i) => {\n const state = { ...(legacyStepRender ? step : props['questionStates'][q.id]) };\n return (\n questionsRef.current[questionNumber + i] = el}\n exercise_uid={exercise.uid}\n key={q.id}\n question={q}\n questionNumber={questionNumber + i}\n choicesEnabled={state.canAnswer}\n displaySolution={true}\n detailedSolution={state.solution?.content_html}\n show_all_feedback={show_all_feedback}\n tableFeedbackEnabled={show_all_feedback && !legacyStepRender}\n canUpdateCurrentStep={\n // misleading prop name, we want to show a continue button for completed questions\n // that aren't the last question, which requires this prop to be true\n 'canUpdateCurrentStep' in props ?\n props.canUpdateCurrentStep : !(i + 1 === exercise.questions.length)\n }\n />\n )\n }\n )}\n
\n \n
;\n})`\n`;\n","const SvgComponent = () => (\n \n \n \n);\nexport default SvgComponent;\n","import styled, { css } from 'styled-components';\nimport { colors, breakpoints } from '../theme';\nimport FlagIcon from '../assets/flag';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';\nimport { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';\n\nconst ProgressBarWrapper = styled.nav`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ${breakpoints.mobile`\n padding: 1.6rem 0.8rem;\n `}\n`;\n\nconst StyledItemWrapper = styled.span`\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n`;\n\nconst handleVariant = (variant: ProgressBarItemVariant) => {\n switch (variant) {\n case 'isStatus':\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n case 'isCorrect':\n return css`\n color: ${colors.answer.correct};\n background-color: #E8F4D8;\n `;\n case 'isIncorrect':\n return css`\n color: ${colors.answer.incorrect};\n background-color: #F8E8EA;\n `;\n default:\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n }\n};\n\nconst shadowCss = 'box-shadow: 0px 1px 4px 0px #00000066;';\n\nexport const StyledItem = styled.button<{ variant: ProgressBarItemVariant, isActive: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: ${props => props.isActive ? '4rem' : '3.2rem'};\n height: ${props => props.isActive ? '4rem' : '3.2rem'};\n border: 0;\n border-radius: 50%;\n margin: ${props => props.isActive ? '0' : '0 0.3rem'};\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ${colors.palette.neutralDarker};\n ${props => props.isActive ? css`\n ${shadowCss}\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n ` : null}\n ${props => handleVariant(props.variant)}\n &:hover {\n ${shadowCss}\n }\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n background: ${props => props.color};\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n`;\n\nconst ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {\n if (!variant || variant !== 'isCorrect' && variant !== 'isIncorrect') {\n return null;\n }\n\n const variantData = {\n isCorrect: {\n icon: faCheck,\n color: colors.answer.correct,\n label: 'Correct',\n },\n isIncorrect: {\n icon: faXmark,\n color: colors.answer.incorrect,\n label: 'Incorrect',\n },\n }[variant];\n\n return ;\n}\n\nexport interface ProgressBarProps {\n steps: S[];\n activeIndex: number | null;\n goToStep: (index: number, step: S) => void;\n}\n\nexport interface ProgressBarItemProps {\n index: number;\n isActive: boolean;\n step: S;\n goToStep: (index: number, step: S) => void;\n}\n\nexport type ProgressBarItemVariant = 'isCorrect' | 'isIncorrect' | 'isStatus' | null;\n\nexport const ProgressBarItem = ({index, isActive, step, goToStep}: ProgressBarItemProps) =>\n \n goToStep(index, step)}\n aria-current={isActive ? 'location' : 'false'}\n aria-label={step.variant === 'isStatus' ? 'Assignment status' : `Question ${index + 1}` }\n >\n {step.variant === 'isStatus' ? : index + 1}\n \n \n ;\n\nexport const ProgressBar = ({ steps, activeIndex, goToStep }: ProgressBarProps) =>\n \n {steps.map((step, index) => )}\n ;\n","import { BulletList } from \"react-content-loader\";\nimport { colors } from \"../../src/theme\";\nimport styled from \"styled-components\";\n\nconst Wrapper = styled.div`\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n`;\n\nexport const Loader = () => ;\n"],"names":["ALPHABET","isAnswerIncorrect","answer","incorrectAnswerId","id","countWords","text","words","trim","match","length","TypesetMathContext","React","createContext","Error","Content","_ref","html","component","block","props","_objectWithoutPropertiesLoose","_excluded","typesetMath","useContext","useEffect","undefined","cloneElement","_extends","_jsx","dangerouslySetInnerHTML","__html","SimpleFeedback","children","contentRenderer","className","classnames","Feedback","wrapperClasses","position","_jsxs","_t","_t2","_t3","_t4","_t5","_t6","_t7","_t8","_t9","_t10","_t11","_t12","_t13","_","t","palette","red","danger","darkRed","lightRed","green","lightGreen","darkGreen","paleYellow","teal","blue","mediumBlue","lightBlue","neutralLightBlue","tangerine","gray","darkGray","pale","light","white","neutralLightest","neutralCool","neutralBright","neutralLighter","neutralLight","neutralMedium","neutral","neutralThin","neutralDark","neutralFeedback","neutralDarker","black","orange","colors","hover","checked","correct","incorrect","popover","arrowOuterColor","borderColor","card","header","background","body","button","backgroundHover","backgroundActive","freeResponse","color","breakpoints","mobile","args","css","tablet","desktop","mixins","answerColor","invertBubble","answerChecked","answerCorrect","answerIncorrect","answerHover","answerCorrectAnswer","resetText","stepCardPadding","visuallyHidden","StyledAnswerIndicator","styled","div","state","AnswerIndicator","isCorrect","isIncorrect","AnswerAnswer","content_html","feedback_html","show_all_feedback","tableFeedbackEnabled","TeacherReview","answered_count","iter","percent","selected_count","Math","round","cn","AnswerChoice","type","disabled","onKeyPress","qid","correctIncorrectIcon","feedbackId","isSelected","hasCorrectAnswer","ariaLabel","onChangeAnswer","_Fragment","name","onChange","htmlFor","AnswerBody","Answer","answerId","correctAnswerId","isChecked","isAnswerChecked","correctness","isAnswerCorrect","classes","displayName","defaultAnswerType","AnswersTable","idCounter","question","hideAnswers","choicesEnabled","correct_answer_id","answer_id","correct_answer_feedback_html","answerIdOrder","instructions","feedback","questionAnswerProps","answersHtml","idOrder","answers","slice","sort","a","b","indexOf","sortedAnswersByIdOrder","map","i","additionalProps","question_id","parseInt","key","answerProps","Object","assign","push","index","forEach","item","spliceIndex","splice","role","InnerStepCard","OuterStepCard","StepCardHeader","StepCardQuestion","StepCard","questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren","otherProps","TaskStepCard","_ref2","step","_excluded2","task","uid","StyledButton","Button","isWaiting","waitingText","GlobalStyle","createGlobalStyle","CompletionStatusCard","CompletionHeader","h2","CompletionStatus","numberCompleted","handleClick","allCompleted","someCompleted","buttonText","split","toLowerCase","onClick","StyledQuestion","Question","forwardRef","ref","exerciseUid","solution","exercise_uid","context","hidePreambles","stem_html","collaborator_solutions","formats","stimulus_html","is_deleted","hasSolution","displaySolution","find","s","join","QuestionHtml","hidden","displayFormats","FormatsListing","format","StepCardFooter","TextAreaErrorStyle","StyledFreeResponse","SyledQuestionStem","InfoRow","hasChildren","FreeResponseTextArea","textarea","isOverWordLimit","readOnly","RevertButton","FreeResponseInput","cancelHandler","defaultValue","infoRowChildren","isSubmitDisabled","saveHandler","submitBtnLabel","textHasChanged","wordLimit","questionProps","placeholder","AttemptsRemaining","count","PublishedComments","published_comments","SaveButton","willContinue","attempt_number","NextButton","canUpdateCurrentStep","FreeResponseReview","free_response","ExerciseQuestion","answer_id_order","onAnswerChange","is_completed","hasMultipleAttempts","attempts_remaining","detailedSolution","canAnswer","needsSaved","apiIsPending","onAnswerSave","onNextStep","available_points","hasFeedback","shouldContinue","setShouldContinue","useState","MATHJAX_CONFIG","extensions","showProcessingMessages","skipStartupTypeset","styles","left","right","visibility","tex2jax","displayMath","inlineMath","findUnprocessedMath","root","processedMath","Array","from","querySelectorAll","findProcessedMath","filter","node","findLatexNodes","latexNodes","formula","getAttribute","classList","contains","textContent","tagName","add","resolveOrWait","resolve","remainingTries","setTimeout","typesetDocumentPromise","windowImpl","Promise","MathJax","Hub","Queue","typesetLatexNodes","isEmpty","Typeset","result","markLatexNodesRendered","typesetMathMLNodes","mathMLNodes","typesetDocument","getTypesetDocument","memoize","debounce","leading","trailing","bind","cache","WeakMap","startMathJax","once","window","configuredCallback","HTML","Cookie","prefix","Configured","Register","StartupHook","document","getElementById","script","createElement","src","async","head","appendChild","Config","processSectionDelay","AuthorInit","StyledToolbar","ExerciseToolbar","icons","_icons$topic","_icons$errata","settings","values","some","location","_location$toolbar$mob","_location$toolbar","toolbar","_location$toolbar$des","_location$toolbar2","topicUrl","topic","url","errataUrl","errata","href","target","FontAwesomeIcon","icon","faBookOpen","faTriangleExclamation","ItemWrapper","InnerWrapper","Popover","PopoverItem","wrapperProps","PopoverItemsWrapper","StyledFontAwesomeIcon","ExerciseHeaderIcons","exercise","defaultHeaderLocation","items","isMultipleChoice","questions","every","q","typeExplanation","_icons$topic$location","_icons$errata$locatio","_icons$info$location","includes","as","info","faCircleInfo","height","width","StyledTaskStepCard","ToolbarWrapper","desktopToolbarEnabled","mobileToolbarEnabled","TaskStepCardWithToolbar","exerciseIcons","Preamble","Exercise","scrollToQuestion","legacyStepRender","questionsRef","useRef","container","typesetExercise","useCallback","current","querySelector","console","warn","el","scrollToElement","Provider","value","_state$solution","_createElement","SvgComponent","viewBox","fill","xmlns","d","ProgressBarWrapper","nav","StyledItemWrapper","span","shadowCss","StyledItem","isActive","variant","handleVariant","ItemIcon","variantData","faCheck","label","faXmark","ProgressBarItem","goToStep","FlagIcon","ProgressBar","steps","activeIndex","Wrapper","Loader","BulletList","uniqueKey"],"mappings":"yxCAEaA,EAAW,6BAeXC,EAAoBA,CAACC,EAAgBC,IAEhDD,EAAOE,KAAOD,WAKAE,EAAWC,GACzB,MAEMC,EAFcD,EAAKE,OAECC,MAAM,qBAChC,OAAIF,EACGA,EAAMG,OADM,EAId,MC9BMC,EAAqBC,EAAMC,cAA0B,KAAQ,MAAU,IAAAC,MAAM,4DCa7EC,EAAWC,IACtB,IAAAC,KAACA,EAAIC,UAAEA,EAASC,MAAEA,GAAQ,GAAiCH,EAAvBI,EAAKC,EAAAL,EAAAM,GAEzC,MAAMC,EDf4BX,EAAMY,WAAWb,GCqBnD,OAJAC,EAAMa,UAAU,KACdF,KACC,CAACA,EAAaN,SAECS,IAAdR,EACKN,EAAMe,aAAaT,EAASU,EAAA,CAAGX,QAASG,IAGxCS,EADLV,EACK,MAEA,OAFAS,EAAA,CAAKE,wBAAyB,CAAEC,OAAQd,IAAYG,cCjBzDY,EAAkBZ,GACtBS,EAAA,QAAA,CAAAI,SACEJ,EAACd,EAAO,CACNG,UAAWE,EAAMc,gBACjBC,UAAWC,EAAW,4BAA6B,WAAYhB,EAAMe,WACrElB,KAAMG,EAAMa,SACZd,OAAO,MAIPkB,EAAWrB,QAACZ,GAAEA,GAA6BY,EAAtBI,EAAKC,EAAAL,EAAAM,GAC9B,MACMgB,EAAiBF,EAAW,oBADjBhB,EAAMmB,UAAY,UAGnC,OACEC,EAAA,QAAA,CAAOpC,GAAIA,EAAI+B,UAAWG,EAAcL,SAAA,CACtCJ,EAAK,MAAA,CAAAM,UAAU,QAAmB,aAAA,oBAClCN,EAACG,EAAcJ,KAAKR,EAAK,CACtBa,SAAAb,EAAMa,gBC7Bf,IAAAQ,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC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,EAAgDC,QAAOC,cAAaJ,cAC7Fhd,EAACic,GAAkB,CAAA,aAAY,cAAa7b,SACzC+c,EAAMlT,IAAI,CAACoC,EAAM1B,IAAU3K,EAAC+c,GAE3B,CAAApS,MAAOA,EACP4R,SAAU5R,IAAUyS,EACpB/Q,KAAMA,EACN2Q,SAAUA,GAJLrS,aCrJX,MAAM0S,GAAUtX,EAAOC,IAAGpF,KAAAA,SAAA;;;;;;;;;;;;;;;;;;GAQJgD,EAAOjC,QAAQkB,OAYxBya,GAASA,IAAMtd,EAACqd,GAAQ,CAAAjd,SAAAJ,EAACud,EAAW,CAAAC,UAAU"} \ No newline at end of file diff --git a/dist/index.module.js b/dist/index.module.js new file mode 100644 index 0000000..d89a4af --- /dev/null +++ b/dist/index.module.js @@ -0,0 +1,2 @@ +import{jsx as n,jsxs as e,Fragment as t}from"react/jsx-runtime";import r from"classnames";import o,{createElement as i}from"react";import a,{css as s,createGlobalStyle as l}from"styled-components";import c from"scroll-to-element";import{debounce as d,once as u}from"lodash";import{memoize as p,isEmpty as m}from"lodash/fp.js";import h from"weak-map";import{FontAwesomeIcon as f}from"@fortawesome/react-fontawesome";import{faBookOpen as b,faTriangleExclamation as g}from"@fortawesome/free-solid-svg-icons";import{faBookOpen as w}from"@fortawesome/free-solid-svg-icons/faBookOpen";import{faTriangleExclamation as x}from"@fortawesome/free-solid-svg-icons/faTriangleExclamation";import{faCircleInfo as v}from"@fortawesome/free-solid-svg-icons/faCircleInfo";import{faCheck as y}from"@fortawesome/free-solid-svg-icons/faCheck";import{faXmark as k}from"@fortawesome/free-solid-svg-icons/faXmark";import{BulletList as C}from"react-content-loader";function _(){return _=Object.assign?Object.assign.bind():function(n){for(var e=1;e=0||(o[t]=n[t]);return o}function q(n,e){return e||(e=n.slice(0)),n.raw=e,n}function S(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t .content {\n padding: "," ",";\n }\n "])),tn.resetText(),"1px",X.popover.borderColor,X.palette.white,"325px","8px","1rem",X.palette.neutralThin,"16px","8px","9px","8px","16px","8px","16px",X.popover.borderColor,"1px",X.palette.white,"9px","1px","9px","1rem","0.8rem")},visuallyHidden:function(){return s(V||(V=q(["\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n "])))}},rn=a.div(B||(B=q(["\n color: ",";\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n"])),function(n){return n.state?X.answer.correct:X.answer.incorrect}),on=function(n){var t=n.isCorrect,r=n.isIncorrect;if(!t&&!r)return null;var o=t||!1===r;return e(rn,{state:o,children:[o?"Correct":"Incorrect"," Answer"]})},an=function(t){var r=t.answer,o=r.content_html,i=r.feedback_html,a=t.contentRenderer,s=t.show_all_feedback,l=t.tableFeedbackEnabled;return e("div",{className:"answer-answer",children:[n(on,{isCorrect:t.isCorrect,isIncorrect:t.isIncorrect}),n(W,{className:"answer-content",component:a,html:o}),s&&i&&!l&&n(G,{contentRenderer:a,children:i},"question-mc-feedback")]})},sn=function(t){var o=t.answer,i=t.answered_count,a=t.isCorrect,s=t.contentRenderer,l=t.iter,c=t.show_all_feedback,d=t.tableFeedbackEnabled,u=o.selected_count&&i?Math.round(o.selected_count/i*100):0;return e("div",{className:"review-wrapper",children:[e("div",{className:r("review-count",{green:a,red:!a}),children:[n("span",{className:"selected-count","data-percent":""+u,children:o.selected_count}),n("span",{className:r("letter",{green:a,red:!a}),children:A[l]})]}),n(an,{answer:o,contentRenderer:s,show_all_feedback:c,tableFeedbackEnabled:d})]})},ln=function(r){var o,i=r.type,a=r.iter,s=r.answer,l=r.disabled,c=r.onKeyPress,d=r.qid,u=r.contentRenderer,p=r.feedbackId,m=r.isSelected,h=r.isCorrect,f=r.isIncorrect,b=r.show_all_feedback,g=r.tableFeedbackEnabled,w=(m?"Selected ":"")+"Choice "+A[a]+":";return r.hasCorrectAnswer||"teacher-review"===i||"teacher-preview"===i||"student-mpp"===i||(o=r.onChangeAnswer),e(t,{children:["teacher-preview"===i&&n("div",{className:"correct-incorrect",children:h&&r.correctIncorrectIcon}),n("input",{type:"radio",className:"answer-input-box",checked:m,id:d+"-option-"+a,name:d+"-options",onChange:function(){return o&&o(s)},disabled:l||!o,"aria-details":p}),e("label",{onKeyPress:c,htmlFor:d+"-option-"+a,className:"answer-label",children:[n("span",{className:"answer-letter-wrapper","aria-label":w,"data-answer-choice":A[a],"data-test-id":"answer-choice-"+A[a]}),n(an,{answer:s,contentRenderer:u,show_all_feedback:b,tableFeedbackEnabled:g,isCorrect:h,isIncorrect:f})]})]})},cn=function(e){return n("teacher-review"===e.type?sn:ln,_({},e))},dn=function(e){var t=e.type,o=e.answer,i=e.disabled,a=e.answerId,s=e.correctAnswerId,l=e.incorrectAnswerId,c=function(n,e){return n.id==e}(o,a),d=function(n,e){if(!n.id&&!e)return n.isCorrect;var t=n.id===e;return null!=n.correctness&&(t="1.0"===n.correctness),t}(o,s),u=I(o,l),p=c||void 0===a&&(!l&&d||u),m=r("answers-answer",{disabled:i,"answer-selected":p,"answer-correct":d&&"student-mpp"!==t,"answer-incorrect":l&&I(o,l)});return n("div",{className:"openstax-answer",children:n("section",{className:m,children:n(cn,_({},e,{isCorrect:d,isSelected:p,isIncorrect:u}))})})};dn.displayName="OSAnswer";var un,pn,mn,hn,fn,bn,gn,wn,xn,vn,yn,kn,Cn=function(t){var r=0,o=t.question,i=t.type,a=t.correct_answer_id,s=t.incorrectAnswerId,l=t.feedback_html,c=t.correct_answer_feedback_html,d=t.show_all_feedback,u=void 0!==d&&d,p=t.tableFeedbackEnabled,m=t.answerIdOrder,h=t.instructions;if(t.hideAnswers)return null;var f,b=[],g={qid:o.id||"auto-"+r++,answerId:t.answer_id,correctAnswerId:a,incorrectAnswerId:s,hasCorrectAnswer:t.hasCorrectAnswer,onChangeAnswer:t.onChangeAnswer,type:void 0===i?"student":i,answered_count:t.answered_count,disabled:!t.choicesEnabled,show_all_feedback:u,tableFeedbackEnabled:p,onKeyPress:t.onKeyPress},w=(m?(f=m,o.answers.slice().sort(function(n,e){return f.indexOf(n.id)-f.indexOf(e.id)})):o.answers).map(function(e,t){var r,i,d={answer:_({},e,{question_id:"string"==typeof o.id?parseInt(o.id,10):o.id}),iter:t,key:g.qid+"-option-"+t},m=Object.assign({},d,g);return u&&e.feedback_html&&p?r=e.feedback_html:e.id===s&&l?r=l:e.id===a&&c&&(r=c),r&&b.push({index:t,html:r,id:i="feedback-"+g.qid+"-"+t}),n(dn,_({feedbackId:i},m))});return b.forEach(function(e,r){var o=e.index+r+1;w.splice(o,0,n(K,{id:e.id,contentRenderer:t.contentRenderer,children:e.html},o))}),e("div",{role:"radiogroup","aria-label":"Answer choices",className:"answers-table",children:[h,w]})},_n=["questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","className","children","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren"],Nn=["step","questionNumber","numberOfQuestions","children","className"],qn=a.div(un||(un=q(["\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ",";\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ","\n"])),X.palette.light,en(pn||(pn=q(["\n max-width: 1000px;\n "])))),Sn=a.div(mn||(mn=q(["\n padding: ",";\n\n ","\n"])),"2rem",$(hn||(hn=q(["\n padding: 0;\n "])))),An=a.div(fn||(fn=q(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ",";\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ",";\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ","\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ","\n\n ","\n"])),X.card.header.background,X.palette.gray,en(bn||(bn=q(["\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n "]))),nn(gn||(gn=q(["\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n button.ox-icon-angle-right {\n margin-left: ",";\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n "])),"24px","24px"),$(wn||(wn=q(["\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n "])),"8px","8px"));An.displayName="StepCardHeader";var In=a.div(xn||(xn=q(["\n .step-card-body {\n ","\n overflow: auto;\n background: ",";\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ","\n\n .reading-step & {\n padding: 0;\n }\n\n ","\n\n ","\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n"])),tn.stepCardPadding(),X.card.body.background,function(){return s(H||(H=q(["@media(max-width: ","px) { "," }"])),600,s.apply(void 0,[].slice.call(arguments)))}(vn||(vn=q(["\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n "]))),en(yn||(yn=q(["\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n "]))),$(kn||(kn=q(["\n .openstax-exercise-badges svg {\n margin-right: ",";\n }\n "])),"8px")),Mn=function(t){var r=t.questionNumber,o=t.numberOfQuestions,i=t.showTotalQuestions,a=t.stepType,s=t.isHomework,l=t.availablePoints,c=t.unpadded,d=t.className,u=t.children,p=t.questionId,m=t.multipartBadge,h=t.leftHeaderChildren,f=t.rightHeaderChildren,b=t.headerTitleChildren,g=N(t,_n);return e(Sn,_({},g,{children:[m,e(qn,{className:d,children:[r&&s&&"exercise"===a&&e(An,{children:[e("div",{children:[h,e("h2",{className:"question-info",children:[b,n("span",{children:o>1?"Questions "+r+" - "+(r+o-1):"Question "+r}),i?e("span",{className:"num-questions",children:[" / ",o]}):null,n("span",{className:"separator",children:"|"}),e("span",{className:"question-id",children:["ID: ",p]})]})]}),l||f?e("div",{children:[l&&e("div",{className:"points",children:[l," Points"]}),f]}):null]}),n(In,{unpadded:c,children:u})]})]}))};Mn.displayName="OSStepCard";var En=function(e){var t=e.step,o=e.questionNumber,i=e.numberOfQuestions,a=e.children,s=e.className,l=N(e,Nn);return n(Mn,_({},l,{unpadded:!0,questionNumber:o,numberOfQuestions:i,stepType:"type"in t?t.type:"exercise",isHomework:!("task"in t)||void 0===t.task||"homework"===t.task.type,"data-task-step-id":t.id,className:r(("type"in t?t.type:"exercise")+"-step",s),questionId:t.uid,children:a}))};En.displayName="OSTaskStepCard";var Tn,On,Hn,jn,Pn,zn,Fn,Ln,Jn,Rn,Qn,Vn,Bn,Dn,Un,Wn=["disabled","isWaiting","waitingText","children"],Zn=a.button(Tn||(Tn=q(["\n background-color: ",";\n color: ",";\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ","\n }\n &:active {\n background: ","\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n"])),X.button.background,X.palette.white,X.button.backgroundHover,X.button.backgroundActive),Gn=function(e){var t=e.disabled,r=e.isWaiting,o=e.waitingText,i=e.children,a=N(e,Wn);return n(Zn,_({},a,{disabled:r||t,children:r&&o||i}))},Kn=l(On||(On=q(["\n :root {\n --content-text-scale: 1;\n }\n"]))),Yn=a(qn)(Hn||(Hn=q(["\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n"]))),Xn=a.h2(jn||(jn=q(["\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n"]))),$n=a(function(r){var o=r.numberOfQuestions,i=r.numberCompleted,a=r.handleClick,s=r.className,l=o===i,c=i>0,d=l?"Next":c?"Continue":"Start";return e(t,{children:[n(Kn,{}),e(Yn,{className:s,children:[n(Xn,{children:l?"You are done.":c?"Quiz is partially complete.":"No questions have been answered."}),n("p",{children:l?"Great job answering all the questions.":c?"You've completed "+i+" of "+o+" questions.":"Begin working on the quiz."}),n(Gn,{"data-test-id":d.split(" ")[0].toLowerCase()+"-btn",onClick:function(){return a()},children:d})]})]})})(Pn||(Pn=q([""]))),ne=a.div(zn||(zn=q(["\n&.step-card-body {\n ",";\n}\n\n&.openstax-question {\n border-top: 1px solid ",";\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ",";\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ",";\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: "," ",";\n margin: "," 0 "," ",";\n border-left: "," solid ",";\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ",";\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ",";\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ",";\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: "," 0 0 0;\n margin: 0;\n transition: color ",";\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ","\n }\n }\n\n .answer-input-box {\n ","\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ",";\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ",";\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ",";\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ",";\n }\n }\n\n &.answer-correct {\n .answer-label {\n ",";\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ","\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ","\n }\n &.answer-selected.answer-incorrect {\n ","\n }\n }\n }\n\n .question-feedback {\n ","\n max-width: ",";\n .question-feedback-content {\n padding: "," ",";\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n"])),tn.stepCardPadding(),X.palette.pale,X.palette.neutral,X.palette.neutralLightBlue,"1rem","2.5rem","1rem","1rem","1rem","1rem",X.palette.neutralLighter,X.palette.neutralLightest,tn.answer(),"1rem","1rem","0.1s ease-in-out",tn.answerHover(),tn.visuallyHidden(),tn.answerChecked(),X.answer.checked,tn.answerChecked(),tn.answerIncorrect(),tn.answerCorrect(!0),tn.answerCorrectAnswer(),tn.answerIncorrect(),tn.answerIncorrect(!0),tn.popover(),"370px","0.9rem","1.1rem"),ee=o.forwardRef(function(t,o){var i,a,s=t.question,l=t.exercise_uid,c=t.questionNumber,d=t.context,u=t.task,p=t.hidePreambles,m=s.stem_html,h=s.collaborator_solutions,f=void 0===h?[]:h,b=s.formats,g=s.stimulus_html,w=!!t.correct_answer_id,x=r("openstax-question",t.className,{"has-correct-answer":w&&!((null!=u?u.is_deleted:void 0)&&"homework"===(null!=u?u.type:void 0)),"has-incorrect-answer":!!t.incorrectAnswerId});return null!=l&&(i=n("div",{className:"exercise-uid",children:l})),function(){var n=s.collaborator_solutions,e=void 0===n?[]:n;return t.displaySolution&&e&&e.find(function(n){return void 0!==n.content_html})}()&&(a=e("div",{className:"detailed-solution",children:[n("div",{className:"header",children:"Detailed solution:"}),n(W,{className:"solution",block:!0,html:f.map(function(n){return n.content_html}).join("")})]})),e(ne,{ref:o,className:x,"data-question-number":c,"data-test-id":"question",children:[n(te,{type:"context",html:d,hidden:p}),n(te,{type:"stimulus",html:g,hidden:p}),n(te,{type:"stem",html:m,hidden:p,questionNumber:c}),t.children,n(Cn,_({},t,{onChangeAnswer:t.onChange,hasCorrectAnswer:w})),a,t.displayFormats?n(re,{formats:b}):void 0,i]})}),te=function(e){var t=e.html,r=void 0===t?"":t;return!0!==e.hidden&&r.length>0?n(W,{html:r,"data-question-number":e.questionNumber,className:"question-"+e.type,block:!0}):null},re=function(t){var r=t.formats,o=void 0===r?[]:r;return e("div",{className:"formats-listing",children:[n("div",{className:"header",children:"Formats:"}),o.map(function(e,t){return n("span",{children:e},t)})]})},oe=a.div(Fn||(Fn=q(["\n ","\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ",";\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ",";\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ","\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ","\n"])),tn.stepCardPadding(),X.card.body.background,X.palette.pale,$(Ln||(Ln=q(["\n flex-wrap: wrap;\n "]))),en(Jn||(Jn=q(["\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n "])))),ie=s(Rn||(Rn=q(["\n background-color: #f5e9ea;\n"]))),ae=a.div(Qn||(Qn=q(["\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ","\n }\n"])),tn.stepCardPadding()),se=a.div(Vn||(Vn=q(["\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n"]))),le=a.div(Bn||(Bn=q(["\n margin: 8px 0;\n display: flex;\n justify-content: ",";\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ",";\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ",";\n"])),function(n){return n.hasChildren?"space-between":"flex-end"},X.palette.danger,X.palette.neutralThin),ce=a.textarea(Dn||(Dn=q(["\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ",";\n color: ",";\n ",";\n ","\n background-color: ",";\n"])),X.palette.neutral,X.palette.neutralDark,function(n){return n.isOverWordLimit&&ie},function(n){return n.isOverWordLimit&&s(Un||(Un=q(["\n border: 2px solid ",";\n "])),X.palette.danger)},function(n){return n.readOnly&&X.palette.neutralCool});ce.displayName="OSFreeResponseTextArea";var de=function(e){return n(Gn,_({},e,{children:"Cancel"}))},ue=function(t){var r=t.availablePoints,o=t.cancelHandler,i=t.defaultValue,a=t.infoRowChildren,s=t.isSubmitDisabled,l=t.question,c=t.questionNumber,d=t.saveHandler,u=t.submitBtnLabel,p=t.textHasChanged,m=t.wordLimit,h=M(i)>m,f={};return c&&(f["data-question-number"]=c),e(ae,{"data-test-id":"student-free-response",children:[e("div",{className:"step-card-body",children:[n(se,_({},f,{children:l.stem_html&&n(te,{type:"stem",html:l.stem_html,hidden:!1})})),n(ce,_({},t,{isOverWordLimit:h,"data-test-id":"free-response-box",placeholder:"Enter your response...","aria-label":"question response text box"})),e(le,{hasChildren:!!a,children:[a,e("div",{children:[e("span",{children:[M(i)," words"]}),h&&e("span",{className:"word-limit-error-info",children:["Maximum ",m," words"]})]})]})]}),e(oe,{children:[r?n("div",{className:"points",role:"status",children:e("strong",{children:["Points: ",r]})}):null,e("div",{className:"controls",children:[n(de,{disabled:!p,onClick:o}),n(Gn,{"data-test-id":"submit-answer-btn",disabled:s||h,onClick:d,children:u})]})]})]})};ue.displayName="OSFreeResponse";var pe=function(n){var t=n.count;return e("div",{children:[t," attempt",1===t?"":"s"," left"]})},me=function(t){var r=t.published_comments;return r?e("div",{children:[n("strong",{children:"Feedback:"})," ",r]}):null},he=function(e){return n(Gn,_({},e,{waitingText:"Saving…",isWaiting:e.isWaiting,"data-test-id":"submit-answer-btn",children:e.willContinue?"Submit & continue":0==e.attempt_number?"Submit":"Re-submit"}))},fe=function(e){return n(Gn,_({},e,{"data-test-id":"continue-btn",children:e.canUpdateCurrentStep?"Continue":"Next"}))},be=function(e){var r=e.free_response;return r?n(t,{children:n("div",{className:"free-response",children:r})}):null},ge=o.forwardRef(function(t,r){var i=t.question,a=t.task,s=t.answer_id_order,l=t.onAnswerChange,c=t.feedback_html,d=t.correct_answer_feedback_html,u=t.is_completed,p=t.correct_answer_id,m=t.incorrectAnswerId,h=t.choicesEnabled,f=t.questionNumber,b=t.answer_id,g=t.hasMultipleAttempts,w=t.attempts_remaining,x=t.published_comments,v=t.detailedSolution,y=t.canAnswer,k=t.needsSaved,C=t.attempt_number,_=t.apiIsPending,N=t.onAnswerSave,q=t.onNextStep,S=t.canUpdateCurrentStep,A=t.displaySolution,I=t.available_points,M=t.free_response,E=t.show_all_feedback,T=t.tableFeedbackEnabled,O=t.hasFeedback,H=o.useState(!1),j=H[0],P=H[1];return o.useEffect(function(){j&&u&&(q(f-1),P(!1))},[q,f,j,u]),e("div",{"data-test-id":"student-exercise-question",children:[n(ee,{ref:r,task:a,question:i,answerIdOrder:s,choicesEnabled:h,answer_id:b,questionNumber:f,onChange:l,feedback_html:c,correct_answer_feedback_html:d,correct_answer_id:u?p:null,incorrectAnswerId:m,className:"step-card-body",hideAnswers:!1,displayFormats:!1,displaySolution:A,show_all_feedback:E,tableFeedbackEnabled:T,children:n(be,{free_response:M})}),n(oe,{className:"step-card-footer",children:e("div",{className:"step-card-footer-inner",children:[e("div",{className:"points",role:"status",children:[I?e("strong",{children:["Points: ",I]}):null,n("span",{className:"attempts-left",children:g&&w>0&&n(pe,{count:w})}),n(me,{published_comments:x}),v&&e("div",{children:[n("strong",{children:"Detailed solution:"})," ",n(W,{html:v})]})]}),n("div",{className:"controls",children:y&&k||j?n(he,{disabled:_||!b||j,isWaiting:_||j,attempt_number:C,onClick:function(){var n;N("string"==typeof(n=i.id)?parseInt(n,10):n),O||P(!0)},willContinue:!O}):n(fe,{onClick:function(){return q(f-1)},canUpdateCurrentStep:S})})]})})]})}),we={extensions:[],showProcessingMessages:!1,skipStartupTypeset:!0,styles:{"#MathJax_MSIE_Frame":{left:"",right:0,visibility:"hidden"},"#MathJax_Message":{left:"",right:0,visibility:"hidden"}},tex2jax:{displayMath:[["‌‌‌","‌‌‌"]],inlineMath:[["​​​","​​​"]]}},xe=function(n){var e=function(n){return Array.from(n.querySelectorAll(".MathJax math"))}(n);return Array.from(n.querySelectorAll("math")).filter(function(n){return-1===e.indexOf(n)})},ve=function(n){for(var e=[],t=0,r=Array.from(n.querySelectorAll("[data-math]:not(.math-rendered)"));t0&&(ve(e).length||xe(e).length)?setTimeout(function(){n(e,t,r-1)},200):t()},ke=function(n,e){return new Promise(function(t){(function(n,e){var t=ve(n);e.MathJax.Hub.Queue(function(n,e){return function(){m(n)||e.MathJax.Hub.Queue(function(){return e.MathJax.Hub.Typeset(n)},function(n){return function(){for(var e,t=[],r=function(n,e){var t="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(t)return(t=t.call(n)).next.bind(t);if(Array.isArray(n)||(t=function(n,e){if(n){if("string"==typeof n)return S(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);return"Object"===t&&n.constructor&&(t=n.constructor.name),"Map"===t||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?S(n,e):void 0}}(n))){t&&(n=t);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(n);!(e=r()).done;)t.push(e.value.className+=" math-rendered")}}(n))}}(t,e),function(n,e){return function(){var t=xe(n);m(t)||e.MathJax.Hub.Queue(function(){return e.MathJax.Hub.Typeset(n)})}}(n,e))})(n,e),e.MathJax.Hub.Queue(function(){ye(n,t)})})},Ce=p(function(n,e){return d(ke,100,{leading:!0,trailing:!1}).bind(null,n,e)});Ce.cache=new h;var _e,Ne,qe,Se,Ae,Ie,Me,Ee,Te,Oe,He,je,Pe,ze,Fe,Le,Je,Re,Qe,Ve,Be,De,Ue,We,Ze,Ge,Ke,Ye,Xe,$e,nt,et,tt,rt,ot,it=u(function(n){return void 0===n&&(n=window),new Promise(function(e){var t=function(){n.MathJax.HTML.Cookie.prefix="mathjax",n.MathJax.Hub.Configured(),n.MathJax.Hub.Register.StartupHook("End",function(){e()})};if(!document.getElementById("MathJax-Script")){var r=document.createElement("script");r.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured",r.id="MathJax-Script",r.async=!0,document.head.appendChild(r)}n.MathJax&&n.MathJax.Hub?(n.MathJax.Hub.Config(we),n.MathJax.Hub.processSectionDelay=0,t()):(we.AuthorInit=t,n.MathJax=we)})}),at=a.div(_e||(_e=q(["\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ",";\n background: #fff;\n margin: "," 0 0 ",";\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ",";\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ",";\n }\n\n span {\n display: block;\n }\n }\n }\n\n ","\n\n ","\n"])),X.palette.light,"2rem","2rem",X.palette.neutral,X.palette.neutralDarker,X.palette.neutralDarker,function(n){return!n.desktop&&s(Ne||(Ne=q(["\n ","\n ","\n "])),en(qe||(qe=q(["\n display: none;\n "]))),nn(Se||(Se=q(["\n display: none;\n "]))))},function(n){return n.mobile&&$(Ae||(Ae=q(["\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ",";\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ",";\n }\n }\n "])),X.palette.neutral,X.palette.light)}),st=function(t){var r,o,i=t.icons;if(!i)return null;var a=Object.values(i),s=a.some(function(n){var e,t,r=n.location;return null==(e=null==r||null==(t=r.toolbar)?void 0:t.mobile)||e}),l=a.some(function(n){var e,t,r=n.location;return null!=(e=null==r||null==(t=r.toolbar)?void 0:t.desktop)&&e}),c=null==(r=i.topic)?void 0:r.url,d=null==(o=i.errata)?void 0:o.url;return e(at,_({},{mobile:s,desktop:l},{children:[c?e("a",{href:c,target:"_blank",children:[n(f,{icon:b}),n("span",{children:"View topic in textbook"})]}):null,d?e("a",{href:d,target:"_blank",children:[n(f,{icon:g}),n("span",{children:"Suggest a correction"})]}):null]}))},lt=a.div(Ie||(Ie=q(["\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ",";}\n .popover { display: flex; }\n }\n ","\n ","\n"])),X.palette.mediumBlue,function(n){return!n.desktop&&s(Me||(Me=q(["\n ","\n ","\n "])),en(Ee||(Ee=q(["\n display: none;\n "]))),nn(Te||(Te=q(["\n display: none;\n "]))))},function(n){return!n.mobile&&$(Oe||(Oe=q(["\n display: none;\n "])))}),ct=a.div(He||(He=q(["\n position: relative;\n display: flex;\n"]))),dt=a.div(je||(je=q(["\n ","\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n"])),tn.popover),ut=function(t){return n(lt,_({},t.wrapperProps,{mobile:t.mobile,desktop:t.desktop,"aria-label":t.text,children:e(ct,{children:[t.children,e(dt,{className:"popover right",children:[n("div",{className:"arrow"}),n("div",{className:"content",children:t.text})]})]})}))},pt=a.div(Pe||(Pe=q(["\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n"]))),mt=a(f)(ze||(ze=q(["\n color: ",";\n height: 1em;\n"])),X.palette.darkGray),ht=function(e){var t,r,o,i,a=e.exercise,s=e.icons,l={desktop:!0,mobile:!1},c=[],d=a.questions.every(function(n){return n.answers.length>0});return d&&a.questions.find(function(n){return n.formats.includes("free-response")})?t="In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. Recalling the answer to a question from memory helps you to retain things longer.":d&&(t="Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts."),s.topic&&c.push(n(ut,_({text:"View topic in textbook",wrapperProps:{as:"a",href:s.topic.url,target:"_blank"}},(null==(r=s.topic.location)?void 0:r.header)||l,{children:n(mt,{icon:w})}),"topic")),s.errata&&c.push(n(ut,_({text:"Suggest a correction",wrapperProps:{as:"a",href:s.errata.url,target:"_blank"}},(null==(o=s.errata.location)?void 0:o.header)||l,{children:n(mt,{icon:x})}),"errata")),s.info&&t&&c.push(n(ut,_({text:t},(null==(i=s.info.location)?void 0:i.header)||l,{children:n(mt,{icon:v,height:"16px",width:"16px"})}),"type")),n(pt,{children:c})},ft=["numberOfQuestions","questionNumber","step","exercise","show_all_feedback","scrollToQuestion","exerciseIcons"],bt=a(En)(Fe||(Fe=q(["\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n"]))),gt=l(Le||(Le=q(["\n :root {\n --content-text-scale: 1;\n }\n"]))),wt=a.div(Je||(Je=q(["\n ","\n\n ","\n"])),function(n){return n.desktopToolbarEnabled&&s(Re||(Re=q(["\n ","\n ","\n ","\n "])),en(Qe||(Qe=q(["\n "," {\n margin-left: 6.8rem;\n }\n "])),bt),nn(Ve||(Ve=q(["\n "," {\n margin-left: 4.8rem;\n }\n "])),bt),$(Be||(Be=q(["\n "," {\n margin-left: 0;\n }\n "])),bt))},function(n){return n.mobileToolbarEnabled&&s(De||(De=q(["\n ","\n "])),$(Ue||(Ue=q(["\n "," + "," "," {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n "])),at,Sn,qn))}),xt=function(t){return e(wt,{desktopToolbarEnabled:t.desktopToolbarEnabled,mobileToolbarEnabled:t.mobileToolbarEnabled,children:[n(st,{icons:t.exerciseIcons}),n(bt,_({},t))]})},vt=function(r){var o=r.exercise;return e(t,{children:[o.context&&n(W,{className:"step-card-body exercise-context",block:!0,html:o.context}),o.stimulus_html&&n(W,{className:"step-card-body exercise-stimulus",block:!0,html:o.stimulus_html})]})},yt=a(function(t){var r=t.numberOfQuestions,a=t.questionNumber,s=t.step,l=t.exercise,d=t.show_all_feedback,u=t.scrollToQuestion,p=t.exerciseIcons,m=N(t,ft),h="feedback_html"in s,f=o.useRef([]),b=o.useRef(null),g=o.useCallback(function(){b.current&&function(n,e){try{void 0===e&&(e=window),Promise.resolve(it()).then(function(){return e&&e.MathJax&&e.MathJax.Hub?n.querySelector("[data-math]:not(.math-rendered), math:not(.math-rendered)")?Ce(n,e)():Promise.resolve():(console.warn("Warning: Expected MathJax to be initialized."),Promise.resolve())})}catch(n){return Promise.reject(n)}}(b.current)},[]);o.useEffect(function(){var n=u&&f.current[u];n&&c(n)},[u,l]);var w=Object.values(p||{}).some(function(n){var e,t=n.location;return null==t||null==(e=t.toolbar)?void 0:e.desktop}),x=Object.values(p||{}).some(function(n){var e,t=n.location;return null==t||null==(e=t.toolbar)?void 0:e.mobile});return e(D.Provider,{value:g,children:[n(gt,{}),n(xt,_({step:s,questionNumber:a,numberOfQuestions:h?r:l.questions.length,rightHeaderChildren:p?n(ht,{exercise:l,icons:p}):null,showTotalQuestions:h,desktopToolbarEnabled:w,mobileToolbarEnabled:x},p?{exerciseIcons:p}:null,{className:m.className,children:e("div",{ref:b,children:[n(vt,{exercise:l}),l.questions.map(function(n,e){var t,r=_({},h?s:m.questionStates[n.id]);return i(ge,_({},m,_({},r,{available_points:void 0}),{ref:function(n){return f.current[a+e]=n},exercise_uid:l.uid,key:n.id,question:n,questionNumber:a+e,choicesEnabled:r.canAnswer,displaySolution:!0,detailedSolution:null==(t=r.solution)?void 0:t.content_html,show_all_feedback:d,tableFeedbackEnabled:d&&!h,canUpdateCurrentStep:"canUpdateCurrentStep"in m?m.canUpdateCurrentStep:!(e+1===l.questions.length)}))})]})}))]})})(We||(We=q(["\n"]))),kt=function(){return n("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n("path",{d:"M14.556 2.09149C15.2296 1.78355 16 2.26721 16 2.99824V10.5951C16 10.9241 15.8362 11.2328 15.5605 11.4188C14.4229 12.1864 13.2007 12.6956 11.6715 12.6956C9.53267 12.6956 8.12768 11.6087 6.42651 11.6087C4.81213 11.6087 3.69241 11.923 2.79365 12.3V15.25C2.79365 15.6642 2.45254 16 2.03175 16H1.52381C1.10302 16 0.761905 15.6642 0.761905 15.25V3.18577C0.301492 2.86952 0 2.34455 0 1.74999C0 0.75924 0.836349 -0.0391985 1.852 0.00148899C2.75575 0.0376765 3.49578 0.75049 3.55203 1.63912C3.56854 1.8998 3.52632 2.1488 3.43819 2.37543C4.09648 2.13699 4.80613 1.99999 5.59835 1.99999C7.73718 1.99999 9.14216 3.08696 10.8433 3.08696C12.1289 3.08696 13.4659 2.5899 14.556 2.09149ZM2.79365 4.20718V6.40999C3.71429 6.07656 4.41841 5.85281 5.13016 5.75656V3.51999C4.38413 3.5878 3.84635 3.82593 2.79365 4.20718ZM9.80317 4.49437C8.96454 4.34837 8.21949 4.05752 7.46667 3.82749V5.93437C8.23413 6.14393 8.9767 6.44824 9.80317 6.63156V4.49437ZM5.13016 5.75656V7.94531C6.1713 7.85224 6.84159 7.92546 7.46667 8.06406V5.93437C6.66517 5.71452 5.98791 5.6399 5.13016 5.75656ZM7.46667 10.2012C8.30279 10.3466 9.04546 10.6365 9.80317 10.8681V8.76156C9.03248 8.55074 8.29397 8.24749 7.46667 8.06406V10.2012ZM2.79365 10.6906C3.54349 10.4284 4.31079 10.2581 5.13016 10.1731V7.94531C4.30127 8.01874 3.62667 8.19656 2.79365 8.48781V10.6906ZM14.4762 3.76562C13.8 4.04218 12.9971 4.31687 12.1397 4.4678V6.71499C13.0067 6.57874 13.7279 6.27437 14.4762 5.96843V3.76562ZM14.4762 10.3269V8.12406C13.7717 8.56781 12.9276 8.83062 12.1397 8.93718V11.1741C12.9356 11.0997 13.679 10.8291 14.4762 10.3269ZM9.80317 6.63156V8.76156C10.6179 8.9845 11.283 9.05349 12.1397 8.93718V6.71499C11.3143 6.84584 10.5542 6.79862 9.80317 6.63156Z",fill:"currentColor"})})},Ct=a.nav(Ze||(Ze=q(["\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ","\n"])),$(Ge||(Ge=q(["\n padding: 1.6rem 0.8rem;\n "])))),_t=a.span(Ke||(Ke=q(["\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n"]))),Nt="box-shadow: 0px 1px 4px 0px #00000066;",qt=a.button(et||(et=q(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: ",";\n height: ",";\n border: 0;\n border-radius: 50%;\n margin: ",";\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ",";\n ","\n ","\n &:hover {\n ","\n }\n"])),function(n){return n.isActive?"4rem":"3.2rem"},function(n){return n.isActive?"4rem":"3.2rem"},function(n){return n.isActive?"0":"0 0.3rem"},X.palette.neutralDarker,function(n){return n.isActive?s(tt||(tt=q(["\n ","\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n "])),Nt):null},function(n){return function(n){switch(n){case"isStatus":return s(Ye||(Ye=q(["\n background-color: ",";\n "])),X.palette.neutralBright);case"isCorrect":return s(Xe||(Xe=q(["\n color: ",";\n background-color: #E8F4D8;\n "])),X.answer.correct);case"isIncorrect":return s($e||($e=q(["\n color: ",";\n background-color: #F8E8EA;\n "])),X.answer.incorrect);default:return s(nt||(nt=q(["\n background-color: ",";\n "])),X.palette.neutralBright)}}(n.variant)},Nt),St=a(f)(rt||(rt=q(["\n background: ",";\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n"])),function(n){return n.color}),At=function(e){var t=e.variant;if(!t||"isCorrect"!==t&&"isIncorrect"!==t)return null;var r={isCorrect:{icon:y,color:X.answer.correct,label:"Correct"},isIncorrect:{icon:k,color:X.answer.incorrect,label:"Incorrect"}}[t];return n(St,{icon:r.icon,color:r.color,height:"16px",width:"16px","aria-label":r.label,"aria-hidden":void 0})},It=function(t){var r=t.index,o=t.isActive,i=t.step,a=t.goToStep;return e(_t,{children:[n(qt,{variant:i.variant,isActive:o,onClick:function(){return a(r,i)},"aria-current":o?"location":"false","aria-label":"isStatus"===i.variant?"Assignment status":"Question "+(r+1),children:"isStatus"===i.variant?n(kt,{}):r+1}),n(At,{variant:i.variant})]})},Mt=function(e){var t=e.activeIndex,r=e.goToStep;return n(Ct,{"aria-label":"Breadcrumbs",children:e.steps.map(function(e,o){return n(It,{index:o,isActive:o===t,step:e,goToStep:r},o)})})},Et=a.div(ot||(ot=q(["\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ",";\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n"])),X.palette.light),Tt=function(){return n(Et,{children:n(C,{uniqueKey:"OSLoader"})})};export{dn as Answer,Cn as AnswersTable,$n as CompletionStatus,yt as Exercise,st as ExerciseToolbar,ue as FreeResponseInput,ce as FreeResponseTextArea,qn as InnerStepCard,Tt as Loader,Sn as OuterStepCard,Mt as ProgressBar,It as ProgressBarItem,ee as Question,te as QuestionHtml,Mn as StepCard,qt as StyledItem,at as StyledToolbar,En as TaskStepCard}; +//# sourceMappingURL=index.module.js.map diff --git a/dist/index.module.js.map b/dist/index.module.js.map new file mode 100644 index 0000000..a8b8c7f --- /dev/null +++ b/dist/index.module.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.module.js","sources":["../src/utils.ts","../src/theme.ts","../src/hooks/useTypesetMath.ts","../src/components/Content.tsx","../src/components/Feedback.tsx","../src/components/Answer.tsx","../src/constants.ts","../src/components/AnswersTable.tsx","../src/components/Card.tsx","../src/components/StepCardFooter.tsx","../src/components/Button.tsx","../src/components/CompletionStatus.tsx","../src/components/Question.tsx","../src/components/FreeResponseInput.tsx","../src/components/ExerciseQuestion.tsx","../src/helpers/mathjax.ts","../src/components/ExerciseToolbar.tsx","../src/components/ExerciseHeaderIcons.tsx","../src/components/Exercise.tsx","../src/assets/flag.tsx","../src/components/ProgressBar.tsx","../src/components/Loader.tsx"],"sourcesContent":["import { Answer, ID } from '../src/types';\n\nexport const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nconst MAX_CORRECTNESS = '1.0';\n\nexport const isAnswerCorrect = function(answer: Answer, correctAnswerId?: ID | null) {\n // if answer does not have an id, check the isCorrect property.\n if (!(answer.id || correctAnswerId)) {\n return answer.isCorrect;\n }\n let isCorrect = answer.id === correctAnswerId;\n if (answer.correctness != null) { isCorrect = (answer.correctness === MAX_CORRECTNESS); }\n\n return isCorrect;\n};\n\nexport const isAnswerIncorrect = (answer: Answer, incorrectAnswerId?: ID) =>\n // Allow multiple attempts to show incorrectness without the correct_answer_id\n answer.id === incorrectAnswerId;\n\nexport const isAnswerChecked = (answer: Answer, answerId?: ID) =>\n answer.id == answerId;\n\nexport function countWords(text: string) {\n const trimmedText = text.trim();\n //https://css-tricks.com/build-word-counter-app/\n const words = trimmedText.match(/\\b[-?(\\w+)?]+\\b/gi);\n if(!words) return 0;\n return words.length;\n}\n\nexport const numberfyId = (id: ID) => typeof id === 'string' ? parseInt(id, 10) : id;\n","import { css } from 'styled-components';\n\nconst palette = {\n red: \"#ca2026\",\n danger: \"#c2002f\",\n darkRed: \"#c22032\",\n lightRed: \"#e298a0\",\n green: \"#77af42\",\n lightGreen: \"#8bc753\",\n darkGreen: \"#63a524\",\n paleYellow: \"#ffffbb\",\n teal: \"#0dc0de\",\n blue: \"#007da4\",\n mediumBlue: \"#026AA1\",\n lightBlue: \"#34bdd8\",\n neutralLightBlue: \"#0dc0dc\",\n tangerine: \"#ffbd3e\",\n gray: \"#5e5e5e\",\n darkGray: \"#757575\",\n pale: \"#d5d5d5\",\n light: \"#e4e4e4\",\n white: \"#ffffff\",\n neutralLightest: \"#f9f9f9\", // nearly white\n neutralCool: \"#f6f7f8\", // cool bright gray\n neutralBright: \"#f5f5f5\", // bright gray\n neutralLighter: \"#f1f1f1\", // light gray\n neutralLight: \"#e5e5e5\", // light gray\n neutralMedium: \"#a0a0a0\", // light gray\n neutral: \"#818181\", // gray\n neutralThin: \"#6f6f6f\", // medium gray\n neutralDark: \"#5f6163\", // dark gray\n neutralFeedback: \"#555\", // another dark gray\n neutralDarker: \"#424242\", // very dark gray\n black: \"#000000\",\n orange: \"#D4450C\"\n};\n\nexport const colors = {\n palette: palette,\n answer: {\n neutral: palette.neutralThin,\n hover: '#026AA1',\n checked: '#026AA1',\n correct: '#0D7741',\n incorrect: '#C22032'\n },\n popover: {\n arrowOuterColor: \"rgba(0, 0, 0, 0.25)\",\n borderColor: \"rgba(0, 0, 0, 0.2)\",\n },\n card: {\n header: {\n background: \"#daf3f8\"\n },\n body: {\n background: \"#fdfdfd\"\n }\n },\n button: {\n background: palette.orange,\n backgroundHover: \"#E74B0D\",\n backgroundActive: \"#C5400B\"\n },\n freeResponse: {\n color: palette.neutralDarker,\n background:palette.neutralLighter,\n },\n};\n\nexport const layouts = {\n answer: {\n verticalSpacing: \"1rem\",\n horizontalSpacing: \"1rem\",\n horizontalBuffer: \"2.5rem\",\n bubbleSize: \"3.6rem\",\n labelSpacing: \"6.5rem\",\n feedback: {\n popover: {\n horizontalSpacing: \"1.1rem\",\n verticalSpacing: \"0.9rem\",\n maxWidth: \"370px\",\n },\n },\n },\n popover: {\n arrow: {\n width: \"16px\",\n height: \"8px\",\n edgeDistance: \"9px\",\n },\n horizontalSpacing: \"0.8rem\",\n verticalSpacing: \"1rem\",\n horizontalBuffer: \"4rem\",\n borderWidth: \"1px\",\n maxWidth: \"325px\",\n },\n card: {\n spacing: '2rem'\n }\n};\n\nexport const BREAKPOINTS = {\n mobile: 600,\n tablet: 999,\n desktop: 1000,\n large: 1600,\n};\n\nexport const breakpoints = {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n tablet(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.tablet}px) { ${css(...args)} }`;\n },\n desktop(...args: Parameters) {\n return css`@media(min-width: ${BREAKPOINTS.desktop}px) { ${css(...args)} }`;\n },\n only: {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n },\n margins: {\n mobile: '8px',\n tablet: '24px',\n },\n};\n\nexport const transitions = {\n answer: \"0.1s ease-in-out\",\n}\n\nexport const mixins = {\n answer: () => css`\n .answer-label {\n display: inline-flex;\n }\n color: ${palette.neutralDarker};\n .answer-letter-wrapper::before {\n width: ${layouts.answer.bubbleSize};\n height: ${layouts.answer.bubbleSize};\n min-width: ${layouts.answer.bubbleSize};\n min-height: ${layouts.answer.bubbleSize};\n border-radius: calc(${layouts.answer.bubbleSize} / 2);\n border-width: 2px;\n border-style: solid;\n border-color: #c6c6c6;\n color: ${colors.answer.neutral};\n transition: color ${transitions.answer}, border-color ${transitions.answer}, background-color ${transitions.answer};\n background-color: ${colors.palette.white};\n font-family: \"Neue Helvetica W01\", Helvetica, Arial, sans-serif;\n box-sizing: border-box;\n font-weight: normal;\n }\n `,\n answerColor: (\n color: string, invertBubble = false\n ) => css`\n .answer-letter-wrapper::before {\n color: ${invertBubble ? '#fff' : color};\n border-color: ${color};\n ${invertBubble ? `background-color: ${color};` : null}\n }\n `,\n answerChecked: () => mixins.answerColor(colors.answer.checked, true),\n answerCorrect: (checked?: boolean) => mixins.answerColor(colors.answer.correct, checked),\n answerIncorrect: (checked?: boolean) => mixins.answerColor(colors.answer.incorrect, checked),\n answerHover: () => css`\n ${mixins.answerColor(colors.answer.hover)};\n font-weight: bold;\n `,\n answerCorrectAnswer: () => mixins.answerColor(colors.answer.correct, false),\n resetText: () => css`\n font-family: \"Neue Helvetica W01\", Helvetica, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-style: normal;\n font-weight: 400;\n line-height: 1.6;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n `,\n stepCardPadding: () => css`\n padding: 48px 140px;\n\n ${breakpoints.tablet`\n padding: ${breakpoints.margins.tablet} ${breakpoints.margins.tablet};\n `}\n\n ${breakpoints.mobile`\n padding: calc(${breakpoints.margins.mobile} * 2) ${breakpoints.margins.mobile};\n `}\n `,\n popover: () => css`\n ${mixins.resetText()}\n\n z-index: 1;\n position: relative;\n border: ${layouts.popover.borderWidth} solid ${colors.popover.borderColor};\n background-color: ${colors.palette.white};\n background-clip: padding-box;\n max-width: ${layouts.popover.maxWidth};\n margin: calc(${layouts.popover.arrow.height} - 14px) 0 ${layouts.answer.horizontalSpacing} 8px;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);\n color: ${colors.palette.neutralThin};\n font-size: calc(1.4rem * var(--content-text-scale));\n\n .arrow {\n position: absolute;\n display: block;\n width: ${layouts.popover.arrow.width};\n height: ${layouts.popover.arrow.height};\n margin-left: ${layouts.popover.arrow.edgeDistance};\n top: calc(${layouts.popover.arrow.height} * -1);\n\n &::before,\n &::after {\n position: absolute;\n display: block;\n content: \"\";\n border-color: transparent;\n border-style: solid;\n border-width: 0 calc(${layouts.popover.arrow.width} / 2) ${layouts.popover.arrow.height} calc(${layouts.popover.arrow.width} / 2);\n }\n &::before {\n top: 0;\n border-bottom-color: ${colors.popover.borderColor};\n }\n &::after {\n top: ${layouts.popover.borderWidth};\n border-bottom-color: ${colors.palette.white};\n }\n }\n\n &.right {\n right: calc(-${layouts.popover.arrow.edgeDistance} - ${layouts.popover.borderWidth});\n .arrow { right: ${layouts.popover.arrow.edgeDistance}; }\n }\n\n\n > .content {\n padding: ${layouts.popover.verticalSpacing} ${layouts.popover.horizontalSpacing};\n }\n `,\n visuallyHidden: () => css`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n `\n};\n\nconst theme = {\n colors: colors,\n layouts: layouts,\n transitions: transitions,\n breakpoints: breakpoints,\n};\n\nexport default theme;\n","import React from \"react\";\n\nexport const TypesetMathContext = React.createContext<() => void>(() => { throw new Error('context not initialized') });\nexport const useTypesetMath = () => React.useContext(TypesetMathContext);\n","import React from \"react\";\nimport { useTypesetMath } from \"../hooks/useTypesetMath\";\n\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\ntype ComponentType = keyof JSX.IntrinsicElements | React.JSXElementConstructor;\n\nexport interface ContentProps {\n className?: string;\n component?: T extends undefined ? undefined :\n T extends ComponentType ? React.ReactComponentElement:\n never;\n html: string;\n block?: boolean;\n}\n\nexport const Content = ((\n {html, component, block = false, ...props}: ContentProps\n) => {\n const typesetMath = useTypesetMath();\n\n React.useEffect(() => {\n typesetMath();\n }, [typesetMath, html])\n\n if (component !== undefined) {\n return React.cloneElement(component, {html, ...props});\n }\n if (block) {\n return
;\n } else {\n return ;\n }\n});\n","import classnames from 'classnames';\nimport { Content } from './Content';\n\ninterface FeedbackProps {\n position?: 'top' | 'bottom' | 'left' | 'right';\n children: string;\n className?: string;\n contentRenderer?: JSX.Element;\n id: string\n}\n\nconst SimpleFeedback = (props: Pick) => (\n \n);\n\nconst Feedback = ({ id, ...props }: FeedbackProps) => {\n const position = props.position || 'bottom';\n const wrapperClasses = classnames('question-feedback', position);\n\n return (\n \n );\n};\n\nexport { Feedback, SimpleFeedback };\n","import cn from 'classnames';\nimport { ReactNode } from 'react';\nimport { ALPHABET, isAnswerChecked, isAnswerCorrect, isAnswerIncorrect } from '../utils';\nimport { Answer as AnswerType, ID } from '../types';\nimport { Content } from './Content';\nimport { SimpleFeedback } from './Feedback';\nimport styled from 'styled-components';\nimport { colors } from '../theme';\n\nconst StyledAnswerIndicator = styled.div<{ state: boolean }>`\n color: ${props => props.state ? colors.answer.correct : colors.answer.incorrect};\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n`;\n\nconst AnswerIndicator = (\n { isCorrect, isIncorrect }: { isCorrect?: boolean; isIncorrect?: boolean }\n) => {\n if (!isCorrect && !isIncorrect) {\n return null;\n }\n const state = isCorrect || isIncorrect === false;\n\n return \n {state ? 'Correct' : 'Incorrect'} Answer\n \n};\n\nexport interface AnswerProps {\n answer: AnswerType;\n iter: number;\n qid: ID;\n type: 'teacher-review' | 'teacher-preview' | 'student' | 'student-mpp';\n hasCorrectAnswer?: boolean;\n onChangeAnswer?: (answer: AnswerType) => void;\n disabled: boolean;\n answerId?: ID;\n correctAnswerId?: ID | null;\n incorrectAnswerId?: ID;\n onKeyPress?: () => void;\n answered_count?: number;\n correctIncorrectIcon?: ReactNode,\n radioBox?: ReactNode;\n contentRenderer?: JSX.Element;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n feedbackId?: string;\n}\n\ntype AnswerAnswerProps = Pick<\n AnswerBodyProps,\n 'answer' |\n 'contentRenderer' |\n 'show_all_feedback' |\n 'tableFeedbackEnabled' |\n 'isCorrect' |\n 'isIncorrect'\n>;\n\nconst AnswerAnswer = (props: AnswerAnswerProps) => {\n const {\n answer: { content_html, feedback_html },\n contentRenderer,\n show_all_feedback,\n tableFeedbackEnabled,\n isCorrect,\n isIncorrect,\n } = props;\n return (\n
\n \n \n {show_all_feedback && feedback_html && !tableFeedbackEnabled &&\n \n {feedback_html}\n }\n
\n )\n}\n\ninterface AnswerBodyProps extends AnswerProps {\n isCorrect?: boolean;\n isSelected?: boolean;\n isIncorrect?: boolean;\n}\n\nconst TeacherReview = (props: AnswerBodyProps) => {\n const {\n answer,\n answered_count,\n isCorrect,\n contentRenderer,\n iter,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const percent = answer.selected_count && answered_count\n ? Math.round((answer.selected_count / answered_count) * 100)\n : 0;\n return (\n
\n
\n \n {answer.selected_count}\n \n \n {ALPHABET[iter]}\n \n
\n \n
\n );\n}\n\nconst AnswerChoice = (props: AnswerBodyProps) => {\n const {\n type,\n iter,\n answer,\n disabled,\n onKeyPress,\n qid,\n contentRenderer,\n correctIncorrectIcon,\n feedbackId,\n isSelected,\n isCorrect,\n isIncorrect,\n hasCorrectAnswer,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const ariaLabel = `${isSelected ? 'Selected ' : ''}Choice ${ALPHABET[iter]}:`;\n let onChangeAnswer: AnswerProps['onChangeAnswer'];\n\n const onChange = () => onChangeAnswer && onChangeAnswer(answer);\n\n if (!hasCorrectAnswer\n && (type !== 'teacher-review')\n && (type !== 'teacher-preview')\n && (type !== 'student-mpp')) {\n ({ onChangeAnswer } = props);\n }\n\n return <>\n {type === 'teacher-preview' &&\n
\n {isCorrect && correctIncorrectIcon}\n
}\n \n \n \n
\n \n \n \n}\n\nconst AnswerBody = (props: AnswerBodyProps) => {\n return props.type === 'teacher-review'\n ? \n : \n}\n\nexport const Answer = (props: AnswerProps) => {\n const {\n type,\n answer,\n disabled,\n answerId,\n correctAnswerId,\n incorrectAnswerId,\n } = props;\n\n const isChecked = isAnswerChecked(answer, answerId);\n const isCorrect = isAnswerCorrect(answer, correctAnswerId);\n const isIncorrect = isAnswerIncorrect(answer, incorrectAnswerId);\n // When rendering a previous response, we can determine if it was this answer.\n // If there is no incorrectAnswerId, that means only a correct answer is present, check isCorrect.\n // If an incorrectAnswerId is present (there is only ever one, if multiple attempts are enabled,\n // it is the latest one) checking isIncorrect works because incorrectAnswerId is only set for\n // a missed attempt, meaning if an attempt is missed and then successfully re-attempted,\n // incorrectAnswerId will be empty.\n const isPreviousResponse = answerId === undefined && (!incorrectAnswerId && isCorrect || isIncorrect);\n\n const isSelected = isChecked || isPreviousResponse;\n const classes = cn('answers-answer', {\n 'disabled': disabled,\n 'answer-selected': isSelected,\n 'answer-correct': isCorrect && type !== 'student-mpp',\n 'answer-incorrect': incorrectAnswerId && isAnswerIncorrect(answer, incorrectAnswerId),\n });\n\n return (\n
\n
\n \n
\n
\n );\n}\nAnswer.displayName = 'OSAnswer';\n","import { AnswerDisplayType } from './types';\n\nexport const defaultAnswerType: AnswerDisplayType = 'student';\n","import { defaultAnswerType } from \"../constants\";\nimport { Answer as AnswerType, AnswerDisplayType, ID, ExerciseQuestionData } from \"src/types\";\nimport { Answer } from \"./Answer\";\nimport { Feedback } from \"./Feedback\";\n\nexport interface AnswersTableProps {\n question: ExerciseQuestionData;\n type?: AnswerDisplayType;\n answer_id?: ID;\n correct_answer_id?: ID | null;\n incorrectAnswerId?: ID;\n answerIdOrder?: ID[],\n feedback_html: string;\n correct_answer_feedback_html?: string;\n answered_count?: number;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n onChangeAnswer: () => void;\n hideAnswers: boolean;\n hasCorrectAnswer?: boolean;\n onChangeAttempt?: () => void;\n choicesEnabled?: boolean;\n onKeyPress?: () => void;\n contentRenderer?: JSX.Element;\n instructions?: JSX.Element;\n}\n\nexport const AnswersTable = (props: AnswersTableProps) => {\n let idCounter = 0;\n\n const {\n question, hideAnswers, type = defaultAnswerType, answered_count, choicesEnabled, correct_answer_id,\n incorrectAnswerId, answer_id, feedback_html, correct_answer_feedback_html,\n show_all_feedback = false, tableFeedbackEnabled, hasCorrectAnswer, onChangeAnswer, onKeyPress, answerIdOrder, instructions\n } = props;\n if (hideAnswers) { return null; }\n\n const { id } = question;\n\n const feedback: { index: number, html: string, id: string }[] = [];\n\n const sortedAnswersByIdOrder = (idOrder: ID[]) => {\n const { answers } = question;\n return answers.slice().sort((a, b) => idOrder.indexOf(a.id) - idOrder.indexOf(b.id));\n }\n\n const questionAnswerProps = {\n qid: id || `auto-${idCounter++}`,\n answerId: answer_id,\n correctAnswerId: correct_answer_id,\n incorrectAnswerId,\n hasCorrectAnswer,\n onChangeAnswer: onChangeAnswer,\n type,\n answered_count,\n disabled: !choicesEnabled,\n show_all_feedback,\n tableFeedbackEnabled,\n onKeyPress\n };\n\n const answers = answerIdOrder ? sortedAnswersByIdOrder(answerIdOrder) : question.answers;\n\n const answersHtml = answers.map((answer, i) => {\n const additionalProps: { answer: AnswerType, iter: number, key: string }\n = {\n answer: {\n ...answer,\n question_id: typeof question.id === 'string' ? parseInt(question.id, 10) : question.id\n },\n iter: i,\n key: `${questionAnswerProps.qid}-option-${i}`,\n };\n const answerProps = Object.assign({}, additionalProps, questionAnswerProps);\n let html: string | undefined;\n let feedbackId: string | undefined;\n\n if (show_all_feedback && answer.feedback_html && tableFeedbackEnabled) {\n html = answer.feedback_html;\n } else if (answer.id === incorrectAnswerId && feedback_html) {\n html = feedback_html;\n } else if (answer.id === correct_answer_id && correct_answer_feedback_html) {\n html = correct_answer_feedback_html;\n }\n\n if (html) {\n feedbackId = `feedback-${questionAnswerProps.qid}-${i}`\n feedback.push({ index: i, html, id: feedbackId });\n }\n\n return (\n \n );\n });\n\n feedback.forEach((item, i) => {\n const spliceIndex = item.index + i + 1;\n answersHtml.splice(spliceIndex, 0, (\n \n {item.html}\n \n ));\n });\n\n return (\n
\n {instructions}\n {answersHtml}\n
\n );\n}\n","import { ReactNode } from \"react\";\nimport { breakpoints, colors, layouts, mixins } from \"../theme\";\nimport { AvailablePoints, StepBase, StepWithData } from \"../types\";\nimport styled from \"styled-components\";\nimport cn from \"classnames\";\n\nexport const InnerStepCard = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ${breakpoints.desktop`\n max-width: 1000px;\n `}\n`;\n\nexport const OuterStepCard = styled.div`\n padding: ${layouts.card.spacing};\n\n ${breakpoints.mobile`\n padding: 0;\n `}\n`;\n\nconst StepCardHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ${colors.card.header.background};\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ${colors.palette.gray};\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ${breakpoints.desktop`\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n `}\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ${breakpoints.tablet`\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.tablet};\n }\n button.ox-icon-angle-right {\n margin-left: ${breakpoints.margins.tablet};\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n `}\n\n ${breakpoints.mobile`\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n`;\nStepCardHeader.displayName = 'StepCardHeader';\n\nconst StepCardQuestion = styled.div<{ unpadded?: boolean }>`\n .step-card-body {\n ${mixins.stepCardPadding()}\n overflow: auto;\n background: ${colors.card.body.background};\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ${breakpoints.only.mobile`\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n `}\n\n .reading-step & {\n padding: 0;\n }\n\n ${breakpoints.desktop`\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n `}\n\n ${breakpoints.mobile`\n .openstax-exercise-badges svg {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n`;\n\ninterface SharedProps {\n questionNumber: number;\n numberOfQuestions: number;\n showTotalQuestions: boolean;\n leftHeaderChildren?: ReactNode;\n rightHeaderChildren?: ReactNode;\n headerTitleChildren?: ReactNode;\n}\n\nexport interface StepCardProps extends SharedProps {\n unpadded: boolean;\n className?: string;\n children?: ReactNode;\n stepType: StepWithData['type'];\n availablePoints?: AvailablePoints;\n questionId?: string;\n multipartBadge?: ReactNode;\n isHomework: boolean;\n}\n\nconst StepCard = ({\n questionNumber,\n numberOfQuestions,\n showTotalQuestions,\n stepType,\n isHomework,\n availablePoints,\n unpadded, // currently does nothing; may need to restore if this causes tutor stepcard regression\n className,\n children,\n questionId,\n multipartBadge,\n leftHeaderChildren,\n rightHeaderChildren,\n headerTitleChildren,\n ...otherProps }: StepCardProps) => {\n\n const formattedQuestionNumber = numberOfQuestions > 1\n ? `Questions ${questionNumber} - ${questionNumber + numberOfQuestions - 1}`\n : `Question ${questionNumber}`;\n\n return (\n \n {multipartBadge}\n \n {questionNumber && isHomework && stepType === 'exercise' &&\n \n
\n {leftHeaderChildren}\n

\n {headerTitleChildren}\n {formattedQuestionNumber}\n {showTotalQuestions ?  / {numberOfQuestions} : null}\n |\n ID: {questionId}\n

\n
\n {availablePoints || rightHeaderChildren ?
\n {availablePoints &&
{availablePoints} Points
}\n {rightHeaderChildren}\n
: null}\n
\n }\n {children}\n
\n
\n )\n};\nStepCard.displayName = 'OSStepCard';\n\nexport interface TaskStepCardProps extends SharedProps {\n className?: string;\n children?: ReactNode;\n step: StepBase | StepWithData;\n questionNumber: number;\n numberOfQuestions: number;\n}\n\nconst TaskStepCard = ({\n step,\n questionNumber,\n numberOfQuestions,\n children,\n className,\n ...otherProps\n}: TaskStepCardProps) =>\n(\n {children}\n);\n\nTaskStepCard.displayName = 'OSTaskStepCard';\n\nexport { StepCard, TaskStepCard };\n","import { colors, breakpoints, mixins } from \"../theme\";\nimport styled from \"styled-components\";\n\nexport const StepCardFooter = styled.div`\n ${mixins.stepCardPadding()}\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ${colors.card.body.background};\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ${colors.palette.pale};\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ${breakpoints.mobile`\n flex-wrap: wrap;\n `}\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ${breakpoints.desktop`\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n `}\n`;\n","import { colors } from \"../theme\";\nimport styled from \"styled-components\";\n\nconst StyledButton = styled.button`\n background-color: ${colors.button.background};\n color: ${colors.palette.white};\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ${colors.button.backgroundHover}\n }\n &:active {\n background: ${colors.button.backgroundActive}\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n`;\n\ninterface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting?: never;\n waitingText?: never;\n}\ninterface WaitingButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting: boolean;\n waitingText: string;\n}\n\nconst Button = (props: ButtonProps | WaitingButtonProps) => {\n const { disabled, isWaiting, waitingText, children, ...otherProps } = props;\n\n return (\n {(isWaiting && waitingText) || children}\n );\n}\n\nexport default Button;\n","import styled, { createGlobalStyle } from \"styled-components\";\nimport { InnerStepCard } from \"./Card\";\nimport Button from \"./Button\";\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nexport interface CompletionStatusProps {\n numberOfQuestions: number;\n numberCompleted: number;\n handleClick: () => void;\n className?: string;\n}\n\nconst CompletionStatusCard = styled(InnerStepCard)`\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n`;\n\nconst CompletionHeader = styled.h2`\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n`;\n\nexport const CompletionStatus = styled(({\n numberOfQuestions, numberCompleted, handleClick, className\n}: CompletionStatusProps) => {\n\n const allCompleted = numberOfQuestions === numberCompleted;\n const someCompleted = numberCompleted > 0;\n const buttonText = allCompleted ? 'Next' : (\n someCompleted ? 'Continue' : 'Start'\n );\n\n return <>\n \n \n {allCompleted ? 'You are done.' : (someCompleted ? 'Quiz is partially complete.' : 'No questions have been answered.')}\n

{allCompleted ? 'Great job answering all the questions.' : (someCompleted ? `You've completed ${numberCompleted} of ${numberOfQuestions} questions.` : 'Begin working on the quiz.')}

\n \n
\n \n})``;\n","import styled from 'styled-components';\nimport { mixins, colors, layouts, transitions } from '../theme';\nimport { AnswersTable } from './AnswersTable';\nimport classnames from 'classnames';\nimport { ID, ExerciseQuestionData, Task } from 'src/types';\nimport React, { ReactNode } from 'react';\nimport { Content } from './Content';\n\nconst StyledQuestion = styled.div`\n&.step-card-body {\n ${mixins.stepCardPadding()};\n}\n\n&.openstax-question {\n border-top: 1px solid ${colors.palette.pale};\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ${colors.palette.neutral};\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ${colors.palette.neutralLightBlue};\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: ${layouts.answer.horizontalSpacing} ${layouts.answer.horizontalBuffer};\n margin: ${layouts.answer.verticalSpacing} 0 ${layouts.answer.horizontalSpacing} ${layouts.answer.verticalSpacing};\n border-left: ${layouts.answer.horizontalSpacing} solid ${colors.palette.neutralLighter};\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ${colors.palette.neutralLightest};\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ${mixins.answer()};\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ${layouts.answer.horizontalSpacing};\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: ${layouts.answer.verticalSpacing} 0 0 0;\n margin: 0;\n transition: color ${transitions.answer};\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ${mixins.answerHover()}\n }\n }\n\n .answer-input-box {\n ${mixins.visuallyHidden()}\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ${colors.answer.checked};\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ${mixins.answerIncorrect()};\n }\n }\n\n &.answer-correct {\n .answer-label {\n ${mixins.answerCorrect(true)};\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ${mixins.answerCorrectAnswer()}\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ${mixins.answerIncorrect()}\n }\n &.answer-selected.answer-incorrect {\n ${mixins.answerIncorrect(true)}\n }\n }\n }\n\n .question-feedback {\n ${mixins.popover()}\n max-width: ${layouts.answer.feedback.popover.maxWidth};\n .question-feedback-content {\n padding: ${layouts.answer.feedback.popover.verticalSpacing} ${layouts.answer.feedback.popover.horizontalSpacing};\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n`;\n\nexport interface QuestionProps {\n question: ExerciseQuestionData,\n answer_id?: ID;\n task?: Task | null,\n correct_answer_id: ID | null;\n incorrectAnswerId: ID;\n hideAnswers: boolean;\n hidePreambles?: boolean,\n exercise_uid?: string;\n displayFormats: boolean,\n className: string;\n questionNumber: number;\n displaySolution: boolean;\n context?: string;\n correct_answer_feedback_html?: string;\n contentRenderer?: JSX.Element;\n feedback_html: string;\n onChange: () => void;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n children?: ReactNode;\n answerIdOrder?: ID[];\n choicesEnabled?: boolean;\n}\n\nexport const Question = React.forwardRef((props: QuestionProps, ref: React.ForwardedRef) => {\n let exerciseUid, solution;\n\n const {\n question, correct_answer_id, incorrectAnswerId, exercise_uid, className, questionNumber, context, task, hidePreambles\n } = props;\n\n const { stem_html, collaborator_solutions = [], formats, stimulus_html } = question;\n\n const hasCorrectAnswer = !!correct_answer_id;\n const hasIncorrectAnswer = !!incorrectAnswerId;\n\n const taskIsDeleted = (task != null ? task.is_deleted : undefined)\n const taskIsHomework = ((task != null ? task.type : undefined) === 'homework');\n\n const classes = classnames('openstax-question', className, {\n 'has-correct-answer': hasCorrectAnswer && !(taskIsDeleted && taskIsHomework),\n 'has-incorrect-answer': hasIncorrectAnswer,\n });\n\n const hasSolution = () => {\n const { displaySolution } = props;\n const { collaborator_solutions = [] } = question;\n\n return (\n displaySolution &&\n collaborator_solutions &&\n collaborator_solutions.find(s => s['content_html'] !== undefined)\n );\n };\n\n if (exercise_uid != null) {\n exerciseUid = (\n
\n {exercise_uid}\n
\n );\n }\n\n if (hasSolution()) {\n solution =\n
\n
\n Detailed solution:\n
\n s['content_html']).join('')} />\n
;\n }\n\n return (\n \n \n );\n});\n\ninterface QuestionHtmlProps {\n html?: string;\n type: string;\n hidden: QuestionProps['hidePreambles'];\n questionNumber?: QuestionProps['questionNumber'];\n}\n\nexport const QuestionHtml = (props: QuestionHtmlProps) => {\n const { html = '', type, hidden, questionNumber } = props;\n if (hidden === true || !(html.length > 0)) { return null; }\n\n return (\n \n );\n};\n\nconst FormatsListing = ({ formats = [] }: { formats: ExerciseQuestionData['formats'] }) => {\n return (\n
\n
Formats:
\n {formats.map((format, i) => {format})}\n
\n );\n};\n","import { MouseEventHandler, ReactNode } from 'react';\nimport { countWords } from '../utils';\nimport styled, { css } from 'styled-components';\nimport { colors, mixins } from '../theme';\nimport { AvailablePoints, ExerciseQuestionData } from 'src/types';\nimport { QuestionHtml } from './Question';\nimport Button from './Button';\nimport { StepCardFooter } from './StepCardFooter';\n\nexport interface FreeResponseProps {\n readOnly: boolean;\n wordLimit: number;\n infoRowChildren?: ReactNode;\n onChange: (event: React.ChangeEvent) => void;\n cancelHandler: MouseEventHandler;\n saveHandler: MouseEventHandler;\n defaultValue: string;\n isSubmitDisabled: boolean;\n questionNumber: number,\n question: ExerciseQuestionData,\n availablePoints?: AvailablePoints,\n textHasChanged: boolean;\n submitBtnLabel: string;\n}\n\nconst TextAreaErrorStyle = css`\n background-color: #f5e9ea;\n`;\n\nconst StyledFreeResponse = styled.div`\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ${mixins.stepCardPadding()}\n }\n`;\n\nconst SyledQuestionStem = styled.div`\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n`;\n\nconst InfoRow = styled.div<{ hasChildren: boolean }>`\n margin: 8px 0;\n display: flex;\n justify-content: ${props => props.hasChildren ? 'space-between' : 'flex-end'};\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ${colors.palette.danger};\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ${colors.palette.neutralThin};\n`;\n\nexport const FreeResponseTextArea = styled.textarea<{ isOverWordLimit: boolean } & FreeResponseProps>`\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ${colors.palette.neutral};\n color: ${colors.palette.neutralDark};\n ${props => props.isOverWordLimit && TextAreaErrorStyle};\n ${props => props.isOverWordLimit && css`\n border: 2px solid ${colors.palette.danger};\n `}\n background-color: ${props => props.readOnly && colors.palette.neutralCool};\n`;\nFreeResponseTextArea.displayName = 'OSFreeResponseTextArea';\n\nconst RevertButton = (props: {\n disabled: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n);\n\n\nexport const FreeResponseInput = (props: FreeResponseProps) => {\n const {\n availablePoints,\n cancelHandler,\n defaultValue,\n infoRowChildren,\n isSubmitDisabled,\n question,\n questionNumber,\n saveHandler,\n submitBtnLabel,\n textHasChanged,\n wordLimit,\n } = props;\n\n const isOverWordLimit = countWords(defaultValue) > wordLimit;\n\n const questionProps = {};\n if (questionNumber) { questionProps['data-question-number'] = questionNumber; }\n\n return (\n \n
\n \n {question.stem_html &&\n \n \n \n {infoRowChildren}\n
\n {countWords(defaultValue)} words\n {isOverWordLimit && Maximum {wordLimit} words}\n
\n
\n
\n \n {availablePoints\n ?
Points: {availablePoints}
\n : null}\n
\n \n \n {submitBtnLabel}\n \n
\n
\n
\n );\n}\n\nFreeResponseInput.displayName = 'OSFreeResponse';\n","import React from \"react\";\nimport { numberfyId } from \"../../src/utils\";\nimport { AvailablePoints, ID, ExerciseQuestionData, Task } from \"../types\";\nimport Button from \"./Button\";\nimport { Content } from \"./Content\";\nimport { ExerciseBaseProps } from \"./Exercise\";\nimport { Question } from './Question';\nimport { StepCardFooter } from \"./StepCardFooter\";\n\nexport interface ExerciseQuestionProps {\n task?: Task;\n question: ExerciseQuestionData;\n answer_id_order?: ID[];\n questionNumber: number;\n choicesEnabled: boolean;\n hasMultipleAttempts: boolean;\n onAnswerChange: () => void;\n onAnswerSave: ExerciseBaseProps['onAnswerSave'];\n onNextStep: ExerciseBaseProps['onNextStep'];\n feedback_html: string;\n correct_answer_feedback_html: string;\n is_completed: boolean;\n correct_answer_id: ID;\n incorrectAnswerId: ID;\n answer_id?: ID;\n attempts_remaining: number;\n published_comments?: string;\n detailedSolution?: string;\n canAnswer: boolean;\n needsSaved: boolean;\n canUpdateCurrentStep: boolean;\n attempt_number: number;\n apiIsPending: boolean;\n displaySolution: boolean;\n available_points?: AvailablePoints;\n exercise_uid: string;\n free_response?: string;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n hasFeedback?: ExerciseBaseProps['hasFeedback'];\n}\n\nconst AttemptsRemaining = ({ count }: { count: number }) => {\n return (\n
{count} attempt{count === 1 ? '' : 's'} left
\n );\n}\n\nconst PublishedComments = ({ published_comments }: { published_comments?: string }) => {\n if (!published_comments) { return null; }\n\n return (\n
\n Feedback: {published_comments}\n
\n );\n}\n\nexport const SaveButton = (props: {\n disabled: boolean, isWaiting: boolean, attempt_number: number, willContinue: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n {props.willContinue\n ? 'Submit & continue'\n : (props.attempt_number == 0 ? 'Submit' : 'Re-submit')}\n \n);\n\nexport const NextButton = (props: {\n canUpdateCurrentStep: boolean,\n} & React.ComponentPropsWithoutRef<'button'>) => {\n return (\n \n );\n}\n\nconst FreeResponseReview = ({ free_response }: Pick) => {\n if (!free_response) { return null; }\n return (\n <>\n
{free_response}
\n \n );\n}\n\nexport const ExerciseQuestion = React.forwardRef((props: ExerciseQuestionProps, ref: React.ForwardedRef) => {\n const {\n question, task, answer_id_order, onAnswerChange, feedback_html, correct_answer_feedback_html,\n is_completed, correct_answer_id, incorrectAnswerId, choicesEnabled, questionNumber,\n answer_id, hasMultipleAttempts, attempts_remaining, published_comments, detailedSolution,\n canAnswer, needsSaved, attempt_number, apiIsPending, onAnswerSave, onNextStep, canUpdateCurrentStep,\n displaySolution, available_points, free_response, show_all_feedback, tableFeedbackEnabled,\n hasFeedback\n } = props;\n\n const [shouldContinue, setShouldContinue] = React.useState(false)\n React.useEffect(() => {\n if (shouldContinue && is_completed) {\n onNextStep(questionNumber - 1);\n setShouldContinue(false);\n }\n }, [onNextStep, questionNumber, shouldContinue, is_completed]);\n\n return (\n
\n \n \n \n \n
\n
\n {available_points ? Points: {available_points} : null}\n \n {hasMultipleAttempts &&\n attempts_remaining > 0 &&\n }\n \n \n {detailedSolution && (
Detailed solution:
)}\n
\n
\n {(canAnswer && needsSaved) || shouldContinue ?\n {\n onAnswerSave(numberfyId(question.id));\n if (!hasFeedback) {\n setShouldContinue(true);\n }\n }}\n willContinue={!hasFeedback}\n /> :\n onNextStep(questionNumber - 1)} canUpdateCurrentStep={canUpdateCurrentStep} />}\n
\n
\n
\n
\n );\n})\n","import { debounce, once } from 'lodash';\nimport { isEmpty, memoize } from 'lodash/fp.js';\nimport WeakMap from 'weak-map';\n\ndeclare global {\n interface Window {\n MathJax?: any;\n __debugMathJax?: boolean;\n }\n}\n\nconst MATH_MARKER_BLOCK = '\\u200c\\u200c\\u200c'; // zero-width non-joiner\nconst MATH_MARKER_INLINE = '\\u200b\\u200b\\u200b'; // zero-width space\n\nconst MATH_RENDERED_CLASS = 'math-rendered';\nconst MATH_MARKED_CLASS = 'math-marked';\nconst MATH_DATA_SELECTOR = `[data-math]:not(.${MATH_RENDERED_CLASS})`;\nconst MATH_ML_SELECTOR = `math:not(.${MATH_RENDERED_CLASS})`;\nconst COMBINED_MATH_SELECTOR = `${MATH_DATA_SELECTOR}, ${MATH_ML_SELECTOR}`;\nconst MATHJAX_CONFIG = {\n extensions: [],\n showProcessingMessages: false,\n skipStartupTypeset: true,\n styles: {\n '#MathJax_MSIE_Frame': {\n left: '', right: 0, visibility: 'hidden',\n },\n '#MathJax_Message': {\n left: '', right: 0, visibility: 'hidden',\n },\n },\n tex2jax: {\n displayMath: [[MATH_MARKER_BLOCK, MATH_MARKER_BLOCK]],\n inlineMath: [[MATH_MARKER_INLINE, MATH_MARKER_INLINE]],\n },\n};\n\nconst findProcessedMath = (root: Element): Element[] => Array.from(root.querySelectorAll('.MathJax math'));\nconst findUnprocessedMath = (root: Element): Element[] => {\n const processedMath = findProcessedMath(root);\n return Array.from(root.querySelectorAll('math')).filter((node) => processedMath.indexOf(node) === -1);;\n};\n\nconst findLatexNodes = (root: Element): Element[] => {\n const latexNodes: Element[] = [];\n for (const node of Array.from(root.querySelectorAll(MATH_DATA_SELECTOR))) {\n const formula = node.getAttribute('data-math');\n\n // Set textContent once so that resolveOrWait calls don't\n // undo a MathJax pass before rendered class is applied\n if (!node.classList.contains(MATH_MARKED_CLASS)) {\n node.textContent = (node.tagName.toLowerCase() === 'div')\n ? `${MATH_MARKER_BLOCK}${formula}${MATH_MARKER_BLOCK}`\n : `${MATH_MARKER_INLINE}${formula}${MATH_MARKER_INLINE}`;\n node.classList.add(MATH_MARKED_CLASS);\n }\n latexNodes.push(node);\n }\n\n return latexNodes;\n};\n\nconst typesetLatexNodes = (latexNodes: Element[], windowImpl: Window) => () => {\n if (isEmpty(latexNodes)) {\n return;\n }\n\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(latexNodes),\n markLatexNodesRendered(latexNodes)\n );\n};\n\nconst typesetMathMLNodes = (root: Element, windowImpl: Window) => () => {\n const mathMLNodes = findUnprocessedMath(root);\n\n if (isEmpty(mathMLNodes)) {\n return;\n }\n\n // style the entire document because mathjax is unable to style individual math elements\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(root)\n );\n};\n\nconst markLatexNodesRendered = (latexNodes: Element[]) => () => {\n // Queue a call to mark the found nodes as rendered so are ignored if typesetting is called repeatedly\n // uses className += instead of classList because IE\n const result = [];\n for (const node of latexNodes) {\n result.push(node.className += ` ${MATH_RENDERED_CLASS}`);\n }\n};\n\n// Search document for math and [data-math] elements and then typeset them\nfunction typesetDocument(root: Element, windowImpl: Window) {\n const latexNodes = findLatexNodes(root);\n\n windowImpl.MathJax.Hub.Queue(\n typesetLatexNodes(latexNodes, windowImpl),\n typesetMathMLNodes(root, windowImpl)\n );\n}\n\nconst resolveOrWait = (root: Element, resolve: () => void, remainingTries = 5) => {\n if (\n remainingTries > 0\n && (findLatexNodes(root).length || findUnprocessedMath(root).length)\n ) {\n setTimeout(() => {\n resolveOrWait(root, resolve, remainingTries - 1);\n }, 200);\n } else {\n resolve();\n }\n};\n\nconst typesetDocumentPromise = (root: Element, windowImpl: Window): Promise => new Promise((resolve) => {\n typesetDocument(root, windowImpl);\n windowImpl.MathJax.Hub.Queue(() => {\n resolveOrWait(root, resolve);\n });\n});\n\n// memoize'd getter for typeset document function so that each node's\n// typeset has its own debounce\nconst getTypesetDocument = memoize((root, windowImpl) => {\n // Install a debounce around typesetting function so that it will only run once\n // every Xms even if called multiple times in that period\n return debounce(typesetDocumentPromise, 100, {\n leading: true,\n trailing: false,\n }).bind(null, root, windowImpl);\n});\ngetTypesetDocument.cache = new WeakMap();\n\n// typesetMath is the main exported function.\n// It's called by components like HTML after they're rendered\nconst typesetMath = async (root: Element, windowImpl = window) => {\n await startMathJax();\n\n // check if MathJax is setup\n if (!(windowImpl && windowImpl.MathJax && windowImpl.MathJax.Hub)) {\n console.warn('Warning: Expected MathJax to be initialized.');\n return Promise.resolve();\n }\n\n // schedule a Mathjax pass if there is at least one [data-math] or element present\n if (root.querySelector(COMBINED_MATH_SELECTOR)) {\n return getTypesetDocument(root, windowImpl)();\n }\n\n return Promise.resolve();\n};\n\nconst startMathJax: (windowImpl?: Window) => Promise = once((windowImpl: Window = window) => new Promise((resolve) => {\n const configuredCallback = () => {\n // there doesn't seem to be a config option for this\n windowImpl.MathJax.HTML.Cookie.prefix = 'mathjax';\n // proceed with mathjax initi\n windowImpl.MathJax.Hub.Configured();\n windowImpl.MathJax.Hub.Register.StartupHook('End', () => {\n resolve();\n });\n };\n\n if (!document.getElementById('MathJax-Script')) {\n const script = document.createElement('script');\n script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured';\n script.id = 'MathJax-Script';\n script.async = true;\n document.head.appendChild(script);\n }\n\n if (windowImpl.MathJax && windowImpl.MathJax.Hub) {\n windowImpl.MathJax.Hub.Config(MATHJAX_CONFIG);\n // Does not seem to work when passed to Config\n windowImpl.MathJax.Hub.processSectionDelay = 0;\n configuredCallback();\n } else {\n // If the MathJax.js file has not loaded yet:\n // Call MathJax.Configured once MathJax loads and\n // loads this config JSON since the CDN URL\n // says to `delayStartupUntil=configured`\n (MATHJAX_CONFIG as any).AuthorInit = configuredCallback;\n windowImpl.MathJax = MATHJAX_CONFIG;\n }\n}));\n\nexport {\n typesetMath,\n startMathJax,\n};\n","import { colors, layouts, breakpoints } from \"../../src/theme\";\nimport styled, { css } from \"styled-components\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faBookOpen, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport { ExerciseIcons } from \"./Exercise\";\n\nexport const StyledToolbar = styled.div<{\n mobile: boolean;\n desktop: boolean;\n}>`\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ${colors.palette.light};\n background: #fff;\n margin: ${layouts.card.spacing} 0 0 ${layouts.card.spacing};\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${colors.palette.neutral};\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ${colors.palette.neutralDarker};\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ${colors.palette.neutralDarker};\n }\n\n span {\n display: block;\n }\n }\n }\n\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n\n ${props => props.mobile && breakpoints.mobile`\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ${colors.palette.neutral};\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ${colors.palette.light};\n }\n }\n `}\n`;\n\nexport const ExerciseToolbar = ({ icons }: { icons?: ExerciseIcons }) => {\n if (!icons) {\n return null;\n }\n const settings = Object.values(icons);\n const mobile = settings.some(({ location }) => location?.toolbar?.mobile ?? true);\n const desktop = settings.some(({ location }) => location?.toolbar?.desktop ?? false);\n const topicUrl = icons.topic?.url;\n const errataUrl = icons.errata?.url;\n\n return \n {topicUrl ? \n \n View topic in textbook\n : null}\n {errataUrl ? \n \n Suggest a correction\n : null}\n \n};\n","import styled, { css } from 'styled-components';\nimport { breakpoints, colors, mixins } from '../../src/theme';\nimport { ExerciseData } from '../../src/types';\nimport { faBookOpen } from '@fortawesome/free-solid-svg-icons/faBookOpen';\nimport { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons/faTriangleExclamation';\nimport { faCircleInfo } from '@fortawesome/free-solid-svg-icons/faCircleInfo';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { ExerciseIcons } from './Exercise';\n\ntype ExplanationType = 'multiple-choice' | 'two-step';\n\nconst TypeExplanations: { [key in ExplanationType]: string } = {\n 'multiple-choice': 'Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts.',\n 'two-step': 'In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. \\\nRecalling the answer to a question from memory helps you to retain things longer.',\n}\n\nconst ItemWrapper = styled.div<{ mobile: boolean; desktop: boolean }>`\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ${colors.palette.mediumBlue};}\n .popover { display: flex; }\n }\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n ${props => !props.mobile && breakpoints.mobile`\n display: none;\n `}\n`;\n\nconst InnerWrapper = styled.div`\n position: relative;\n display: flex;\n`;\n\nconst Popover = styled.div`\n ${mixins.popover}\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n`;\n\ninterface PopoverItemProps {\n text: string;\n children: JSX.Element;\n wrapperProps?: {\n as: keyof JSX.IntrinsicElements;\n href?: string;\n target?: string;\n },\n mobile: boolean;\n desktop: boolean;\n}\n\nconst PopoverItem = (props: PopoverItemProps) => (\n \n \n {props.children}\n \n
\n
{props.text}
\n
\n
\n \n);\n\nconst PopoverItemsWrapper = styled.div`\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n color: ${colors.palette.darkGray};\n height: 1em;\n`;\n\nexport const ExerciseHeaderIcons = ({ exercise, icons }: {\n exercise: ExerciseData, icons: ExerciseIcons\n}) => {\n const defaultHeaderLocation = { desktop: true, mobile: false };\n const items = [];\n const isMultipleChoice = exercise.questions.every((q) => q.answers.length > 0);\n let typeExplanation;\n\n if (isMultipleChoice && exercise.questions.find((q) => q.formats.includes('free-response'))) {\n typeExplanation = TypeExplanations['two-step'];\n } else if (isMultipleChoice) {\n typeExplanation = TypeExplanations['multiple-choice'];\n }\n\n if (icons.topic) {\n items.push(\n \n \n \n );\n }\n\n if (icons.errata) {\n items.push(\n \n \n \n )\n }\n\n if (icons.info && typeExplanation) {\n items.push(\n \n \n \n )\n }\n\n return (\n \n {items}\n \n );\n};\n","import React from 'react';\nimport scrollToElement from 'scroll-to-element';\nimport styled, { createGlobalStyle, css } from 'styled-components';\nimport { Answer, ExerciseData, ID, QuestionState, StepBase, StepWithData } from '../../src/types';\nimport { InnerStepCard, OuterStepCard, TaskStepCard, TaskStepCardProps } from './Card';\nimport { Content } from './Content';\nimport { ExerciseQuestion } from './ExerciseQuestion';\nimport { typesetMath } from '../helpers/mathjax';\nimport { ExerciseToolbar, StyledToolbar } from './ExerciseToolbar';\nimport { breakpoints } from '../theme';\nimport { ExerciseHeaderIcons } from './ExerciseHeaderIcons';\nimport { TypesetMathContext } from '../hooks/useTypesetMath';\n\nconst StyledTaskStepCard = styled(TaskStepCard)`\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n`;\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nconst ToolbarWrapper = styled.div<{\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n}>`\n ${props => props.desktopToolbarEnabled && css`\n ${breakpoints.desktop`\n ${StyledTaskStepCard} {\n margin-left: 6.8rem;\n }\n `}\n ${breakpoints.tablet`\n ${StyledTaskStepCard} {\n margin-left: 4.8rem;\n }\n `}\n ${breakpoints.mobile`\n ${StyledTaskStepCard} {\n margin-left: 0;\n }\n `}\n `}\n\n ${props => props.mobileToolbarEnabled && css`\n ${breakpoints.mobile`\n ${StyledToolbar} + ${OuterStepCard} ${InnerStepCard} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n `}\n `}\n`;\n\nconst TaskStepCardWithToolbar = (props: React.PropsWithChildren &\n Pick & {\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n }\n) => \n \n \n ;\n\nconst Preamble = ({ exercise }: { exercise: ExerciseData }) => {\n return (\n <>\n {exercise.context &&\n }\n\n {exercise.stimulus_html &&\n }\n \n );\n};\n\ninterface ExerciseIconLocation {\n desktop: boolean;\n mobile: boolean;\n}\n\ninterface ExerciseIcon {\n location?: {\n /**\n * @default {\n * desktop: true,\n * mobile: false\n * }\n **/\n header?: ExerciseIconLocation;\n /**\n * @default {\n * desktop: false,\n * mobile: true\n * }\n **/\n toolbar?: ExerciseIconLocation;\n }\n}\n\nexport interface ExerciseIcons {\n /** An object containing a URL for the errata form for this exercise and settings for rendering the icon. */\n errata?: ExerciseIcon & { url: string };\n /** An object containing a URL for textbook content relevant to the exercise and settings for rendering the icon. */\n topic?: ExerciseIcon & { url: string };\n /** An object of settings for rendering the info icon that describes the exercise type (multiple-choice, two-step, etc.) */\n info?: ExerciseIcon;\n}\n\nexport interface ExerciseBaseProps {\n /** An object containing a Step ID and Exercise UID */\n step: StepBase;\n /** An exercise object from the Exercises API */\n exercise: ExerciseData;\n numberOfQuestions: number;\n /** The current question index. For multipart questions this is the first question number. */\n questionNumber: number;\n /** A boolean that enables showing the amount of attempts remaining. */\n hasMultipleAttempts: boolean;\n /** A callback with the question_id when the Submit/Re-submit button is clicked. */\n onAnswerSave: (question_id: number) => void;\n /** A callback with the current question index when the Next/Continue button is clicked. */\n onNextStep: (currentIndex: number) => void;\n /** A boolean that enables always showing every answer feedback_html field. */\n show_all_feedback?: boolean;\n /** The question number to scroll into view when the component renders. */\n scrollToQuestion?: number;\n /** An object containing data for how to render the following icons:\n * - An errata icon linking to the errata/feedback form\n * - An info icon describing the exercise type (multiple-choice, two-step, etc.)\n * - A topic icon linking to the relevant textbook location\n */\n exerciseIcons?: ExerciseIcons;\n hasFeedback?: boolean;\n}\n\nexport interface ExerciseWithStepDataProps extends ExerciseBaseProps {\n /** A Tutor Step object */\n step: StepWithData;\n canAnswer: boolean;\n needsSaved: boolean;\n apiIsPending: boolean;\n onAnswerChange: (answer: Answer) => void;\n canUpdateCurrentStep: boolean;\n answer_id_order?: ID[];\n}\n\nexport interface ExerciseWithQuestionStatesProps extends ExerciseBaseProps {\n questionStates: { [key: ID]: QuestionState };\n /** A callback with the IDs of the answer and question */\n onAnswerChange: (answer: Omit & { id: number, question_id: number }) => void;\n}\n\nexport const Exercise = styled(({\n numberOfQuestions, questionNumber, step, exercise, show_all_feedback, scrollToQuestion, exerciseIcons, ...props\n}: { className?: string } & (ExerciseWithStepDataProps | ExerciseWithQuestionStatesProps)) => {\n const legacyStepRender = 'feedback_html' in step;\n const questionsRef = React.useRef>([]);\n const container = React.useRef(null);\n\n const typesetExercise = React.useCallback(() => {\n if (container.current) {\n typesetMath(container.current);\n }\n }, []);\n\n React.useEffect(() => {\n const el = scrollToQuestion && questionsRef.current[scrollToQuestion];\n if (el) {\n scrollToElement(el);\n }\n }, [scrollToQuestion, exercise]);\n\n const desktopToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.desktop);\n const mobileToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.mobile);\n\n return \n \n : null}\n showTotalQuestions={legacyStepRender}\n desktopToolbarEnabled={desktopToolbarEnabled}\n mobileToolbarEnabled={mobileToolbarEnabled}\n {...(exerciseIcons ? { exerciseIcons: exerciseIcons } : null)}\n className={props.className}\n >\n
\n \n\n {exercise.questions.map((q, i) => {\n const state = { ...(legacyStepRender ? step : props['questionStates'][q.id]) };\n return (\n questionsRef.current[questionNumber + i] = el}\n exercise_uid={exercise.uid}\n key={q.id}\n question={q}\n questionNumber={questionNumber + i}\n choicesEnabled={state.canAnswer}\n displaySolution={true}\n detailedSolution={state.solution?.content_html}\n show_all_feedback={show_all_feedback}\n tableFeedbackEnabled={show_all_feedback && !legacyStepRender}\n canUpdateCurrentStep={\n // misleading prop name, we want to show a continue button for completed questions\n // that aren't the last question, which requires this prop to be true\n 'canUpdateCurrentStep' in props ?\n props.canUpdateCurrentStep : !(i + 1 === exercise.questions.length)\n }\n />\n )\n }\n )}\n
\n \n
;\n})`\n`;\n","const SvgComponent = () => (\n \n \n \n);\nexport default SvgComponent;\n","import styled, { css } from 'styled-components';\nimport { colors, breakpoints } from '../theme';\nimport FlagIcon from '../assets/flag';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';\nimport { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';\n\nconst ProgressBarWrapper = styled.nav`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ${breakpoints.mobile`\n padding: 1.6rem 0.8rem;\n `}\n`;\n\nconst StyledItemWrapper = styled.span`\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n`;\n\nconst handleVariant = (variant: ProgressBarItemVariant) => {\n switch (variant) {\n case 'isStatus':\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n case 'isCorrect':\n return css`\n color: ${colors.answer.correct};\n background-color: #E8F4D8;\n `;\n case 'isIncorrect':\n return css`\n color: ${colors.answer.incorrect};\n background-color: #F8E8EA;\n `;\n default:\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n }\n};\n\nconst shadowCss = 'box-shadow: 0px 1px 4px 0px #00000066;';\n\nexport const StyledItem = styled.button<{ variant: ProgressBarItemVariant, isActive: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: ${props => props.isActive ? '4rem' : '3.2rem'};\n height: ${props => props.isActive ? '4rem' : '3.2rem'};\n border: 0;\n border-radius: 50%;\n margin: ${props => props.isActive ? '0' : '0 0.3rem'};\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ${colors.palette.neutralDarker};\n ${props => props.isActive ? css`\n ${shadowCss}\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n ` : null}\n ${props => handleVariant(props.variant)}\n &:hover {\n ${shadowCss}\n }\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n background: ${props => props.color};\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n`;\n\nconst ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {\n if (!variant || variant !== 'isCorrect' && variant !== 'isIncorrect') {\n return null;\n }\n\n const variantData = {\n isCorrect: {\n icon: faCheck,\n color: colors.answer.correct,\n label: 'Correct',\n },\n isIncorrect: {\n icon: faXmark,\n color: colors.answer.incorrect,\n label: 'Incorrect',\n },\n }[variant];\n\n return ;\n}\n\nexport interface ProgressBarProps {\n steps: S[];\n activeIndex: number | null;\n goToStep: (index: number, step: S) => void;\n}\n\nexport interface ProgressBarItemProps {\n index: number;\n isActive: boolean;\n step: S;\n goToStep: (index: number, step: S) => void;\n}\n\nexport type ProgressBarItemVariant = 'isCorrect' | 'isIncorrect' | 'isStatus' | null;\n\nexport const ProgressBarItem = ({index, isActive, step, goToStep}: ProgressBarItemProps) =>\n \n goToStep(index, step)}\n aria-current={isActive ? 'location' : 'false'}\n aria-label={step.variant === 'isStatus' ? 'Assignment status' : `Question ${index + 1}` }\n >\n {step.variant === 'isStatus' ? : index + 1}\n \n \n ;\n\nexport const ProgressBar = ({ steps, activeIndex, goToStep }: ProgressBarProps) =>\n \n {steps.map((step, index) => )}\n ;\n","import { BulletList } from \"react-content-loader\";\nimport { colors } from \"../../src/theme\";\nimport styled from \"styled-components\";\n\nconst Wrapper = styled.div`\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n`;\n\nexport const Loader = () => ;\n"],"names":["ALPHABET","isAnswerIncorrect","answer","incorrectAnswerId","id","countWords","text","words","trim","match","length","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","TypesetMathContext","React","createContext","Error","Content","_ref","html","component","_ref$block","block","props","_objectWithoutPropertiesLoose","_excluded","typesetMath","useContext","useEffect","undefined","cloneElement","_extends","_jsx","dangerouslySetInnerHTML","__html","SimpleFeedback","children","contentRenderer","className","classnames","Feedback","wrapperClasses","position","_jsxs","palette","red","danger","darkRed","lightRed","green","lightGreen","darkGreen","paleYellow","teal","blue","mediumBlue","lightBlue","neutralLightBlue","tangerine","gray","darkGray","pale","light","white","neutralLightest","neutralCool","neutralBright","neutralLighter","neutralLight","neutralMedium","neutral","neutralThin","neutralDark","neutralFeedback","neutralDarker","black","orange","colors","hover","checked","correct","incorrect","popover","arrowOuterColor","borderColor","card","header","background","body","button","backgroundHover","backgroundActive","freeResponse","color","breakpoints","css","_taggedTemplateLiteralLoose","BREAKPOINTS","apply","slice","call","arguments","desktop","mixins","answerColor","invertBubble","answerChecked","answerCorrect","answerIncorrect","answerHover","answerCorrectAnswer","resetText","stepCardPadding","visuallyHidden","StyledAnswerIndicator","styled","div","state","AnswerIndicator","isCorrect","isIncorrect","AnswerAnswer","_props$answer","content_html","feedback_html","show_all_feedback","tableFeedbackEnabled","TeacherReview","answered_count","iter","percent","selected_count","Math","round","cn","AnswerChoice","onChangeAnswer","type","disabled","onKeyPress","qid","feedbackId","isSelected","ariaLabel","hasCorrectAnswer","_Fragment","correctIncorrectIcon","name","onChange","htmlFor","AnswerBody","Answer","answerId","correctAnswerId","isChecked","isAnswerChecked","correctness","isAnswerCorrect","classes","displayName","AnswersTable","idCounter","question","_props$type","correct_answer_id","correct_answer_feedback_html","_props$show_all_feedb","answerIdOrder","instructions","hideAnswers","idOrder","feedback","questionAnswerProps","answer_id","choicesEnabled","answersHtml","answers","sort","a","b","indexOf","map","i","additionalProps","question_id","parseInt","key","answerProps","Object","assign","push","index","forEach","item","spliceIndex","splice","role","InnerStepCard","OuterStepCard","StepCardHeader","StepCardQuestion","StepCard","questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren","otherProps","TaskStepCard","_ref2","step","_excluded2","task","uid","StyledButton","Button","isWaiting","waitingText","GlobalStyle","createGlobalStyle","CompletionStatusCard","CompletionHeader","h2","CompletionStatus","numberCompleted","handleClick","allCompleted","someCompleted","buttonText","split","toLowerCase","onClick","StyledQuestion","Question","forwardRef","ref","exerciseUid","solution","exercise_uid","context","hidePreambles","stem_html","_question$collaborato","collaborator_solutions","formats","stimulus_html","is_deleted","_question$collaborato2","displaySolution","find","s","hasSolution","join","QuestionHtml","hidden","displayFormats","FormatsListing","_props$html","_ref$formats","format","StepCardFooter","TextAreaErrorStyle","StyledFreeResponse","SyledQuestionStem","InfoRow","hasChildren","FreeResponseTextArea","textarea","isOverWordLimit","readOnly","RevertButton","FreeResponseInput","cancelHandler","defaultValue","infoRowChildren","isSubmitDisabled","saveHandler","submitBtnLabel","textHasChanged","wordLimit","questionProps","placeholder","AttemptsRemaining","count","PublishedComments","published_comments","SaveButton","willContinue","attempt_number","NextButton","canUpdateCurrentStep","FreeResponseReview","_ref3","free_response","ExerciseQuestion","answer_id_order","onAnswerChange","is_completed","hasMultipleAttempts","attempts_remaining","detailedSolution","canAnswer","needsSaved","apiIsPending","onAnswerSave","onNextStep","available_points","hasFeedback","_React$useState","useState","shouldContinue","setShouldContinue","MATHJAX_CONFIG","extensions","showProcessingMessages","skipStartupTypeset","styles","left","right","visibility","tex2jax","displayMath","inlineMath","findUnprocessedMath","root","processedMath","Array","from","querySelectorAll","findProcessedMath","filter","node","findLatexNodes","latexNodes","_i","_Array$from","formula","getAttribute","classList","contains","textContent","tagName","add","resolveOrWait","resolve","remainingTries","setTimeout","typesetDocumentPromise","windowImpl","Promise","MathJax","Hub","Queue","isEmpty","Typeset","_step","result","_iterator","_createForOfIteratorHelperLoose","done","value","markLatexNodesRendered","typesetLatexNodes","mathMLNodes","typesetMathMLNodes","typesetDocument","getTypesetDocument","memoize","debounce","leading","trailing","bind","cache","WeakMap","startMathJax","once","window","configuredCallback","HTML","Cookie","prefix","Configured","Register","StartupHook","document","getElementById","script","createElement","src","async","head","appendChild","Config","processSectionDelay","AuthorInit","StyledToolbar","mobile","ExerciseToolbar","_icons$topic","_icons$errata","icons","settings","values","some","_location$toolbar$mob","_location$toolbar","location","toolbar","_location$toolbar$des","_location$toolbar2","topicUrl","topic","url","errataUrl","errata","href","target","FontAwesomeIcon","icon","faBookOpen","faTriangleExclamation","ItemWrapper","InnerWrapper","Popover","PopoverItem","wrapperProps","PopoverItemsWrapper","StyledFontAwesomeIcon","ExerciseHeaderIcons","typeExplanation","_icons$topic$location","_icons$errata$locatio","_icons$info$location","exercise","defaultHeaderLocation","items","isMultipleChoice","questions","every","q","includes","as","info","faCircleInfo","height","width","StyledTaskStepCard","ToolbarWrapper","desktopToolbarEnabled","mobileToolbarEnabled","TaskStepCardWithToolbar","exerciseIcons","Preamble","Exercise","scrollToQuestion","legacyStepRender","questionsRef","useRef","container","typesetExercise","useCallback","current","then","querySelector","MATH_DATA_SELECTOR","console","warn","e","reject","el","scrollToElement","_ref4","Provider","_state$solution","_createElement","SvgComponent","viewBox","fill","xmlns","d","ProgressBarWrapper","nav","StyledItemWrapper","span","shadowCss","StyledItem","isActive","variant","handleVariant","ItemIcon","variantData","faCheck","label","faXmark","ProgressBarItem","goToStep","FlagIcon","ProgressBar","activeIndex","steps","Wrapper","Loader","BulletList","uniqueKey"],"mappings":"o7CAEaA,EAAW,6BAeXC,EAAoB,SAACC,EAAgBC,GAAsB,OAEtED,EAAOE,KAAOD,YAKAE,EAAWC,GACzB,IAEMC,EAFcD,EAAKE,OAECC,MAAM,qBAChC,OAAIF,EACGA,EAAMG,OADM,EAIR,IChCbC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,ICEaC,EAAqBC,EAAMC,cAA0B,WAAQ,MAAM,IAAIC,MAAM,4DCa7EC,EAAW,SAAJC,GAEhB,IADDC,EAAID,EAAJC,KAAMC,EAASF,EAATE,UAASC,EAAAH,EAAEI,MAAAA,OAAQ,IAAHD,GAAQA,EAAKE,EAAKC,EAAAN,EAAAO,GAEnCC,EDf4BZ,EAAMa,WAAWd,GCqBnD,OAJAC,EAAMc,UAAU,WACdF,KACC,CAACA,EAAaP,SAECU,IAAdT,EACKN,EAAMgB,aAAaV,EAASW,EAAA,CAAGZ,KAAAA,GAASI,IAGxCS,EADLV,EACK,MAEA,OAFAS,EAAKE,CAAAA,wBAAyB,CAAEC,OAAQf,IAAYI,cCjBzDY,EAAiB,SAACZ,UACtBS,EAAA,QAAA,CAAAI,SACEJ,EAACf,EAAO,CACNG,UAAWG,EAAMc,gBACjBC,UAAWC,EAAW,4BAA6B,WAAYhB,EAAMe,WACrEnB,KAAMI,EAAMa,SACZd,OAAO,OAIPkB,EAAW,SAAHtB,GAAuC,IAAjCzB,EAAEyB,EAAFzB,GAAO8B,EAAKC,EAAAN,EAAAO,GAExBgB,EAAiBF,E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QAAQkB,OAYxB8b,GAAS,WAAM,OAAA5d,EAAC2d,GAAQ,CAAAvd,SAAAJ,EAAC6d,EAAW,CAAAC,UAAU"} \ No newline at end of file diff --git a/dist/index.umd.js b/dist/index.umd.js new file mode 100644 index 0000000..e30b96c --- /dev/null +++ b/dist/index.umd.js @@ -0,0 +1,2 @@ +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("react/jsx-runtime"),require("classnames"),require("react"),require("styled-components"),require("scroll-to-element"),require("lodash"),require("lodash/fp.js"),require("weak-map"),require("@fortawesome/react-fontawesome"),require("@fortawesome/free-solid-svg-icons"),require("@fortawesome/free-solid-svg-icons/faBookOpen"),require("@fortawesome/free-solid-svg-icons/faTriangleExclamation"),require("@fortawesome/free-solid-svg-icons/faCircleInfo"),require("@fortawesome/free-solid-svg-icons/faCheck"),require("@fortawesome/free-solid-svg-icons/faXmark"),require("react-content-loader")):"function"==typeof define&&define.amd?define(["exports","react/jsx-runtime","classnames","react","styled-components","scroll-to-element","lodash","lodash/fp.js","weak-map","@fortawesome/react-fontawesome","@fortawesome/free-solid-svg-icons","@fortawesome/free-solid-svg-icons/faBookOpen","@fortawesome/free-solid-svg-icons/faTriangleExclamation","@fortawesome/free-solid-svg-icons/faCircleInfo","@fortawesome/free-solid-svg-icons/faCheck","@fortawesome/free-solid-svg-icons/faXmark","react-content-loader"],n):n((e||self).assessmentComponents={},e.jsxRuntime,e.classnames,e.react,e.styledComponents,e.scrollToElement,e.lodash,e.fp_js,e.weakMap,e.reactFontawesome,e.freeSolidSvgIcons,e.faBookOpen,e.faTriangleExclamation,e.faCircleInfo,e.faCheck,e.faXmark,e.reactContentLoader)}(this,function(e,n,t,r,a,o,i,s,l,c,d,u,p,f,m,h,x){function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var g=/*#__PURE__*/b(t),w=/*#__PURE__*/b(r),v=/*#__PURE__*/b(a),y=/*#__PURE__*/b(o),j=/*#__PURE__*/b(l);function k(){return k=Object.assign?Object.assign.bind():function(e){for(var n=1;n=0||(a[t]=e[t]);return a}function _(e,n){return n||(n=e.slice(0)),e.raw=n,e}function N(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t .content {\n padding: "," ",";\n }\n "])),fe.resetText(),ae,X.popover.borderColor,X.palette.white,"325px",te,$,X.palette.neutralThin,ne,te,re,te,ne,te,ne,X.popover.borderColor,ae,X.palette.white,re,ae,re,"1rem","0.8rem")},visuallyHidden:function(){return a.css(Q||(Q=_(["\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n "])))}},me=v.default.div(J||(J=_(["\n color: ",";\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n"])),function(e){return e.state?X.answer.correct:X.answer.incorrect}),he=function(e){var t=e.isCorrect,r=e.isIncorrect;if(!t&&!r)return null;var a=t||!1===r;return n.jsxs(me,{state:a,children:[a?"Correct":"Incorrect"," Answer"]})},xe=function(e){var t=e.answer,r=t.content_html,a=t.feedback_html,o=e.contentRenderer,i=e.show_all_feedback,s=e.tableFeedbackEnabled;return n.jsxs("div",{className:"answer-answer",children:[n.jsx(he,{isCorrect:e.isCorrect,isIncorrect:e.isIncorrect}),n.jsx(U,{className:"answer-content",component:o,html:r}),i&&a&&!s&&n.jsx(Z,{contentRenderer:o,children:a},"question-mc-feedback")]})},be=function(e){var t=e.answer,r=e.answered_count,a=e.isCorrect,o=e.contentRenderer,i=e.iter,s=e.show_all_feedback,l=e.tableFeedbackEnabled,c=t.selected_count&&r?Math.round(t.selected_count/r*100):0;return n.jsxs("div",{className:"review-wrapper",children:[n.jsxs("div",{className:g.default("review-count",{green:a,red:!a}),children:[n.jsx("span",{className:"selected-count","data-percent":""+c,children:t.selected_count}),n.jsx("span",{className:g.default("letter",{green:a,red:!a}),children:q[i]})]}),n.jsx(xe,{answer:t,contentRenderer:o,show_all_feedback:s,tableFeedbackEnabled:l})]})},ge=function(e){var t,r=e.type,a=e.iter,o=e.answer,i=e.disabled,s=e.onKeyPress,l=e.qid,c=e.contentRenderer,d=e.feedbackId,u=e.isSelected,p=e.isCorrect,f=e.isIncorrect,m=e.show_all_feedback,h=e.tableFeedbackEnabled,x=(u?"Selected ":"")+"Choice "+q[a]+":";return e.hasCorrectAnswer||"teacher-review"===r||"teacher-preview"===r||"student-mpp"===r||(t=e.onChangeAnswer),n.jsxs(n.Fragment,{children:["teacher-preview"===r&&n.jsx("div",{className:"correct-incorrect",children:p&&e.correctIncorrectIcon}),n.jsx("input",{type:"radio",className:"answer-input-box",checked:u,id:l+"-option-"+a,name:l+"-options",onChange:function(){return t&&t(o)},disabled:i||!t,"aria-details":d}),n.jsxs("label",{onKeyPress:s,htmlFor:l+"-option-"+a,className:"answer-label",children:[n.jsx("span",{className:"answer-letter-wrapper","aria-label":x,"data-answer-choice":q[a],"data-test-id":"answer-choice-"+q[a]}),n.jsx(xe,{answer:o,contentRenderer:c,show_all_feedback:m,tableFeedbackEnabled:h,isCorrect:p,isIncorrect:f})]})]})},we=function(e){return n.jsx("teacher-review"===e.type?be:ge,k({},e))},ve=function(e){var t=e.type,r=e.answer,a=e.disabled,o=e.answerId,i=e.correctAnswerId,s=e.incorrectAnswerId,l=function(e,n){return e.id==n}(r,o),c=function(e,n){if(!e.id&&!n)return e.isCorrect;var t=e.id===n;return null!=e.correctness&&(t="1.0"===e.correctness),t}(r,i),d=S(r,s),u=l||void 0===o&&(!s&&c||d),p=g.default("answers-answer",{disabled:a,"answer-selected":u,"answer-correct":c&&"student-mpp"!==t,"answer-incorrect":s&&S(r,s)});return n.jsx("div",{className:"openstax-answer",children:n.jsx("section",{className:p,children:n.jsx(we,k({},e,{isCorrect:c,isSelected:u,isIncorrect:d}))})})};ve.displayName="OSAnswer";var ye,je,ke,Ce,_e,Ne,qe,Se,Ae,Ie,Te,Ee,Me=function(e){var t=0,r=e.question,a=e.type,o=e.correct_answer_id,i=e.incorrectAnswerId,s=e.feedback_html,l=e.correct_answer_feedback_html,c=e.show_all_feedback,d=void 0!==c&&c,u=e.tableFeedbackEnabled,p=e.answerIdOrder,f=e.instructions;if(e.hideAnswers)return null;var m,h=[],x={qid:r.id||"auto-"+t++,answerId:e.answer_id,correctAnswerId:o,incorrectAnswerId:i,hasCorrectAnswer:e.hasCorrectAnswer,onChangeAnswer:e.onChangeAnswer,type:void 0===a?"student":a,answered_count:e.answered_count,disabled:!e.choicesEnabled,show_all_feedback:d,tableFeedbackEnabled:u,onKeyPress:e.onKeyPress},b=(p?(m=p,r.answers.slice().sort(function(e,n){return m.indexOf(e.id)-m.indexOf(n.id)})):r.answers).map(function(e,t){var a,c,p={answer:k({},e,{question_id:"string"==typeof r.id?parseInt(r.id,10):r.id}),iter:t,key:x.qid+"-option-"+t},f=Object.assign({},p,x);return d&&e.feedback_html&&u?a=e.feedback_html:e.id===i&&s?a=s:e.id===o&&l&&(a=l),a&&h.push({index:t,html:a,id:c="feedback-"+x.qid+"-"+t}),n.jsx(ve,k({feedbackId:c},f))});return h.forEach(function(t,r){var a=t.index+r+1;b.splice(a,0,n.jsx(G,{id:t.id,contentRenderer:e.contentRenderer,children:t.html},a))}),n.jsxs("div",{role:"radiogroup","aria-label":"Answer choices",className:"answers-table",children:[f,b]})},Oe=["questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","className","children","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren"],He=["step","questionNumber","numberOfQuestions","children","className"],Fe=v.default.div(ye||(ye=_(["\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ",";\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ","\n"])),X.palette.light,ce(je||(je=_(["\n max-width: 1000px;\n "])))),Pe=v.default.div(ke||(ke=_(["\n padding: ",";\n\n ","\n"])),oe,se(Ce||(Ce=_(["\n padding: 0;\n "])))),ze=v.default.div(_e||(_e=_(["\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ",";\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ",";\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ","\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ","\n\n ","\n"])),X.card.header.background,X.palette.gray,ce(Ne||(Ne=_(["\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n "]))),le(qe||(qe=_(["\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n button.ox-icon-angle-right {\n margin-left: ",";\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n "])),ue,ue),se(Se||(Se=_(["\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n button.ox-icon-angle-left {\n margin-right: ",";\n }\n "])),de,de));ze.displayName="StepCardHeader";var Be=v.default.div(Ae||(Ae=_(["\n .step-card-body {\n ","\n overflow: auto;\n background: ",";\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ","\n\n .reading-step & {\n padding: 0;\n }\n\n ","\n\n ","\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n"])),fe.stepCardPadding(),X.card.body.background,function(){return a.css(M||(M=_(["@media(max-width: ","px) { "," }"])),ie,a.css.apply(void 0,[].slice.call(arguments)))}(Ie||(Ie=_(["\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n "]))),ce(Te||(Te=_(["\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n "]))),se(Ee||(Ee=_(["\n .openstax-exercise-badges svg {\n margin-right: ",";\n }\n "])),de)),Le=function(e){var t=e.questionNumber,r=e.numberOfQuestions,a=e.showTotalQuestions,o=e.stepType,i=e.isHomework,s=e.availablePoints,l=e.unpadded,c=e.className,d=e.children,u=e.questionId,p=e.multipartBadge,f=e.leftHeaderChildren,m=e.rightHeaderChildren,h=e.headerTitleChildren,x=C(e,Oe);return n.jsxs(Pe,k({},x,{children:[p,n.jsxs(Fe,{className:c,children:[t&&i&&"exercise"===o&&n.jsxs(ze,{children:[n.jsxs("div",{children:[f,n.jsxs("h2",{className:"question-info",children:[h,n.jsx("span",{children:r>1?"Questions "+t+" - "+(t+r-1):"Question "+t}),a?n.jsxs("span",{className:"num-questions",children:[" / ",r]}):null,n.jsx("span",{className:"separator",children:"|"}),n.jsxs("span",{className:"question-id",children:["ID: ",u]})]})]}),s||m?n.jsxs("div",{children:[s&&n.jsxs("div",{className:"points",children:[s," Points"]}),m]}):null]}),n.jsx(Be,{unpadded:l,children:d})]})]}))};Le.displayName="OSStepCard";var Re=function(e){var t=e.step,r=e.questionNumber,a=e.numberOfQuestions,o=e.children,i=e.className,s=C(e,He);return n.jsx(Le,k({},s,{unpadded:!0,questionNumber:r,numberOfQuestions:a,stepType:"type"in t?t.type:"exercise",isHomework:!("task"in t)||void 0===t.task||"homework"===t.task.type,"data-task-step-id":t.id,className:g.default(("type"in t?t.type:"exercise")+"-step",i),questionId:t.uid,children:o}))};Re.displayName="OSTaskStepCard";var Qe,Je,Ve,De,Ue,We,Ze,Ge,Ke,Xe,Ye,$e,en,nn,tn,rn=["disabled","isWaiting","waitingText","children"],an=v.default.button(Qe||(Qe=_(["\n background-color: ",";\n color: ",";\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ","\n }\n &:active {\n background: ","\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n"])),X.button.background,X.palette.white,X.button.backgroundHover,X.button.backgroundActive),on=function(e){var t=e.disabled,r=e.isWaiting,a=e.waitingText,o=e.children,i=C(e,rn);return n.jsx(an,k({},i,{disabled:r||t,children:r&&a||o}))},sn=a.createGlobalStyle(Je||(Je=_(["\n :root {\n --content-text-scale: 1;\n }\n"]))),ln=v.default(Fe)(Ve||(Ve=_(["\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n"]))),cn=v.default.h2(De||(De=_(["\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n"]))),dn=v.default(function(e){var t=e.numberOfQuestions,r=e.numberCompleted,a=e.handleClick,o=e.className,i=t===r,s=r>0,l=i?"Next":s?"Continue":"Start";return n.jsxs(n.Fragment,{children:[n.jsx(sn,{}),n.jsxs(ln,{className:o,children:[n.jsx(cn,{children:i?"You are done.":s?"Quiz is partially complete.":"No questions have been answered."}),n.jsx("p",{children:i?"Great job answering all the questions.":s?"You've completed "+r+" of "+t+" questions.":"Begin working on the quiz."}),n.jsx(on,{"data-test-id":l.split(" ")[0].toLowerCase()+"-btn",onClick:function(){return a()},children:l})]})]})})(Ue||(Ue=_([""]))),un=v.default.div(We||(We=_(["\n&.step-card-body {\n ",";\n}\n\n&.openstax-question {\n border-top: 1px solid ",";\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ",";\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ",";\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: "," ",";\n margin: "," 0 "," ",";\n border-left: "," solid ",";\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ",";\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ",";\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ",";\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: "," 0 0 0;\n margin: 0;\n transition: color ",";\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ","\n }\n }\n\n .answer-input-box {\n ","\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ",";\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ",";\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ",";\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ",";\n }\n }\n\n &.answer-correct {\n .answer-label {\n ",";\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ","\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ","\n }\n &.answer-selected.answer-incorrect {\n ","\n }\n }\n }\n\n .question-feedback {\n ","\n max-width: ",";\n .question-feedback-content {\n padding: "," ",";\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n"])),fe.stepCardPadding(),X.palette.pale,X.palette.neutral,X.palette.neutralLightBlue,$,"2.5rem",Y,$,Y,$,X.palette.neutralLighter,X.palette.neutralLightest,fe.answer(),$,Y,pe,fe.answerHover(),fe.visuallyHidden(),fe.answerChecked(),X.answer.checked,fe.answerChecked(),fe.answerIncorrect(),fe.answerCorrect(!0),fe.answerCorrectAnswer(),fe.answerIncorrect(),fe.answerIncorrect(!0),fe.popover(),"370px","0.9rem","1.1rem"),pn=w.default.forwardRef(function(e,t){var r,a,o=e.question,i=e.exercise_uid,s=e.questionNumber,l=e.context,c=e.task,d=e.hidePreambles,u=o.stem_html,p=o.collaborator_solutions,f=void 0===p?[]:p,m=o.formats,h=o.stimulus_html,x=!!e.correct_answer_id,b=g.default("openstax-question",e.className,{"has-correct-answer":x&&!((null!=c?c.is_deleted:void 0)&&"homework"===(null!=c?c.type:void 0)),"has-incorrect-answer":!!e.incorrectAnswerId});return null!=i&&(r=n.jsx("div",{className:"exercise-uid",children:i})),function(){var n=o.collaborator_solutions,t=void 0===n?[]:n;return e.displaySolution&&t&&t.find(function(e){return void 0!==e.content_html})}()&&(a=n.jsxs("div",{className:"detailed-solution",children:[n.jsx("div",{className:"header",children:"Detailed solution:"}),n.jsx(U,{className:"solution",block:!0,html:f.map(function(e){return e.content_html}).join("")})]})),n.jsxs(un,{ref:t,className:b,"data-question-number":s,"data-test-id":"question",children:[n.jsx(fn,{type:"context",html:l,hidden:d}),n.jsx(fn,{type:"stimulus",html:h,hidden:d}),n.jsx(fn,{type:"stem",html:u,hidden:d,questionNumber:s}),e.children,n.jsx(Me,k({},e,{onChangeAnswer:e.onChange,hasCorrectAnswer:x})),a,e.displayFormats?n.jsx(mn,{formats:m}):void 0,r]})}),fn=function(e){var t=e.html,r=void 0===t?"":t;return!0!==e.hidden&&r.length>0?n.jsx(U,{html:r,"data-question-number":e.questionNumber,className:"question-"+e.type,block:!0}):null},mn=function(e){var t=e.formats,r=void 0===t?[]:t;return n.jsxs("div",{className:"formats-listing",children:[n.jsx("div",{className:"header",children:"Formats:"}),r.map(function(e,t){return n.jsx("span",{children:e},t)})]})},hn=v.default.div(Ze||(Ze=_(["\n ","\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ",";\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ",";\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ","\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ","\n"])),fe.stepCardPadding(),X.card.body.background,X.palette.pale,se(Ge||(Ge=_(["\n flex-wrap: wrap;\n "]))),ce(Ke||(Ke=_(["\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n "])))),xn=a.css(Xe||(Xe=_(["\n background-color: #f5e9ea;\n"]))),bn=v.default.div(Ye||(Ye=_(["\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ","\n }\n"])),fe.stepCardPadding()),gn=v.default.div($e||($e=_(["\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n"]))),wn=v.default.div(en||(en=_(["\n margin: 8px 0;\n display: flex;\n justify-content: ",";\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ",";\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ",";\n"])),function(e){return e.hasChildren?"space-between":"flex-end"},X.palette.danger,X.palette.neutralThin),vn=v.default.textarea(nn||(nn=_(["\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ",";\n color: ",";\n ",";\n ","\n background-color: ",";\n"])),X.palette.neutral,X.palette.neutralDark,function(e){return e.isOverWordLimit&&xn},function(e){return e.isOverWordLimit&&a.css(tn||(tn=_(["\n border: 2px solid ",";\n "])),X.palette.danger)},function(e){return e.readOnly&&X.palette.neutralCool});vn.displayName="OSFreeResponseTextArea";var yn=function(e){return n.jsx(on,k({},e,{children:"Cancel"}))},jn=function(e){var t=e.availablePoints,r=e.cancelHandler,a=e.defaultValue,o=e.infoRowChildren,i=e.isSubmitDisabled,s=e.question,l=e.questionNumber,c=e.saveHandler,d=e.submitBtnLabel,u=e.textHasChanged,p=e.wordLimit,f=A(a)>p,m={};return l&&(m["data-question-number"]=l),n.jsxs(bn,{"data-test-id":"student-free-response",children:[n.jsxs("div",{className:"step-card-body",children:[n.jsx(gn,k({},m,{children:s.stem_html&&n.jsx(fn,{type:"stem",html:s.stem_html,hidden:!1})})),n.jsx(vn,k({},e,{isOverWordLimit:f,"data-test-id":"free-response-box",placeholder:"Enter your response...","aria-label":"question response text box"})),n.jsxs(wn,{hasChildren:!!o,children:[o,n.jsxs("div",{children:[n.jsxs("span",{children:[A(a)," words"]}),f&&n.jsxs("span",{className:"word-limit-error-info",children:["Maximum ",p," words"]})]})]})]}),n.jsxs(hn,{children:[t?n.jsx("div",{className:"points",role:"status",children:n.jsxs("strong",{children:["Points: ",t]})}):null,n.jsxs("div",{className:"controls",children:[n.jsx(yn,{disabled:!u,onClick:r}),n.jsx(on,{"data-test-id":"submit-answer-btn",disabled:i||f,onClick:c,children:d})]})]})]})};jn.displayName="OSFreeResponse";var kn=function(e){var t=e.count;return n.jsxs("div",{children:[t," attempt",1===t?"":"s"," left"]})},Cn=function(e){var t=e.published_comments;return t?n.jsxs("div",{children:[n.jsx("strong",{children:"Feedback:"})," ",t]}):null},_n=function(e){return n.jsx(on,k({},e,{waitingText:"Saving…",isWaiting:e.isWaiting,"data-test-id":"submit-answer-btn",children:e.willContinue?"Submit & continue":0==e.attempt_number?"Submit":"Re-submit"}))},Nn=function(e){return n.jsx(on,k({},e,{"data-test-id":"continue-btn",children:e.canUpdateCurrentStep?"Continue":"Next"}))},qn=function(e){var t=e.free_response;return t?n.jsx(n.Fragment,{children:n.jsx("div",{className:"free-response",children:t})}):null},Sn=w.default.forwardRef(function(e,t){var r=e.question,a=e.task,o=e.answer_id_order,i=e.onAnswerChange,s=e.feedback_html,l=e.correct_answer_feedback_html,c=e.is_completed,d=e.correct_answer_id,u=e.incorrectAnswerId,p=e.choicesEnabled,f=e.questionNumber,m=e.answer_id,h=e.hasMultipleAttempts,x=e.attempts_remaining,b=e.published_comments,g=e.detailedSolution,v=e.canAnswer,y=e.needsSaved,j=e.attempt_number,k=e.apiIsPending,C=e.onAnswerSave,_=e.onNextStep,N=e.canUpdateCurrentStep,q=e.displaySolution,S=e.available_points,A=e.free_response,I=e.show_all_feedback,T=e.tableFeedbackEnabled,E=e.hasFeedback,M=w.default.useState(!1),O=M[0],H=M[1];return w.default.useEffect(function(){O&&c&&(_(f-1),H(!1))},[_,f,O,c]),n.jsxs("div",{"data-test-id":"student-exercise-question",children:[n.jsx(pn,{ref:t,task:a,question:r,answerIdOrder:o,choicesEnabled:p,answer_id:m,questionNumber:f,onChange:i,feedback_html:s,correct_answer_feedback_html:l,correct_answer_id:c?d:null,incorrectAnswerId:u,className:"step-card-body",hideAnswers:!1,displayFormats:!1,displaySolution:q,show_all_feedback:I,tableFeedbackEnabled:T,children:n.jsx(qn,{free_response:A})}),n.jsx(hn,{className:"step-card-footer",children:n.jsxs("div",{className:"step-card-footer-inner",children:[n.jsxs("div",{className:"points",role:"status",children:[S?n.jsxs("strong",{children:["Points: ",S]}):null,n.jsx("span",{className:"attempts-left",children:h&&x>0&&n.jsx(kn,{count:x})}),n.jsx(Cn,{published_comments:b}),g&&n.jsxs("div",{children:[n.jsx("strong",{children:"Detailed solution:"})," ",n.jsx(U,{html:g})]})]}),n.jsx("div",{className:"controls",children:v&&y||O?n.jsx(_n,{disabled:k||!m||O,isWaiting:k||O,attempt_number:j,onClick:function(){var e;C("string"==typeof(e=r.id)?parseInt(e,10):e),E||H(!0)},willContinue:!E}):n.jsx(Nn,{onClick:function(){return _(f-1)},canUpdateCurrentStep:N})})]})})]})}),An="‌‌‌",In="​​​",Tn="math-marked",En={extensions:[],showProcessingMessages:!1,skipStartupTypeset:!0,styles:{"#MathJax_MSIE_Frame":{left:"",right:0,visibility:"hidden"},"#MathJax_Message":{left:"",right:0,visibility:"hidden"}},tex2jax:{displayMath:[[An,An]],inlineMath:[[In,In]]}},Mn=function(e){var n=function(e){return Array.from(e.querySelectorAll(".MathJax math"))}(e);return Array.from(e.querySelectorAll("math")).filter(function(e){return-1===n.indexOf(e)})},On=function(e){for(var n=[],t=0,r=Array.from(e.querySelectorAll("[data-math]:not(.math-rendered)"));t0&&(On(n).length||Mn(n).length)?setTimeout(function(){e(n,t,r-1)},200):t()},Fn=function(e,n){return new Promise(function(t){(function(e,n){var t=On(e);n.MathJax.Hub.Queue(function(e,n){return function(){s.isEmpty(e)||n.MathJax.Hub.Queue(function(){return n.MathJax.Hub.Typeset(e)},function(e){return function(){for(var n,t=[],r=function(e,n){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,n){if(e){if("string"==typeof e)return N(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?N(e,n):void 0}}(e))){t&&(e=t);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(n=r()).done;)t.push(n.value.className+=" math-rendered")}}(e))}}(t,n),function(e,n){return function(){var t=Mn(e);s.isEmpty(t)||n.MathJax.Hub.Queue(function(){return n.MathJax.Hub.Typeset(e)})}}(e,n))})(e,n),n.MathJax.Hub.Queue(function(){Hn(e,t)})})},Pn=s.memoize(function(e,n){return i.debounce(Fn,100,{leading:!0,trailing:!1}).bind(null,e,n)});Pn.cache=new j.default;var zn,Bn,Ln,Rn,Qn,Jn,Vn,Dn,Un,Wn,Zn,Gn,Kn,Xn,Yn,$n,et,nt,tt,rt,at,ot,it,st,lt,ct,dt,ut,pt,ft,mt,ht,xt,bt,gt,wt=i.once(function(e){return void 0===e&&(e=window),new Promise(function(n){var t=function(){e.MathJax.HTML.Cookie.prefix="mathjax",e.MathJax.Hub.Configured(),e.MathJax.Hub.Register.StartupHook("End",function(){n()})};if(!document.getElementById("MathJax-Script")){var r=document.createElement("script");r.src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured",r.id="MathJax-Script",r.async=!0,document.head.appendChild(r)}e.MathJax&&e.MathJax.Hub?(e.MathJax.Hub.Config(En),e.MathJax.Hub.processSectionDelay=0,t()):(En.AuthorInit=t,e.MathJax=En)})}),vt=v.default.div(zn||(zn=_(["\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ",";\n background: #fff;\n margin: "," 0 0 ",";\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ",";\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ",";\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ",";\n }\n\n span {\n display: block;\n }\n }\n }\n\n ","\n\n ","\n"])),X.palette.light,oe,oe,X.palette.neutral,X.palette.neutralDarker,X.palette.neutralDarker,function(e){return!e.desktop&&a.css(Bn||(Bn=_(["\n ","\n ","\n "])),ce(Ln||(Ln=_(["\n display: none;\n "]))),le(Rn||(Rn=_(["\n display: none;\n "]))))},function(e){return e.mobile&&se(Qn||(Qn=_(["\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ",";\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ",";\n }\n }\n "])),X.palette.neutral,X.palette.light)}),yt=function(e){var t,r,a=e.icons;if(!a)return null;var o=Object.values(a),i=o.some(function(e){var n,t,r=e.location;return null==(n=null==r||null==(t=r.toolbar)?void 0:t.mobile)||n}),s=o.some(function(e){var n,t,r=e.location;return null!=(n=null==r||null==(t=r.toolbar)?void 0:t.desktop)&&n}),l=null==(t=a.topic)?void 0:t.url,u=null==(r=a.errata)?void 0:r.url;return n.jsxs(vt,k({},{mobile:i,desktop:s},{children:[l?n.jsxs("a",{href:l,target:"_blank",children:[n.jsx(c.FontAwesomeIcon,{icon:d.faBookOpen}),n.jsx("span",{children:"View topic in textbook"})]}):null,u?n.jsxs("a",{href:u,target:"_blank",children:[n.jsx(c.FontAwesomeIcon,{icon:d.faTriangleExclamation}),n.jsx("span",{children:"Suggest a correction"})]}):null]}))},jt=v.default.div(Jn||(Jn=_(["\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ",";}\n .popover { display: flex; }\n }\n ","\n ","\n"])),X.palette.mediumBlue,function(e){return!e.desktop&&a.css(Vn||(Vn=_(["\n ","\n ","\n "])),ce(Dn||(Dn=_(["\n display: none;\n "]))),le(Un||(Un=_(["\n display: none;\n "]))))},function(e){return!e.mobile&&se(Wn||(Wn=_(["\n display: none;\n "])))}),kt=v.default.div(Zn||(Zn=_(["\n position: relative;\n display: flex;\n"]))),Ct=v.default.div(Gn||(Gn=_(["\n ","\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n"])),fe.popover),_t=function(e){return n.jsx(jt,k({},e.wrapperProps,{mobile:e.mobile,desktop:e.desktop,"aria-label":e.text,children:n.jsxs(kt,{children:[e.children,n.jsxs(Ct,{className:"popover right",children:[n.jsx("div",{className:"arrow"}),n.jsx("div",{className:"content",children:e.text})]})]})}))},Nt=v.default.div(Kn||(Kn=_(["\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n"]))),qt=v.default(c.FontAwesomeIcon)(Xn||(Xn=_(["\n color: ",";\n height: 1em;\n"])),X.palette.darkGray),St=function(e){var t,r,a,o,i=e.exercise,s=e.icons,l={desktop:!0,mobile:!1},c=[],d=i.questions.every(function(e){return e.answers.length>0});return d&&i.questions.find(function(e){return e.formats.includes("free-response")})?t="In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. Recalling the answer to a question from memory helps you to retain things longer.":d&&(t="Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts."),s.topic&&c.push(n.jsx(_t,k({text:"View topic in textbook",wrapperProps:{as:"a",href:s.topic.url,target:"_blank"}},(null==(r=s.topic.location)?void 0:r.header)||l,{children:n.jsx(qt,{icon:u.faBookOpen})}),"topic")),s.errata&&c.push(n.jsx(_t,k({text:"Suggest a correction",wrapperProps:{as:"a",href:s.errata.url,target:"_blank"}},(null==(a=s.errata.location)?void 0:a.header)||l,{children:n.jsx(qt,{icon:p.faTriangleExclamation})}),"errata")),s.info&&t&&c.push(n.jsx(_t,k({text:t},(null==(o=s.info.location)?void 0:o.header)||l,{children:n.jsx(qt,{icon:f.faCircleInfo,height:"16px",width:"16px"})}),"type")),n.jsx(Nt,{children:c})},At=["numberOfQuestions","questionNumber","step","exercise","show_all_feedback","scrollToQuestion","exerciseIcons"],It=v.default(Re)(Yn||(Yn=_(["\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n"]))),Tt=a.createGlobalStyle($n||($n=_(["\n :root {\n --content-text-scale: 1;\n }\n"]))),Et=v.default.div(et||(et=_(["\n ","\n\n ","\n"])),function(e){return e.desktopToolbarEnabled&&a.css(nt||(nt=_(["\n ","\n ","\n ","\n "])),ce(tt||(tt=_(["\n "," {\n margin-left: 6.8rem;\n }\n "])),It),le(rt||(rt=_(["\n "," {\n margin-left: 4.8rem;\n }\n "])),It),se(at||(at=_(["\n "," {\n margin-left: 0;\n }\n "])),It))},function(e){return e.mobileToolbarEnabled&&a.css(ot||(ot=_(["\n ","\n "])),se(it||(it=_(["\n "," + "," "," {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n "])),vt,Pe,Fe))}),Mt=function(e){return n.jsxs(Et,{desktopToolbarEnabled:e.desktopToolbarEnabled,mobileToolbarEnabled:e.mobileToolbarEnabled,children:[n.jsx(yt,{icons:e.exerciseIcons}),n.jsx(It,k({},e))]})},Ot=function(e){var t=e.exercise;return n.jsxs(n.Fragment,{children:[t.context&&n.jsx(U,{className:"step-card-body exercise-context",block:!0,html:t.context}),t.stimulus_html&&n.jsx(U,{className:"step-card-body exercise-stimulus",block:!0,html:t.stimulus_html})]})},Ht=v.default(function(e){var t=e.numberOfQuestions,a=e.questionNumber,o=e.step,i=e.exercise,s=e.show_all_feedback,l=e.scrollToQuestion,c=e.exerciseIcons,d=C(e,At),u="feedback_html"in o,p=w.default.useRef([]),f=w.default.useRef(null),m=w.default.useCallback(function(){f.current&&function(e,n){try{void 0===n&&(n=window),Promise.resolve(wt()).then(function(){return n&&n.MathJax&&n.MathJax.Hub?e.querySelector("[data-math]:not(.math-rendered), math:not(.math-rendered)")?Pn(e,n)():Promise.resolve():(console.warn("Warning: Expected MathJax to be initialized."),Promise.resolve())})}catch(e){return Promise.reject(e)}}(f.current)},[]);w.default.useEffect(function(){var e=l&&p.current[l];e&&y.default(e)},[l,i]);var h=Object.values(c||{}).some(function(e){var n,t=e.location;return null==t||null==(n=t.toolbar)?void 0:n.desktop}),x=Object.values(c||{}).some(function(e){var n,t=e.location;return null==t||null==(n=t.toolbar)?void 0:n.mobile});return n.jsxs(V.Provider,{value:m,children:[n.jsx(Tt,{}),n.jsx(Mt,k({step:o,questionNumber:a,numberOfQuestions:u?t:i.questions.length,rightHeaderChildren:c?n.jsx(St,{exercise:i,icons:c}):null,showTotalQuestions:u,desktopToolbarEnabled:h,mobileToolbarEnabled:x},c?{exerciseIcons:c}:null,{className:d.className,children:n.jsxs("div",{ref:f,children:[n.jsx(Ot,{exercise:i}),i.questions.map(function(e,n){var t,l=k({},u?o:d.questionStates[e.id]);return r.createElement(Sn,k({},d,k({},l,{available_points:void 0}),{ref:function(e){return p.current[a+n]=e},exercise_uid:i.uid,key:e.id,question:e,questionNumber:a+n,choicesEnabled:l.canAnswer,displaySolution:!0,detailedSolution:null==(t=l.solution)?void 0:t.content_html,show_all_feedback:s,tableFeedbackEnabled:s&&!u,canUpdateCurrentStep:"canUpdateCurrentStep"in d?d.canUpdateCurrentStep:!(n+1===i.questions.length)}))})]})}))]})})(st||(st=_(["\n"]))),Ft=function(){return n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M14.556 2.09149C15.2296 1.78355 16 2.26721 16 2.99824V10.5951C16 10.9241 15.8362 11.2328 15.5605 11.4188C14.4229 12.1864 13.2007 12.6956 11.6715 12.6956C9.53267 12.6956 8.12768 11.6087 6.42651 11.6087C4.81213 11.6087 3.69241 11.923 2.79365 12.3V15.25C2.79365 15.6642 2.45254 16 2.03175 16H1.52381C1.10302 16 0.761905 15.6642 0.761905 15.25V3.18577C0.301492 2.86952 0 2.34455 0 1.74999C0 0.75924 0.836349 -0.0391985 1.852 0.00148899C2.75575 0.0376765 3.49578 0.75049 3.55203 1.63912C3.56854 1.8998 3.52632 2.1488 3.43819 2.37543C4.09648 2.13699 4.80613 1.99999 5.59835 1.99999C7.73718 1.99999 9.14216 3.08696 10.8433 3.08696C12.1289 3.08696 13.4659 2.5899 14.556 2.09149ZM2.79365 4.20718V6.40999C3.71429 6.07656 4.41841 5.85281 5.13016 5.75656V3.51999C4.38413 3.5878 3.84635 3.82593 2.79365 4.20718ZM9.80317 4.49437C8.96454 4.34837 8.21949 4.05752 7.46667 3.82749V5.93437C8.23413 6.14393 8.9767 6.44824 9.80317 6.63156V4.49437ZM5.13016 5.75656V7.94531C6.1713 7.85224 6.84159 7.92546 7.46667 8.06406V5.93437C6.66517 5.71452 5.98791 5.6399 5.13016 5.75656ZM7.46667 10.2012C8.30279 10.3466 9.04546 10.6365 9.80317 10.8681V8.76156C9.03248 8.55074 8.29397 8.24749 7.46667 8.06406V10.2012ZM2.79365 10.6906C3.54349 10.4284 4.31079 10.2581 5.13016 10.1731V7.94531C4.30127 8.01874 3.62667 8.19656 2.79365 8.48781V10.6906ZM14.4762 3.76562C13.8 4.04218 12.9971 4.31687 12.1397 4.4678V6.71499C13.0067 6.57874 13.7279 6.27437 14.4762 5.96843V3.76562ZM14.4762 10.3269V8.12406C13.7717 8.56781 12.9276 8.83062 12.1397 8.93718V11.1741C12.9356 11.0997 13.679 10.8291 14.4762 10.3269ZM9.80317 6.63156V8.76156C10.6179 8.9845 11.283 9.05349 12.1397 8.93718V6.71499C11.3143 6.84584 10.5542 6.79862 9.80317 6.63156Z",fill:"currentColor"})})},Pt=v.default.nav(lt||(lt=_(["\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ","\n"])),se(ct||(ct=_(["\n padding: 1.6rem 0.8rem;\n "])))),zt=v.default.span(dt||(dt=_(["\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n"]))),Bt="box-shadow: 0px 1px 4px 0px #00000066;",Lt=v.default.button(ht||(ht=_(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: ",";\n height: ",";\n border: 0;\n border-radius: 50%;\n margin: ",";\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ",";\n ","\n ","\n &:hover {\n ","\n }\n"])),function(e){return e.isActive?"4rem":"3.2rem"},function(e){return e.isActive?"4rem":"3.2rem"},function(e){return e.isActive?"0":"0 0.3rem"},X.palette.neutralDarker,function(e){return e.isActive?a.css(xt||(xt=_(["\n ","\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n "])),Bt):null},function(e){return function(e){switch(e){case"isStatus":return a.css(ut||(ut=_(["\n background-color: ",";\n "])),X.palette.neutralBright);case"isCorrect":return a.css(pt||(pt=_(["\n color: ",";\n background-color: #E8F4D8;\n "])),X.answer.correct);case"isIncorrect":return a.css(ft||(ft=_(["\n color: ",";\n background-color: #F8E8EA;\n "])),X.answer.incorrect);default:return a.css(mt||(mt=_(["\n background-color: ",";\n "])),X.palette.neutralBright)}}(e.variant)},Bt),Rt=v.default(c.FontAwesomeIcon)(bt||(bt=_(["\n background: ",";\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n"])),function(e){return e.color}),Qt=function(e){var t=e.variant;if(!t||"isCorrect"!==t&&"isIncorrect"!==t)return null;var r={isCorrect:{icon:m.faCheck,color:X.answer.correct,label:"Correct"},isIncorrect:{icon:h.faXmark,color:X.answer.incorrect,label:"Incorrect"}}[t];return n.jsx(Rt,{icon:r.icon,color:r.color,height:"16px",width:"16px","aria-label":r.label,"aria-hidden":void 0})},Jt=function(e){var t=e.index,r=e.isActive,a=e.step,o=e.goToStep;return n.jsxs(zt,{children:[n.jsx(Lt,{variant:a.variant,isActive:r,onClick:function(){return o(t,a)},"aria-current":r?"location":"false","aria-label":"isStatus"===a.variant?"Assignment status":"Question "+(t+1),children:"isStatus"===a.variant?n.jsx(Ft,{}):t+1}),n.jsx(Qt,{variant:a.variant})]})},Vt=v.default.div(gt||(gt=_(["\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ",";\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n"])),X.palette.light);e.Answer=ve,e.AnswersTable=Me,e.CompletionStatus=dn,e.Exercise=Ht,e.ExerciseToolbar=yt,e.FreeResponseInput=jn,e.FreeResponseTextArea=vn,e.InnerStepCard=Fe,e.Loader=function(){return n.jsx(Vt,{children:n.jsx(x.BulletList,{uniqueKey:"OSLoader"})})},e.OuterStepCard=Pe,e.ProgressBar=function(e){var t=e.activeIndex,r=e.goToStep;return n.jsx(Pt,{"aria-label":"Breadcrumbs",children:e.steps.map(function(e,a){return n.jsx(Jt,{index:a,isActive:a===t,step:e,goToStep:r},a)})})},e.ProgressBarItem=Jt,e.Question=pn,e.QuestionHtml=fn,e.StepCard=Le,e.StyledItem=Lt,e.StyledToolbar=vt,e.TaskStepCard=Re}); +//# sourceMappingURL=index.umd.js.map diff --git a/dist/index.umd.js.map b/dist/index.umd.js.map new file mode 100644 index 0000000..61c3aa0 --- /dev/null +++ b/dist/index.umd.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.umd.js","sources":["../src/utils.ts","../src/theme.ts","../src/hooks/useTypesetMath.ts","../src/components/Content.tsx","../src/components/Feedback.tsx","../src/components/Answer.tsx","../src/constants.ts","../src/components/AnswersTable.tsx","../src/components/Card.tsx","../src/components/StepCardFooter.tsx","../src/components/Button.tsx","../src/components/CompletionStatus.tsx","../src/components/Question.tsx","../src/components/FreeResponseInput.tsx","../src/components/ExerciseQuestion.tsx","../src/helpers/mathjax.ts","../src/components/ExerciseToolbar.tsx","../src/components/ExerciseHeaderIcons.tsx","../src/components/Exercise.tsx","../src/assets/flag.tsx","../src/components/ProgressBar.tsx","../src/components/Loader.tsx"],"sourcesContent":["import { Answer, ID } from '../src/types';\n\nexport const ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\nconst MAX_CORRECTNESS = '1.0';\n\nexport const isAnswerCorrect = function(answer: Answer, correctAnswerId?: ID | null) {\n // if answer does not have an id, check the isCorrect property.\n if (!(answer.id || correctAnswerId)) {\n return answer.isCorrect;\n }\n let isCorrect = answer.id === correctAnswerId;\n if (answer.correctness != null) { isCorrect = (answer.correctness === MAX_CORRECTNESS); }\n\n return isCorrect;\n};\n\nexport const isAnswerIncorrect = (answer: Answer, incorrectAnswerId?: ID) =>\n // Allow multiple attempts to show incorrectness without the correct_answer_id\n answer.id === incorrectAnswerId;\n\nexport const isAnswerChecked = (answer: Answer, answerId?: ID) =>\n answer.id == answerId;\n\nexport function countWords(text: string) {\n const trimmedText = text.trim();\n //https://css-tricks.com/build-word-counter-app/\n const words = trimmedText.match(/\\b[-?(\\w+)?]+\\b/gi);\n if(!words) return 0;\n return words.length;\n}\n\nexport const numberfyId = (id: ID) => typeof id === 'string' ? parseInt(id, 10) : id;\n","import { css } from 'styled-components';\n\nconst palette = {\n red: \"#ca2026\",\n danger: \"#c2002f\",\n darkRed: \"#c22032\",\n lightRed: \"#e298a0\",\n green: \"#77af42\",\n lightGreen: \"#8bc753\",\n darkGreen: \"#63a524\",\n paleYellow: \"#ffffbb\",\n teal: \"#0dc0de\",\n blue: \"#007da4\",\n mediumBlue: \"#026AA1\",\n lightBlue: \"#34bdd8\",\n neutralLightBlue: \"#0dc0dc\",\n tangerine: \"#ffbd3e\",\n gray: \"#5e5e5e\",\n darkGray: \"#757575\",\n pale: \"#d5d5d5\",\n light: \"#e4e4e4\",\n white: \"#ffffff\",\n neutralLightest: \"#f9f9f9\", // nearly white\n neutralCool: \"#f6f7f8\", // cool bright gray\n neutralBright: \"#f5f5f5\", // bright gray\n neutralLighter: \"#f1f1f1\", // light gray\n neutralLight: \"#e5e5e5\", // light gray\n neutralMedium: \"#a0a0a0\", // light gray\n neutral: \"#818181\", // gray\n neutralThin: \"#6f6f6f\", // medium gray\n neutralDark: \"#5f6163\", // dark gray\n neutralFeedback: \"#555\", // another dark gray\n neutralDarker: \"#424242\", // very dark gray\n black: \"#000000\",\n orange: \"#D4450C\"\n};\n\nexport const colors = {\n palette: palette,\n answer: {\n neutral: palette.neutralThin,\n hover: '#026AA1',\n checked: '#026AA1',\n correct: '#0D7741',\n incorrect: '#C22032'\n },\n popover: {\n arrowOuterColor: \"rgba(0, 0, 0, 0.25)\",\n borderColor: \"rgba(0, 0, 0, 0.2)\",\n },\n card: {\n header: {\n background: \"#daf3f8\"\n },\n body: {\n background: \"#fdfdfd\"\n }\n },\n button: {\n background: palette.orange,\n backgroundHover: \"#E74B0D\",\n backgroundActive: \"#C5400B\"\n },\n freeResponse: {\n color: palette.neutralDarker,\n background:palette.neutralLighter,\n },\n};\n\nexport const layouts = {\n answer: {\n verticalSpacing: \"1rem\",\n horizontalSpacing: \"1rem\",\n horizontalBuffer: \"2.5rem\",\n bubbleSize: \"3.6rem\",\n labelSpacing: \"6.5rem\",\n feedback: {\n popover: {\n horizontalSpacing: \"1.1rem\",\n verticalSpacing: \"0.9rem\",\n maxWidth: \"370px\",\n },\n },\n },\n popover: {\n arrow: {\n width: \"16px\",\n height: \"8px\",\n edgeDistance: \"9px\",\n },\n horizontalSpacing: \"0.8rem\",\n verticalSpacing: \"1rem\",\n horizontalBuffer: \"4rem\",\n borderWidth: \"1px\",\n maxWidth: \"325px\",\n },\n card: {\n spacing: '2rem'\n }\n};\n\nexport const BREAKPOINTS = {\n mobile: 600,\n tablet: 999,\n desktop: 1000,\n large: 1600,\n};\n\nexport const breakpoints = {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n tablet(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.tablet}px) { ${css(...args)} }`;\n },\n desktop(...args: Parameters) {\n return css`@media(min-width: ${BREAKPOINTS.desktop}px) { ${css(...args)} }`;\n },\n only: {\n mobile(...args: Parameters) {\n return css`@media(max-width: ${BREAKPOINTS.mobile}px) { ${css(...args)} }`;\n },\n },\n margins: {\n mobile: '8px',\n tablet: '24px',\n },\n};\n\nexport const transitions = {\n answer: \"0.1s ease-in-out\",\n}\n\nexport const mixins = {\n answer: () => css`\n .answer-label {\n display: inline-flex;\n }\n color: ${palette.neutralDarker};\n .answer-letter-wrapper::before {\n width: ${layouts.answer.bubbleSize};\n height: ${layouts.answer.bubbleSize};\n min-width: ${layouts.answer.bubbleSize};\n min-height: ${layouts.answer.bubbleSize};\n border-radius: calc(${layouts.answer.bubbleSize} / 2);\n border-width: 2px;\n border-style: solid;\n border-color: #c6c6c6;\n color: ${colors.answer.neutral};\n transition: color ${transitions.answer}, border-color ${transitions.answer}, background-color ${transitions.answer};\n background-color: ${colors.palette.white};\n font-family: \"Neue Helvetica W01\", Helvetica, Arial, sans-serif;\n box-sizing: border-box;\n font-weight: normal;\n }\n `,\n answerColor: (\n color: string, invertBubble = false\n ) => css`\n .answer-letter-wrapper::before {\n color: ${invertBubble ? '#fff' : color};\n border-color: ${color};\n ${invertBubble ? `background-color: ${color};` : null}\n }\n `,\n answerChecked: () => mixins.answerColor(colors.answer.checked, true),\n answerCorrect: (checked?: boolean) => mixins.answerColor(colors.answer.correct, checked),\n answerIncorrect: (checked?: boolean) => mixins.answerColor(colors.answer.incorrect, checked),\n answerHover: () => css`\n ${mixins.answerColor(colors.answer.hover)};\n font-weight: bold;\n `,\n answerCorrectAnswer: () => mixins.answerColor(colors.answer.correct, false),\n resetText: () => css`\n font-family: \"Neue Helvetica W01\", Helvetica, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Arial, \"Noto Sans\", \"Liberation Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\";\n font-style: normal;\n font-weight: 400;\n line-height: 1.6;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n `,\n stepCardPadding: () => css`\n padding: 48px 140px;\n\n ${breakpoints.tablet`\n padding: ${breakpoints.margins.tablet} ${breakpoints.margins.tablet};\n `}\n\n ${breakpoints.mobile`\n padding: calc(${breakpoints.margins.mobile} * 2) ${breakpoints.margins.mobile};\n `}\n `,\n popover: () => css`\n ${mixins.resetText()}\n\n z-index: 1;\n position: relative;\n border: ${layouts.popover.borderWidth} solid ${colors.popover.borderColor};\n background-color: ${colors.palette.white};\n background-clip: padding-box;\n max-width: ${layouts.popover.maxWidth};\n margin: calc(${layouts.popover.arrow.height} - 14px) 0 ${layouts.answer.horizontalSpacing} 8px;\n box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.1);\n color: ${colors.palette.neutralThin};\n font-size: calc(1.4rem * var(--content-text-scale));\n\n .arrow {\n position: absolute;\n display: block;\n width: ${layouts.popover.arrow.width};\n height: ${layouts.popover.arrow.height};\n margin-left: ${layouts.popover.arrow.edgeDistance};\n top: calc(${layouts.popover.arrow.height} * -1);\n\n &::before,\n &::after {\n position: absolute;\n display: block;\n content: \"\";\n border-color: transparent;\n border-style: solid;\n border-width: 0 calc(${layouts.popover.arrow.width} / 2) ${layouts.popover.arrow.height} calc(${layouts.popover.arrow.width} / 2);\n }\n &::before {\n top: 0;\n border-bottom-color: ${colors.popover.borderColor};\n }\n &::after {\n top: ${layouts.popover.borderWidth};\n border-bottom-color: ${colors.palette.white};\n }\n }\n\n &.right {\n right: calc(-${layouts.popover.arrow.edgeDistance} - ${layouts.popover.borderWidth});\n .arrow { right: ${layouts.popover.arrow.edgeDistance}; }\n }\n\n\n > .content {\n padding: ${layouts.popover.verticalSpacing} ${layouts.popover.horizontalSpacing};\n }\n `,\n visuallyHidden: () => css`\n clip: rect(0 0 0 0);\n clip-path: inset(50%);\n height: 1px;\n overflow: hidden;\n position: absolute;\n white-space: nowrap;\n width: 1px;\n `\n};\n\nconst theme = {\n colors: colors,\n layouts: layouts,\n transitions: transitions,\n breakpoints: breakpoints,\n};\n\nexport default theme;\n","import React from \"react\";\n\nexport const TypesetMathContext = React.createContext<() => void>(() => { throw new Error('context not initialized') });\nexport const useTypesetMath = () => React.useContext(TypesetMathContext);\n","import React from \"react\";\nimport { useTypesetMath } from \"../hooks/useTypesetMath\";\n\n/* eslint-disable-next-line @typescript-eslint/no-explicit-any */\ntype ComponentType = keyof JSX.IntrinsicElements | React.JSXElementConstructor;\n\nexport interface ContentProps {\n className?: string;\n component?: T extends undefined ? undefined :\n T extends ComponentType ? React.ReactComponentElement:\n never;\n html: string;\n block?: boolean;\n}\n\nexport const Content = ((\n {html, component, block = false, ...props}: ContentProps\n) => {\n const typesetMath = useTypesetMath();\n\n React.useEffect(() => {\n typesetMath();\n }, [typesetMath, html])\n\n if (component !== undefined) {\n return React.cloneElement(component, {html, ...props});\n }\n if (block) {\n return
;\n } else {\n return ;\n }\n});\n","import classnames from 'classnames';\nimport { Content } from './Content';\n\ninterface FeedbackProps {\n position?: 'top' | 'bottom' | 'left' | 'right';\n children: string;\n className?: string;\n contentRenderer?: JSX.Element;\n id: string\n}\n\nconst SimpleFeedback = (props: Pick) => (\n \n);\n\nconst Feedback = ({ id, ...props }: FeedbackProps) => {\n const position = props.position || 'bottom';\n const wrapperClasses = classnames('question-feedback', position);\n\n return (\n \n );\n};\n\nexport { Feedback, SimpleFeedback };\n","import cn from 'classnames';\nimport { ReactNode } from 'react';\nimport { ALPHABET, isAnswerChecked, isAnswerCorrect, isAnswerIncorrect } from '../utils';\nimport { Answer as AnswerType, ID } from '../types';\nimport { Content } from './Content';\nimport { SimpleFeedback } from './Feedback';\nimport styled from 'styled-components';\nimport { colors } from '../theme';\n\nconst StyledAnswerIndicator = styled.div<{ state: boolean }>`\n color: ${props => props.state ? colors.answer.correct : colors.answer.incorrect};\n text-transform: uppercase;\n font-size: calc(1.1rem * var(--content-text-scale));\n font-weight: bold;\n`;\n\nconst AnswerIndicator = (\n { isCorrect, isIncorrect }: { isCorrect?: boolean; isIncorrect?: boolean }\n) => {\n if (!isCorrect && !isIncorrect) {\n return null;\n }\n const state = isCorrect || isIncorrect === false;\n\n return \n {state ? 'Correct' : 'Incorrect'} Answer\n \n};\n\nexport interface AnswerProps {\n answer: AnswerType;\n iter: number;\n qid: ID;\n type: 'teacher-review' | 'teacher-preview' | 'student' | 'student-mpp';\n hasCorrectAnswer?: boolean;\n onChangeAnswer?: (answer: AnswerType) => void;\n disabled: boolean;\n answerId?: ID;\n correctAnswerId?: ID | null;\n incorrectAnswerId?: ID;\n onKeyPress?: () => void;\n answered_count?: number;\n correctIncorrectIcon?: ReactNode,\n radioBox?: ReactNode;\n contentRenderer?: JSX.Element;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n feedbackId?: string;\n}\n\ntype AnswerAnswerProps = Pick<\n AnswerBodyProps,\n 'answer' |\n 'contentRenderer' |\n 'show_all_feedback' |\n 'tableFeedbackEnabled' |\n 'isCorrect' |\n 'isIncorrect'\n>;\n\nconst AnswerAnswer = (props: AnswerAnswerProps) => {\n const {\n answer: { content_html, feedback_html },\n contentRenderer,\n show_all_feedback,\n tableFeedbackEnabled,\n isCorrect,\n isIncorrect,\n } = props;\n return (\n
\n \n \n {show_all_feedback && feedback_html && !tableFeedbackEnabled &&\n \n {feedback_html}\n }\n
\n )\n}\n\ninterface AnswerBodyProps extends AnswerProps {\n isCorrect?: boolean;\n isSelected?: boolean;\n isIncorrect?: boolean;\n}\n\nconst TeacherReview = (props: AnswerBodyProps) => {\n const {\n answer,\n answered_count,\n isCorrect,\n contentRenderer,\n iter,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const percent = answer.selected_count && answered_count\n ? Math.round((answer.selected_count / answered_count) * 100)\n : 0;\n return (\n
\n
\n \n {answer.selected_count}\n \n \n {ALPHABET[iter]}\n \n
\n \n
\n );\n}\n\nconst AnswerChoice = (props: AnswerBodyProps) => {\n const {\n type,\n iter,\n answer,\n disabled,\n onKeyPress,\n qid,\n contentRenderer,\n correctIncorrectIcon,\n feedbackId,\n isSelected,\n isCorrect,\n isIncorrect,\n hasCorrectAnswer,\n show_all_feedback,\n tableFeedbackEnabled,\n } = props;\n const ariaLabel = `${isSelected ? 'Selected ' : ''}Choice ${ALPHABET[iter]}:`;\n let onChangeAnswer: AnswerProps['onChangeAnswer'];\n\n const onChange = () => onChangeAnswer && onChangeAnswer(answer);\n\n if (!hasCorrectAnswer\n && (type !== 'teacher-review')\n && (type !== 'teacher-preview')\n && (type !== 'student-mpp')) {\n ({ onChangeAnswer } = props);\n }\n\n return <>\n {type === 'teacher-preview' &&\n
\n {isCorrect && correctIncorrectIcon}\n
}\n \n \n \n
\n \n \n \n}\n\nconst AnswerBody = (props: AnswerBodyProps) => {\n return props.type === 'teacher-review'\n ? \n : \n}\n\nexport const Answer = (props: AnswerProps) => {\n const {\n type,\n answer,\n disabled,\n answerId,\n correctAnswerId,\n incorrectAnswerId,\n } = props;\n\n const isChecked = isAnswerChecked(answer, answerId);\n const isCorrect = isAnswerCorrect(answer, correctAnswerId);\n const isIncorrect = isAnswerIncorrect(answer, incorrectAnswerId);\n // When rendering a previous response, we can determine if it was this answer.\n // If there is no incorrectAnswerId, that means only a correct answer is present, check isCorrect.\n // If an incorrectAnswerId is present (there is only ever one, if multiple attempts are enabled,\n // it is the latest one) checking isIncorrect works because incorrectAnswerId is only set for\n // a missed attempt, meaning if an attempt is missed and then successfully re-attempted,\n // incorrectAnswerId will be empty.\n const isPreviousResponse = answerId === undefined && (!incorrectAnswerId && isCorrect || isIncorrect);\n\n const isSelected = isChecked || isPreviousResponse;\n const classes = cn('answers-answer', {\n 'disabled': disabled,\n 'answer-selected': isSelected,\n 'answer-correct': isCorrect && type !== 'student-mpp',\n 'answer-incorrect': incorrectAnswerId && isAnswerIncorrect(answer, incorrectAnswerId),\n });\n\n return (\n
\n
\n \n
\n
\n );\n}\nAnswer.displayName = 'OSAnswer';\n","import { AnswerDisplayType } from './types';\n\nexport const defaultAnswerType: AnswerDisplayType = 'student';\n","import { defaultAnswerType } from \"../constants\";\nimport { Answer as AnswerType, AnswerDisplayType, ID, ExerciseQuestionData } from \"src/types\";\nimport { Answer } from \"./Answer\";\nimport { Feedback } from \"./Feedback\";\n\nexport interface AnswersTableProps {\n question: ExerciseQuestionData;\n type?: AnswerDisplayType;\n answer_id?: ID;\n correct_answer_id?: ID | null;\n incorrectAnswerId?: ID;\n answerIdOrder?: ID[],\n feedback_html: string;\n correct_answer_feedback_html?: string;\n answered_count?: number;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n onChangeAnswer: () => void;\n hideAnswers: boolean;\n hasCorrectAnswer?: boolean;\n onChangeAttempt?: () => void;\n choicesEnabled?: boolean;\n onKeyPress?: () => void;\n contentRenderer?: JSX.Element;\n instructions?: JSX.Element;\n}\n\nexport const AnswersTable = (props: AnswersTableProps) => {\n let idCounter = 0;\n\n const {\n question, hideAnswers, type = defaultAnswerType, answered_count, choicesEnabled, correct_answer_id,\n incorrectAnswerId, answer_id, feedback_html, correct_answer_feedback_html,\n show_all_feedback = false, tableFeedbackEnabled, hasCorrectAnswer, onChangeAnswer, onKeyPress, answerIdOrder, instructions\n } = props;\n if (hideAnswers) { return null; }\n\n const { id } = question;\n\n const feedback: { index: number, html: string, id: string }[] = [];\n\n const sortedAnswersByIdOrder = (idOrder: ID[]) => {\n const { answers } = question;\n return answers.slice().sort((a, b) => idOrder.indexOf(a.id) - idOrder.indexOf(b.id));\n }\n\n const questionAnswerProps = {\n qid: id || `auto-${idCounter++}`,\n answerId: answer_id,\n correctAnswerId: correct_answer_id,\n incorrectAnswerId,\n hasCorrectAnswer,\n onChangeAnswer: onChangeAnswer,\n type,\n answered_count,\n disabled: !choicesEnabled,\n show_all_feedback,\n tableFeedbackEnabled,\n onKeyPress\n };\n\n const answers = answerIdOrder ? sortedAnswersByIdOrder(answerIdOrder) : question.answers;\n\n const answersHtml = answers.map((answer, i) => {\n const additionalProps: { answer: AnswerType, iter: number, key: string }\n = {\n answer: {\n ...answer,\n question_id: typeof question.id === 'string' ? parseInt(question.id, 10) : question.id\n },\n iter: i,\n key: `${questionAnswerProps.qid}-option-${i}`,\n };\n const answerProps = Object.assign({}, additionalProps, questionAnswerProps);\n let html: string | undefined;\n let feedbackId: string | undefined;\n\n if (show_all_feedback && answer.feedback_html && tableFeedbackEnabled) {\n html = answer.feedback_html;\n } else if (answer.id === incorrectAnswerId && feedback_html) {\n html = feedback_html;\n } else if (answer.id === correct_answer_id && correct_answer_feedback_html) {\n html = correct_answer_feedback_html;\n }\n\n if (html) {\n feedbackId = `feedback-${questionAnswerProps.qid}-${i}`\n feedback.push({ index: i, html, id: feedbackId });\n }\n\n return (\n \n );\n });\n\n feedback.forEach((item, i) => {\n const spliceIndex = item.index + i + 1;\n answersHtml.splice(spliceIndex, 0, (\n \n {item.html}\n \n ));\n });\n\n return (\n
\n {instructions}\n {answersHtml}\n
\n );\n}\n","import { ReactNode } from \"react\";\nimport { breakpoints, colors, layouts, mixins } from \"../theme\";\nimport { AvailablePoints, StepBase, StepWithData } from \"../types\";\nimport styled from \"styled-components\";\nimport cn from \"classnames\";\n\nexport const InnerStepCard = styled.div`\n position: relative;\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 400px;\n margin: 0 auto 5rem auto;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n overflow: hidden;\n\n ${breakpoints.desktop`\n max-width: 1000px;\n `}\n`;\n\nexport const OuterStepCard = styled.div`\n padding: ${layouts.card.spacing};\n\n ${breakpoints.mobile`\n padding: 0;\n `}\n`;\n\nconst StepCardHeader = styled.div`\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 16px 24px;\n background: ${colors.card.header.background};\n font-size: 1.8rem;\n line-height: 3rem;\n letter-spacing: -0.72px;\n\n div.question-info {\n display: flex;\n align-items: baseline;\n font-weight: bold;\n\n .question-id {\n font-weight: normal;\n }\n .ox-icon-lock {\n margin-right: 1rem;\n }\n }\n\n .num-questions, .points {\n display: none;\n }\n\n .exercise-id, .separator {\n font-weight: normal;\n }\n\n .separator {\n margin: 0 0.4rem;\n }\n\n .exercise-id {\n height: 28px; // Fix baseline issue\n }\n\n button {\n color: ${colors.palette.gray};\n }\n\n .openstax-exercise-badges {\n margin: 0;\n line-height: 2rem;\n svg {\n display: block;\n &:not(.interactive) {\n margin: 0 0 0 6px !important;\n }\n }\n }\n\n ${breakpoints.desktop`\n button.ox-icon-angle-left, button.ox-icon-angle-right {\n display: none;\n }\n .separator {\n display: inherit;\n }\n `}\n\n /*\n 1. Show the arrows to move to previous and next question.\n 2. Show the number of questions.\n 3. Override box-shadow of icons when turned into a button.\n */\n ${breakpoints.tablet`\n font-size: 1.6rem;\n line-height: 2.5rem;\n\n svg.ox-icon {\n display: inherit;\n margin: 0;\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.tablet};\n }\n button.ox-icon-angle-right {\n margin-left: ${breakpoints.margins.tablet};\n }\n .openstax-exercise-badges svg {\n display: none;\n }\n .num-questions, points {\n display: inherit;\n }\n\n .exercise-id {\n display: none;\n }\n\n button[class^='ox-icon-angle']:hover {\n box-shadow: none;\n }\n `}\n\n ${breakpoints.mobile`\n font-size: 1.4rem;\n line-height: 2rem;\n padding: 10px 8px;\n\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n button.ox-icon-angle-left {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n`;\nStepCardHeader.displayName = 'StepCardHeader';\n\nconst StepCardQuestion = styled.div<{ unpadded?: boolean }>`\n .step-card-body {\n ${mixins.stepCardPadding()}\n overflow: auto;\n background: ${colors.card.body.background};\n\n &.exercise-stimulus {\n display: flex;\n flex-direction: column;\n align-items: center;\n }\n }\n\n & + div .step-card-body {\n padding-top: 0;\n }\n\n &.exercise-context, &.exercise-stimulus, &.exercise-stem {\n padding-bottom: 0;\n }\n\n ${breakpoints.only.mobile`\n && .question-feedback {\n margin-left: 0;\n\n .arrow { margin-left: 12px; }\n }\n `}\n\n .reading-step & {\n padding: 0;\n }\n\n ${breakpoints.desktop`\n .video-step &, .interactive-step & {\n .openstax-exercise-badges {\n margin-right: 3.8rem;\n }\n }\n `}\n\n ${breakpoints.mobile`\n .openstax-exercise-badges svg {\n margin-right: ${breakpoints.margins.mobile};\n }\n `}\n\n &&& {\n .openstax-has-html .splash .frame-wrapper { margin-top: 0; }\n }\n`;\n\ninterface SharedProps {\n questionNumber: number;\n numberOfQuestions: number;\n showTotalQuestions: boolean;\n leftHeaderChildren?: ReactNode;\n rightHeaderChildren?: ReactNode;\n headerTitleChildren?: ReactNode;\n}\n\nexport interface StepCardProps extends SharedProps {\n unpadded: boolean;\n className?: string;\n children?: ReactNode;\n stepType: StepWithData['type'];\n availablePoints?: AvailablePoints;\n questionId?: string;\n multipartBadge?: ReactNode;\n isHomework: boolean;\n}\n\nconst StepCard = ({\n questionNumber,\n numberOfQuestions,\n showTotalQuestions,\n stepType,\n isHomework,\n availablePoints,\n unpadded, // currently does nothing; may need to restore if this causes tutor stepcard regression\n className,\n children,\n questionId,\n multipartBadge,\n leftHeaderChildren,\n rightHeaderChildren,\n headerTitleChildren,\n ...otherProps }: StepCardProps) => {\n\n const formattedQuestionNumber = numberOfQuestions > 1\n ? `Questions ${questionNumber} - ${questionNumber + numberOfQuestions - 1}`\n : `Question ${questionNumber}`;\n\n return (\n \n {multipartBadge}\n \n {questionNumber && isHomework && stepType === 'exercise' &&\n \n
\n {leftHeaderChildren}\n

\n {headerTitleChildren}\n {formattedQuestionNumber}\n {showTotalQuestions ?  / {numberOfQuestions} : null}\n |\n ID: {questionId}\n

\n
\n {availablePoints || rightHeaderChildren ?
\n {availablePoints &&
{availablePoints} Points
}\n {rightHeaderChildren}\n
: null}\n
\n }\n {children}\n
\n
\n )\n};\nStepCard.displayName = 'OSStepCard';\n\nexport interface TaskStepCardProps extends SharedProps {\n className?: string;\n children?: ReactNode;\n step: StepBase | StepWithData;\n questionNumber: number;\n numberOfQuestions: number;\n}\n\nconst TaskStepCard = ({\n step,\n questionNumber,\n numberOfQuestions,\n children,\n className,\n ...otherProps\n}: TaskStepCardProps) =>\n(\n {children}\n);\n\nTaskStepCard.displayName = 'OSTaskStepCard';\n\nexport { StepCard, TaskStepCard };\n","import { colors, breakpoints, mixins } from \"../theme\";\nimport styled from \"styled-components\";\n\nexport const StepCardFooter = styled.div`\n ${mixins.stepCardPadding()}\n display: flex;\n flex-wrap: wrap;\n justify-content: space-between;\n font-size: calc(1.4rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n background: ${colors.card.body.background};\n overflow: auto;\n\n > * {\n flex-grow: 1;\n }\n\n button {\n width: 160px;\n height: 48px;\n }\n\n .step-card-footer-inner {\n border-top: 1px solid ${colors.palette.pale};\n padding-top: 32px;\n display: flex;\n justify-content: space-between;\n gap: 1.6rem;\n\n ${breakpoints.mobile`\n flex-wrap: wrap;\n `}\n }\n\n .points {\n .attempts-left {\n color: #B03808;\n font-weight: bold;\n }\n }\n\n .controls {\n display: flex;\n flex-flow: column wrap-reverse;\n\n button + button {\n margin: 0.8rem 0 0 0;\n }\n }\n\n ${breakpoints.desktop`\n padding: 0 140px 32px 140px;\n flex-wrap: nowrap;\n\n .points {\n max-width: 400px;\n }\n\n .controls {\n flex-flow: row;\n justify-content: flex-end;\n\n button + button {\n margin: 0 0 0 0.8rem;\n }\n }\n `}\n`;\n","import { colors } from \"../theme\";\nimport styled from \"styled-components\";\n\nconst StyledButton = styled.button`\n background-color: ${colors.button.background};\n color: ${colors.palette.white};\n font-size: 1.6rem;\n font-weight: 700;\n line-height: 2rem;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n height: 4rem;\n padding: 0 3rem;\n border: 0;\n border-radius: 5px;\n box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);\n\n &:not([disabled]) {\n cursor: pointer;\n &:hover {\n background: ${colors.button.backgroundHover}\n }\n &:active {\n background: ${colors.button.backgroundActive}\n }\n }\n &:disabled {\n opacity: 0.4;\n }\n`;\n\ninterface ButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting?: never;\n waitingText?: never;\n}\ninterface WaitingButtonProps extends React.ComponentPropsWithoutRef<'button'> {\n isWaiting: boolean;\n waitingText: string;\n}\n\nconst Button = (props: ButtonProps | WaitingButtonProps) => {\n const { disabled, isWaiting, waitingText, children, ...otherProps } = props;\n\n return (\n {(isWaiting && waitingText) || children}\n );\n}\n\nexport default Button;\n","import styled, { createGlobalStyle } from \"styled-components\";\nimport { InnerStepCard } from \"./Card\";\nimport Button from \"./Button\";\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nexport interface CompletionStatusProps {\n numberOfQuestions: number;\n numberCompleted: number;\n handleClick: () => void;\n className?: string;\n}\n\nconst CompletionStatusCard = styled(InnerStepCard)`\n padding: 88px 72px;\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(3rem * var(--content-text-scale));\n display: block;\n\n button {\n min-width: 160px;\n height: 48px;\n }\n\n p {\n margin: 16px 0 20px 0;\n }\n`;\n\nconst CompletionHeader = styled.h2`\n font-size: calc(2.4rem * var(--content-text-scale));\n margin: 0;\n`;\n\nexport const CompletionStatus = styled(({\n numberOfQuestions, numberCompleted, handleClick, className\n}: CompletionStatusProps) => {\n\n const allCompleted = numberOfQuestions === numberCompleted;\n const someCompleted = numberCompleted > 0;\n const buttonText = allCompleted ? 'Next' : (\n someCompleted ? 'Continue' : 'Start'\n );\n\n return <>\n \n \n {allCompleted ? 'You are done.' : (someCompleted ? 'Quiz is partially complete.' : 'No questions have been answered.')}\n

{allCompleted ? 'Great job answering all the questions.' : (someCompleted ? `You've completed ${numberCompleted} of ${numberOfQuestions} questions.` : 'Begin working on the quiz.')}

\n \n
\n \n})``;\n","import styled from 'styled-components';\nimport { mixins, colors, layouts, transitions } from '../theme';\nimport { AnswersTable } from './AnswersTable';\nimport classnames from 'classnames';\nimport { ID, ExerciseQuestionData, Task } from 'src/types';\nimport React, { ReactNode } from 'react';\nimport { Content } from './Content';\n\nconst StyledQuestion = styled.div`\n&.step-card-body {\n ${mixins.stepCardPadding()};\n}\n\n&.openstax-question {\n border-top: 1px solid ${colors.palette.pale};\n font-size: calc(1.8rem * var(--content-text-scale));\n\n .detailed-solution {\n margin-bottom: 1rem;\n .header {\n display: inline;\n margin-right: 0.5rem;\n color: #5e6062;\n font-weight: bold;\n flex-basis: 0;\n }\n .solution {\n display: inline;\n color: #6f6f6f;\n }\n }\n\n img {\n display: block;\n margin: auto;\n max-width: 100%;\n }\n\n .question-stem {\n margin-bottom: 0;\n }\n\n .answers-table {\n margin-bottom: 20px;\n font-size: calc(1.6rem * var(--content-text-scale));\n line-height: calc(2rem * var(--content-text-scale));\n }\n\n .instructions {\n font-size: 1.4rem;\n font-style: italic;\n margin-top: 10px;\n color: ${colors.palette.neutral};\n margin: 0;\n\n i {\n margin-left: 5px;\n }\n\n .text-info {\n color: ${colors.palette.neutralLightBlue};\n padding-left: 5px;\n cursor: pointer;\n font-style: normal;\n }\n }\n\n .multiple-choice-prompt {\n font-weight: 600;\n }\n\n .free-response {\n padding: ${layouts.answer.horizontalSpacing} ${layouts.answer.horizontalBuffer};\n margin: ${layouts.answer.verticalSpacing} 0 ${layouts.answer.horizontalSpacing} ${layouts.answer.verticalSpacing};\n border-left: ${layouts.answer.horizontalSpacing} solid ${colors.palette.neutralLighter};\n font-style: italic;\n }\n\n &:not(.openstax-question-preview) {\n .answers-answer {\n width: initial;\n &:not(.disabled){\n .answer-label:focus{\n background-color: ${colors.palette.neutralLightest};\n }\n }\n &.answer-selected {\n font-weight: bold;\n }\n ${mixins.answer()};\n }\n\n .answer-answer {\n flex: 1;\n display: flex;\n flex-direction: column;\n justify-content: center;\n margin-left: ${layouts.answer.horizontalSpacing};\n * {\n margin: 0;\n }\n }\n\n .answer-letter-wrapper::before {\n content: attr(data-answer-choice);\n text-align: center;\n padding: 0;\n font-size: 1.6rem;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n\n .answer-label {\n width: 100%;\n padding: ${layouts.answer.verticalSpacing} 0 0 0;\n margin: 0;\n transition: color ${transitions.answer};\n }\n\n // a selectable answer\n .answer-input-box:not([disabled]) ~ .answer-label {\n cursor: pointer;\n\n &:hover {\n ${mixins.answerHover()}\n }\n }\n\n .answer-input-box {\n ${mixins.visuallyHidden()}\n }\n\n // a selected answer\n &:not(.has-correct-answer) {\n .answer-input-box {\n &:checked {\n + .answer-label,\n + .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n\n &:focus-visible {\n + .answer-label .answer-letter-wrapper::before {\n outline-style: solid;\n outline-width: 2px;\n outline-offset: 2px;\n outline-color: ${colors.answer.checked};\n }\n }\n }\n\n .answer-selected {\n .answer-label, .answer-label:hover {\n ${mixins.answerChecked()};\n }\n }\n }\n\n // answer that has been checked\n &.has-correct-answer {\n .answer-selected {\n &:not(.answer-correct) {\n .answer-label {\n ${mixins.answerIncorrect()};\n }\n }\n\n &.answer-correct {\n .answer-label {\n ${mixins.answerCorrect(true)};\n }\n }\n }\n\n .answer-correct:not(.answer-selected) {\n .answer-label {\n ${mixins.answerCorrectAnswer()}\n }\n }\n }\n\n &.has-incorrect-answer {\n .answer-incorrect {\n .answer-label, .answer-label:hover {\n ${mixins.answerIncorrect()}\n }\n &.answer-selected.answer-incorrect {\n ${mixins.answerIncorrect(true)}\n }\n }\n }\n\n .question-feedback {\n ${mixins.popover()}\n max-width: ${layouts.answer.feedback.popover.maxWidth};\n .question-feedback-content {\n padding: ${layouts.answer.feedback.popover.verticalSpacing} ${layouts.answer.feedback.popover.horizontalSpacing};\n }\n }\n }\n\n .openstax-answer {\n border-top: 1px solid #d5d5d5;\n margin: 10px 0;\n padding: 6px 8px;\n }\n}\n`;\n\nexport interface QuestionProps {\n question: ExerciseQuestionData,\n answer_id?: ID;\n task?: Task | null,\n correct_answer_id: ID | null;\n incorrectAnswerId: ID;\n hideAnswers: boolean;\n hidePreambles?: boolean,\n exercise_uid?: string;\n displayFormats: boolean,\n className: string;\n questionNumber: number;\n displaySolution: boolean;\n context?: string;\n correct_answer_feedback_html?: string;\n contentRenderer?: JSX.Element;\n feedback_html: string;\n onChange: () => void;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n children?: ReactNode;\n answerIdOrder?: ID[];\n choicesEnabled?: boolean;\n}\n\nexport const Question = React.forwardRef((props: QuestionProps, ref: React.ForwardedRef) => {\n let exerciseUid, solution;\n\n const {\n question, correct_answer_id, incorrectAnswerId, exercise_uid, className, questionNumber, context, task, hidePreambles\n } = props;\n\n const { stem_html, collaborator_solutions = [], formats, stimulus_html } = question;\n\n const hasCorrectAnswer = !!correct_answer_id;\n const hasIncorrectAnswer = !!incorrectAnswerId;\n\n const taskIsDeleted = (task != null ? task.is_deleted : undefined)\n const taskIsHomework = ((task != null ? task.type : undefined) === 'homework');\n\n const classes = classnames('openstax-question', className, {\n 'has-correct-answer': hasCorrectAnswer && !(taskIsDeleted && taskIsHomework),\n 'has-incorrect-answer': hasIncorrectAnswer,\n });\n\n const hasSolution = () => {\n const { displaySolution } = props;\n const { collaborator_solutions = [] } = question;\n\n return (\n displaySolution &&\n collaborator_solutions &&\n collaborator_solutions.find(s => s['content_html'] !== undefined)\n );\n };\n\n if (exercise_uid != null) {\n exerciseUid = (\n
\n {exercise_uid}\n
\n );\n }\n\n if (hasSolution()) {\n solution =\n
\n
\n Detailed solution:\n
\n s['content_html']).join('')} />\n
;\n }\n\n return (\n \n \n );\n});\n\ninterface QuestionHtmlProps {\n html?: string;\n type: string;\n hidden: QuestionProps['hidePreambles'];\n questionNumber?: QuestionProps['questionNumber'];\n}\n\nexport const QuestionHtml = (props: QuestionHtmlProps) => {\n const { html = '', type, hidden, questionNumber } = props;\n if (hidden === true || !(html.length > 0)) { return null; }\n\n return (\n \n );\n};\n\nconst FormatsListing = ({ formats = [] }: { formats: ExerciseQuestionData['formats'] }) => {\n return (\n
\n
Formats:
\n {formats.map((format, i) => {format})}\n
\n );\n};\n","import { MouseEventHandler, ReactNode } from 'react';\nimport { countWords } from '../utils';\nimport styled, { css } from 'styled-components';\nimport { colors, mixins } from '../theme';\nimport { AvailablePoints, ExerciseQuestionData } from 'src/types';\nimport { QuestionHtml } from './Question';\nimport Button from './Button';\nimport { StepCardFooter } from './StepCardFooter';\n\nexport interface FreeResponseProps {\n readOnly: boolean;\n wordLimit: number;\n infoRowChildren?: ReactNode;\n onChange: (event: React.ChangeEvent) => void;\n cancelHandler: MouseEventHandler;\n saveHandler: MouseEventHandler;\n defaultValue: string;\n isSubmitDisabled: boolean;\n questionNumber: number,\n question: ExerciseQuestionData,\n availablePoints?: AvailablePoints,\n textHasChanged: boolean;\n submitBtnLabel: string;\n}\n\nconst TextAreaErrorStyle = css`\n background-color: #f5e9ea;\n`;\n\nconst StyledFreeResponse = styled.div`\n display: flex;\n flex-direction: column;\n\n .step-card-body {\n ${mixins.stepCardPadding()}\n }\n`;\n\nconst SyledQuestionStem = styled.div`\n font-size: 2rem;\n line-height: 1.68em;\n position: relative;\n`;\n\nconst InfoRow = styled.div<{ hasChildren: boolean }>`\n margin: 8px 0;\n display: flex;\n justify-content: ${props => props.hasChildren ? 'space-between' : 'flex-end'};\n line-height: 1.6rem;\n\n .word-limit-error-info {\n color: ${colors.palette.danger};\n }\n\n div > span {\n font-size: 12px;\n line-height: 16px;\n\n + span {\n margin-left: 1rem;\n }\n }\n\n .last-submitted + * {\n margin-top: 0.8rem;\n }\n\n color: ${colors.palette.neutralThin};\n`;\n\nexport const FreeResponseTextArea = styled.textarea<{ isOverWordLimit: boolean } & FreeResponseProps>`\n display: block;\n font-family: inherit;\n font-size: 1.8rem;\n line-height: 3rem;\n width: 100%;\n min-height: 10.5em;\n line-height: 1.5em;\n margin: 2.5rem 0 0 0;\n padding: 0.5em;\n border: 1px solid ${colors.palette.neutral};\n color: ${colors.palette.neutralDark};\n ${props => props.isOverWordLimit && TextAreaErrorStyle};\n ${props => props.isOverWordLimit && css`\n border: 2px solid ${colors.palette.danger};\n `}\n background-color: ${props => props.readOnly && colors.palette.neutralCool};\n`;\nFreeResponseTextArea.displayName = 'OSFreeResponseTextArea';\n\nconst RevertButton = (props: {\n disabled: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n);\n\n\nexport const FreeResponseInput = (props: FreeResponseProps) => {\n const {\n availablePoints,\n cancelHandler,\n defaultValue,\n infoRowChildren,\n isSubmitDisabled,\n question,\n questionNumber,\n saveHandler,\n submitBtnLabel,\n textHasChanged,\n wordLimit,\n } = props;\n\n const isOverWordLimit = countWords(defaultValue) > wordLimit;\n\n const questionProps = {};\n if (questionNumber) { questionProps['data-question-number'] = questionNumber; }\n\n return (\n \n
\n \n {question.stem_html &&\n \n \n \n {infoRowChildren}\n
\n {countWords(defaultValue)} words\n {isOverWordLimit && Maximum {wordLimit} words}\n
\n
\n
\n \n {availablePoints\n ?
Points: {availablePoints}
\n : null}\n
\n \n \n {submitBtnLabel}\n \n
\n
\n
\n );\n}\n\nFreeResponseInput.displayName = 'OSFreeResponse';\n","import React from \"react\";\nimport { numberfyId } from \"../../src/utils\";\nimport { AvailablePoints, ID, ExerciseQuestionData, Task } from \"../types\";\nimport Button from \"./Button\";\nimport { Content } from \"./Content\";\nimport { ExerciseBaseProps } from \"./Exercise\";\nimport { Question } from './Question';\nimport { StepCardFooter } from \"./StepCardFooter\";\n\nexport interface ExerciseQuestionProps {\n task?: Task;\n question: ExerciseQuestionData;\n answer_id_order?: ID[];\n questionNumber: number;\n choicesEnabled: boolean;\n hasMultipleAttempts: boolean;\n onAnswerChange: () => void;\n onAnswerSave: ExerciseBaseProps['onAnswerSave'];\n onNextStep: ExerciseBaseProps['onNextStep'];\n feedback_html: string;\n correct_answer_feedback_html: string;\n is_completed: boolean;\n correct_answer_id: ID;\n incorrectAnswerId: ID;\n answer_id?: ID;\n attempts_remaining: number;\n published_comments?: string;\n detailedSolution?: string;\n canAnswer: boolean;\n needsSaved: boolean;\n canUpdateCurrentStep: boolean;\n attempt_number: number;\n apiIsPending: boolean;\n displaySolution: boolean;\n available_points?: AvailablePoints;\n exercise_uid: string;\n free_response?: string;\n show_all_feedback?: boolean;\n tableFeedbackEnabled?: boolean;\n hasFeedback?: ExerciseBaseProps['hasFeedback'];\n}\n\nconst AttemptsRemaining = ({ count }: { count: number }) => {\n return (\n
{count} attempt{count === 1 ? '' : 's'} left
\n );\n}\n\nconst PublishedComments = ({ published_comments }: { published_comments?: string }) => {\n if (!published_comments) { return null; }\n\n return (\n
\n Feedback: {published_comments}\n
\n );\n}\n\nexport const SaveButton = (props: {\n disabled: boolean, isWaiting: boolean, attempt_number: number, willContinue: boolean\n} & React.ComponentPropsWithoutRef<'button'>) => (\n \n {props.willContinue\n ? 'Submit & continue'\n : (props.attempt_number == 0 ? 'Submit' : 'Re-submit')}\n \n);\n\nexport const NextButton = (props: {\n canUpdateCurrentStep: boolean,\n} & React.ComponentPropsWithoutRef<'button'>) => {\n return (\n \n );\n}\n\nconst FreeResponseReview = ({ free_response }: Pick) => {\n if (!free_response) { return null; }\n return (\n <>\n
{free_response}
\n \n );\n}\n\nexport const ExerciseQuestion = React.forwardRef((props: ExerciseQuestionProps, ref: React.ForwardedRef) => {\n const {\n question, task, answer_id_order, onAnswerChange, feedback_html, correct_answer_feedback_html,\n is_completed, correct_answer_id, incorrectAnswerId, choicesEnabled, questionNumber,\n answer_id, hasMultipleAttempts, attempts_remaining, published_comments, detailedSolution,\n canAnswer, needsSaved, attempt_number, apiIsPending, onAnswerSave, onNextStep, canUpdateCurrentStep,\n displaySolution, available_points, free_response, show_all_feedback, tableFeedbackEnabled,\n hasFeedback\n } = props;\n\n const [shouldContinue, setShouldContinue] = React.useState(false)\n React.useEffect(() => {\n if (shouldContinue && is_completed) {\n onNextStep(questionNumber - 1);\n setShouldContinue(false);\n }\n }, [onNextStep, questionNumber, shouldContinue, is_completed]);\n\n return (\n
\n \n \n \n \n
\n
\n {available_points ? Points: {available_points} : null}\n \n {hasMultipleAttempts &&\n attempts_remaining > 0 &&\n }\n \n \n {detailedSolution && (
Detailed solution:
)}\n
\n
\n {(canAnswer && needsSaved) || shouldContinue ?\n {\n onAnswerSave(numberfyId(question.id));\n if (!hasFeedback) {\n setShouldContinue(true);\n }\n }}\n willContinue={!hasFeedback}\n /> :\n onNextStep(questionNumber - 1)} canUpdateCurrentStep={canUpdateCurrentStep} />}\n
\n
\n
\n
\n );\n})\n","import { debounce, once } from 'lodash';\nimport { isEmpty, memoize } from 'lodash/fp.js';\nimport WeakMap from 'weak-map';\n\ndeclare global {\n interface Window {\n MathJax?: any;\n __debugMathJax?: boolean;\n }\n}\n\nconst MATH_MARKER_BLOCK = '\\u200c\\u200c\\u200c'; // zero-width non-joiner\nconst MATH_MARKER_INLINE = '\\u200b\\u200b\\u200b'; // zero-width space\n\nconst MATH_RENDERED_CLASS = 'math-rendered';\nconst MATH_MARKED_CLASS = 'math-marked';\nconst MATH_DATA_SELECTOR = `[data-math]:not(.${MATH_RENDERED_CLASS})`;\nconst MATH_ML_SELECTOR = `math:not(.${MATH_RENDERED_CLASS})`;\nconst COMBINED_MATH_SELECTOR = `${MATH_DATA_SELECTOR}, ${MATH_ML_SELECTOR}`;\nconst MATHJAX_CONFIG = {\n extensions: [],\n showProcessingMessages: false,\n skipStartupTypeset: true,\n styles: {\n '#MathJax_MSIE_Frame': {\n left: '', right: 0, visibility: 'hidden',\n },\n '#MathJax_Message': {\n left: '', right: 0, visibility: 'hidden',\n },\n },\n tex2jax: {\n displayMath: [[MATH_MARKER_BLOCK, MATH_MARKER_BLOCK]],\n inlineMath: [[MATH_MARKER_INLINE, MATH_MARKER_INLINE]],\n },\n};\n\nconst findProcessedMath = (root: Element): Element[] => Array.from(root.querySelectorAll('.MathJax math'));\nconst findUnprocessedMath = (root: Element): Element[] => {\n const processedMath = findProcessedMath(root);\n return Array.from(root.querySelectorAll('math')).filter((node) => processedMath.indexOf(node) === -1);;\n};\n\nconst findLatexNodes = (root: Element): Element[] => {\n const latexNodes: Element[] = [];\n for (const node of Array.from(root.querySelectorAll(MATH_DATA_SELECTOR))) {\n const formula = node.getAttribute('data-math');\n\n // Set textContent once so that resolveOrWait calls don't\n // undo a MathJax pass before rendered class is applied\n if (!node.classList.contains(MATH_MARKED_CLASS)) {\n node.textContent = (node.tagName.toLowerCase() === 'div')\n ? `${MATH_MARKER_BLOCK}${formula}${MATH_MARKER_BLOCK}`\n : `${MATH_MARKER_INLINE}${formula}${MATH_MARKER_INLINE}`;\n node.classList.add(MATH_MARKED_CLASS);\n }\n latexNodes.push(node);\n }\n\n return latexNodes;\n};\n\nconst typesetLatexNodes = (latexNodes: Element[], windowImpl: Window) => () => {\n if (isEmpty(latexNodes)) {\n return;\n }\n\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(latexNodes),\n markLatexNodesRendered(latexNodes)\n );\n};\n\nconst typesetMathMLNodes = (root: Element, windowImpl: Window) => () => {\n const mathMLNodes = findUnprocessedMath(root);\n\n if (isEmpty(mathMLNodes)) {\n return;\n }\n\n // style the entire document because mathjax is unable to style individual math elements\n windowImpl.MathJax.Hub.Queue(\n () => windowImpl.MathJax.Hub.Typeset(root)\n );\n};\n\nconst markLatexNodesRendered = (latexNodes: Element[]) => () => {\n // Queue a call to mark the found nodes as rendered so are ignored if typesetting is called repeatedly\n // uses className += instead of classList because IE\n const result = [];\n for (const node of latexNodes) {\n result.push(node.className += ` ${MATH_RENDERED_CLASS}`);\n }\n};\n\n// Search document for math and [data-math] elements and then typeset them\nfunction typesetDocument(root: Element, windowImpl: Window) {\n const latexNodes = findLatexNodes(root);\n\n windowImpl.MathJax.Hub.Queue(\n typesetLatexNodes(latexNodes, windowImpl),\n typesetMathMLNodes(root, windowImpl)\n );\n}\n\nconst resolveOrWait = (root: Element, resolve: () => void, remainingTries = 5) => {\n if (\n remainingTries > 0\n && (findLatexNodes(root).length || findUnprocessedMath(root).length)\n ) {\n setTimeout(() => {\n resolveOrWait(root, resolve, remainingTries - 1);\n }, 200);\n } else {\n resolve();\n }\n};\n\nconst typesetDocumentPromise = (root: Element, windowImpl: Window): Promise => new Promise((resolve) => {\n typesetDocument(root, windowImpl);\n windowImpl.MathJax.Hub.Queue(() => {\n resolveOrWait(root, resolve);\n });\n});\n\n// memoize'd getter for typeset document function so that each node's\n// typeset has its own debounce\nconst getTypesetDocument = memoize((root, windowImpl) => {\n // Install a debounce around typesetting function so that it will only run once\n // every Xms even if called multiple times in that period\n return debounce(typesetDocumentPromise, 100, {\n leading: true,\n trailing: false,\n }).bind(null, root, windowImpl);\n});\ngetTypesetDocument.cache = new WeakMap();\n\n// typesetMath is the main exported function.\n// It's called by components like HTML after they're rendered\nconst typesetMath = async (root: Element, windowImpl = window) => {\n await startMathJax();\n\n // check if MathJax is setup\n if (!(windowImpl && windowImpl.MathJax && windowImpl.MathJax.Hub)) {\n console.warn('Warning: Expected MathJax to be initialized.');\n return Promise.resolve();\n }\n\n // schedule a Mathjax pass if there is at least one [data-math] or element present\n if (root.querySelector(COMBINED_MATH_SELECTOR)) {\n return getTypesetDocument(root, windowImpl)();\n }\n\n return Promise.resolve();\n};\n\nconst startMathJax: (windowImpl?: Window) => Promise = once((windowImpl: Window = window) => new Promise((resolve) => {\n const configuredCallback = () => {\n // there doesn't seem to be a config option for this\n windowImpl.MathJax.HTML.Cookie.prefix = 'mathjax';\n // proceed with mathjax initi\n windowImpl.MathJax.Hub.Configured();\n windowImpl.MathJax.Hub.Register.StartupHook('End', () => {\n resolve();\n });\n };\n\n if (!document.getElementById('MathJax-Script')) {\n const script = document.createElement('script');\n script.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_HTMLorMML-full&delayStartupUntil=configured';\n script.id = 'MathJax-Script';\n script.async = true;\n document.head.appendChild(script);\n }\n\n if (windowImpl.MathJax && windowImpl.MathJax.Hub) {\n windowImpl.MathJax.Hub.Config(MATHJAX_CONFIG);\n // Does not seem to work when passed to Config\n windowImpl.MathJax.Hub.processSectionDelay = 0;\n configuredCallback();\n } else {\n // If the MathJax.js file has not loaded yet:\n // Call MathJax.Configured once MathJax loads and\n // loads this config JSON since the CDN URL\n // says to `delayStartupUntil=configured`\n (MATHJAX_CONFIG as any).AuthorInit = configuredCallback;\n windowImpl.MathJax = MATHJAX_CONFIG;\n }\n}));\n\nexport {\n typesetMath,\n startMathJax,\n};\n","import { colors, layouts, breakpoints } from \"../../src/theme\";\nimport styled, { css } from \"styled-components\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faBookOpen, faTriangleExclamation } from \"@fortawesome/free-solid-svg-icons\";\nimport { ExerciseIcons } from \"./Exercise\";\n\nexport const StyledToolbar = styled.div<{\n mobile: boolean;\n desktop: boolean;\n}>`\n position: absolute;\n background: #fff;\n width: 4.5rem;\n border: 1px solid ${colors.palette.light};\n background: #fff;\n margin: ${layouts.card.spacing} 0 0 ${layouts.card.spacing};\n z-index: 1;\n\n > * {\n height: 4.7rem;\n display: flex;\n align-items: center;\n justify-content: center;\n color: ${colors.palette.neutral};\n background: #fff;\n text-decoration: none;\n\n &:after {\n border-bottom: 1px solid #f1f1f1;\n }\n\n svg {\n width: 4.3rem;\n height: 1.6rem;\n transition: color 150ms;\n }\n\n span {\n display: none;\n flex-grow: 1;\n font-size: 1.4rem;\n color: ${colors.palette.neutralDarker};\n }\n\n &:hover {\n box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 2px;\n width: 20rem;\n\n svg {\n color: ${colors.palette.neutralDarker};\n }\n\n span {\n display: block;\n }\n }\n }\n\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n\n ${props => props.mobile && breakpoints.mobile`\n display: block;\n position: relative;\n width: auto;\n display: flex;\n flex-direction: row;\n margin: 0;\n\n &:not(:last-child) {\n border-bottom: 0;\n }\n\n > * {\n flex-direction: column;\n flex-grow: 1;\n align-items: center;\n justify-content: center;\n padding: 1rem 1.8rem 0.6rem;\n height: auto;\n min-height: 4.8rem;\n\n &:hover {\n width: auto;\n }\n\n span {\n display: block;\n font-size: 1rem;\n margin-top: 0.2rem;\n color: ${colors.palette.neutral};\n text-align: center;\n }\n\n & + * {\n border-left: 1px solid ${colors.palette.light};\n }\n }\n `}\n`;\n\nexport const ExerciseToolbar = ({ icons }: { icons?: ExerciseIcons }) => {\n if (!icons) {\n return null;\n }\n const settings = Object.values(icons);\n const mobile = settings.some(({ location }) => location?.toolbar?.mobile ?? true);\n const desktop = settings.some(({ location }) => location?.toolbar?.desktop ?? false);\n const topicUrl = icons.topic?.url;\n const errataUrl = icons.errata?.url;\n\n return \n {topicUrl ? \n \n View topic in textbook\n : null}\n {errataUrl ? \n \n Suggest a correction\n : null}\n \n};\n","import styled, { css } from 'styled-components';\nimport { breakpoints, colors, mixins } from '../../src/theme';\nimport { ExerciseData } from '../../src/types';\nimport { faBookOpen } from '@fortawesome/free-solid-svg-icons/faBookOpen';\nimport { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons/faTriangleExclamation';\nimport { faCircleInfo } from '@fortawesome/free-solid-svg-icons/faCircleInfo';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { ExerciseIcons } from './Exercise';\n\ntype ExplanationType = 'multiple-choice' | 'two-step';\n\nconst TypeExplanations: { [key in ExplanationType]: string } = {\n 'multiple-choice': 'Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts.',\n 'two-step': 'In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. \\\nRecalling the answer to a question from memory helps you to retain things longer.',\n}\n\nconst ItemWrapper = styled.div<{ mobile: boolean; desktop: boolean }>`\n padding: 0.6rem 0.9rem;\n .popover { display: none; }\n &:hover {\n svg path { fill: ${colors.palette.mediumBlue};}\n .popover { display: flex; }\n }\n ${props => !props.desktop && css`\n ${breakpoints.desktop`\n display: none;\n `}\n ${breakpoints.tablet`\n display: none;\n `}\n `}\n ${props => !props.mobile && breakpoints.mobile`\n display: none;\n `}\n`;\n\nconst InnerWrapper = styled.div`\n position: relative;\n display: flex;\n`;\n\nconst Popover = styled.div`\n ${mixins.popover}\n top: 3rem;\n width: 20rem;\n position: absolute;\n font-size: 1.2rem;\n line-height: 1.8rem;\n`;\n\ninterface PopoverItemProps {\n text: string;\n children: JSX.Element;\n wrapperProps?: {\n as: keyof JSX.IntrinsicElements;\n href?: string;\n target?: string;\n },\n mobile: boolean;\n desktop: boolean;\n}\n\nconst PopoverItem = (props: PopoverItemProps) => (\n \n \n {props.children}\n \n
\n
{props.text}
\n
\n
\n \n);\n\nconst PopoverItemsWrapper = styled.div`\n max-width: 200px;\n display: flex;\n justify-content: space-between;\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n color: ${colors.palette.darkGray};\n height: 1em;\n`;\n\nexport const ExerciseHeaderIcons = ({ exercise, icons }: {\n exercise: ExerciseData, icons: ExerciseIcons\n}) => {\n const defaultHeaderLocation = { desktop: true, mobile: false };\n const items = [];\n const isMultipleChoice = exercise.questions.every((q) => q.answers.length > 0);\n let typeExplanation;\n\n if (isMultipleChoice && exercise.questions.find((q) => q.formats.includes('free-response'))) {\n typeExplanation = TypeExplanations['two-step'];\n } else if (isMultipleChoice) {\n typeExplanation = TypeExplanations['multiple-choice'];\n }\n\n if (icons.topic) {\n items.push(\n \n \n \n );\n }\n\n if (icons.errata) {\n items.push(\n \n \n \n )\n }\n\n if (icons.info && typeExplanation) {\n items.push(\n \n \n \n )\n }\n\n return (\n \n {items}\n \n );\n};\n","import React from 'react';\nimport scrollToElement from 'scroll-to-element';\nimport styled, { createGlobalStyle, css } from 'styled-components';\nimport { Answer, ExerciseData, ID, QuestionState, StepBase, StepWithData } from '../../src/types';\nimport { InnerStepCard, OuterStepCard, TaskStepCard, TaskStepCardProps } from './Card';\nimport { Content } from './Content';\nimport { ExerciseQuestion } from './ExerciseQuestion';\nimport { typesetMath } from '../helpers/mathjax';\nimport { ExerciseToolbar, StyledToolbar } from './ExerciseToolbar';\nimport { breakpoints } from '../theme';\nimport { ExerciseHeaderIcons } from './ExerciseHeaderIcons';\nimport { TypesetMathContext } from '../hooks/useTypesetMath';\n\nconst StyledTaskStepCard = styled(TaskStepCard)`\n font-size: calc(1.8rem * var(--content-text-scale));\n line-height: calc(2.8rem * var(--content-text-scale));\n`;\n\nconst GlobalStyle = createGlobalStyle`\n :root {\n --content-text-scale: 1;\n }\n`;\n\nconst ToolbarWrapper = styled.div<{\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n}>`\n ${props => props.desktopToolbarEnabled && css`\n ${breakpoints.desktop`\n ${StyledTaskStepCard} {\n margin-left: 6.8rem;\n }\n `}\n ${breakpoints.tablet`\n ${StyledTaskStepCard} {\n margin-left: 4.8rem;\n }\n `}\n ${breakpoints.mobile`\n ${StyledTaskStepCard} {\n margin-left: 0;\n }\n `}\n `}\n\n ${props => props.mobileToolbarEnabled && css`\n ${breakpoints.mobile`\n ${StyledToolbar} + ${OuterStepCard} ${InnerStepCard} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n `}\n `}\n`;\n\nconst TaskStepCardWithToolbar = (props: React.PropsWithChildren &\n Pick & {\n desktopToolbarEnabled: boolean;\n mobileToolbarEnabled: boolean;\n }\n) => \n \n \n ;\n\nconst Preamble = ({ exercise }: { exercise: ExerciseData }) => {\n return (\n <>\n {exercise.context &&\n }\n\n {exercise.stimulus_html &&\n }\n \n );\n};\n\ninterface ExerciseIconLocation {\n desktop: boolean;\n mobile: boolean;\n}\n\ninterface ExerciseIcon {\n location?: {\n /**\n * @default {\n * desktop: true,\n * mobile: false\n * }\n **/\n header?: ExerciseIconLocation;\n /**\n * @default {\n * desktop: false,\n * mobile: true\n * }\n **/\n toolbar?: ExerciseIconLocation;\n }\n}\n\nexport interface ExerciseIcons {\n /** An object containing a URL for the errata form for this exercise and settings for rendering the icon. */\n errata?: ExerciseIcon & { url: string };\n /** An object containing a URL for textbook content relevant to the exercise and settings for rendering the icon. */\n topic?: ExerciseIcon & { url: string };\n /** An object of settings for rendering the info icon that describes the exercise type (multiple-choice, two-step, etc.) */\n info?: ExerciseIcon;\n}\n\nexport interface ExerciseBaseProps {\n /** An object containing a Step ID and Exercise UID */\n step: StepBase;\n /** An exercise object from the Exercises API */\n exercise: ExerciseData;\n numberOfQuestions: number;\n /** The current question index. For multipart questions this is the first question number. */\n questionNumber: number;\n /** A boolean that enables showing the amount of attempts remaining. */\n hasMultipleAttempts: boolean;\n /** A callback with the question_id when the Submit/Re-submit button is clicked. */\n onAnswerSave: (question_id: number) => void;\n /** A callback with the current question index when the Next/Continue button is clicked. */\n onNextStep: (currentIndex: number) => void;\n /** A boolean that enables always showing every answer feedback_html field. */\n show_all_feedback?: boolean;\n /** The question number to scroll into view when the component renders. */\n scrollToQuestion?: number;\n /** An object containing data for how to render the following icons:\n * - An errata icon linking to the errata/feedback form\n * - An info icon describing the exercise type (multiple-choice, two-step, etc.)\n * - A topic icon linking to the relevant textbook location\n */\n exerciseIcons?: ExerciseIcons;\n hasFeedback?: boolean;\n}\n\nexport interface ExerciseWithStepDataProps extends ExerciseBaseProps {\n /** A Tutor Step object */\n step: StepWithData;\n canAnswer: boolean;\n needsSaved: boolean;\n apiIsPending: boolean;\n onAnswerChange: (answer: Answer) => void;\n canUpdateCurrentStep: boolean;\n answer_id_order?: ID[];\n}\n\nexport interface ExerciseWithQuestionStatesProps extends ExerciseBaseProps {\n questionStates: { [key: ID]: QuestionState };\n /** A callback with the IDs of the answer and question */\n onAnswerChange: (answer: Omit & { id: number, question_id: number }) => void;\n}\n\nexport const Exercise = styled(({\n numberOfQuestions, questionNumber, step, exercise, show_all_feedback, scrollToQuestion, exerciseIcons, ...props\n}: { className?: string } & (ExerciseWithStepDataProps | ExerciseWithQuestionStatesProps)) => {\n const legacyStepRender = 'feedback_html' in step;\n const questionsRef = React.useRef>([]);\n const container = React.useRef(null);\n\n const typesetExercise = React.useCallback(() => {\n if (container.current) {\n typesetMath(container.current);\n }\n }, []);\n\n React.useEffect(() => {\n const el = scrollToQuestion && questionsRef.current[scrollToQuestion];\n if (el) {\n scrollToElement(el);\n }\n }, [scrollToQuestion, exercise]);\n\n const desktopToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.desktop);\n const mobileToolbarEnabled = Object.values(exerciseIcons || {}).some(({ location }) => location?.toolbar?.mobile);\n\n return \n \n : null}\n showTotalQuestions={legacyStepRender}\n desktopToolbarEnabled={desktopToolbarEnabled}\n mobileToolbarEnabled={mobileToolbarEnabled}\n {...(exerciseIcons ? { exerciseIcons: exerciseIcons } : null)}\n className={props.className}\n >\n
\n \n\n {exercise.questions.map((q, i) => {\n const state = { ...(legacyStepRender ? step : props['questionStates'][q.id]) };\n return (\n questionsRef.current[questionNumber + i] = el}\n exercise_uid={exercise.uid}\n key={q.id}\n question={q}\n questionNumber={questionNumber + i}\n choicesEnabled={state.canAnswer}\n displaySolution={true}\n detailedSolution={state.solution?.content_html}\n show_all_feedback={show_all_feedback}\n tableFeedbackEnabled={show_all_feedback && !legacyStepRender}\n canUpdateCurrentStep={\n // misleading prop name, we want to show a continue button for completed questions\n // that aren't the last question, which requires this prop to be true\n 'canUpdateCurrentStep' in props ?\n props.canUpdateCurrentStep : !(i + 1 === exercise.questions.length)\n }\n />\n )\n }\n )}\n
\n \n
;\n})`\n`;\n","const SvgComponent = () => (\n \n \n \n);\nexport default SvgComponent;\n","import styled, { css } from 'styled-components';\nimport { colors, breakpoints } from '../theme';\nimport FlagIcon from '../assets/flag';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faCheck } from '@fortawesome/free-solid-svg-icons/faCheck';\nimport { faXmark } from '@fortawesome/free-solid-svg-icons/faXmark';\n\nconst ProgressBarWrapper = styled.nav`\n display: flex;\n justify-content: center;\n flex-wrap: wrap;\n gap: 1rem;\n padding: 2rem;\n\n ${breakpoints.mobile`\n padding: 1.6rem 0.8rem;\n `}\n`;\n\nconst StyledItemWrapper = styled.span`\n display: flex;\n align-items: center;\n position: relative;\n\n &:last-child {\n margin-right: 0;\n }\n`;\n\nconst handleVariant = (variant: ProgressBarItemVariant) => {\n switch (variant) {\n case 'isStatus':\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n case 'isCorrect':\n return css`\n color: ${colors.answer.correct};\n background-color: #E8F4D8;\n `;\n case 'isIncorrect':\n return css`\n color: ${colors.answer.incorrect};\n background-color: #F8E8EA;\n `;\n default:\n return css`\n background-color: ${colors.palette.neutralBright};\n `;\n }\n};\n\nconst shadowCss = 'box-shadow: 0px 1px 4px 0px #00000066;';\n\nexport const StyledItem = styled.button<{ variant: ProgressBarItemVariant, isActive: boolean }>`\n display: flex;\n justify-content: center;\n align-items: center;\n width: ${props => props.isActive ? '4rem' : '3.2rem'};\n height: ${props => props.isActive ? '4rem' : '3.2rem'};\n border: 0;\n border-radius: 50%;\n margin: ${props => props.isActive ? '0' : '0 0.3rem'};\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n color: ${colors.palette.neutralDarker};\n ${props => props.isActive ? css`\n ${shadowCss}\n & + [data-icon] {\n bottom: 0;\n right: 0;\n }\n ` : null}\n ${props => handleVariant(props.variant)}\n &:hover {\n ${shadowCss}\n }\n`;\n\nconst StyledFontAwesomeIcon = styled(FontAwesomeIcon)`\n background: ${props => props.color};\n color: #fff;\n position: absolute;\n bottom: 0.4rem;\n right: 0.3rem;\n height: 0.8rem;\n width: 0.8rem;\n padding: 0.1rem;\n font-size: 1.2rem;\n border-radius: 50%;\n`;\n\nconst ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {\n if (!variant || variant !== 'isCorrect' && variant !== 'isIncorrect') {\n return null;\n }\n\n const variantData = {\n isCorrect: {\n icon: faCheck,\n color: colors.answer.correct,\n label: 'Correct',\n },\n isIncorrect: {\n icon: faXmark,\n color: colors.answer.incorrect,\n label: 'Incorrect',\n },\n }[variant];\n\n return ;\n}\n\nexport interface ProgressBarProps {\n steps: S[];\n activeIndex: number | null;\n goToStep: (index: number, step: S) => void;\n}\n\nexport interface ProgressBarItemProps {\n index: number;\n isActive: boolean;\n step: S;\n goToStep: (index: number, step: S) => void;\n}\n\nexport type ProgressBarItemVariant = 'isCorrect' | 'isIncorrect' | 'isStatus' | null;\n\nexport const ProgressBarItem = ({index, isActive, step, goToStep}: ProgressBarItemProps) =>\n \n goToStep(index, step)}\n aria-current={isActive ? 'location' : 'false'}\n aria-label={step.variant === 'isStatus' ? 'Assignment status' : `Question ${index + 1}` }\n >\n {step.variant === 'isStatus' ? : index + 1}\n \n \n ;\n\nexport const ProgressBar = ({ steps, activeIndex, goToStep }: ProgressBarProps) =>\n \n {steps.map((step, index) => )}\n ;\n","import { BulletList } from \"react-content-loader\";\nimport { colors } from \"../../src/theme\";\nimport styled from \"styled-components\";\n\nconst Wrapper = styled.div`\n max-width: 1000px;\n @media(min-width: 960px) {\n // Around the height of a multiple choice with 4 options\n min-height: 53.8rem;\n }\n padding: 2rem;\n margin: 2rem;\n border: 1px solid ${colors.palette.light};\n border-radius: 0.25rem;\n background-color: white;\n display: flex;\n justify-content: center;\n align-items: center;\n > svg {\n max-width: 600px;\n flex-grow: 1;\n }\n`;\n\nexport const Loader = () => ;\n"],"names":["ALPHABET","isAnswerIncorrect","answer","incorrectAnswerId","id","countWords","text","words","trim","match","length","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","_templateObject11","_templateObject12","_templateObject13","TypesetMathContext","React","createContext","Error","Content","_ref","html","component","_ref$block","block","props","_objectWithoutPropertiesLoose","_excluded","typesetMath","useContext","useEffect","undefined","cloneElement","_extends","_jsx","jsx","dangerouslySetInnerHTML","__html","SimpleFeedback","children","contentRenderer","className","classnames","Feedback","wrapperClasses","position","_jsxs","palette","red","danger","darkRed","lightRed","green","lightGreen","darkGreen","paleYellow","teal","blue","mediumBlue","lightBlue","neutralLightBlue","tangerine","gray","darkGray","pale","light","white","neutralLightest","neutralCool","neutralBright","neutralLighter","neutralLight","neutralMedium","neutral","neutralThin","neutralDark","neutralFeedback","neutralDarker","black","orange","colors","hover","checked","correct","incorrect","popover","arrowOuterColor","borderColor","card","header","background","body","button","backgroundHover","backgroundActive","freeResponse","color","layouts","BREAKPOINTS","breakpoints","css","_taggedTemplateLiteralLoose","apply","slice","call","arguments","desktop","transitions","mixins","answerColor","invertBubble","answerChecked","answerCorrect","answerIncorrect","answerHover","answerCorrectAnswer","resetText","stepCardPadding","visuallyHidden","StyledAnswerIndicator","styled","div","state","AnswerIndicator","isCorrect","isIncorrect","AnswerAnswer","_props$answer","content_html","feedback_html","show_all_feedback","tableFeedbackEnabled","TeacherReview","answered_count","iter","percent","selected_count","Math","round","cn","AnswerChoice","onChangeAnswer","type","disabled","onKeyPress","qid","feedbackId","isSelected","ariaLabel","hasCorrectAnswer","jsxs","_Fragment","Fragment","correctIncorrectIcon","name","onChange","htmlFor","AnswerBody","Answer","answerId","correctAnswerId","isChecked","isAnswerChecked","correctness","isAnswerCorrect","classes","displayName","AnswersTable","idCounter","question","_props$type","correct_answer_id","correct_answer_feedback_html","_props$show_all_feedb","answerIdOrder","instructions","hideAnswers","idOrder","feedback","questionAnswerProps","answer_id","choicesEnabled","answersHtml","answers","sort","a","b","indexOf","map","i","additionalProps","question_id","parseInt","key","answerProps","Object","assign","push","index","forEach","item","spliceIndex","splice","role","InnerStepCard","OuterStepCard","StepCardHeader","StepCardQuestion","StepCard","questionNumber","numberOfQuestions","showTotalQuestions","stepType","isHomework","availablePoints","unpadded","questionId","multipartBadge","leftHeaderChildren","rightHeaderChildren","headerTitleChildren","otherProps","TaskStepCard","_ref2","step","_excluded2","task","uid","StyledButton","Button","isWaiting","waitingText","GlobalStyle","createGlobalStyle","CompletionStatusCard","CompletionHeader","h2","CompletionStatus","numberCompleted","handleClick","allCompleted","someCompleted","buttonText","split","toLowerCase","onClick","StyledQuestion","Question","forwardRef","ref","exerciseUid","solution","exercise_uid","context","hidePreambles","stem_html","_question$collaborato","collaborator_solutions","formats","stimulus_html","is_deleted","_question$collaborato2","displaySolution","find","s","hasSolution","join","QuestionHtml","hidden","displayFormats","FormatsListing","_props$html","_ref$formats","format","StepCardFooter","TextAreaErrorStyle","StyledFreeResponse","SyledQuestionStem","InfoRow","hasChildren","FreeResponseTextArea","textarea","isOverWordLimit","readOnly","RevertButton","FreeResponseInput","cancelHandler","defaultValue","infoRowChildren","isSubmitDisabled","saveHandler","submitBtnLabel","textHasChanged","wordLimit","questionProps","placeholder","AttemptsRemaining","count","PublishedComments","published_comments","SaveButton","willContinue","attempt_number","NextButton","canUpdateCurrentStep","FreeResponseReview","_ref3","free_response","ExerciseQuestion","answer_id_order","onAnswerChange","is_completed","hasMultipleAttempts","attempts_remaining","detailedSolution","canAnswer","needsSaved","apiIsPending","onAnswerSave","onNextStep","available_points","hasFeedback","_React$useState","useState","shouldContinue","setShouldContinue","MATH_MARKER_BLOCK","MATH_MARKER_INLINE","MATH_MARKED_CLASS","MATHJAX_CONFIG","extensions","showProcessingMessages","skipStartupTypeset","styles","left","right","visibility","tex2jax","displayMath","inlineMath","findUnprocessedMath","root","processedMath","Array","from","querySelectorAll","findProcessedMath","filter","node","findLatexNodes","latexNodes","_i","_Array$from","formula","getAttribute","classList","contains","textContent","tagName","add","resolveOrWait","resolve","remainingTries","setTimeout","typesetDocumentPromise","windowImpl","Promise","MathJax","Hub","Queue","isEmpty","Typeset","_step","result","_iterator","_createForOfIteratorHelperLoose","done","value","markLatexNodesRendered","typesetLatexNodes","mathMLNodes","typesetMathMLNodes","typesetDocument","getTypesetDocument","memoize","debounce","leading","trailing","bind","cache","WeakMap","startMathJax","once","window","configuredCallback","HTML","Cookie","prefix","Configured","Register","StartupHook","document","getElementById","script","createElement","src","async","head","appendChild","Config","processSectionDelay","AuthorInit","StyledToolbar","mobile","ExerciseToolbar","_icons$topic","_icons$errata","icons","settings","values","some","_location$toolbar$mob","_location$toolbar","location","toolbar","_location$toolbar$des","_location$toolbar2","topicUrl","topic","url","errataUrl","errata","href","target","FontAwesomeIcon","icon","faBookOpen","faTriangleExclamation","ItemWrapper","InnerWrapper","Popover","PopoverItem","wrapperProps","PopoverItemsWrapper","StyledFontAwesomeIcon","ExerciseHeaderIcons","typeExplanation","_icons$topic$location","_icons$errata$locatio","_icons$info$location","exercise","defaultHeaderLocation","items","isMultipleChoice","questions","every","q","includes","as","info","faCircleInfo","height","width","StyledTaskStepCard","ToolbarWrapper","desktopToolbarEnabled","mobileToolbarEnabled","TaskStepCardWithToolbar","exerciseIcons","Preamble","Exercise","scrollToQuestion","legacyStepRender","questionsRef","useRef","container","typesetExercise","useCallback","current","then","querySelector","MATH_DATA_SELECTOR","console","warn","e","reject","el","scrollToElement","_ref4","Provider","_state$solution","_createElement","SvgComponent","viewBox","fill","xmlns","d","ProgressBarWrapper","nav","StyledItemWrapper","span","shadowCss","StyledItem","isActive","variant","handleVariant","ItemIcon","variantData","faCheck","label","faXmark","ProgressBarItem","goToStep","FlagIcon","Wrapper","BulletList","uniqueKey","activeIndex","steps"],"mappings":"isEAEaA,EAAW,6BAeXC,EAAoB,SAACC,EAAgBC,GAAsB,OAEtED,EAAOE,KAAOD,YAKAE,EAAWC,GACzB,IAEMC,EAFcD,EAAKE,OAECC,MAAM,qBAChC,OAAIF,EACGA,EAAMG,OADM,EAIR,IChCbC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,ICEaC,EAAqBC,EAAK,QAACC,cAA0B,WAAQ,MAAM,IAAIC,MAAM,4DCa7EC,EAAW,SAAJC,GAEhB,IADDC,EAAID,EAAJC,KAAMC,EAASF,EAATE,UAASC,EAAAH,EAAEI,MAAAA,OAAQ,IAAHD,GAAQA,EAAKE,EAAKC,EAAAN,EAAAO,GAEnCC,EDf4BZ,EAAAA,QAAMa,WAAWd,GCqBnD,OAJAC,UAAMc,UAAU,WACdF,KACC,CAACA,EAAaP,SAECU,IAAdT,EACKN,UAAMgB,aAAaV,EAASW,EAAA,CAAGZ,KAAAA,GAASI,IAGxCS,EAAAC,IADLX,EACK,MAEA,OAFAS,EAAKG,CAAAA,wBAAyB,CAAEC,OAAQhB,IAAYI,cCjBzDa,EAAiB,SAACb,UACtBS,EAAAC,IAAA,QAAA,CAAAI,SACEL,MAACf,EAAO,CACNG,UAAWG,EAAMe,gBACjBC,UAAWC,UAAW,4BAA6B,WAAYjB,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,OAAM2Q,EAAS1T,EAAO0B,mBACjBuR,EAAW,WAAa,qBACT,aAAjBvR,EAAKwR,QAAyB,oBAAkClT,aAAAA,EAAQ,GAAG/J,SAErE,aAAjByL,EAAKwR,QAAyBtd,EAAAA,IAAC+d,OAAc3T,EAAQ,IAExDpK,EAAAA,IAACwd,GAAQ,CAACF,QAASxR,EAAKwR,cC/ItBU,GAAU1Y,EAAM,QAACC,IAAGvH,KAAAA,GAAAmG,EAQJrB,CAAAA,6MAAAA,gMAAAA,EAAOjC,QAAQkB,2KAYf,WAAM,OAAA/B,EAAAA,IAACge,GAAQ,CAAA3d,SAAAL,EAAAA,IAACie,EAAAA,WAAW,CAAAC,UAAU,iDD8HhC,SAAHlN,GAAA,IAA0DmN,EAAWnN,EAAXmN,YAAaL,EAAQ9M,EAAR8M,SAC7F,OAAA9d,MAAC+c,GAAkB,CAAA,aAAY,cAAa1c,SADkC2Q,EAALoN,MAEhE1U,IAAI,SAACoC,EAAM1B,GAAK,OAAKpK,MAAC6d,GAE3B,CAAAzT,MAAOA,EACPiT,SAAUjT,IAAU+T,EACpBrS,KAAMA,EACNgS,SAAUA,GAJL1T"} \ No newline at end of file diff --git a/dist/scripts/download-json.d.ts b/dist/scripts/download-json.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/scripts/download-json.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/scripts/generate-chapter-reading-homework-pdfs.d.ts b/dist/scripts/generate-chapter-reading-homework-pdfs.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/scripts/generate-chapter-reading-homework-pdfs.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/scripts/generate-pdf.d.ts b/dist/scripts/generate-pdf.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/scripts/generate-pdf.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/assets/flag.d.ts b/dist/src/assets/flag.d.ts new file mode 100644 index 0000000..4143a29 --- /dev/null +++ b/dist/src/assets/flag.d.ts @@ -0,0 +1,2 @@ +declare const SvgComponent: () => JSX.Element; +export default SvgComponent; diff --git a/dist/src/components/Answer.d.ts b/dist/src/components/Answer.d.ts new file mode 100644 index 0000000..4ef2523 --- /dev/null +++ b/dist/src/components/Answer.d.ts @@ -0,0 +1,26 @@ +import { ReactNode } from 'react'; +import { Answer as AnswerType, ID } from '../types'; +export interface AnswerProps { + answer: AnswerType; + iter: number; + qid: ID; + type: 'teacher-review' | 'teacher-preview' | 'student' | 'student-mpp'; + hasCorrectAnswer?: boolean; + onChangeAnswer?: (answer: AnswerType) => void; + disabled: boolean; + answerId?: ID; + correctAnswerId?: ID | null; + incorrectAnswerId?: ID; + onKeyPress?: () => void; + answered_count?: number; + correctIncorrectIcon?: ReactNode; + radioBox?: ReactNode; + contentRenderer?: JSX.Element; + show_all_feedback?: boolean; + tableFeedbackEnabled?: boolean; + feedbackId?: string; +} +export declare const Answer: { + (props: AnswerProps): JSX.Element; + displayName: string; +}; diff --git a/dist/src/components/Answer.spec.d.ts b/dist/src/components/Answer.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Answer.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Answer.stories.d.ts b/dist/src/components/Answer.stories.d.ts new file mode 100644 index 0000000..9930909 --- /dev/null +++ b/dist/src/components/Answer.stories.d.ts @@ -0,0 +1,4 @@ +export declare const Default: () => JSX.Element; +export declare const Checked: () => JSX.Element; +export declare const Correct: () => JSX.Element; +export declare const Incorrect: () => JSX.Element; diff --git a/dist/src/components/AnswersTable.d.ts b/dist/src/components/AnswersTable.d.ts new file mode 100644 index 0000000..a01f240 --- /dev/null +++ b/dist/src/components/AnswersTable.d.ts @@ -0,0 +1,23 @@ +import { AnswerDisplayType, ID, ExerciseQuestionData } from "src/types"; +export interface AnswersTableProps { + question: ExerciseQuestionData; + type?: AnswerDisplayType; + answer_id?: ID; + correct_answer_id?: ID | null; + incorrectAnswerId?: ID; + answerIdOrder?: ID[]; + feedback_html: string; + correct_answer_feedback_html?: string; + answered_count?: number; + show_all_feedback?: boolean; + tableFeedbackEnabled?: boolean; + onChangeAnswer: () => void; + hideAnswers: boolean; + hasCorrectAnswer?: boolean; + onChangeAttempt?: () => void; + choicesEnabled?: boolean; + onKeyPress?: () => void; + contentRenderer?: JSX.Element; + instructions?: JSX.Element; +} +export declare const AnswersTable: (props: AnswersTableProps) => JSX.Element | null; diff --git a/dist/src/components/AnswersTable.spec.d.ts b/dist/src/components/AnswersTable.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/AnswersTable.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/AnswersTable.stories.d.ts b/dist/src/components/AnswersTable.stories.d.ts new file mode 100644 index 0000000..6ff4860 --- /dev/null +++ b/dist/src/components/AnswersTable.stories.d.ts @@ -0,0 +1,5 @@ +export declare const Default: () => JSX.Element; +export declare const Checked: () => JSX.Element; +export declare const CorrectAnswerFeedback: () => JSX.Element; +export declare const Ordered: () => JSX.Element; +export declare const Instructions: () => JSX.Element; diff --git a/dist/src/components/Button.d.ts b/dist/src/components/Button.d.ts new file mode 100644 index 0000000..5224e6a --- /dev/null +++ b/dist/src/components/Button.d.ts @@ -0,0 +1,11 @@ +/// +interface ButtonProps extends React.ComponentPropsWithoutRef<'button'> { + isWaiting?: never; + waitingText?: never; +} +interface WaitingButtonProps extends React.ComponentPropsWithoutRef<'button'> { + isWaiting: boolean; + waitingText: string; +} +declare const Button: (props: ButtonProps | WaitingButtonProps) => JSX.Element; +export default Button; diff --git a/dist/src/components/Button.spec.d.ts b/dist/src/components/Button.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Button.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Button.stories.d.ts b/dist/src/components/Button.stories.d.ts new file mode 100644 index 0000000..b7d7f96 --- /dev/null +++ b/dist/src/components/Button.stories.d.ts @@ -0,0 +1,3 @@ +export declare const Default: () => JSX.Element; +export declare const Disabled: () => JSX.Element; +export declare const Waiting: () => JSX.Element; diff --git a/dist/src/components/Card.d.ts b/dist/src/components/Card.d.ts new file mode 100644 index 0000000..b1a1736 --- /dev/null +++ b/dist/src/components/Card.d.ts @@ -0,0 +1,38 @@ +import { ReactNode } from "react"; +import { AvailablePoints, StepBase, StepWithData } from "../types"; +export declare const InnerStepCard: import("styled-components").StyledComponent<"div", any, {}, never>; +export declare const OuterStepCard: import("styled-components").StyledComponent<"div", any, {}, never>; +interface SharedProps { + questionNumber: number; + numberOfQuestions: number; + showTotalQuestions: boolean; + leftHeaderChildren?: ReactNode; + rightHeaderChildren?: ReactNode; + headerTitleChildren?: ReactNode; +} +export interface StepCardProps extends SharedProps { + unpadded: boolean; + className?: string; + children?: ReactNode; + stepType: StepWithData['type']; + availablePoints?: AvailablePoints; + questionId?: string; + multipartBadge?: ReactNode; + isHomework: boolean; +} +declare const StepCard: { + ({ questionNumber, numberOfQuestions, showTotalQuestions, stepType, isHomework, availablePoints, unpadded, className, children, questionId, multipartBadge, leftHeaderChildren, rightHeaderChildren, headerTitleChildren, ...otherProps }: StepCardProps): JSX.Element; + displayName: string; +}; +export interface TaskStepCardProps extends SharedProps { + className?: string; + children?: ReactNode; + step: StepBase | StepWithData; + questionNumber: number; + numberOfQuestions: number; +} +declare const TaskStepCard: { + ({ step, questionNumber, numberOfQuestions, children, className, ...otherProps }: TaskStepCardProps): JSX.Element; + displayName: string; +}; +export { StepCard, TaskStepCard }; diff --git a/dist/src/components/Card.spec.d.ts b/dist/src/components/Card.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Card.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Card.stories.d.ts b/dist/src/components/Card.stories.d.ts new file mode 100644 index 0000000..8dfde6b --- /dev/null +++ b/dist/src/components/Card.stories.d.ts @@ -0,0 +1,2 @@ +export declare const Default: () => JSX.Element; +export declare const CustomComponents: () => JSX.Element; diff --git a/dist/src/components/CompletionStatus.d.ts b/dist/src/components/CompletionStatus.d.ts new file mode 100644 index 0000000..eb1d0ca --- /dev/null +++ b/dist/src/components/CompletionStatus.d.ts @@ -0,0 +1,7 @@ +export interface CompletionStatusProps { + numberOfQuestions: number; + numberCompleted: number; + handleClick: () => void; + className?: string; +} +export declare const CompletionStatus: import("styled-components").StyledComponent<({ numberOfQuestions, numberCompleted, handleClick, className }: CompletionStatusProps) => JSX.Element, any, {}, never>; diff --git a/dist/src/components/CompletionStatus.spec.d.ts b/dist/src/components/CompletionStatus.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/CompletionStatus.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/CompletionStatus.stories.d.ts b/dist/src/components/CompletionStatus.stories.d.ts new file mode 100644 index 0000000..6651c87 --- /dev/null +++ b/dist/src/components/CompletionStatus.stories.d.ts @@ -0,0 +1,3 @@ +export declare const Default: () => JSX.Element; +export declare const PartialComplete: () => JSX.Element; +export declare const Complete: () => JSX.Element; diff --git a/dist/src/components/Content.d.ts b/dist/src/components/Content.d.ts new file mode 100644 index 0000000..e92b1ac --- /dev/null +++ b/dist/src/components/Content.d.ts @@ -0,0 +1,10 @@ +import React from "react"; +declare type ComponentType = keyof JSX.IntrinsicElements | React.JSXElementConstructor; +export interface ContentProps { + className?: string; + component?: T extends undefined ? undefined : T extends ComponentType ? React.ReactComponentElement : never; + html: string; + block?: boolean; +} +export declare const Content: ({ html, component, block, ...props }: ContentProps) => JSX.Element; +export {}; diff --git a/dist/src/components/Content.spec.d.ts b/dist/src/components/Content.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Content.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Exercise.d.ts b/dist/src/components/Exercise.d.ts new file mode 100644 index 0000000..4b7b526 --- /dev/null +++ b/dist/src/components/Exercise.d.ts @@ -0,0 +1,85 @@ +import { Answer, ExerciseData, ID, QuestionState, StepBase, StepWithData } from '../../src/types'; +interface ExerciseIconLocation { + desktop: boolean; + mobile: boolean; +} +interface ExerciseIcon { + location?: { + /** + * @default { + * desktop: true, + * mobile: false + * } + **/ + header?: ExerciseIconLocation; + /** + * @default { + * desktop: false, + * mobile: true + * } + **/ + toolbar?: ExerciseIconLocation; + }; +} +export interface ExerciseIcons { + /** An object containing a URL for the errata form for this exercise and settings for rendering the icon. */ + errata?: ExerciseIcon & { + url: string; + }; + /** An object containing a URL for textbook content relevant to the exercise and settings for rendering the icon. */ + topic?: ExerciseIcon & { + url: string; + }; + /** An object of settings for rendering the info icon that describes the exercise type (multiple-choice, two-step, etc.) */ + info?: ExerciseIcon; +} +export interface ExerciseBaseProps { + /** An object containing a Step ID and Exercise UID */ + step: StepBase; + /** An exercise object from the Exercises API */ + exercise: ExerciseData; + numberOfQuestions: number; + /** The current question index. For multipart questions this is the first question number. */ + questionNumber: number; + /** A boolean that enables showing the amount of attempts remaining. */ + hasMultipleAttempts: boolean; + /** A callback with the question_id when the Submit/Re-submit button is clicked. */ + onAnswerSave: (question_id: number) => void; + /** A callback with the current question index when the Next/Continue button is clicked. */ + onNextStep: (currentIndex: number) => void; + /** A boolean that enables always showing every answer feedback_html field. */ + show_all_feedback?: boolean; + /** The question number to scroll into view when the component renders. */ + scrollToQuestion?: number; + /** An object containing data for how to render the following icons: + * - An errata icon linking to the errata/feedback form + * - An info icon describing the exercise type (multiple-choice, two-step, etc.) + * - A topic icon linking to the relevant textbook location + */ + exerciseIcons?: ExerciseIcons; + hasFeedback?: boolean; +} +export interface ExerciseWithStepDataProps extends ExerciseBaseProps { + /** A Tutor Step object */ + step: StepWithData; + canAnswer: boolean; + needsSaved: boolean; + apiIsPending: boolean; + onAnswerChange: (answer: Answer) => void; + canUpdateCurrentStep: boolean; + answer_id_order?: ID[]; +} +export interface ExerciseWithQuestionStatesProps extends ExerciseBaseProps { + questionStates: { + [key: ID]: QuestionState; + }; + /** A callback with the IDs of the answer and question */ + onAnswerChange: (answer: Omit & { + id: number; + question_id: number; + }) => void; +} +export declare const Exercise: import("styled-components").StyledComponent<({ numberOfQuestions, questionNumber, step, exercise, show_all_feedback, scrollToQuestion, exerciseIcons, ...props }: { + className?: string; +} & (ExerciseWithStepDataProps | ExerciseWithQuestionStatesProps)) => JSX.Element, any, {}, never>; +export {}; diff --git a/dist/src/components/Exercise.spec.d.ts b/dist/src/components/Exercise.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Exercise.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Exercise.stories.d.ts b/dist/src/components/Exercise.stories.d.ts new file mode 100644 index 0000000..e8b66c9 --- /dev/null +++ b/dist/src/components/Exercise.stories.d.ts @@ -0,0 +1,10 @@ +export declare const Default: () => JSX.Element; +export declare const DefaultWithoutFeedback: () => JSX.Element; +export declare const DeprecatedStepData: () => JSX.Element; +export declare const CompleteWithFeedback: () => JSX.Element; +export declare const CompleteWithoutFeedback: () => JSX.Element; +export declare const IncorrectWithFeedbackAndSolution: () => JSX.Element; +export declare const IncorrectWithFeedbackAndSolutionWrappingText: () => JSX.Element; +export declare const MultiPartHalfComplete: () => JSX.Element; +export declare const Icons: () => JSX.Element; +export declare const MathJax: () => JSX.Element; diff --git a/dist/src/components/ExerciseHeaderIcons.d.ts b/dist/src/components/ExerciseHeaderIcons.d.ts new file mode 100644 index 0000000..1814a63 --- /dev/null +++ b/dist/src/components/ExerciseHeaderIcons.d.ts @@ -0,0 +1,6 @@ +import { ExerciseData } from '../../src/types'; +import { ExerciseIcons } from './Exercise'; +export declare const ExerciseHeaderIcons: ({ exercise, icons }: { + exercise: ExerciseData; + icons: ExerciseIcons; +}) => JSX.Element; diff --git a/dist/src/components/ExerciseHeaderIcons.spec.d.ts b/dist/src/components/ExerciseHeaderIcons.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/ExerciseHeaderIcons.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/ExerciseQuestion.d.ts b/dist/src/components/ExerciseQuestion.d.ts new file mode 100644 index 0000000..2ca0b74 --- /dev/null +++ b/dist/src/components/ExerciseQuestion.d.ts @@ -0,0 +1,45 @@ +import React from "react"; +import { AvailablePoints, ID, ExerciseQuestionData, Task } from "../types"; +import { ExerciseBaseProps } from "./Exercise"; +export interface ExerciseQuestionProps { + task?: Task; + question: ExerciseQuestionData; + answer_id_order?: ID[]; + questionNumber: number; + choicesEnabled: boolean; + hasMultipleAttempts: boolean; + onAnswerChange: () => void; + onAnswerSave: ExerciseBaseProps['onAnswerSave']; + onNextStep: ExerciseBaseProps['onNextStep']; + feedback_html: string; + correct_answer_feedback_html: string; + is_completed: boolean; + correct_answer_id: ID; + incorrectAnswerId: ID; + answer_id?: ID; + attempts_remaining: number; + published_comments?: string; + detailedSolution?: string; + canAnswer: boolean; + needsSaved: boolean; + canUpdateCurrentStep: boolean; + attempt_number: number; + apiIsPending: boolean; + displaySolution: boolean; + available_points?: AvailablePoints; + exercise_uid: string; + free_response?: string; + show_all_feedback?: boolean; + tableFeedbackEnabled?: boolean; + hasFeedback?: ExerciseBaseProps['hasFeedback']; +} +export declare const SaveButton: (props: { + disabled: boolean; + isWaiting: boolean; + attempt_number: number; + willContinue: boolean; +} & React.ComponentPropsWithoutRef<'button'>) => JSX.Element; +export declare const NextButton: (props: { + canUpdateCurrentStep: boolean; +} & React.ComponentPropsWithoutRef<'button'>) => JSX.Element; +export declare const ExerciseQuestion: React.ForwardRefExoticComponent>; diff --git a/dist/src/components/ExerciseQuestion.spec.d.ts b/dist/src/components/ExerciseQuestion.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/ExerciseQuestion.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/ExerciseQuestion.stories.d.ts b/dist/src/components/ExerciseQuestion.stories.d.ts new file mode 100644 index 0000000..cd43d3b --- /dev/null +++ b/dist/src/components/ExerciseQuestion.stories.d.ts @@ -0,0 +1,5 @@ +export declare const Default: () => JSX.Element; +export declare const FreeResponseEntered: () => JSX.Element; +export declare const MultipleAttemptsAllLeft: () => JSX.Element; +export declare const MultipleAttemptsOneLeft: () => JSX.Element; +export declare const MultipleAttemptsNoneLeft: () => JSX.Element; diff --git a/dist/src/components/ExerciseToolbar.d.ts b/dist/src/components/ExerciseToolbar.d.ts new file mode 100644 index 0000000..8ed9a68 --- /dev/null +++ b/dist/src/components/ExerciseToolbar.d.ts @@ -0,0 +1,8 @@ +import { ExerciseIcons } from "./Exercise"; +export declare const StyledToolbar: import("styled-components").StyledComponent<"div", any, { + mobile: boolean; + desktop: boolean; +}, never>; +export declare const ExerciseToolbar: ({ icons }: { + icons?: ExerciseIcons | undefined; +}) => JSX.Element | null; diff --git a/dist/src/components/ExerciseToolbar.spec.d.ts b/dist/src/components/ExerciseToolbar.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/ExerciseToolbar.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/ExerciseToolbar.stories.d.ts b/dist/src/components/ExerciseToolbar.stories.d.ts new file mode 100644 index 0000000..c99f2e8 --- /dev/null +++ b/dist/src/components/ExerciseToolbar.stories.d.ts @@ -0,0 +1,2 @@ +export declare const Default: () => JSX.Element; +export declare const DefaultMobileOnly: () => JSX.Element; diff --git a/dist/src/components/Feedback.d.ts b/dist/src/components/Feedback.d.ts new file mode 100644 index 0000000..786b7ff --- /dev/null +++ b/dist/src/components/Feedback.d.ts @@ -0,0 +1,10 @@ +interface FeedbackProps { + position?: 'top' | 'bottom' | 'left' | 'right'; + children: string; + className?: string; + contentRenderer?: JSX.Element; + id: string; +} +declare const SimpleFeedback: (props: Pick) => JSX.Element; +declare const Feedback: ({ id, ...props }: FeedbackProps) => JSX.Element; +export { Feedback, SimpleFeedback }; diff --git a/dist/src/components/Feedback.stories.d.ts b/dist/src/components/Feedback.stories.d.ts new file mode 100644 index 0000000..8615f83 --- /dev/null +++ b/dist/src/components/Feedback.stories.d.ts @@ -0,0 +1 @@ +export declare const Default: () => JSX.Element; diff --git a/dist/src/components/FreeResponseInput.d.ts b/dist/src/components/FreeResponseInput.d.ts new file mode 100644 index 0000000..cb06176 --- /dev/null +++ b/dist/src/components/FreeResponseInput.d.ts @@ -0,0 +1,24 @@ +import { MouseEventHandler, ReactNode } from 'react'; +import { AvailablePoints, ExerciseQuestionData } from 'src/types'; +export interface FreeResponseProps { + readOnly: boolean; + wordLimit: number; + infoRowChildren?: ReactNode; + onChange: (event: React.ChangeEvent) => void; + cancelHandler: MouseEventHandler; + saveHandler: MouseEventHandler; + defaultValue: string; + isSubmitDisabled: boolean; + questionNumber: number; + question: ExerciseQuestionData; + availablePoints?: AvailablePoints; + textHasChanged: boolean; + submitBtnLabel: string; +} +export declare const FreeResponseTextArea: import("styled-components").StyledComponent<"textarea", any, { + isOverWordLimit: boolean; +} & FreeResponseProps, never>; +export declare const FreeResponseInput: { + (props: FreeResponseProps): JSX.Element; + displayName: string; +}; diff --git a/dist/src/components/FreeResponseInput.spec.d.ts b/dist/src/components/FreeResponseInput.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/FreeResponseInput.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/FreeResponseInput.stories.d.ts b/dist/src/components/FreeResponseInput.stories.d.ts new file mode 100644 index 0000000..e274227 --- /dev/null +++ b/dist/src/components/FreeResponseInput.stories.d.ts @@ -0,0 +1,3 @@ +export declare const Default: () => JSX.Element; +export declare const OverWordLimit: () => JSX.Element; +export declare const SubmittedDate: () => JSX.Element; diff --git a/dist/src/components/Loader.d.ts b/dist/src/components/Loader.d.ts new file mode 100644 index 0000000..a1457ba --- /dev/null +++ b/dist/src/components/Loader.d.ts @@ -0,0 +1 @@ +export declare const Loader: () => JSX.Element; diff --git a/dist/src/components/Loader.spec.d.ts b/dist/src/components/Loader.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Loader.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Loader.stories.d.ts b/dist/src/components/Loader.stories.d.ts new file mode 100644 index 0000000..8615f83 --- /dev/null +++ b/dist/src/components/Loader.stories.d.ts @@ -0,0 +1 @@ +export declare const Default: () => JSX.Element; diff --git a/dist/src/components/Print.stories.d.ts b/dist/src/components/Print.stories.d.ts new file mode 100644 index 0000000..8615f83 --- /dev/null +++ b/dist/src/components/Print.stories.d.ts @@ -0,0 +1 @@ +export declare const Default: () => JSX.Element; diff --git a/dist/src/components/ProgressBar.d.ts b/dist/src/components/ProgressBar.d.ts new file mode 100644 index 0000000..056a950 --- /dev/null +++ b/dist/src/components/ProgressBar.d.ts @@ -0,0 +1,24 @@ +export declare const StyledItem: import("styled-components").StyledComponent<"button", any, { + variant: ProgressBarItemVariant; + isActive: boolean; +}, never>; +export interface ProgressBarProps { + steps: S[]; + activeIndex: number | null; + goToStep: (index: number, step: S) => void; +} +export interface ProgressBarItemProps { + index: number; + isActive: boolean; + step: S; + goToStep: (index: number, step: S) => void; +} +export declare type ProgressBarItemVariant = 'isCorrect' | 'isIncorrect' | 'isStatus' | null; +export declare const ProgressBarItem: ({ index, isActive, step, goToStep }: ProgressBarItemProps) => JSX.Element; +export declare const ProgressBar: ({ steps, activeIndex, goToStep }: ProgressBarProps) => JSX.Element; diff --git a/dist/src/components/ProgressBar.spec.d.ts b/dist/src/components/ProgressBar.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/ProgressBar.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/ProgressBar.stories.d.ts b/dist/src/components/ProgressBar.stories.d.ts new file mode 100644 index 0000000..d2dc430 --- /dev/null +++ b/dist/src/components/ProgressBar.stories.d.ts @@ -0,0 +1,4 @@ +export declare const Default: () => JSX.Element; +export declare const InProgress: () => JSX.Element; +export declare const Review: () => JSX.Element; +export declare const StatusStep: () => JSX.Element; diff --git a/dist/src/components/Question.d.ts b/dist/src/components/Question.d.ts new file mode 100644 index 0000000..02b37de --- /dev/null +++ b/dist/src/components/Question.d.ts @@ -0,0 +1,35 @@ +import { ID, ExerciseQuestionData, Task } from 'src/types'; +import React, { ReactNode } from 'react'; +export interface QuestionProps { + question: ExerciseQuestionData; + answer_id?: ID; + task?: Task | null; + correct_answer_id: ID | null; + incorrectAnswerId: ID; + hideAnswers: boolean; + hidePreambles?: boolean; + exercise_uid?: string; + displayFormats: boolean; + className: string; + questionNumber: number; + displaySolution: boolean; + context?: string; + correct_answer_feedback_html?: string; + contentRenderer?: JSX.Element; + feedback_html: string; + onChange: () => void; + show_all_feedback?: boolean; + tableFeedbackEnabled?: boolean; + children?: ReactNode; + answerIdOrder?: ID[]; + choicesEnabled?: boolean; +} +export declare const Question: React.ForwardRefExoticComponent>; +interface QuestionHtmlProps { + html?: string; + type: string; + hidden: QuestionProps['hidePreambles']; + questionNumber?: QuestionProps['questionNumber']; +} +export declare const QuestionHtml: (props: QuestionHtmlProps) => JSX.Element | null; +export {}; diff --git a/dist/src/components/Question.spec.d.ts b/dist/src/components/Question.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/components/Question.spec.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/dist/src/components/Question.stories.d.ts b/dist/src/components/Question.stories.d.ts new file mode 100644 index 0000000..6c96c8d --- /dev/null +++ b/dist/src/components/Question.stories.d.ts @@ -0,0 +1,5 @@ +export declare const Default: () => JSX.Element; +export declare const Checked: () => JSX.Element; +export declare const Correct: () => JSX.Element; +export declare const Incorrect: () => JSX.Element; +export declare const Math: () => JSX.Element; diff --git a/dist/src/components/StepCardFooter.d.ts b/dist/src/components/StepCardFooter.d.ts new file mode 100644 index 0000000..698712a --- /dev/null +++ b/dist/src/components/StepCardFooter.d.ts @@ -0,0 +1 @@ +export declare const StepCardFooter: import("styled-components").StyledComponent<"div", any, {}, never>; diff --git a/dist/src/constants.d.ts b/dist/src/constants.d.ts new file mode 100644 index 0000000..375214d --- /dev/null +++ b/dist/src/constants.d.ts @@ -0,0 +1,2 @@ +import { AnswerDisplayType } from './types'; +export declare const defaultAnswerType: AnswerDisplayType; diff --git a/dist/src/helpers/mathjax.d.ts b/dist/src/helpers/mathjax.d.ts new file mode 100644 index 0000000..2d88ce0 --- /dev/null +++ b/dist/src/helpers/mathjax.d.ts @@ -0,0 +1,9 @@ +declare global { + interface Window { + MathJax?: any; + __debugMathJax?: boolean; + } +} +declare const typesetMath: (root: Element, windowImpl?: Window & typeof globalThis) => Promise; +declare const startMathJax: (windowImpl?: Window) => Promise; +export { typesetMath, startMathJax, }; diff --git a/dist/src/hooks/useTypesetMath.d.ts b/dist/src/hooks/useTypesetMath.d.ts new file mode 100644 index 0000000..716b443 --- /dev/null +++ b/dist/src/hooks/useTypesetMath.d.ts @@ -0,0 +1,3 @@ +import React from "react"; +export declare const TypesetMathContext: React.Context<() => void>; +export declare const useTypesetMath: () => () => void; diff --git a/dist/src/index.d.ts b/dist/src/index.d.ts new file mode 100644 index 0000000..cbfd733 --- /dev/null +++ b/dist/src/index.d.ts @@ -0,0 +1,10 @@ +export * from './components/Answer'; +export * from './components/AnswersTable'; +export * from './components/CompletionStatus'; +export * from './components/Question'; +export * from './components/FreeResponseInput'; +export * from './components/Card'; +export * from './components/Exercise'; +export * from './components/ProgressBar'; +export * from './components/Loader'; +export * from './components/ExerciseToolbar'; diff --git a/dist/src/test/fixtures.d.ts b/dist/src/test/fixtures.d.ts new file mode 100644 index 0000000..9ca3b7b --- /dev/null +++ b/dist/src/test/fixtures.d.ts @@ -0,0 +1 @@ +export declare const answerContent: string[]; diff --git a/dist/src/test/utils.d.ts b/dist/src/test/utils.d.ts new file mode 100644 index 0000000..249a97e --- /dev/null +++ b/dist/src/test/utils.d.ts @@ -0,0 +1,2 @@ +import renderer from 'react-test-renderer'; +export declare const findByTestId: (instance: renderer.ReactTestInstance, id: string) => renderer.ReactTestInstance; diff --git a/dist/src/theme.d.ts b/dist/src/theme.d.ts new file mode 100644 index 0000000..4e24a1b --- /dev/null +++ b/dist/src/theme.d.ts @@ -0,0 +1,242 @@ +export declare const colors: { + palette: { + red: string; + danger: string; + darkRed: string; + lightRed: string; + green: string; + lightGreen: string; + darkGreen: string; + paleYellow: string; + teal: string; + blue: string; + mediumBlue: string; + lightBlue: string; + neutralLightBlue: string; + tangerine: string; + gray: string; + darkGray: string; + pale: string; + light: string; + white: string; + neutralLightest: string; + neutralCool: string; + neutralBright: string; + neutralLighter: string; + neutralLight: string; + neutralMedium: string; + neutral: string; + neutralThin: string; + neutralDark: string; + neutralFeedback: string; + neutralDarker: string; + black: string; + orange: string; + }; + answer: { + neutral: string; + hover: string; + checked: string; + correct: string; + incorrect: string; + }; + popover: { + arrowOuterColor: string; + borderColor: string; + }; + card: { + header: { + background: string; + }; + body: { + background: string; + }; + }; + button: { + background: string; + backgroundHover: string; + backgroundActive: string; + }; + freeResponse: { + color: string; + background: string; + }; +}; +export declare const layouts: { + answer: { + verticalSpacing: string; + horizontalSpacing: string; + horizontalBuffer: string; + bubbleSize: string; + labelSpacing: string; + feedback: { + popover: { + horizontalSpacing: string; + verticalSpacing: string; + maxWidth: string; + }; + }; + }; + popover: { + arrow: { + width: string; + height: string; + edgeDistance: string; + }; + horizontalSpacing: string; + verticalSpacing: string; + horizontalBuffer: string; + borderWidth: string; + maxWidth: string; + }; + card: { + spacing: string; + }; +}; +export declare const BREAKPOINTS: { + mobile: number; + tablet: number; + desktop: number; + large: number; +}; +export declare const breakpoints: { + mobile(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + tablet(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + desktop(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + only: { + mobile(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + }; + margins: { + mobile: string; + tablet: string; + }; +}; +export declare const transitions: { + answer: string; +}; +export declare const mixins: { + answer: () => import("styled-components").FlattenSimpleInterpolation; + answerColor: (color: string, invertBubble?: boolean) => import("styled-components").FlattenSimpleInterpolation; + answerChecked: () => import("styled-components").FlattenSimpleInterpolation; + answerCorrect: (checked?: boolean) => import("styled-components").FlattenSimpleInterpolation; + answerIncorrect: (checked?: boolean) => import("styled-components").FlattenSimpleInterpolation; + answerHover: () => import("styled-components").FlattenSimpleInterpolation; + answerCorrectAnswer: () => import("styled-components").FlattenSimpleInterpolation; + resetText: () => import("styled-components").FlattenSimpleInterpolation; + stepCardPadding: () => import("styled-components").FlattenInterpolation>; + popover: () => import("styled-components").FlattenSimpleInterpolation; + visuallyHidden: () => import("styled-components").FlattenSimpleInterpolation; +}; +declare const theme: { + colors: { + palette: { + red: string; + danger: string; + darkRed: string; + lightRed: string; + green: string; + lightGreen: string; + darkGreen: string; + paleYellow: string; + teal: string; + blue: string; + mediumBlue: string; + lightBlue: string; + neutralLightBlue: string; + tangerine: string; + gray: string; + darkGray: string; + pale: string; + light: string; + white: string; + neutralLightest: string; + neutralCool: string; + neutralBright: string; + neutralLighter: string; + neutralLight: string; + neutralMedium: string; + neutral: string; + neutralThin: string; + neutralDark: string; + neutralFeedback: string; + neutralDarker: string; + black: string; + orange: string; + }; + answer: { + neutral: string; + hover: string; + checked: string; + correct: string; + incorrect: string; + }; + popover: { + arrowOuterColor: string; + borderColor: string; + }; + card: { + header: { + background: string; + }; + body: { + background: string; + }; + }; + button: { + background: string; + backgroundHover: string; + backgroundActive: string; + }; + freeResponse: { + color: string; + background: string; + }; + }; + layouts: { + answer: { + verticalSpacing: string; + horizontalSpacing: string; + horizontalBuffer: string; + bubbleSize: string; + labelSpacing: string; + feedback: { + popover: { + horizontalSpacing: string; + verticalSpacing: string; + maxWidth: string; + }; + }; + }; + popover: { + arrow: { + width: string; + height: string; + edgeDistance: string; + }; + horizontalSpacing: string; + verticalSpacing: string; + horizontalBuffer: string; + borderWidth: string; + maxWidth: string; + }; + card: { + spacing: string; + }; + }; + transitions: { + answer: string; + }; + breakpoints: { + mobile(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + tablet(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + desktop(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + only: { + mobile(first: import("styled-components").CSSObject | import("styled-components").InterpolationFunction> | TemplateStringsArray, ...interpolations: import("styled-components").Interpolation>[]): import("styled-components").FlattenInterpolation>; + }; + margins: { + mobile: string; + tablet: string; + }; + }; +}; +export default theme; diff --git a/dist/src/types/index.d.ts b/dist/src/types/index.d.ts new file mode 100644 index 0000000..2551185 --- /dev/null +++ b/dist/src/types/index.d.ts @@ -0,0 +1,136 @@ +export interface ExercisePersonData { + user_id: ID; + name: string; +} +export interface ExerciseAnswerData { + id: ID; + content_html: string; + correctness?: string; + feedback_html?: string; + isCorrect?: boolean; +} +export interface ExerciseTagData { + id: ID; + type: string; + is_visible: boolean; + data: string; +} +export interface ExerciseQuestionData { + id: ID; + is_answer_order_important: boolean; + stimulus_html: string; + stem_html: string; + answers: ExerciseAnswerData[]; + hints?: string[]; + formats: string[]; + combo_choices?: any[]; + collaborator_solutions?: Solution[]; + community_solutions?: Solution[]; +} +export interface ExerciseQueryData { + title?: string; + exercises: ExerciseData[]; +} +export interface ExerciseData { + tags: string[]; + uuid: string; + group_uuid: string; + number: ID; + version: number; + uid: string; + published_at: string; + authors: ExercisePersonData[]; + copyright_holders: ExercisePersonData[]; + derived_from: any[]; + is_vocab: boolean; + context?: string; + stimulus_html: string; + questions: ExerciseQuestionData[]; + versions: number[]; + solutions_are_public: boolean; +} +export declare type Answer = { + id: ID; + question_id: number; + correctness?: string | null | undefined; + isCorrect?: boolean; + content_html: string; + selected_count?: number; + feedback_html?: string; +}; +export declare type StepBase = { + /** A Step ID from Tutor or the index from Assessments */ + id: number; + /** An exercise UID (number@version) */ + uid: string; + /** The number of available points to display in the header that wraps the exercise question(s). */ + available_points?: AvailablePoints; +}; +export declare type StepWithData = StepBase & { + type?: 'exercise'; + task?: Task; + preview?: string; + is_completed: boolean; + answer_id?: ID; + answer_id_order?: ID[]; + free_response: string; + feedback_html: string; + correct_answer_id: ID; + correct_answer_feedback_html: string; + last_completed_at?: Date; + response_validation?: any; + external_url?: ''; + formats?: string[]; + can_be_updated?: boolean; + is_feedback_available?: boolean; + exercise_id?: ID; + attempts_remaining?: number; + attempt_number?: number; + solution?: Solution; + incorrectAnswerId?: ID; +}; +export declare type QuestionState = { + /** The number of available points to display in the footer for the question. */ + available_points: AvailablePoints; + /** A boolean that will display the Continue/Next button when true and canAnswer is false */ + is_completed: boolean; + /** A number ID of the user's selected Answer */ + answer_id?: number; + /** An array of Answer IDs that specify the order to display them when hasMultipleAttempts is true. */ + answer_id_order: ID[]; + /** A string of the user's written response, used in two-step/WRM */ + free_response: string; + /** A string of HTML to display below the incorrect answer */ + feedback_html: string; + /** An ID of the answer to mark as correct. is_complete must also be true for this to display. */ + correct_answer_id: ID; + /** A string of HTML to display below the correct answer */ + correct_answer_feedback_html: string; + response_validation?: any; + /** A number of the attempts remaining to display when hasMultipleAttempts is true. */ + attempts_remaining: number; + /** A number of the current attempt. Determines the button text - "Submit" when 0, otherwise "Re-submit". */ + attempt_number: number; + /** A Solution object that renders the content_html in the footer as "Detailed solution" */ + solution?: Solution; + /** An ID of the answer to mark as incorrect. Will always display regardless of correct_answer_id and is_completed. */ + incorrectAnswerId: ID; + /** A boolean that will disable the input controls and turn the Submit/Re-Submit button into Next/Continue when false. */ + canAnswer: boolean; + /** A boolean that will enable the Submit/Re-Submit button when this and canAnswer are true. */ + needsSaved: boolean; + /** A boolean that will change the Submit/Re-Submit button to a disabled "Saving..." button when true */ + apiIsPending: boolean; +}; +export interface Solution { + images?: any[]; + content_html: string; + solution_type: string; +} +export declare type Task = { + is_deleted: boolean; + type?: 'homework'; +}; +export declare type AnswerDisplayType = 'teacher-review' | 'teacher-preview' | 'student' | 'student-mpp'; +export declare type ID = string | number; +export declare type AvailablePoints = `${number}.${number}`; diff --git a/dist/src/utils.d.ts b/dist/src/utils.d.ts new file mode 100644 index 0000000..8d93aef --- /dev/null +++ b/dist/src/utils.d.ts @@ -0,0 +1,7 @@ +import { Answer, ID } from '../src/types'; +export declare const ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; +export declare const isAnswerCorrect: (answer: Answer, correctAnswerId?: ID | null) => boolean | undefined; +export declare const isAnswerIncorrect: (answer: Answer, incorrectAnswerId?: ID) => boolean; +export declare const isAnswerChecked: (answer: Answer, answerId?: ID) => boolean; +export declare function countWords(text: string): number; +export declare const numberfyId: (id: ID) => number; diff --git a/dist/src/utils.spec.d.ts b/dist/src/utils.spec.d.ts new file mode 100644 index 0000000..509db18 --- /dev/null +++ b/dist/src/utils.spec.d.ts @@ -0,0 +1 @@ +export {};