"use strict";(globalThis.webpackChunkacadlix=globalThis.webpackChunkacadlix||[]).push([["admin_quiz_free_assessment"],{"./src/free/admin/question/types/Assessment.js":(e,a,n)=>{n.r(a),n.d(a,{default:()=>m});var t=n("react"),r=n("./node_modules/@mui/material/esm/Card/Card.js"),s=n("./node_modules/@mui/material/esm/CardHeader/CardHeader.js"),i=n("./node_modules/@mui/material/esm/CardContent/CardContent.js"),d=n("./node_modules/@mui/material/esm/Grid/Grid.js"),l=n("@wordpress/i18n"),o=n("./src/components/CustomTypography.js"),c=n("./src/components/CustomTextField.js"),u=n("react/jsx-runtime");const m=e=>{const a=()=>{e?.loadEditor(`reference_answer_${e?.index}`,`language.${e?.index}.answer_data.${e?.type}.referenceAnswer`)};return(0,t.useEffect)(()=>(a(),window.addEventListener("load",a),()=>{e?.removeEditor(`reference_answer_${e?.index}`),window.removeEventListener("load",a)}),[]),(0,u.jsxs)(r.A,{children:[(0,u.jsx)(s.A,{title:e?.watch("multi_language")?(0,l.__)("Assessment","acadlix")+` (${e?.lang?.language_name})`:(0,l.__)("Assessment","acadlix"),titleTypographyProps:{variant:"h6"}}),(0,u.jsx)(i.A,{sx:{paddingTop:1},children:(0,u.jsxs)(d.A,{container:!0,spacing:4,alignItems:"center",children:[(0,u.jsx)(d.A,{size:{xs:12,lg:3},children:(0,u.jsx)(o.A,{children:(0,l.__)("Character Limit","acadlix")})}),(0,u.jsx)(d.A,{size:{xs:12,lg:3},children:(0,u.jsx)(c.A,{...e?.register(`language.${e?.index}.answer_data.${e?.type}.characterLimit`),fullWidth:!0,size:"small",label:(0,l.__)("Character Limit (0 => unlimited)","acadlix"),type:"number",inputProps:{step:1,min:0},value:e?.lang?.answer_data?.[e?.type]?.characterLimit,onChange:a=>{e?.setValue(`language.${e?.index}.answer_data.${e?.type}.characterLimit`,a?.target?.value,{shouldDirty:!0})},sx:{"& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button":{display:"none"},"& input[type=number]":{MozAppearance:"textfield"}},error:Boolean(e.formState?.errors?.language?.[e?.index]?.answer_data?.[e?.type]?.characterLimit),helperText:e.formState.errors?.language?.[e?.index]?.answer_data?.[e?.type]?.characterLimit?.message})}),(0,u.jsx)(d.A,{size:{xs:12,lg:12},children:(0,u.jsx)(o.A,{children:(0,l.__)("Provide a reference answer for this assessment-type question. It may be used by an Evaluator as a guideline when reviewing student responses.","acadlix")})}),(0,u.jsx)(d.A,{size:{xs:12,lg:12},children:(0,u.jsx)("textarea",{...e?.register(`language.${e?.index}.answer_data.${e?.type}.referenceAnswer`),id:`reference_answer_${e?.index}`,style:{width:"100%"},value:e?.lang?.answer_data?.[e?.type]?.referenceAnswer||"",onChange:a=>{let n=a?.target?.value;if(window.tinymce){const a=window.tinymce.get(`reference_answer_${e?.index}`);a&&a.getContent()!==n&&a.setContent(n||"")}e.setValue(`language.${e?.index}.answer_data.${e?.type}.referenceAnswer`,n,{shouldDirty:!0})}})})]})})]})}}}]);