@cuemath/leap 3.4.7-m-t → 3.4.7-m1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement } from 'react';\n\nimport type { TNodeTypes } from '../../../types/models/worksheet';\nimport type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO-ANTIL: Accept only validation which can be 'system' or 'teacher' or undefined\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n\n // If true, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n studentClassroomId?: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends Omit<IBaseWorksheetProps, 'behavior'>,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n isLessonV3Enabled?: boolean; // If true, the worksheet is rendered in lesson v3 mode\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAQY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"worksheet-types.js","sources":["../../../../src/features/worksheet/worksheet/worksheet-types.ts"],"sourcesContent":["import type { MutableRefObject, ReactElement, ReactNode } from 'react';\n\nimport type { TNodeTypes } from '../../../types/models/worksheet';\nimport type { IActionData, TPublish, TSubscribe } from '../../cue-canvas/types/cue-canvas';\nimport type { TPublishMouseMove, TSubscribeMouseMove } from '../../pointer-sync/pointer-types';\nimport type { TColorNames, THueNames, TUserTypes } from '../../ui/types';\nimport type { IFile } from './worksheet-question/subjective-review';\n\nexport enum QUESTION_TAGS {\n TRIAL_TOPIC = 'trial-topic',\n QUESTION_CODE = 'question code',\n}\n\nexport enum QUESTIONS_RATING {\n E = 3,\n S = 2, // Just right\n H = 1,\n}\n\nexport interface ILearnosityError {\n code: number;\n consumerKey: string;\n detail: string;\n errorUI: string;\n msg: string;\n}\n\ninterface ILearnosityQuestionMetadata {\n widget_reference: string;\n sheet_reference: string;\n hints?: string[];\n solution?: string[];\n teacher_tips?: string[];\n valid_response_count: number;\n source: {\n organisation_id: number;\n };\n}\n\nexport type TInstructorStimulus =\n | 'SystemIntro' // lesson v3\n | 'Intro' // lesson v3\n | 'Concept-Intro' // lesson v3\n | 'Instruction' // lesson v3\n | 'Task' // lesson v3\n | 'Try' // trial v3\n | 'Learn' // trial v3\n | 'Apply'; // trial v3\nexport type TItemType =\n | 'overview'\n | 'learning-we-do'\n | 'learning-your-turn'\n | 'learning-explore'\n | 'practice-basic'\n | 'practice-basic-optional'\n | 'practice-regular'\n | 'practice-regular-optional'\n | 'exit-ticket'\n | 'advanced-we-do'\n | 'advanced-your-turn'\n | 'advanced-explore'\n | 'advanced-practice';\n\nexport type TSectionName =\n | 'overview'\n | 'learning'\n | 'practice-basic'\n | 'practice-regular'\n | 'exit-ticket'\n | 'advanced';\n\nexport interface IQuestionValidResponse {\n score: number;\n value: unknown[];\n}\n\nexport interface ISheetNudgeBannerInfo {\n bannerBackgroundColor: TColorNames;\n label: string;\n}\n\nexport interface ILearnosityQuestion {\n response_id: string;\n instructor_stimulus?: TInstructorStimulus;\n metadata: ILearnosityQuestionMetadata;\n instant_feedback?: boolean;\n math_renderer?: string;\n template?: string;\n tokenization?: string;\n numberPad?: string[];\n symbols?: unknown[];\n response_container?: Record<string, unknown>;\n ui_style?: Record<string, unknown>;\n shuffle_options?: boolean;\n // for custom type question validation is undefined.\n validation?: {\n scoring_type?: string;\n unscored?: boolean;\n valid_response?: IQuestionValidResponse;\n alt_responses?: IQuestionValidResponse[];\n penalty?: number;\n min_score_if_attempted?: number;\n };\n is_math?: boolean;\n labels?: Record<string, unknown>;\n line?: Record<string, unknown>;\n points?: string[];\n snap_to_ticks?: boolean;\n ticks?: Record<string, unknown>;\n max_length?: number;\n type:\n | 'hotspot'\n | 'tokenhighlight'\n | 'numberline'\n | 'clozeassociation'\n | 'clozetext'\n | 'association'\n | 'classification'\n | 'clozedropdown'\n | 'clozeformula'\n | 'mcq'\n | 'choicematrix'\n | 'plaintext'\n | 'drawing';\n case_sensitive?: boolean;\n show_copy?: boolean;\n show_cut?: boolean;\n show_paste?: boolean;\n spellcheck?: boolean;\n stimulus?: string;\n stimulus_review?: string;\n stimulus_list?: string[];\n image?: Record<string, unknown>;\n areas?: unknown[];\n area_attributes?: Record<string, unknown>;\n possible_responses?: string[][] | string[];\n duplicate_responses?: boolean;\n response_containers?: unknown[];\n options?: Record<string, unknown>[] | string[];\n feedback_attempts?: number;\n stems?: string[];\n multiple_responses?: boolean;\n}\n\nexport interface ILearnosityItem {\n reference: string;\n questions: ILearnosityQuestion[];\n source: Record<string, unknown>;\n content: string;\n metadata: Record<string, unknown> | unknown[];\n workflow: unknown[];\n response_ids: string[];\n feature_ids: unknown[];\n features: unknown[];\n itemType?: TItemType;\n tags?: string[];\n}\n\nexport interface IWorksheetQuestion extends ILearnosityQuestion {\n item_reference: string;\n item_type?: TItemType;\n section_name?: TSectionName;\n is_optional?: boolean;\n item_tags: string[];\n item_tags_map: Record<string, string>;\n item_number: number;\n item_display_number: number;\n question_number: number;\n total_questions: number;\n}\n\nexport interface ILearnosityQuestionScore {\n score?: number | null;\n max_score: number;\n unscored?: boolean;\n}\n\nexport interface ILearnosityQuestionResponse {\n value: unknown;\n responses?: unknown;\n type: unknown;\n updatedFormat?: boolean;\n wordCount?: number;\n apiVersion: string;\n revision: number;\n feedbackAttemptsCount?: number;\n}\n\nexport interface IAttempt {\n response: ILearnosityQuestionResponse;\n score: ILearnosityQuestionScore;\n}\n\ninterface ITeacherReview {\n reviewComment?: string;\n images?: string[];\n}\nexport interface IWorksheetResponse {\n widgetReference: string;\n itemReference: string;\n itemPosition: number; // 0 based\n questionPosition: number; // 0 based\n isOkayTypeQuestion: boolean;\n response?: ILearnosityQuestionResponse;\n simState?: Record<string, unknown>;\n score?: ILearnosityQuestionScore;\n responseEdited?: boolean;\n hintsUsed?: number;\n markedForReview?: boolean;\n attemptsHistory?: IAttempt[];\n validatedByTeacher?: boolean;\n submittedByStudent?: boolean;\n assignStatus?: 'assigned' | 'skipped';\n rating?: number;\n skipped?: boolean;\n doubtResolved?: boolean;\n teacherReview?: ITeacherReview;\n tags?: Record<string, string>;\n timeSpent?: number;\n}\n\ntype TMathRenderer = 'mathjax' | 'mathquill';\nexport interface ILearnosity {\n ready: () => void;\n questions: () => Record<string, unknown>;\n question: (responseId: string) =>\n | {\n enable: () => boolean;\n disable: () => boolean;\n getQuestion: () => ILearnosityQuestion;\n getMetadata: () => ILearnosityQuestionMetadata;\n getResponse: () => ILearnosityQuestionResponse;\n getScore: (\n callback?: (score: ILearnosityQuestionScore | null) => void,\n ) => ILearnosityQuestionScore;\n validate: (\n options?: { showCorrectAnswers?: boolean; feedbackAttempts?: boolean },\n callback?: () => void,\n ) => void;\n resetValidationUI: () => void;\n on: (eventName: 'changed', callback: () => void) => void;\n off: (eventName: 'changed', callback?: () => void) => void;\n }\n | undefined;\n append: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n appendQuestion: (toAppend: {\n questions: ILearnosityQuestion[];\n responses?: Record<string, unknown>;\n }) => void;\n reset: () => void;\n renderMath: (renderer: TMathRenderer) => void;\n}\n\nexport interface IWorksheetBehavior {\n /**\n * If true, Opens the worksheet in resume mode.\n * - If false, Opens the worksheet in review mode.\n */\n canAttempt: boolean;\n /**\n * If true, the user can mark the question for review.\n */\n canMarkForReview: boolean;\n /**\n * The mode of navigation for the worksheet.\n * - `OPEN` mode allows the user to navigate to any question in the worksheet.\n * - `LINEAR` mode allows the user to navigate to the next question only.\n * - `ADAPTIVE` mode allows the user to navigate future questions based on the rating of the current question.\n * - `CURRENT` mode allows the user to navigate to the current question only. Back and forth not allowed.\n */\n navigationMode: 'OPEN' | 'LINEAR' | 'ADAPTIVE' | 'CURRENT';\n /**\n * The initial question to display when the worksheet is loaded.\n * - `FIRST` mode displays the first question in the worksheet.\n * - `CURRENT` mode displays the question that the user was last on.\n */\n initialQuestion: 'FIRST' | 'CURRENT';\n /**\n * If hints are available, on clicking the help button, first availble hint will be shown.\n * Clicking again will show the next hint.\n * If no more hints are available, onHelp will be called.\n */\n hints: boolean;\n /**\n * The time in seconds after which the hints button will be shown.\n */\n hintsTimer?: number; // in seconds\n /**\n * If true, the user can skip the question without attempting it.\n * Skip button will be shown only after the hints are exausted and skipTimer is reached.\n */\n skippable?: boolean;\n /**\n * The time in seconds after which the user can skip the question.\n */\n skippableTime?: number; // in seconds\n /**\n * If true, teacher validation is needed for the question to proceed\n */\n teacherValidationEnabled: boolean;\n /**\n * If worksheet is attempting outside the class setting\n * This needs teacherValidationEnabled to be true\n * TODO-ANTIL: Accept only validation which can be 'system' or 'teacher' or undefined\n */\n canTeacherValidate: boolean;\n /**\n * If true, questions will be validated and feedback will be shown.\n */\n validation: boolean;\n /**\n * If true, solution wont be shown to the user.\n */\n solutionHidden?: boolean;\n /**\n * If true, questions will be validated and feedback will be shown along with the correct answer.\n */\n review: boolean;\n /**\n * The maximum number of attempts allowed for each question.\n * 0 means unlimited attempts.\n * -1 means attempts will not be validated, hence not pushed to attempt history.\n * -2 means the sheet is a puzzle sheet\n * After reaching the maximum number of attempts, the user cannot attempt the question anymore.\n * If maxAtttmpts reached and canExceedAttempts is true, the user can still attempt the question\n * , also user will have the option to move to next question\n */\n maximumAttempts: number;\n /**\n * If true, the user can exceed the maximum number of attempts.\n */\n canExceedAttempts: boolean;\n /**\n * If the worksheet minimumAccuracy is not met, on clicking the final submit button, onMinimumAccuracyNotMet will be called.\n */\n minimumAccuracy: number;\n /**\n * Label for the check button\n * For example,\n * - \"Check\" for Checking the answer\n * - \"Submit\" for Submitting the answer when doing assessment\n */\n checkButtonLabel: string;\n /**\n * If attempt is incorrect, we show retry button, this is the label for the retry button\n * For example,\n * - 'Try Again' for retrying the question\n */\n retryButtonLabel: string;\n /**\n * If true show demos calculator https://www.desmos.com/calculator\n */\n canShowDesmosCalc: boolean;\n\n // If true, canvas is enabled and user can use canvas to scribble on the worksheet by toggling the scribble button\n canvasEnabled?: boolean;\n\n // If true, the user can scribble on workheet\n canScribble?: boolean;\n}\n\nexport type TWORKSHHET_QUESTION_MEDIA_TYPE = 'SIMULATION' | 'VIDEO' | 'AUDIO';\n\nexport interface IWorksheetCallbackProps {\n onResponseChange?: (options: {\n responseId: string;\n response: IWorksheetResponse;\n isNewAttempt: boolean;\n question: IWorksheetQuestion;\n }) => void;\n onBulkResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onResponsesChange?: (responses: Record<string, IWorksheetResponse>) => void;\n onMediaStateChange?: (\n question: IWorksheetQuestion,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n onTeacherValidation?: (questionId: string, rating?: keyof typeof QUESTIONS_RATING) => void;\n onOptionalItemAssignment?: (itemType: TItemType) => void;\n onOptionalItemSkip?: (itemType: TItemType) => void;\n onHelp?: (options: { questionId: string; questionNumber: string }) => void;\n onMinimumAccuracyNotMet?: (accuracy: number) => void;\n onExitTicketStart?: () => void;\n onExitTicketSubmit?: () => void;\n onSubmit?: (responses: Record<string, IWorksheetResponse>) => void;\n loggerRef: MutableRefObject<(eventName: string, data?: Record<string, unknown>) => void>;\n}\n\nexport interface ICueCanvasCallbackProps {\n onPublishStrokes?: TPublish;\n onReceiveStrokes?: TSubscribe;\n}\n\nexport interface ICueCanvasProps {\n initialStrokesData?: Record<string, IActionData[]>;\n}\n\nexport interface IPointerSyncCallbackProps {\n onPublishMouseMove?: TPublishMouseMove;\n onSubscribeMouseMove?: TSubscribeMouseMove;\n}\n\nexport interface IWorksheetLayout {\n containerStyle: 'none' | 'card';\n navigationBar: 'none' | 'top' | 'bottom';\n actionBar: 'none' | 'bottom';\n containerWidth: string;\n topOffset: number; // Offset from the top of the screen, for eg: height of the header\n questionsScrollable: boolean;\n minQuestionHeight: string | number;\n minSummaryHeight: string | number;\n renderSideBar: boolean;\n showUserPointer?: boolean;\n renderQuestionHeader?: boolean;\n imageHue?: THueNames;\n background?: 'none' | 'paper';\n questionPadding: number;\n}\n\nexport interface ISubjectiveSheetProps {\n onAddReviewComment?: (\n responseId: string,\n commentData: {\n score: ILearnosityQuestionScore;\n teacherReview: ITeacherReview;\n },\n ) => void;\n openImagesReviewModal?: (props: IOpenImageReviewModalProps) => void;\n handleReviewSubmit?: () => void;\n isSubmittingReview?: boolean;\n isReviewPending?: boolean;\n}\n\ninterface IBaseWorksheetProps {\n userType: TUserTypes;\n userId: string;\n studentId: string;\n studentName?: string;\n worksheetName: string;\n layout: IWorksheetLayout;\n behavior: IWorksheetBehavior;\n initialResponseId?: string;\n initialItemIndex?: number;\n updatedResponses?: Record<string, IWorksheetResponse>;\n worksheetCompleted: boolean;\n showNudgeBanner?: boolean;\n markedAsCompleted?: boolean;\n onResolveDoubt?: (responseId: string) => void;\n onActiveQuestionChange?: (question: IWorksheetQuestion) => void;\n canResolveDoubt?: boolean;\n onSkip?: (itemIndex: number, widgetIndex: number) => void;\n canShowActionBar?: boolean;\n actionBarRightElement?: ReactElement; // Extra Elements to be rendered in the action bar\n}\n\ninterface IWorksheetPlugins {\n plugins?: {\n stickers?: ReactNode;\n };\n}\n\nexport interface IWorksheetProps\n extends IBaseWorksheetProps,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {\n learnosityActivityRef?: string;\n learnosityItems: ILearnosityItem[];\n learnosityResponses?: Record<string, IWorksheetResponse>;\n learnosity: ILearnosity;\n appendedQuestionIds: string[];\n questionsSignedRequest: string;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n studentId: string;\n attemptId?: string;\n subjectiveProps?: ISubjectiveSheetProps;\n}\n\nexport interface IUpdateImages {\n filteredImages: string[];\n newImages: IFile[];\n}\nexport interface IOpenImageReviewModalProps {\n isReviewed?: boolean;\n disableScoreForm?: boolean;\n imageUrls?: string[];\n filteredImageUrls?: (props: IUpdateImages) => void;\n uploadedImages?: (IFile | string)[];\n image?: string;\n}\n\nexport interface IWorksheetContainerProps\n extends Omit<IBaseWorksheetProps, 'behavior'>,\n IWorksheetCallbackProps,\n ICueCanvasProps,\n ICueCanvasCallbackProps,\n IPointerSyncCallbackProps,\n IWorksheetPlugins {\n studentId: string;\n attemptId?: string;\n itemsSignedRequest: string;\n questionsSignedRequest: string;\n onLoaded: () => void;\n onErrored: (error: { code?: number; message: string }) => void;\n onResponsesLoaded?: (responses: Record<string, IWorksheetResponse>) => void;\n openQuestionFeedbackModal?: (itemRef: string) => void;\n summaryDescription?: ReactElement | null;\n canSubmitWorksheet?: boolean;\n subjectiveProps?: ISubjectiveSheetProps;\n inClass?: boolean; // If true, the worksheet is rendered inside class\n isLessonV3Enabled?: boolean; // If true, the worksheet is rendered in lesson v3 mode\n isDesmosEnabled?: boolean; // If true, the worksheet can show desmos calculator\n nodeType: TNodeTypes; // NodeType of the worksheet\n mode: 'resume' | 'review' | 'preview'; // mode of the worksheet\n}\n\nexport interface IWorksheetRef {\n validateQuestion: (\n responseId: string,\n rating?: keyof typeof QUESTIONS_RATING,\n skipRemainingQuestions?: boolean,\n ) => void;\n assignOptionalItems: (itemType: TItemType) => void;\n skipOptionalItems: (itemType: TItemType) => void;\n updateMediaState: (\n responseId: string,\n mediaType: TWORKSHHET_QUESTION_MEDIA_TYPE,\n mediaState: Record<string, unknown>,\n ) => void;\n}\n\ninterface IWorksheetHeaderLayoutArgs {\n isPuzzleWorksheet?: boolean;\n isTestWorksheet?: boolean;\n imageHue?: THueNames;\n}\n\nexport interface IWorksheetHeaderLayoutProps {\n (args: IWorksheetHeaderLayoutArgs): {\n bgColor: TColorNames;\n borderColor?: TColorNames;\n textColor?: TColorNames;\n };\n}\n"],"names":["QUESTION_TAGS","QUESTIONS_RATING"],"mappings":"AAQY,IAAAA,sBAAAA,OACVA,EAAA,cAAc,eACdA,EAAA,gBAAgB,iBAFNA,IAAAA,KAAA,CAAA,CAAA,GAKAC,sBAAAA,OACVA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KACAA,EAAAA,EAAA,IAAI,CAAJ,IAAA,KAHUA,IAAAA,KAAA,CAAA,CAAA;"}
@@ -1,27 +1,27 @@
1
- import { jsxs as y, Fragment as st, jsx as i } from "react/jsx-runtime";
2
- import { memo as at, forwardRef as dt, useMemo as z, useState as C, useCallback as S, useEffect as T, useLayoutEffect as ct } from "react";
3
- import lt from "../../../assets/line-icons/icons/check2.js";
4
- import mt from "../../../assets/line-icons/icons/info2.js";
5
- import ut from "../../../helpers/get-device-details.js";
6
- import ht from "../../sheet-tools/desmos-calculator/desmos-calculator.js";
7
- import de from "../../ui/layout/flex-view.js";
8
- import ft from "../../ui/text/text.js";
9
- import pt from "../user-pointer-pin/user-pin.js";
10
- import { WORKSHEET_NUDGE_BANNER_HEIGHT as ce, TOP_NAVIGATION_HEIGHT as gt, DESMOS_CALC_POSITION as bt } from "./constants.js";
11
- import It from "./hooks/use-create-imperative-handle.js";
12
- import Ct from "./hooks/use-get-active-question-id.js";
13
- import St from "./hooks/use-time-on-questions.js";
14
- import kt from "./question-tips.js";
15
- import $t from "./worksheet-action-bar/worksheet-action-bar.js";
16
- import Tt from "./worksheet-blocker/worksheet-blocker.js";
17
- import { getWorksheetDimensions as vt, getQuestionsFromItems as Et, getInitialResponses as wt, getLastUnlockedQuestionIndex as le, getInitialQuestionId as Nt, getQuestionMetadata as me, scrollToQuestion as x, getRenderableQuestions as Bt, getWorksheetNudgeBannerInfo as At } from "./worksheet-helpers.js";
18
- import yt from "./worksheet-navigation/worksheet-navigation.js";
19
- import Wt from "./worksheet-question/worksheet-question.js";
20
- import _t from "./worksheet-sidebar/navigator.js";
21
- import Ot from "./worksheet-sidebar/sidebar.js";
22
- import { NudgeBannerWrapper as Dt, NudgeBannerIcon as ue, WorksheetContainer as Vt, NavigationContainer as Ht, NavigationWrapper as Mt, BlockerWrapper as xt, DesmosCalcWrapper as Rt, ActionbarContainer as Pt, ActionbarWrapper as Qt, StudentWorksheetSideBar as Gt, QuestionsWrapper as Ft } from "./worksheet-styled.js";
23
- import jt from "./worksheet-summary/worksheet-summary.js";
24
- const qt = (he, fe) => {
1
+ import { jsxs as y, Fragment as rt, jsx as i } from "react/jsx-runtime";
2
+ import { memo as st, forwardRef as at, useMemo as z, useState as C, useCallback as S, useEffect as T, useLayoutEffect as ct } from "react";
3
+ import dt from "../../../assets/line-icons/icons/check2.js";
4
+ import lt from "../../../assets/line-icons/icons/info2.js";
5
+ import mt from "../../../helpers/get-device-details.js";
6
+ import ut from "../../sheet-tools/desmos-calculator/desmos-calculator.js";
7
+ import ce from "../../ui/layout/flex-view.js";
8
+ import ht from "../../ui/text/text.js";
9
+ import ft from "../user-pointer-pin/user-pin.js";
10
+ import { WORKSHEET_NUDGE_BANNER_HEIGHT as de, TOP_NAVIGATION_HEIGHT as pt, DESMOS_CALC_POSITION as gt } from "./constants.js";
11
+ import bt from "./hooks/use-create-imperative-handle.js";
12
+ import It from "./hooks/use-get-active-question-id.js";
13
+ import Ct from "./hooks/use-time-on-questions.js";
14
+ import St from "./question-tips.js";
15
+ import kt from "./worksheet-action-bar/worksheet-action-bar.js";
16
+ import $t from "./worksheet-blocker/worksheet-blocker.js";
17
+ import { getWorksheetDimensions as Tt, getQuestionsFromItems as vt, getInitialResponses as Et, getLastUnlockedQuestionIndex as le, getInitialQuestionId as wt, getQuestionMetadata as me, scrollToQuestion as x, getRenderableQuestions as Nt, getWorksheetNudgeBannerInfo as Bt } from "./worksheet-helpers.js";
18
+ import At from "./worksheet-navigation/worksheet-navigation.js";
19
+ import yt from "./worksheet-question/worksheet-question.js";
20
+ import Wt from "./worksheet-sidebar/navigator.js";
21
+ import _t from "./worksheet-sidebar/sidebar.js";
22
+ import { NudgeBannerWrapper as Ot, NudgeBannerIcon as ue, WorksheetContainer as Dt, NavigationContainer as Vt, NavigationWrapper as Ht, BlockerWrapper as Mt, DesmosCalcWrapper as xt, ActionbarContainer as Rt, ActionbarWrapper as Pt, StudentWorksheetSideBar as Qt, QuestionsWrapper as Gt } from "./worksheet-styled.js";
23
+ import Ft from "./worksheet-summary/worksheet-summary.js";
24
+ const jt = (he, fe) => {
25
25
  const {
26
26
  userType: r,
27
27
  studentName: pe = "Student",
@@ -66,56 +66,55 @@ const qt = (he, fe) => {
66
66
  onResolveDoubt: Me,
67
67
  onSkip: xe,
68
68
  studentId: Re,
69
- studentClassroomId: Pe,
70
- subjectiveProps: Qe,
71
- canShowActionBar: Ge = !0,
72
- actionBarRightElement: Fe
73
- } = he, { initialQuestion: je, navigationMode: m, teacherValidationEnabled: qe, maximumAttempts: ee } = a, {
69
+ subjectiveProps: Pe,
70
+ canShowActionBar: Qe = !0,
71
+ actionBarRightElement: Ge
72
+ } = he, { initialQuestion: Fe, navigationMode: m, teacherValidationEnabled: je, maximumAttempts: ee } = a, {
74
73
  containerStyle: O,
75
- containerWidth: Le,
74
+ containerWidth: qe,
76
75
  minQuestionHeight: te,
77
- minSummaryHeight: Xe,
76
+ minSummaryHeight: Le,
78
77
  questionsScrollable: D,
79
- navigationBar: Ke,
78
+ navigationBar: Xe,
80
79
  topOffset: V,
81
- renderSideBar: ze,
82
- showUserPointer: Je = !0,
83
- questionPadding: Ue
80
+ renderSideBar: Ke,
81
+ showUserPointer: ze = !0,
82
+ questionPadding: Je
84
83
  } = k, { actionbarHeight: g, maxQuestionWidth: q, questionsContainerWidth: L } = z(
85
- () => vt(R, k),
84
+ () => Tt(R, k),
86
85
  [k, R]
87
86
  ), [t] = C(
88
- () => Et(R, {
89
- sectioned: qe && m !== "ADAPTIVE" && m !== "CURRENT",
87
+ () => vt(R, {
88
+ sectioned: je && m !== "ADAPTIVE" && m !== "CURRENT",
90
89
  adaptive: m === "ADAPTIVE"
91
90
  })
92
- ), [d, v] = C(
93
- () => Ce ?? wt(t)
94
- ), [ie, Ye] = C(!1), u = z(
91
+ ), [c, v] = C(
92
+ () => Ce ?? Et(t)
93
+ ), [ie, Ue] = C(!1), u = z(
95
94
  () => m !== "OPEN" ? le({
96
95
  questions: t,
97
- responses: d,
96
+ responses: c,
98
97
  behavior: a,
99
98
  userType: r
100
99
  }) : t.length - 1,
101
- [a, m, t, d, r]
102
- ), c = t[u], n = d[(c == null ? void 0 : c.response_id) ?? ""], { bannerBackgroundColor: Ze, label: et } = At(r, !!U), [E] = C(
103
- () => Nt({
100
+ [a, m, t, c, r]
101
+ ), d = t[u], n = c[(d == null ? void 0 : d.response_id) ?? ""], { bannerBackgroundColor: Ye, label: Ze } = Bt(r, !!U), [E] = C(
102
+ () => wt({
104
103
  questions: t,
105
- initialQuestion: je,
104
+ initialQuestion: Fe,
106
105
  lastUnlockedQuestionIndex: le({
107
106
  questions: t,
108
- responses: d,
107
+ responses: c,
109
108
  behavior: a,
110
109
  userType: r
111
110
  }),
112
111
  initialResponseId: be,
113
112
  initialItemIndex: Ie
114
113
  })
115
- ), { activeQuestionId: w, setActiveQuestionId: H, intersectionObserver: X } = Ct(E), l = z(
114
+ ), { activeQuestionId: w, setActiveQuestionId: H, intersectionObserver: X } = It(E), l = z(
116
115
  () => t.findIndex((e) => e.response_id === w),
117
116
  [w, t]
118
- ), [h, K] = C(!1), [ne, N] = C(), [oe, re] = C(!1), se = St(a, d, w), tt = S(
117
+ ), [h, K] = C(!1), [ne, N] = C(), [oe, re] = C(!1), se = Ct(a, c, w), et = S(
119
118
  (e, s, o) => {
120
119
  const b = s === "SIMULATION" ? "simState" : void 0;
121
120
  b && (f ? v(($) => {
@@ -138,7 +137,7 @@ const qt = (he, fe) => {
138
137
  }) : G && G(e, s, o));
139
138
  },
140
139
  [G, f, t]
141
- ), it = S(
140
+ ), tt = S(
142
141
  (e, s) => {
143
142
  v((o) => {
144
143
  const b = me(t, e);
@@ -168,17 +167,17 @@ const qt = (he, fe) => {
168
167
  K(!1), D ? requestAnimationFrame(() => x(e)) : H(e);
169
168
  },
170
169
  [D, H]
171
- ), nt = S(() => {
170
+ ), it = S(() => {
172
171
  re(!1);
173
- }, []), ot = S(() => {
172
+ }, []), nt = S(() => {
174
173
  re(!0);
175
- }, []), rt = S(() => {
174
+ }, []), ot = S(() => {
176
175
  K(!0);
177
176
  }, []);
178
177
  return T(() => {
179
178
  const e = t[l];
180
179
  e && F && F(e);
181
- }, [F, t, l]), It(fe, {
180
+ }, [F, t, l]), bt(fe, {
182
181
  behavior: a,
183
182
  questions: t,
184
183
  setResponses: v,
@@ -188,67 +187,67 @@ const qt = (he, fe) => {
188
187
  }), T(() => () => {
189
188
  X.disconnect();
190
189
  }, [X]), T(() => {
191
- Q && d && Q(d);
192
- }, [Q, d]), T(() => {
190
+ Q && c && Q(c);
191
+ }, [Q, c]), T(() => {
193
192
  P && v(P);
194
193
  }, [P]), ct(() => {
195
194
  let e;
196
- return p && E && (ut().browser_name === "Safari" ? e = setTimeout(() => {
195
+ return p && E && (mt().browser_name === "Safari" ? e = setTimeout(() => {
197
196
  x(E);
198
197
  }, 400) : x(E)), () => {
199
198
  clearTimeout(e);
200
199
  };
201
200
  }, [p, E, V]), T(() => {
202
- if (a.teacherValidationEnabled && c) {
203
- const { item_type: e, instructor_stimulus: s, is_optional: o } = c;
201
+ if (a.teacherValidationEnabled && d) {
202
+ const { item_type: e, instructor_stimulus: s, is_optional: o } = d;
204
203
  r === "TEACHER" && (e === "exit-ticket" && s !== "SystemIntro" ? n != null && n.submittedByStudent && !(n != null && n.validatedByTeacher) ? N("exit-ticket-review-available") : n != null && n.validatedByTeacher ? B() : N("exit-ticket-teacher-intervention") : o ? n != null && n.assignStatus ? B() : N("optional-items-assignment") : o || B());
205
204
  }
206
205
  }, [
207
206
  a.teacherValidationEnabled,
208
207
  B,
209
- c,
208
+ d,
210
209
  n,
211
210
  r
212
211
  ]), T(() => {
213
- if (a.teacherValidationEnabled && c) {
214
- const { item_type: e, instructor_stimulus: s } = c;
212
+ if (a.teacherValidationEnabled && d) {
213
+ const { item_type: e, instructor_stimulus: s } = d;
215
214
  r === "STUDENT" && e === "exit-ticket" && s !== "SystemIntro" && (n != null && n.submittedByStudent ? _ == null || _() : W == null || W());
216
215
  }
217
216
  }, [
218
217
  a.teacherValidationEnabled,
219
- c,
218
+ d,
220
219
  n == null ? void 0 : n.submittedByStudent,
221
220
  W,
222
221
  _,
223
222
  r
224
- ]), p ? /* @__PURE__ */ y(st, { children: [
223
+ ]), p ? /* @__PURE__ */ y(rt, { children: [
225
224
  Se && /* @__PURE__ */ y(
226
- Dt,
225
+ Ot,
227
226
  {
228
227
  $flexDirection: "row",
229
228
  $justifyContent: "center",
230
229
  $alignItems: "center",
231
230
  $width: "100%",
232
231
  $heightX: 1.75,
233
- $height: ce,
232
+ $height: de,
234
233
  $gap: 8,
235
234
  $gutter: 8,
236
235
  $flexGap: 8,
237
- $background: Ze,
238
- $topOffset: k.topOffset - ce,
236
+ $background: Ye,
237
+ $topOffset: k.topOffset - de,
239
238
  children: [
240
- U ? /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i(lt, { width: 16, height: 16 }) }) : /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i(mt, { width: 16, height: 16 }) }),
241
- /* @__PURE__ */ i(ft, { $renderAs: "ub3", children: et })
239
+ U ? /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i(dt, { width: 16, height: 16 }) }) : /* @__PURE__ */ i(ue, { children: /* @__PURE__ */ i(lt, { width: 16, height: 16 }) }),
240
+ /* @__PURE__ */ i(ht, { $renderAs: "ub3", children: Ze })
242
241
  ]
243
242
  }
244
243
  ),
245
- /* @__PURE__ */ y(Vt, { $background: "WHITE_1", $width: Le, children: [
246
- Ke === "top" && /* @__PURE__ */ i(Ht, { $topOffset: V, $height: gt, children: /* @__PURE__ */ i(Mt, { children: /* @__PURE__ */ i(
247
- yt,
244
+ /* @__PURE__ */ y(Dt, { $background: "WHITE_1", $width: qe, children: [
245
+ Xe === "top" && /* @__PURE__ */ i(Vt, { $topOffset: V, $height: pt, children: /* @__PURE__ */ i(Ht, { children: /* @__PURE__ */ i(
246
+ At,
248
247
  {
249
248
  placement: "top",
250
249
  questions: t,
251
- responses: d,
250
+ responses: c,
252
251
  activeQuestionIndex: l,
253
252
  lastUnlockedQuestionIndex: u,
254
253
  behavior: a,
@@ -257,11 +256,11 @@ const qt = (he, fe) => {
257
256
  summaryVisible: h
258
257
  }
259
258
  ) }) }),
260
- ne && c && /* @__PURE__ */ i(xt, { $minHeight: te, $topOffset: V, children: /* @__PURE__ */ i(de, { $width: q, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ i(
261
- Tt,
259
+ ne && d && /* @__PURE__ */ i(Mt, { $minHeight: te, $topOffset: V, children: /* @__PURE__ */ i(ce, { $width: q, $justifyContent: "center", $alignItems: "center", children: /* @__PURE__ */ i(
260
+ $t,
262
261
  {
263
262
  blocker: ne,
264
- lastUnlockedQuestion: c,
263
+ lastUnlockedQuestion: d,
265
264
  studentName: pe,
266
265
  onBlockerClose: B,
267
266
  onOptionalItemAssignment: $e,
@@ -269,8 +268,8 @@ const qt = (he, fe) => {
269
268
  onTeacherValidation: Y
270
269
  }
271
270
  ) }) }),
272
- Je && /* @__PURE__ */ i(
273
- pt,
271
+ ze && /* @__PURE__ */ i(
272
+ ft,
274
273
  {
275
274
  activeQuestionIndex: l,
276
275
  onClick: M,
@@ -280,16 +279,16 @@ const qt = (he, fe) => {
280
279
  userType: r
281
280
  }
282
281
  ),
283
- oe && /* @__PURE__ */ i(Rt, { children: /* @__PURE__ */ i(ht, { initialPosition: bt, onClose: nt }) }),
282
+ oe && /* @__PURE__ */ i(xt, { children: /* @__PURE__ */ i(ut, { initialPosition: gt, onClose: it }) }),
284
283
  /* @__PURE__ */ y(
285
- Pt,
284
+ Rt,
286
285
  {
287
286
  $marginTop: r === "TEACHER" && h ? "0" : g,
288
287
  $height: g,
289
288
  $isCardView: O === "card",
290
289
  children: [
291
290
  ee !== -2 && /* @__PURE__ */ i(
292
- kt,
291
+ St,
293
292
  {
294
293
  width: L - 32,
295
294
  question: t[l],
@@ -297,14 +296,14 @@ const qt = (he, fe) => {
297
296
  userType: r
298
297
  }
299
298
  ),
300
- Ge && /* @__PURE__ */ i(
301
- Qt,
299
+ Qe && /* @__PURE__ */ i(
300
+ Pt,
302
301
  {
303
302
  $height: g,
304
303
  $width: O === "card" || ee === -2 ? L - 32 : "100%",
305
304
  $isCardView: O === "card",
306
305
  children: /* @__PURE__ */ i(
307
- de,
306
+ ce,
308
307
  {
309
308
  $gutterX: 1,
310
309
  $flexDirection: "row",
@@ -312,15 +311,15 @@ const qt = (he, fe) => {
312
311
  $alignItems: "center",
313
312
  $width: L - 32,
314
313
  children: /* @__PURE__ */ i(
315
- $t,
314
+ kt,
316
315
  {
317
316
  userType: r,
318
317
  layout: k,
319
318
  behavior: a,
320
319
  worksheetName: J,
321
320
  questions: t,
322
- responses: d,
323
- onCalculatorOpen: ot,
321
+ responses: c,
322
+ onCalculatorOpen: nt,
324
323
  activeQuestionIndex: l,
325
324
  lastUnlockedQuestionIndex: u,
326
325
  appendedQuestionIds: Z,
@@ -332,10 +331,10 @@ const qt = (he, fe) => {
332
331
  getTimeSpentOnQuestion: se,
333
332
  setSummaryVisible: K,
334
333
  setBlocker: N,
335
- setIsScribblingEnabled: Ye,
334
+ setIsScribblingEnabled: Ue,
336
335
  setActiveQuestionId: H,
337
336
  onItemNumberClick: M,
338
- onGoToReview: rt,
337
+ onGoToReview: ot,
339
338
  onResponseChange: f,
340
339
  onHelp: ye,
341
340
  onTeacherValidation: Y,
@@ -343,37 +342,37 @@ const qt = (he, fe) => {
343
342
  showCalculator: oe,
344
343
  loggerRef: j,
345
344
  onSkip: xe,
346
- actionBarRightElement: Fe
345
+ actionBarRightElement: Ge
347
346
  }
348
347
  )
349
348
  }
350
349
  )
351
350
  }
352
351
  ),
353
- !h && D && r === "STUDENT" && /* @__PURE__ */ i(Gt, { children: /* @__PURE__ */ i(_t, {}) })
352
+ !h && D && r === "STUDENT" && /* @__PURE__ */ i(Qt, { children: /* @__PURE__ */ i(Wt, {}) })
354
353
  ]
355
354
  }
356
355
  ),
357
356
  /* @__PURE__ */ y(
358
- Ft,
357
+ Gt,
359
358
  {
360
359
  $actionbarHeight: g,
361
360
  $isCardView: O === "card",
362
- $questionPadding: Ue,
361
+ $questionPadding: Je,
363
362
  children: [
364
- Bt({ questions: t, lastUnlockedQuestionIndex: u, userType: r }).map(
363
+ Nt({ questions: t, lastUnlockedQuestionIndex: u, userType: r }).map(
365
364
  (e, s) => {
366
365
  var I, A;
367
- const { response_id: o, is_optional: b } = e, $ = (I = d[o]) == null ? void 0 : I.assignStatus;
366
+ const { response_id: o, is_optional: b } = e, $ = (I = c[o]) == null ? void 0 : I.assignStatus;
368
367
  return a.teacherValidationEnabled && ($ === "skipped" || b && $ !== "assigned" && r === "STUDENT") ? null : /* @__PURE__ */ i(
369
- Wt,
368
+ yt,
370
369
  {
371
370
  signedRequest: ge,
372
371
  userType: r,
373
372
  worksheetCompleted: Ee,
374
373
  question: e,
375
- response: d[o],
376
- nextQuestionId: m === "ADAPTIVE" || m === "CURRENT" ? c == null ? void 0 : c.response_id : s < u ? (A = t[s + 1]) == null ? void 0 : A.response_id : void 0,
374
+ response: c[o],
375
+ nextQuestionId: m === "ADAPTIVE" || m === "CURRENT" ? d == null ? void 0 : d.response_id : s < u ? (A = t[s + 1]) == null ? void 0 : A.response_id : void 0,
377
376
  maxQuestionWidth: q,
378
377
  learnosity: p,
379
378
  isActive: o === w,
@@ -384,8 +383,8 @@ const qt = (he, fe) => {
384
383
  layout: k,
385
384
  actionbarHeight: g,
386
385
  intersectionObserver: X,
387
- onMarkForReview: it,
388
- onMediaStateChange: tt,
386
+ onMarkForReview: tt,
387
+ onMediaStateChange: et,
389
388
  userId: we,
390
389
  isScribblingEnabled: ie,
391
390
  onPublishStrokes: Ne,
@@ -397,8 +396,8 @@ const qt = (he, fe) => {
397
396
  canResolveDoubt: He,
398
397
  onResolveDoubt: Me,
399
398
  studentId: Re,
400
- subjectiveProps: Qe,
401
- responses: d,
399
+ subjectiveProps: Pe,
400
+ responses: c,
402
401
  loggerRef: j
403
402
  },
404
403
  o
@@ -406,16 +405,16 @@ const qt = (he, fe) => {
406
405
  }
407
406
  ),
408
407
  h && /* @__PURE__ */ i(
409
- jt,
408
+ Ft,
410
409
  {
411
410
  worksheetName: J,
412
411
  questions: t,
413
- responses: d,
412
+ responses: c,
414
413
  activeQuestionIndex: l,
415
414
  lastUnlockedQuestionIndex: u,
416
415
  onItemNumberClick: M,
417
416
  behavior: a,
418
- minHeight: Xe,
417
+ minHeight: Le,
419
418
  summaryDescription: De,
420
419
  summaryVisible: h
421
420
  }
@@ -423,8 +422,8 @@ const qt = (he, fe) => {
423
422
  ]
424
423
  }
425
424
  ),
426
- !h && ze && /* @__PURE__ */ i(
427
- Ot,
425
+ !h && Ke && /* @__PURE__ */ i(
426
+ _t,
428
427
  {
429
428
  questionWidth: q,
430
429
  questions: t,
@@ -434,14 +433,13 @@ const qt = (he, fe) => {
434
433
  height: te,
435
434
  actionbarHeight: g,
436
435
  openQuestionFeedbackModal: Oe,
437
- loggerRef: j,
438
- studentClassroomId: Pe
436
+ loggerRef: j
439
437
  }
440
438
  )
441
439
  ] })
442
440
  ] }) : null;
443
- }, pi = at(dt(qt));
441
+ }, fi = st(at(jt));
444
442
  export {
445
- pi as default
443
+ fi as default
446
444
  };
447
445
  //# sourceMappingURL=worksheet.js.map