PageSourceSearch

https://lingoteach.ai/static/js/4375.06e94479.chunk.js

js lingoteach.ai collected 2026-09-24 13:38:55 UTC 79,825 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkall_language_frontend=self.webpackChunkall_language_frontend||[]).push([[4375],{54634:function(e,t,n){n.d(t,{D7:function(){return o.D7},PO:function(){return s},cG:function(){return o.cG},RY:function(){return o.RY},RD:function(){return o.RD},dr:function(){return o.dr},f0:function(){return u}});var a=n(74165),r=n(15861),i=n(67911),s=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(t){var n;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.e.post("/v1/homework",t);case 3:return n=e.sent,e.abrupt("return",n.data);case 7:throw e.prev=7,e.t0=e.catch(0),e.t0;case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),o=n(12018),l=n(1413),c=n(3815),u=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(t){var n,r,s,o,u,d,m,h,p,v,f,g,x,b,w;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!window.location.pathname.includes("/pupil/language-library/play/")&&!window.location.pathname.includes("/pupil/reading-room/play/")){e.next=15;break}return d=window.location.pathname.split("/").pop(),e.next=5,i.e.post("/v1/reading-room/pupil/submit-attempt",{attemptId:Number(d),submittedData:t.submittedData});case 5:return m=e.sent,h=m.data.attempt,p=!(null===h||void 0===h||!h.sharedFolder),v=p?null===h||void 0===h||null===(n=h.sharedFolder)||void 0===n?void 0:n.id:null===h||void 0===h||null===(r=h.readingRoomFolder)||void 0===r?void 0:r.id,f=void 0!==v&&null!==v?"&contextId=".concat(v):"",g=new URLSearchParams(window.location.search),x=g.get("folderId"),b=x&&"null"!==x&&"undefined"!==x?"&folderId=".concat(x):"",sessionStorage.setItem("readingRoomRedirectUrl","/pupil/language-library/resource/".concat(null===h||void 0===h||null===(s=h.resource)||void 0===s?void 0:s.id,"?isShared=").concat(p).concat(f).concat(b)),e.abrupt("return",(0,l.Z)((0,l.Z)({},m.data),{},{scorePercentage:Math.round(null!==(o=null===(u=m.data)||void 0===u?void 0:u.scorePercentage)&&void 0!==o?o:0)}));case 15:return e.next=17,i.e.post("/v1/submit-homework-tasks",t);case 17:return w=e.sent,e.abrupt("return",w.data);case 21:throw e.prev=21,e.t0=e.catch(0),(0,c.Z)("error",e.t0.message),e.t0;case 25:case"end":return e.stop()}}),e,null,[[0,21]])})));return function(t){return e.apply(this,arguments)}}()},3002:function(e,t,n){n.d(t,{Z:function(){return c}});var a=n(1413),r=n(45987),i=(n(47313),n(89874)),s=n(60327),o=n(46417),l=["text","className","textStyle","onClick","disabled","loading","suggestion","style","type","logToActivityStream"],c=function(e){var t=e.text,n=e.className,c=e.textStyle,u=void 0===c?{}:c,d=e.onClick,m=e.disabled,h=void 0!==m&&m,p=e.loading,v=e.suggestion,f=e.style,g=void 0===f?{}:f,x=e.type,b=void 0===x?"button":x,w=e.logToActivityStream,Z=void 0===w||w,y=(0,r.Z)(e,l),k=void 0!==p?p:h;return(0,o.jsx)(s.Z,{suggestion:null!==v&&void 0!==v?v:"",children:(0,o.jsx)("button",(0,a.Z)((0,a.Z)((0,a.Z)({style:g,onClick:function(){!d||k||h||d()},className:"buttonResouce ".concat(n),disabled:h||p,id:t,type:b},Z?{"data-log":t}:{}),y),{},{children:k?(0,o.jsx)(i.Z,{}):(0,o.jsx)("div",{style:u,children:t})}))})}},47435:function(e,t,n){var a=n(1413),r=n(3002),i=n(47313),s=n(41965),o=n(46417),l=function(e){return(0,o.jsxs)(s.Z,(0,a.Z)((0,a.Z)({},e),{},{"aria-labelledby":"contained-modal-title-vcenter",centered:!0,backdrop:"static",keyboard:!1,children:[(0,o.jsx)(s.Z.Body,{children:(0,o.jsx)("div",{children:"string"===typeof e.message?(0,o.jsx)("span",{style:{whiteSpace:"pre-wrap"},children:e.message}):e.message})}),(0,o.jsxs)(s.Z.Footer,{children:[(0,o.jsx)(r.Z,{className:"btn btn-dark",text:(null===e||void 0===e?void 0:e.cancelText)||"Cancel",onClick:e.onHide,disabled:e.loading}),(0,o.jsx)(r.Z,{className:"btn btn-effects",text:(null===e||void 0===e?void 0:e.confirmText)||"Yes",onClick:e.onAction,loading:e.loading})]})]}))};t.Z=(0,i.memo)(l)},61044:function(e,t,n){var a=n(93433),r=n(29439),i=n(51855),s=n(94464),o=n(11054),l=n(6235),c=n(47313),u=(n(6379),n(4119)),d=n(46417);t.Z=function(e){var t=e.taskData,n=e.setAnswers,m=e.answers,h=e.sideBySide,p=void 0!==h&&h,v=e.isRemoveGap,f=void 0!==v&&v,g=(0,c.useState)([]),x=(0,r.Z)(g,2),b=x[0],w=x[1],Z=(0,c.useState)(null),y=(0,r.Z)(Z,2),k=y[0],j=y[1],N=(0,c.useRef)(null);return(0,c.useEffect)((function(){var e;if((null===(e=t.answer)||void 0===e?void 0:e.length)>0){var n=(0,a.Z)(t.answer),r=(0,u.TV)(n);w(r)}}),[t]),(0,d.jsxs)(o.Z,{sx:{display:"flex",flexDirection:p?{xs:"column",lg:p?"row-reverse":"row"}:"column",gap:{xs:2,lg:f?0:2},alignItems:p?"flex-start":"stretch","& .primary-container":{mb:{xs:1,lg:0}}},children:[(0,d.jsx)(o.Z,{sx:{width:{xs:"100%",lg:p?"70%":"100"}},children:(0,d.jsx)(i.Z,{children:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.Z,{className:"test-heading-container",variant:"h6",children:"Fill in the blanks:"}),(0,d.jsx)(o.Z,{className:"masked-text text-drag-drop-test-container",sx:{maxHeight:{xs:"40vh",md:"60vh"},overflowY:"auto"},children:function(){var e=t.text.split(/(__+|\n)/g),r=0;return e.map((function(e,t){if("\n"===e)return(0,d.jsx)("br",{},"br-".concat(t));
1if(/__+/.test(e)){var i,o=r,l=m[o]&&(null===(i=m[o])||void 0===i?void 0:i.length)>0?m[o]:null;return r++,(0,d.jsx)("span",{children:l?(0,d.jsx)(s.Z,{label:l,onDelete:function(){return function(e){var t=m[e];if(t){var r=(0,a.Z)(m);r[e]="",n(r),setTimeout((function(){w((function(e){return[].concat((0,a.Z)(e),[t])}))}),0)}}(o)},className:"filled-chip"}):(0,d.jsx)("span",{onDragOver:function(e){return e.preventDefault()},onDrop:function(){return function(e){if(k&&m&&!m[e]){var t=(0,a.Z)(m);t[e]=k,n(t);var r=b.filter((function(e,t){return t!==N.current}));w(r),j(null),N.current=null}}(o)},className:"empty-gap",children:"_________"})},t)}return(0,d.jsx)("span",{children:e},t)}))}()})]})})}),(0,d.jsx)(o.Z,{sx:{width:{xs:"100%",lg:p?"30%":"100"}},children:b.length>0&&(0,d.jsx)(i.Z,{children:(0,d.jsx)(o.Z,{component:"div",className:"mb-2",children:(0,d.jsx)("div",{className:"available-words",children:b.length>0&&b.map((function(e,t){return(0,d.jsx)(s.Z,{label:e,draggable:!0,onDragStart:function(){j(e),N.current=t},className:"draggable-chip",style:{cursor:"pointer"}},t)}))})})})})]})}},46681:function(e,t,n){var a=n(93433),r=n(29439),i=n(51855),s=n(94464),o=n(11054),l=n(6235),c=n(47313),u=(n(6379),n(4119)),d=n(46417);t.Z=function(e){var t=e.taskData,n=e.setAnswers,m=e.answers,h=(0,c.useState)([]),p=(0,r.Z)(h,2),v=p[0],f=p[1],g=(0,c.useState)(null),x=(0,r.Z)(g,2),b=x[0],w=x[1];return(0,c.useEffect)((function(){var e;if((null===(e=t.answer)||void 0===e?void 0:e.length)>0){var n=(0,a.Z)(t.answer),r=(0,u.TV)(n);f(r)}}),[t]),(0,d.jsxs)(o.Z,{children:[(0,d.jsx)(i.Z,{children:(0,d.jsxs)(o.Z,{children:[(0,d.jsx)(l.Z,{className:"test-heading-container",variant:"h6",children:"Fill in the blanks:"}),(0,d.jsx)("div",{className:"masked-text text-drag-drop-test-container",children:function(){var e=t.text.split(/(__+|)/g),r=0;return e.map((function(e,t){if("\n"===e)return(0,d.jsx)("br",{},"br-".concat(t));if(/__+/.test(e)){var i,o=r,l=m[o]&&(null===(i=m[o])||void 0===i?void 0:i.length)>0?m[o]:null,c=b===o;return r++,(0,d.jsx)("span",{children:l?(0,d.jsx)(s.Z,{label:l,onDelete:function(){return function(e){var t=m[e];if(t){var r=(0,a.Z)(m);r[e]="",n(r),setTimeout((function(){f((function(e){return[].concat((0,a.Z)(e),[t])}))}),0)}}(o)},className:"filled-chip"}):(0,d.jsx)("span",{onClick:function(){return w(o)},style:{cursor:"pointer"},className:"empty-gap ".concat(c?"selected-gap":""),children:"_________"})},t)}return(0,d.jsx)("span",{children:e},t)}))}()})]})}),v.length>0&&(0,d.jsx)(i.Z,{children:(0,d.jsx)(o.Z,{component:"div",className:"mb-2",children:(0,d.jsx)("div",{className:"available-words",children:v.length>0&&v.map((function(e,t){return(0,d.jsx)(s.Z,{label:e,onClick:function(){!function(e,t){var r=(0,a.Z)(m),i=null!==b?b:r.findIndex((function(e){return!e}));-1===i||r[i]||(r[i]=e,n(r),f((function(e){return e.filter((function(e,n){return n!==t}))})),w(null))}(e,t)},className:"draggable-chip"},t)}))})})})]})}},72794:function(e,t,n){var a=n(47313),r=n(46417);t.Z=function(e){var t=e.taskData,n=e.answers,i=e.touched,s=e.errors,o=e.prefix,l=e.onChange,c=e.onBlur,u=e.setActiveGapIdx,d=e.activeGapIndex,m=(0,a.useRef)([]);(0,a.useEffect)((function(){m.current=Array(t.answer.length).fill(null)}),[t.answer.length]);var h=function(e,t){var n=e.target.value.slice(-1);l(n,t),n&&t<m.current.length-1&&setTimeout((function(){u(d+1)}),0)};(0,a.useEffect)((function(){var e;d&&(null===(e=m.current[d])||void 0===e||e.focus())}),[d]);return(0,r.jsx)("div",{className:"text-response",children:function(){var e=[],a=0,l=t.text.split("\n");return l.forEach((function(t,d){for(var p=function(){var l=t[v];if("_"===l){var p=a,f=i[p]&&!!s[p];e.push((0,r.jsx)("input",{ref:function(e){return m.current[p]=e},value:n[p]||"",onChange:function(e){return h(e,p)},onBlur:function(){return c(p)},onFocus:function(){return u(p)},maxLength:1,className:"fill-blank-input".concat(f?" input-error":""),"aria-label":"".concat(o,"-input-").concat(p+1),style:{width:"20px",textAlign:"center",margin:"0 2px"},autoCapitalize:"none"},"".concat(o,"-input-").concat(p))),a++}else e.push((0,r.jsx)("span",{className:"static-char",children:l},"".concat(o,"-char-").concat(d,"-").concat(v)))},v=0;v<t.length;v++)p();d<l.length-1&&e.push((0,r.jsx)("br",{},"".concat(o,"-br-").concat(d)))})),e}()})}},98282:function(e,t,n){var a=n(74165),r=n(1413),i=n(15861),s=n(93433),o=n(54634),l=n(7410),c=n(85554),u=n(21933),d=n(22102),m=n(67203),h=n(58467),p=(n(6379),n(73882)),v=n(3002),f=n(46681),g=n(61044),x=n(11054),b=n(15439),w=n(46417);t.Z=function(){var e=(0,h.s0)(),t=(0,c.I0)(),n=(0,c.v9)((function(e){return e})).selectedTaskSlice,Z=n.taskData,y=n.homeworkId,k=n.id,j=n.pupilHomeworkAssociationId,N=n.taskName,S=n.restData,I=new Array((Z.data.text.match(/__+/g)||[]).length).fill(""),A=(0,l.TA)({initialValues:{filledWords:(0,s.Z)(I)},validationSchema:u.Ry({filledWords:u.IX().of(u.Z_().optional()).required()}),onSubmit:function(e,t){D(e,t)}}),D=function(){var n=(0,i.Z)((0,a.Z)().mark((function n(i,s){var l,c,u,d,m,h;return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,u=(0,r.Z)((0,r.Z)({},Z.data),{},{answer:i.filledWords}),t((0,p.NY)({submittedData:{data:u}})),n.next=5,(0,o.f0)({homeworkId:y,taskId:k,submittedData:{data:u},pupilHomeworkAssociationId:j});case 5:return d=n.sent,n.next=8,(0,b.HK)({actionType:"Submitted",taskName:N,homeworkName:(null===S||void 0===S?void 0:S.name)||"-",teacherName:(null===S||void 0===S||null===(l=S.teacher)||void 0===l?void 0:l.name)||"-",className:(null===S||void 0===S?void 0:S.className)||"-",action:"Submit"});case 8:m=Math.round(null!==(c=null===d||void 0===d?void 0:d.scorePercentage)&&void 0!==c?c:0),h=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(k),t((0,p.Pi
1)({score:m,redirectUrl:h})),e("/pupil/result/tasks/".concat(k)),s.setSubmitting(!1),n.next=18;break;case 15:n.prev=15,n.t0=n.catch(0),console.log({error:n.t0});case 18:case"end":return n.stop()}}),n,null,[[0,15]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,w.jsx)(d.Z,{className:"d-flex justify-content-center",children:(0,w.jsxs)(m.Z,{className:"d-flex flex-column",onSubmit:A.handleSubmit,children:[(0,w.jsx)(x.Z,{sx:{display:{xs:"block",lg:"none"}},children:(0,w.jsx)(f.Z,{taskData:Z.data,answers:A.values.filledWords,setAnswers:function(e){A.setFieldValue("filledWords",e,!1),A.setTouched({filledWords:e.map((function(e){return!!e}))})}})}),(0,w.jsx)(x.Z,{sx:{display:{xs:"none",lg:"block"}},children:(0,w.jsx)(g.Z,{taskData:Z.data,answers:A.values.filledWords,setAnswers:function(e){A.setFieldValue("filledWords",e,!1),A.setTouched({filledWords:e.map((function(e){return!!e}))})},sideBySide:!0})}),(0,w.jsx)("div",{className:"text-center mt-lg-3",children:(0,w.jsx)(v.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:A.isSubmitting,type:"submit",logToActivityStream:!1})})]})})}},15009:function(e,t,n){n.d(t,{Z:function(){return y}});var a=n(74165),r=n(15861),i=n(4942),s=n(93433),o=n(1413),l=n(29439),c=n(85554),u=n(58467),d=n(47313),m=n(22102),h=n(11054),p=n(3002),v=n(54634),f=n(73882),g=n(51855),x=n(4119),b=n(46417),w={borderRadius:"8px",height:"auto",overflowY:"auto"},Z={p:2,display:"flex",flexWrap:"wrap",justifyContent:"center",alignItems:"center",gap:"10px",maxHeight:"400px",overflowY:"auto"},y=function(){var e,t=(0,u.s0)(),n=(0,c.I0)(),y=(0,c.v9)((function(e){return e})).selectedTaskSlice,k=y.taskData,j=y.homeworkId,N=y.id,S=y.pupilHomeworkAssociationId,I=y.taskName,A=y.restData,D=(k.data.answer||[]).flatMap((function(e,t){return[{id:"".concat(t,"-native"),text:e.native,pairIndex:t,side:"native"},{id:"".concat(t,"-target"),text:e.target,pairIndex:t,side:"target"}]})),T=(0,d.useState)([]),R=(0,l.Z)(T,2),C=R[0],F=R[1],q=(0,d.useState)([]),V=(0,l.Z)(q,2),_=V[0],U=V[1],H=(0,d.useState)({}),P=(0,l.Z)(H,2),G=P[0],B=P[1],M=(0,d.useState)([]),E=(0,l.Z)(M,2),L=E[0],Y=E[1],z=(0,d.useState)((function(){return(0,x.TV)(D)})),W=(0,l.Z)(z,1)[0],K=function(e){if(G[e.id]){var t=e.pairIndex,n=D.find((function(e){return e.pairIndex===t&&"native"===e.side})),a=D.find((function(e){return e.pairIndex===t&&"target"===e.side}));n&&a&&(U((function(e){return e.filter((function(e){return!(e.native===n.text&&e.target===a.text)}))})),B((function(e){var t=(0,o.Z)({},e);return delete t[n.id],delete t[a.id],t})))}else if(1!==C.length||C[0].id!==e.id){var r,c=[].concat((0,s.Z)(C),[e]);if(2===c.length){var u=(0,l.Z)(c,2),d=u[0],m=u[1],h=(r=_.length,"hsl(".concat(137.508*r%360,", 60%, 75%)"));if(d.pairIndex===m.pairIndex&&d.side!==m.side&&d.id!==m.id){var p="native"===d.side?d:m,v="target"===d.side?d:m;U((function(e){return[].concat((0,s.Z)(e),[{native:p.text,target:v.text}])})),B((function(e){var t;return(0,o.Z)((0,o.Z)({},e),{},(t={},(0,i.Z)(t,d.id,h),(0,i.Z)(t,m.id,h),t))})),F([])}else Y([d.id,m.id]),setTimeout((function(){return Y([])}),900),F([])}else F(c)}else F([])},O=function(e){var t=G[e.id]||"#fff",n=C.some((function(t){return t.id===e.id})),a=L.includes(e.id);return{backgroundColor:t,border:a?"2px solid red":n?"2px solid #000":"1px solid #ccc",animation:a?"blink-red 0.9s ease-in-out":void 0}},J=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(r){var i,s,o,l,c,u,d,m;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=r.map((function(e){return{native:e.native,target:e.target}})),o={answer:s},e.next=5,(0,v.f0)({homeworkId:j,taskId:N,submittedData:{data:o},pupilHomeworkAssociationId:S});case 5:l=e.sent,c=(l||{}).gradedData,u=c&&"data"in c?c:{data:c},n((0,f.NY)({submittedData:u})),d=Math.round(null!==(i=null===l||void 0===l?void 0:l.scorePercentage)&&void 0!==i?i:0),m=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(N),n((0,f.Pi)({score:d,redirectUrl:m})),t("/pupil/result/tasks/".concat(N)),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.log({error:e.t0});case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}();return(0,b.jsxs)(h.Z,{children:[(0,b.jsx)(h.Z,{sx:{display:{xs:"none",lg:"block"}},children:(0,b.jsx)(g.Z,{isFullscreen:!0,children:(0,b.jsx)(m.Z,{className:"mt-4 matching-game-test-container",children:(0,b.jsx)("div",{children:(0,b.jsx)("div",{className:"words-grid",children:(null===W||void 0===W?void 0:W.length)>0&&W.map((function(e){return(0,b.jsx)("div",{className:"word-box",onClick:function(){return K(e)},style:O(e),children:e.text},e.id)}))})})})})}),(0,b.jsx)(h.Z,{sx:{display:{xs:"block",lg:"none"}},children:(0,b.jsxs)(m.Z,{children:[(0,b.jsx)(g.Z,{isFullscreen:!0,children:(0,b.jsx)(h.Z,{sx:w,className:"target-container",children:(0,b.jsx)(h.Z,{sx:Z,children:null===W||void 0===W?void 0:W.filter((function(e){return"target"===e.side})).map((function(e){return(0,b.jsx)(h.Z,{className:"word-box",onClick:function(){return K(e)},style:O(e),children:e.text},e.id)}))})})}),(0,b.jsx)(g.Z,{isFullscreen:!0,children:(0,b.jsx)(h.Z,{sx:w,className:"native-container",children:(0,b.jsx)(h.Z,{sx:Z,children:null===W||void 0===W?void 0:W.filter((function(e){return"native"===e.side})).map((function(e){return(0,b.jsx)(h.Z,{className:"word-box",onClick:function(){return K(e)},style:O(e),children:e.text},e.id)}))})})})]})}),(0,b.jsx)("div",{className:"text-center mt-3",children:(0,b.jsx)(p.Z,{text:"Submit",className:"btn btn-effects test-submit-button",onClick:function(){return J(_)},logToActivityStream:!1,"data-log":JSON.stringify({actionType:"Submitted",taskName:I,homeworkName:(null===A||void 0===A?void 0:A.name)||"-",teacherName:(null===A||void 0===A||null===(e=A.teacher)||void 0===e?void 0:e.name)||"-",className:(null===A||void 0===A?void 0:A.className)||"-",action:"Submit"})})})]})}},95510:function(e,t,n){var a=n(74165),r=n(15861),i=n(85554),s=n(51855),o=n(67203),l=n(22102),c=n(65832),u=n(63849),d=n(31616),m=n(7410),h=n(21933),p=n(3815),v=n(54634),f=n(58467),g=n(73882),x=n(3002),b=n(15439),w=n(46417);t.Z=function(){var e=(0,f.s0)(),t=(0,i.I0)(),n=(0,i.v9)((function(e){return e.selectedTaskSlice})),Z=n.taskData,y=n.homeworkId,k=n.id,j=n.pupilHomeworkAssociationId,N=n.taskName,S=n.restData,I=Z.data.reduce((function(e,t,n){return e[n]="",e}),{}),A=h.Ry(Z.data.reduce((function(e,t,n){return e[n]=h.Z_().optional(),e}),{})),D=function(){var n=(0,r.Z)((0,a.Z)().mark((function n(r,i){var s,o,l,c,u,d;return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if((o=Z.data.map((function(e,t){return{question:e.question,answer:r[t]}}))).length===Z.data.length){n.next=5;break}return(0,p.Z)("warning","Please answer all questions"),i.setSubmitting(!1),n.abrupt("return");case 5:return t((0,g.NY)({submittedData:{data:o}})),n.next=8,(0,v.f0)({homeworkId:y,taskId:k,submittedData:{data:o},pupilHomeworkAssociationId:j});case 8:return l=n.sent,n.prev=9,n.next=12,(0,b.HK)({actionType:"Submitted",taskName:N,homeworkName:(null===S||void 0===S?void 0:S.name)||"-",teacherName:(null===S||void 0===S||null===(c=S.teacher)||void 0===c?void 0:c.name)||"-",className:(null===S||void 0===S?void 0:S.className)||"-",action:"Submit"});case 12:n.next=17;break;case 14:n.prev=14,n.t0=n.catch(9),console.error("Activity log error:",n.t0);case 17:u=Math.round(null!==(s=null===l||void 0===l?void 0:l.scorePercentage)&&void 0!==s?s:0),d=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(k),t((0,g.Pi)({score:u,redirectUrl:d})),e("/pupil/result/tasks/".concat(k)),i.setSubmitting(!1);case 22:case"end":return n.stop()}}),n,null,[[9,14]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,w.jsx)(s.Z,{children:(0,w.jsx)(m.J9,{initialValues:I,validationSchema:A,onSubmit:function(e,t){D(e,t)},children:function(e){var t=e.handleSubmit,n=(e.errors,e.touched,e.isSubmitting);return(0,w.jsxs)(o.Z,{onSubmit:t,children:[(0,w.jsx)(l.Z,{className:"my-4 multi-choice-container",children:Z.data.map((function(e,t){return(0,w.jsx)(c.Z,{className:"mb-3 shadow",children:(0,w.jsxs)(c.Z.Body,{children:[(0,w.jsxs)("span",{className:"mb-4",children:[t+1,". ",e.question]}),(0,w.jsx)(u.Z,{children:e.options.map((function(e,n){return(0,w.jsx)(d.Z,{xs:12,md:6,className:"mb-2",children:(0,w.jsxs)("label",{className:"d-flex align-items-center gap-2",children:[(0,w.jsx)(m.gN,{type:"radio",name:"".concat(t),value:e,className:"form-check-input"}),String.fromCharCode(65+n),") ",e]})},n)}))}),(0,w.jsx)(m.Bc,{name:"".concat(t),component:"div",className:"text-danger mt-2"})]})},t)}))}),(0,w.jsx)("div",{className:"text-center",children:(0,w.jsx)(x.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:n,type:"submit",logToActivityStream:!1})})]})}})})}},26547:function(e,t,n){var a=n(93433),r=n(74165),i=n(1413),s=n(15861),o=n(29439),l=n(7410),c=n(21933),u=n(67203),d=n(65832),m=n(11054),h=n(85554),p=n(58467),v=n(54634),f=n(51855),g=n(72794),x=(n(66808),n(73882)),b=n(3002),w=n(47313),Z=n(44314),y=n(46417);t.Z=function(){var e,t=(0,p.s0)(),n=(0,h.I0)(),k=(0,h.v9)((function(e){return e})),j=k.selectedTaskSlice,N=j.taskData,S=j.homeworkId,I=j.id,A=j.pupilHomeworkAssociationId,D=j.taskName,T=j.restData,R=k.SelectedResourceSlice,C=(0,w.useState)({target:0,native:0}),F=(0,o.Z)(C,2),q=F[0],V=F[1],_=(0,w.useState)(null),U=(0,o.Z)(_,2),H=(U[0],U[1]),P=N.data,G={nativeAnswers:Array(P.native.answer.length).fill(""),targetAnswers:Array(P.target.answer.length).fill("")},B=c.Ry().shape({nativeAnswers:c.IX().of(c.Z_().length(1,"Each ga
1p must be filled").optional()).required(),targetAnswers:c.IX().of(c.Z_().length(1,"Each gap must be filled").optional()).required()}),M=(0,l.TA)({initialValues:G,validationSchema:B,onSubmit:function(){var e=(0,s.Z)((0,r.Z)().mark((function e(a,s){var o,l,c,u,d;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,l={native:(0,i.Z)((0,i.Z)({},P.native),{},{answer:a.nativeAnswers}),target:(0,i.Z)((0,i.Z)({},P.target),{},{answer:a.targetAnswers})},n((0,x.NY)({submittedData:{data:l}})),e.next=5,(0,v.f0)({homeworkId:S,taskId:I,submittedData:{data:l},pupilHomeworkAssociationId:A});case 5:c=e.sent,u=Math.round(null!==(o=null===c||void 0===c?void 0:c.scorePercentage)&&void 0!==o?o:0),d=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(I),n((0,x.Pi)({score:u,redirectUrl:d})),t("/pupil/result/tasks/".concat(I)),s.setSubmitting(!1),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(0),console.error("Submission Error:",e.t0);case 16:case"end":return e.stop()}}),e,null,[[0,13]])})));return function(t,n){return e.apply(this,arguments)}}()});return(0,y.jsx)("div",{style:{position:"relative"},children:(0,y.jsxs)(u.Z,{onSubmit:M.handleSubmit,children:[(0,y.jsxs)(m.Z,{component:"div",className:"row gap-2 justify-content-center",children:[(0,y.jsx)(m.Z,{component:"div",className:"col-md-5 col-sm-12",children:(0,y.jsx)(f.Z,{children:(0,y.jsx)(y.Fragment,{children:(0,y.jsxs)(d.Z,{className:"fill-blank-card mb-4",children:[(0,y.jsx)("h5",{children:"Target Text"}),(0,y.jsx)(d.Z.Body,{className:"parallel-gap-fills-test-container",children:(0,y.jsx)(g.Z,{taskData:P.target,answers:M.values.targetAnswers,touched:Array.isArray(M.touched.targetAnswers)?M.touched.targetAnswers.map(Boolean):Array(M.values.targetAnswers.length).fill(!1),errors:M.errors.targetAnswers||[],prefix:"target",onChange:function(e,t){var n=(0,a.Z)(M.values.targetAnswers);n[t]=e,M.setFieldValue("targetAnswers",n)},onBlur:function(e){M.setFieldTouched("targetAnswers[".concat(e,"]"),!0)},activeGapIndex:q.target,setActiveGapIdx:function(e){V((function(t){return(0,i.Z)((0,i.Z)({},t),{},{target:e})})),H("target")}})})]})})})}),(0,y.jsx)(m.Z,{component:"div",className:"col-md-5 col-sm-12",children:(0,y.jsx)(f.Z,{children:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{style:{position:"sticky",top:10,zIndex:99,width:"100%",display:"flex",justifyContent:"center",flexDirection:"row"},children:(0,y.jsx)(Z.Z,{setWord:function(e){if(null!==q.native){var t=(0,a.Z)(M.values.nativeAnswers);t[q.native]=e,M.setFieldValue("nativeAnswers",t),V((function(e){return(0,i.Z)((0,i.Z)({},e),{},{native:q.native+1})}))}},language:R.language.native,setCharacterDirectly:!0,ref:null})}),(0,y.jsxs)(d.Z,{className:"fill-blank-card mb-4",children:[(0,y.jsx)("h5",{children:"Native Text"}),(0,y.jsx)(d.Z.Body,{className:"parallel-gap-fills-test-container",children:(0,y.jsx)(g.Z,{taskData:P.native,answers:M.values.nativeAnswers,touched:Array.isArray(M.touched.nativeAnswers)?M.touched.nativeAnswers.map(Boolean):Array(M.values.nativeAnswers.length).fill(!1),errors:M.errors.nativeAnswers||[],prefix:"native",onChange:function(e,t){var n=(0,a.Z)(M.values.nativeAnswers);n[t]=e,M.setFieldValue("nativeAnswers",n)},onBlur:function(e){M.setFieldTouched("nativeAnswers[".concat(e,"]"),!0)},activeGapIndex:q.native,setActiveGapIdx:function(e){V((function(t){return(0,i.Z)((0,i.Z)({},t),{},{native:e})})),H("native")}})})]})]})})})]}),(0,y.jsx)("div",{className:"text-center mt-4",children:(0,y.jsx)(b.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:M.isSubmitting,type:"submit",logToActivityStream:!1,"data-log":JSON.stringify({actionType:"Submitted",taskName:D,homeworkName:(null===T||void 0===T?void 0:T.name)||"-",teacherName:(null===T||void 0===T||null===(e=T.teacher)||void 0===e?void 0:e.name)||"-",className:(null===T||void 0===T?void 0:T.className)||"-",action:"Submit"})})})]})})}},52841:function(e,t,n){n.d(t,{Z:function(){return y}});var a=n(74165),r=n(1413),i=n(15861),s=n(93433),o=n(54634),l=n(7410),c=n(85554),u=n(21933),d=n(67203),m=n(58467),h=(n(6379),n(73882)),p=n(3002),v=n(46681),f=n(61044),g=n(29439),x=n(47313);var b=n(11054),w=n(15439),Z=n(46417),y=function(){var e,t,n=(0,m.s0)(),y=(0,c.I0)(),k=(function(){var e=(0,x.useState)(window.innerWidth),t=(0,g.Z)(e,2),n=t[0],a=t[1];(0,x.useEffect)((function(){var e=function(){return a(window.innerWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}}),[])}(),(0,c.v9)((function(e){return e})).selectedTaskSlice),j=k.taskData,N=k.homeworkId,S=k.id,I=k.pupilHomeworkAssociationId,A=k.taskName,D=k.restData,T=j.data,R={native:Array(null===(e=T.native.answer)||void 0===e?void 0:e.length).fill(""),target:Array(null===(t=T.target.answer)||void 0===t?void 0:t.length).fill("")},C=(0,l.TA)({initialValues:{native:(0,s.Z)(R.native),target:(0,s.Z)(R.target)},validationSchema:u.Ry({native:u.IX().of(u.Z_().optional()).required(),target:u.IX().of(u.Z_().optional()).required()}),onSubmit:function(e,t){F(e,t)}}),F=function(){var e=(0,i.Z)((0,a.Z)().mark((function e(t,i){var s,l,c,u,d,m;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,c=(0,r.Z)((0,r.Z)({},T),{},{native:(0,r.Z)((0,r.Z)({},T.native),{},{answer:t.native}),target:(0,r.Z)((0,r.Z)({},T.target),{},{answer:t.target})}),y((0,h.NY)({submittedData:{data:c}})),e.next=5,(0,o.f0)({homeworkId:N,taskId:S,submittedData:{data:c},pupilHomeworkAssociationId:I});case 5:return u=e.sent,e.next=8,(0,w.HK)({actionType:"Submitted",taskName:A,homeworkName:(null===D||void 0===D?void 0:D.name)||"-",teacherName:(null===D||void 0===D||null===(s=D.teacher)||void 0===s?void 0:s.name)||"-",className:(null===D||void 0===D?void 0:D.className)||"-",action:"Submit"});case 8:d=Math.round(null!==(l=null===u||void 0===u?void 0:u.scorePercentage)&&void 0!==l?l:0),m=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(S),y((0,h.Pi)({score:d,redirectUrl:m})),n("/pupil/result/tasks/".concat(S)),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),console.log({error:e.t0});case 17:return e.prev=17,i.setSubmitting(!1),e.finish(17);case 20:case"end":return e.stop()}}),e,null,[[0,14,17,20]])})));return function(t,n){return e.apply(this,arguments)}}();return(0,Z.jsxs)(d.Z,{className:"d-flex flex-column",onSubmit:C.handleSubmit,children:[(0,Z.jsxs)(b.Z,{component:"div",className:"row gap-2 justify-content-center",children:[(0,Z.jsxs)(b.Z,{component:"div",className:"col-md-5 col-sm-12",children:[(0,Z.jsx)(b.Z,{sx:{display:{xs:"block",lg:"none"}},children:(0,Z.jsx)(v.Z,{taskData:T.target,answers:C.values.target,setAnswers:function(e){C.setFieldValue("target",e,!1),C.setTouched({target:e.map((function(e){return!!e}))})}})}),(0,Z.jsx)(b.Z,{sx:{display:{xs:"none",lg:"block"}},children:(0,Z.jsx)(f.Z,{taskData:T.target,answers:C.values.target,setAnswers:function(e){C.setFieldValue("target",e,!1),C.setTouched({target:e.map((function(e){return!!e}))})},isRemoveGap:!0})})]}),(0,Z.jsxs)(b.Z,{component:"div",className:"col-md-5 col-sm-12",children:[(0,Z.jsx)(b.Z,{sx:{display:{xs:"block",lg:"none"}},children:(0,Z.jsx)(v.Z,{taskData:T.native,answers:C.values.native,setAnswers:function(e){C.setFieldValue("native",e,!1),C.setTouched({native:e.map((function(e){return!!e}))})}})}),(0,Z.jsx)(b.Z,{sx:{display:{xs:"none",lg:"block"}},children:(0,Z.jsx)(f.Z,{taskData:T.native,answers:C.values.native,setAnswers:function(e){C.setFieldValue("native",e,!1),C.setTouched({native:e.map((function(e){return!!e}))})},isRemoveGap:!0})})]})]}),(0,Z.jsx)("div",{className:"text-center mt-lg-3",children:(0,Z.jsx)(p.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:C.isSubmitting,logToActivityStream:!1,type:"submit"})})]})}},20562:function(e,t,n){var a=n(47313),r=n(51855),i=n(11054),s=n(46417);t.Z=function(e){var t=e.text,n=(0,a.useRef)(null);return(0,a.useEffect)((function(){var e=n.current;e&&(e.style.height="auto",e.style.height="".concat(e.scrollHeight,"px"))}),[t]),(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(r.Z,{children:(0,s.jsx)(i.Z,{component:"div",className:"text-container-scroll",children:(0,s.jsx)(i.Z,{style:{height:"auto",width:"100%",border:"none",resize:"none",overflow:"hidden"},ref:n,component:"textarea",value:t,readOnly:!0})})})})}},28316:function(e,t,n){n.d(t,{Z:function(){return k}});var a=n(1413),r=n(74165),i=n(15861),s=n(29439),o=n(85554),l=n(58467),c=n(22102),u=n(11054),d=n(47313),m=n(3002),h=n(73882),p=n(54634),v=n(93433),f=n(51855),g=n(94464),x=n(6235),b=(n(6379),n(4119)),w=n(46417),Z=function(e){e.taskData;var t=e.targetText,n=e.selectedQuestions,a=e.userAnswer,r=e.setUserAnswer,i=(0,d.useState)(null),o=(0,s.Z)(i,2),l=o[0],c=o[1],m=(0,d.useState)((0,b.TV)((0,v.Z)(n.map((function(e){return e.target}))))),h=(0,s.Z)(m,1)[0],p=h.filter((function(e){return!a.includes(e)}));return(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,w.jsx)(f.Z,{children:(0,w.jsxs)(u.Z,{children:[(0,w.jsx)(x.Z,{className:"test-heading-container",variant:"h6",children:"Drag translations to fill the gaps:"}),(0,w.jsx)("div",{className:"masked-text text-drag-drop-test-container",children:function(){var e=t.split(/(\n)/g),i=n.map((function(e){return e.target})),s=n.map((function(e){return e.native})),o=0;return e.map((function(e,t){for(var n=[],u=0,d=function(){var d=i[o],m=e.indexOf(d,u);if(-1===m)return"break";m>u&&n.push((0,w.jsx)("span",{children:e.slice(u,m)},"text-".concat(t,"-").concat(u)));var h=o,p=l===h,f=!!a[h];n.push((0,w.jsx)("span",{className:"drop-zone",children:f?(0,w.jsx)(g.Z,{label:a[h],onDelete:function(){return function(e){if(a[e]){var t=(0,v.Z)(a);t[e]=null,r(t)}}(h)},className:"filled-chip"}):(0,w.jsx)("span",{onClick:function(){return c(h)},style:{cursor:"pointer"},className:"empty-gap ".concat(p?"selected-gap":""),title:"Click to fill with translation of: ".concat(s[o]),children:s[o]})},"drop-".concat(t,"-").concat(o))),u=m+d.length,o++};u<e.length&&o<i.length;){if("break"===d())break}return u<e.length&&n.push((0,w.jsx)("span",{children:e.slice(u)},"text-end-".concat(t))),(0,w.jsx)("p",{children:n},"line-".concat(t))}))}()})]})}),p.length>0&&(0,w.jsx)(f.Z,{children:(0,w.jsxs)(u.Z,{component:"div",className:"mb-2",children:[(0,w.jsx)(x.Z,{variant:"body2",className:"mb-1",children:"Available translations:"}),(0,w.jsx)("div",{className:"available-words text-drag-drop-test-container",children:p.map((function(e,t){return(0,w.jsx)(g.Z,{label:e,onClick:function(){return function(e,t){if(null!==l){var n=(0,v.Z)(a);n[l]||(n[l]=e,r(n),c(null))}}(e)},className:"draggable-chip",style:{cursor:"pointer",margin:"2px"}},"word-".concat(t,"-").concat(e))}))})]})})]})},y=function(e){e.taskData;var t=e.targetText,n=e.selectedQuestions,a=e.userAnswer,r=e.setUserAnswer,i=(0,d.useState)([]),o=(0,s.Z)(i,2),l=o[0],c=o[1],m=(0,d.useState)(null),h=(0,s.Z)(m,2),p=h[0],Z=h[1],y=(0,d.useRef)(null);(0,d.useEffect)((function(){var e=(0,b.TV)((0,v.Z)(n.map((function(e){return e.target}))));c(e)}),[n]);return(0,w.jsxs)(u.Z,{sx:{display:"flex",flexDirection:{xs:"column",lg:"row"},gap:2,alignItems:"flex-start"},children:[(0,w.jsx)(u.Z,{sx:{width:{xs:"100%",lg:"30%"}},children:l.length>0&&(0,w.jsx)(f.Z,{children:(0,w.jsxs)(u.Z,{component:"div",className:"mb-2",children:[(0,w.jsx)(x.Z,{variant:"body2",className:"mb-1",children:"Available translations:"}),(0,w.jsx)("div",{className:"available-words text-drag-drop-test-container",children:l.map((function(e,t){return(0,w.jsx)(g.Z,{label:e,draggable:!0,onDragStart:function(n){Z(e),y.current=t,n.dataTransfer.setData("text/plain",e)},className:"draggable-chip",style:{cursor:"grab",margin:"2px"}},"word-".concat(t,"-").concat(e))}))})]})})}),(0,w.jsx)(u.Z,{sx:{width:{xs:"100%",lg:"70%"}},children:(0,w.jsx)(f.Z,{children:(0,w.jsxs)(u.Z,{children:[(0,w.jsx)(x.Z,{className:"test-heading-container",variant:"h6",children:"Drag translations to fill the gaps:"}),(0,w.jsx)("div",{className:"masked-text text-drag-drop-test-container",children:function(){var e=t.split(/(\n)/g),i=n.map((function(e){return e.target})),s=n.map((function(e){return e.native})),o=0;return e.map((function(e,t){for(var n=[],u=0,d=function(){var d=i[o],m=e.indexOf(d,u);if(-1===m)return"break";m>u&&n.push((0,w.jsx)("span",{children:e.slice(u,m)},"text-".concat(t,"-").concat(u)));var h=o;n.push((0,w.jsx)("span",{className:"drop-zone",children:a[h]?(0,w.jsx)(g.Z,{label:a[h],onDelete:function(){return function(e){var t=a[e];if(t){var n=(0,v.Z)(a);n[e]=null,r(n),c((function(e){return[].concat((0,v.Z)(e),[t])}))}}(h)},className:"filled-chip"}):(0,w.jsx)("span",{onDragOver:function(e){return e.preventDefault()},onDrop:function(){return function(e){if(p&&!a[e]){var t=(0,v.Z)(a);if(t[e]=p,r(t),null!==y.current){var n=l.filter((function(e,t){return t!==y.current}));c(n)}Z(null),y.current=null}}(h)},className:"empty-gap",children:s[o]})},"drop-".concat(t,"-").concat(o))),u=m+d.length,o++};u<e.length&&o<i.length;){if("break"===d())break}return u<e.length&&n.push((0,w.jsx)("span",{children:e.slice(u)},"text-end-".concat(t))),(0,w.jsx)("p",{children:n},"line-".concat(t))}))}()})]})})})]})},k=function(){var e,t=(0,l.s0)(),n=(0,o.I0)(),v=(0,o.v9)((function(e){return e})),f=v.selectedTaskSlice,g=f.taskData,x=f.homeworkId,b=f.id,k=f.pupilHomeworkAssociationId,j=f.taskName,N=f.restData,S=v.SelectedResourceSlice.text.target,I=g.data,A=I.answer,D=(0,d.useState)(A.map((function(){return null}))),T=(0,s.Z)(D,2),R=T[0],C=T[1],F=function(){var e=(0,i.Z)((0,r.Z)().mark((function e(){var a,i,s,o,l,c,u;return(0,r.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a={answer:A.map((function(e,t){var n;return{target:null!==(n=R[t])&&void 0!==n?n:"",native:e.native}}))},e.prev=1,e.next=4,(0,p.f0)({homeworkId:x,taskId:b,submittedData:{data:a},pupilHomeworkAssociationId:k});case 4:s=e.sent,o=(s||{}).gradedData,l=o&&"data"in o?o:{data:o},n((0,h.NY)({submittedData:l})),c=Math.round(null!==(i=null===s||void 0===s?void 0:s.scorePercentage)&&void 0!==i?i:0),u=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(b),n((0,h.Pi)({score:c,redirectUrl:u})),t("/pupil/result/tasks/".concat(b)),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),console.error("Submission failed:",e.t0);case 17:case"end":return e.stop()}}),e,null,[[1,14]])}
1)));return function(){return e.apply(this,arguments)}}(),q={taskData:I,targetText:S,selectedQuestions:A,userAnswer:R,setUserAnswer:C};return(0,w.jsx)(c.Z,{className:"mt-4 d-flex justify-content-center",children:(0,w.jsxs)(u.Z,{component:"div",className:"d-flex flex-column w-100",children:[(0,w.jsx)(u.Z,{sx:{display:{xs:"block",lg:"none"}},children:(0,w.jsx)(Z,(0,a.Z)({},q))}),(0,w.jsx)(u.Z,{sx:{display:{xs:"none",lg:"block"}},children:(0,w.jsx)(y,(0,a.Z)({},q))}),(0,w.jsx)("div",{className:"text-center mt-3",children:(0,w.jsx)(m.Z,{className:"btn btn-effects test-submit-button",text:"Submit",type:"button",logToActivityStream:!1,"data-log":JSON.stringify({actionType:"Submitted",taskName:j,homeworkName:(null===N||void 0===N?void 0:N.name)||"-",teacherName:(null===N||void 0===N||null===(e=N.teacher)||void 0===e?void 0:e.name)||"-",className:(null===N||void 0===N?void 0:N.className)||"-",action:"Submit"}),onClick:function(){F()}})})]})})}},51855:function(e,t,n){n.d(t,{Z:function(){return r}});var a=n(46417),r=function(e){var t=e.children,n=e.isFullscreen;return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:n?"primary-container-fullscreen":"primary-container",id:"primary",style:{background:"#ffff"},children:[(0,a.jsx)("div",{className:"head-container",style:{background:"#f5f5f5"}}),(0,a.jsx)("div",{className:"text-content",children:t})]})})}},45585:function(e,t,n){var a=n(93433),r=n(74165),i=n(1413),s=n(15861),o=n(29439),l=n(54634),c=n(7410),u=n(85554),d=n(21933),m=n(51855),h=n(65832),p=n(67203),v=n(22102),f=n(58467),g=(n(66808),n(72794)),x=n(73882),b=n(3002),w=n(47313),Z=n(15439),y=n(46417);t.Z=function(){var e=(0,f.s0)(),t=(0,u.I0)(),n=(0,u.v9)((function(e){return e})),k=n.selectedTaskSlice,j=k.taskData,N=k.homeworkId,S=k.id,I=k.pupilHomeworkAssociationId,A=k.taskName,D=k.restData,T=(n.SelectedResourceSlice,j.data),R={answers:Array(T.answer.length).fill("")},C=d.Ry().shape({answers:d.IX().of(d.Z_().length(1,"Each gap must be filled").optional()).required()}),F=(0,c.TA)({initialValues:R,validationSchema:C,onSubmit:function(e,t){H(e,t)}}),q=(0,w.useState)(null),V=(0,o.Z)(q,2),_=V[0],U=V[1],H=function(){var n=(0,s.Z)((0,r.Z)().mark((function n(a,s){var o,c,u,d,m,h;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,u=(0,i.Z)((0,i.Z)({},j.data),{},{answer:a.answers}),t((0,x.NY)({submittedData:{data:u}})),n.next=5,(0,l.f0)({homeworkId:N,taskId:S,submittedData:{data:u},pupilHomeworkAssociationId:I});case 5:return d=n.sent,n.next=8,(0,Z.HK)({actionType:"Submitted",taskName:A,homeworkName:(null===D||void 0===D?void 0:D.name)||"-",teacherName:(null===D||void 0===D||null===(o=D.teacher)||void 0===o?void 0:o.name)||"-",className:(null===D||void 0===D?void 0:D.className)||"-",action:"Submit"});case 8:m=Math.round(null!==(c=null===d||void 0===d?void 0:d.scorePercentage)&&void 0!==c?c:0),h=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(S),t((0,x.Pi)({score:m,redirectUrl:h})),e("/pupil/result/tasks/".concat(S)),s.setSubmitting(!1),n.next=18;break;case 15:n.prev=15,n.t0=n.catch(0),console.log({error:n.t0});case 18:case"end":return n.stop()}}),n,null,[[0,15]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,y.jsx)("div",{style:{position:"relative"},children:(0,y.jsx)(m.Z,{children:(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(h.Z,{className:"fill-blank-card",children:(0,y.jsx)(h.Z.Body,{children:(0,y.jsxs)(p.Z,{onSubmit:F.handleSubmit,children:[(0,y.jsx)(v.Z,{className:"test-gap-fills-test-container",children:(0,y.jsx)(g.Z,{taskData:T,answers:F.values.answers,touched:Array.isArray(F.touched.answers)?F.touched.answers.map(Boolean):Array(F.values.answers.length).fill(!1),errors:F.errors.answers||[],prefix:"answers",onChange:function(e,t){var n=(0,a.Z)(F.values.answers);n[t]=e,F.setFieldValue("answers",n)},onBlur:function(e){F.setFieldTouched("answers[".concat(e,"]"),!0)},setActiveGapIdx:function(e){return U(e)},activeGapIndex:null!==_&&void 0!==_?_:0})}),(0,y.jsx)("div",{className:"text-center mt-4",children:(0,y.jsx)(b.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:F.isSubmitting,type:"submit",logToActivityStream:!1})})]})})})})})})}},93275:function(e,t,n){var a=n(1413),r=n(74165),i=n(15861),s=n(29439),o=n(67203),l=n(22102),c=n(65832),u=n(51855),d=n(85554),m=n(58467),h=n(21933),p=n(7410),v=n(3815),f=n(54634),g=n(3002),x=n(73882),b=n(47313),w=n(44314),Z=n(15439),y=n(46417);t.Z=function(){var e=(0,m.s0)(),t=(0,d.I0)(),n=(0,d.v9)((function(e){return e})),k=n.selectedTaskSlice,j=k.taskData,N=k.homeworkId,S=k.id,I=k.pupilHomeworkAssociationId,A=k.taskName,D=k.restData,T=n.SelectedResourceSlice,R=(0,b.useRef)(null),C=(0,b.useState)(0),F=(0,s.Z)(C,2),q=F[0],V=F[1],_=(0,b.useState)(null),U=(0,s.Z)(_,2),H=U[0],P=U[1],G=j.data.reduce((function(e,t,n){return e[n]="",e}),{}),B=h.Ry(j.data.reduce((function(e,t,n){return e[n]=h.Z_().optional(),e}),{})),M=function(){var n=(0,i.Z)((0,r.Z)().mark((function n(a,i){var s,o,l,c,u,d,m,h;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,(o=j.data.map((function(e,t){return{question:e.question,answer:a[t]}}))).length===j.data.length){n.next=6;break}return(0,v.Z)("warning","Please answer all questions"),i.setSubmitting(!1),n.abrupt("return");case 6:return n.next=8,(0,f.f0)({homeworkId:N,taskId:S,submittedData:{data:o},pupilHomeworkAssociationId:I});case 8:return l=n.sent,c=(l||{}).gradedData,u=c&&"data"in c?c:{data:c},t((0,x.NY)({submittedData:u})),n.prev=12,n.next=15,(0,Z.HK)({actionType:"Submitted",taskName:A,homeworkName:(null===D||void 0===D?void 0:D.name)||"-",teacherName:(null===D||void 0===D||null===(d=D.teacher)||void 0===d?void 0:d.name)||"-",className:(null===D||void 0===D?void 0:D.className)||"-",action:"Submit"});case 15:n.next=20;break;case 17:n.prev=17,n.t0=n.catch(12),console.error("Activity log error:",n.t0);
1case 20:m=Math.round(null!==(s=null===l||void 0===l?void 0:l.scorePercentage)&&void 0!==s?s:0),h=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(S),t((0,x.Pi)({score:m,redirectUrl:h})),e("/pupil/result/tasks/".concat(S)),n.next=29;break;case 26:n.prev=26,n.t1=n.catch(0),console.log({error:n.t1});case 29:return n.prev=29,i.setSubmitting(!1),n.finish(29);case 32:case"end":return n.stop()}}),n,null,[[0,26,29,32],[12,17]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,y.jsx)(u.Z,{children:(0,y.jsx)(p.J9,{initialValues:G,validationSchema:B,onSubmit:function(e,t){M(e,t)},children:function(e){var t=e.handleSubmit,n=(e.errors,e.touched,e.isSubmitting),r=e.setFieldValue,i=e.values;return(0,y.jsxs)(o.Z,{onSubmit:t,children:[(0,y.jsx)("div",{style:{position:"sticky",top:10,zIndex:99,width:"100%",display:"flex",justifyContent:"center",flexDirection:"row"},children:(0,y.jsx)(w.Z,{language:T.language.target,setWord:function(e){if(H){var t=i[H]||"",n=t.slice(0,q)+e+t.slice(q);r(H,n);var a=q+e.length;V(a),requestAnimationFrame((function(){R.current&&(R.current.focus(),R.current.setSelectionRange(a,a))}))}},setCharacterDirectly:!0})}),(0,y.jsx)(l.Z,{className:"my-4 text-input-questions-container",children:j.data.map((function(e,t){return(0,y.jsx)(c.Z,{className:"mb-3 shadow",children:(0,y.jsxs)(c.Z.Body,{children:[(0,y.jsxs)("span",{className:"mb-3",children:[t+1,". ",e.question]}),(0,y.jsx)(p.gN,{name:"".concat(t),children:function(e){var t=e.field,n=e.form;return(0,y.jsx)("textarea",(0,a.Z)((0,a.Z)({},t),{},{className:"form-control",row:1,onFocus:function(e){P(t.name),V(e.target.selectionStart||0),R.current=e.target},onClick:function(e){return V(e.currentTarget.selectionStart||0)},onKeyUp:function(e){return V(e.currentTarget.selectionStart||0)},onSelect:function(e){return V(e.currentTarget.selectionStart||0)},onChange:function(e){n.setFieldValue(t.name,e.target.value),V(e.target.selectionStart||0)}}))}}),(0,y.jsx)(p.Bc,{name:"".concat(t),component:"div",className:"text-danger mt-2"})]})},t)}))}),(0,y.jsx)("div",{className:"text-center",children:(0,y.jsx)(g.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:n,logToActivityStream:!1,type:"submit"})})]})}})})}},62449:function(e,t,n){var a=n(4942),r=n(1413),i=n(74165),s=n(15861),o=n(85554),l=n(51855),c=n(67203),u=n(22102),d=n(65832),m=n(63849),h=n(31616),p=n(21933),v=n(7410),f=n(3815),g=n(54634),x=n(58467),b=n(73882),w=n(3002),Z=(n(59782),n(15439)),y=n(46417);t.Z=function(){var e=(0,x.s0)(),t=(0,o.I0)(),n=(0,o.v9)((function(e){return e.selectedTaskSlice})),k=n.taskData,j=n.homeworkId,N=n.id,S=n.pupilHomeworkAssociationId,I=n.taskName,A=n.restData,D=k.data.reduce((function(e,t,n){return e[n]="",e}),{}),T=p.Ry(k.data.reduce((function(e,t,n){return e[n]=p.Z_().optional(),e}),{})),R=function(){var n=(0,s.Z)((0,i.Z)().mark((function n(a,r){var s,o,l,c,u,d;return(0,i.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,(o=k.data.map((function(e,t){return{question:e.question,answer:a[t]}}))).length===k.data.length){n.next=6;break}return(0,f.Z)("warning","Please answer all questions"),r.setSubmitting(!1),n.abrupt("return");case 6:return t((0,b.NY)({submittedData:{data:o}})),n.next=9,(0,g.f0)({homeworkId:j,taskId:N,submittedData:{data:o},pupilHomeworkAssociationId:S});case 9:return l=n.sent,n.prev=10,n.next=13,(0,Z.HK)({actionType:"Submitted",taskName:I,homeworkName:(null===A||void 0===A?void 0:A.name)||"-",teacherName:(null===A||void 0===A||null===(c=A.teacher)||void 0===c?void 0:c.name)||"-",className:(null===A||void 0===A?void 0:A.className)||"-",action:"Submit"});case 13:n.next=18;break;case 15:n.prev=15,n.t0=n.catch(10),console.error("Activity log error:",n.t0);case 18:u=Math.round(null!==(s=null===l||void 0===l?void 0:l.scorePercentage)&&void 0!==s?s:0),d=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(N),t((0,b.Pi)({score:u,redirectUrl:d})),e("/pupil/result/tasks/".concat(N)),n.next=28;break;case 24:n.prev=24,n.t1=n.catch(0),console.error("Submission Error:",n.t1),(0,f.Z)("error","Error submitting task attempt");case 28:return n.prev=28,r.setSubmitting(!1),n.finish(28);case 31:case"end":return n.stop()}}),n,null,[[0,24,28,31],[10,15]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,y.jsx)(v.J9,{initialValues:D,validationSchema:T,onSubmit:function(e,t){R(e,t)},children:function(e){var t=e.handleSubmit,n=(e.errors,e.touched,e.isSubmitting),i=e.values,s=e.setValues;return(0,y.jsx)(l.Z,{children:(0,y.jsxs)(c.Z,{onSubmit:t,children:[(0,y.jsx)(u.Z,{className:"my-4 true-false-questions-container",children:k.data.map((function(e,t){return(0,y.jsx)(d.Z,{className:"mb-3 shadow",children:(0,y.jsxs)(d.Z.Body,{children:[(0,y.jsxs)("span",{className:"mb-3",children:[t+1,". ",e.question]}),(0,y.jsx)(m.Z,{children:["True","False","Not in Text"].map((function(e,o){return(0,y.jsx)(h.Z,{xs:4,className:"mb-2",children:(0,y.jsx)(w.Z,{className:"btn ".concat(e===i[t]?"btn-warning":"btn-light"),onClick:function(){s((0,r.Z)((0,r.Z)({},i),{},(0,a.Z)({},t,e)))},logToActivityStream:!1,text:e,disabled:n})},o)}))}),(0,y.jsx)(v.Bc,{name:"".concat(t),component:"div",className:"text-danger mt-2"})]})},t)}))}),(0,y.jsx)("div",{className:"text-center",children:(0,y.jsx)(w.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:n,logToActivityStream:!1,type:"submit"})})]})})}})}},64844:function(e,t,n){var a=n(74165),r=n(15861),i=n(4942),s=n(93433),o=n(1413),l=n(29439),c=n(54634),u=n(47313),d=n(85554),m=n(58467),h=n(51855),p=n(11054),v=n(22102),f=n(3002),g=n(73882),x=n(4119),b=n(46417);t.Z=function(){var e,t=(0,m.s0)(),n=(0,d.I0)(),w=(0,d.v9)((function(e){return e})),Z=w.selectedTaskSlice,y=Z.taskData,k=Z.homeworkId,j=Z.id,N=Z.pupilHomeworkAssociationId,S=Z.taskName,I=Z.restData,A=w.SelectedResourceSlice,D=y.data,T=new Set;D.answer.forEach((function(e){T.add(e.id),T.add(e.target)}));var R=Array.from(T),C=(0,u.useState)([]),F=(0,l.Z)(C,2),q=F[0],V=F[1],_=(0,u.useState)([]),U=(0,l.Z)(_,2),H=U[0],P=U[1],G=(0,u.useState)({}),B=(0,l.Z)(G,2),M=B[0],E=B[1],L=(0,u.useState)([]),Y=(0,l.Z)(L,2),z=Y[0],W=Y[1],K=(0,u.useState)((0,x.TV)(R)),O=(0,l.Z)(K,2),J=O[0],Q=(O[1],D.answer.map((function(e){return e.id}))),X=function(e){var t=-1;if(-1!==(t="number"===typeof e?H.findIndex((function(t){return t.id===e})):H.findIndex((function(t){return t.target===e})))){var n=H[t];P(H.filter((function(e,n){return n!==t})));var a=(0,o.Z)({},M);return delete a[n.id],delete a[n.target],void E(a)}if(1!==q.length||q[0]!==e){var r,c=[].concat((0,s.Z)(q),[e]);if(2===c.length){var u=(0,l.Z)(c,2),d=u[0],m=u[1];if("string"===typeof d&&"string"===typeof m||"number"===typeof d&&"number"===typeof m)return;var h,p=(r=H.length,"hsl(".concat(137.508*r%360,", 60%, 75%)")),v=Q.includes(d)?{id:d,target:m}:{id:m,target:d};if(D.answer.some((function(e){return e.id===v.id&&e.target===v.target})))P([].concat((0,s.Z)(H),[v])),E((0,o.Z)((0,o.Z)({},M),{},(h={},(0,i.Z)(h,d,p),(0,i.Z)(h,m,p),h))),V([]);else W([d,m]),setTimeout((function(){return W([])}),900),V([])}else V(c)}else V([])},$=function(e){var t=M[e]||"#fff",n=q.includes(e),a=z.includes(e);return{backgroundColor:t,border:a?"2px solid red":n?"2px solid #000":"1px solid #ccc",animation:a?"blink-red 0.9s ease-in-out":void 0}},ee=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(r){var i,s,o,l,u,d,m,h;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,s=r.map((function(e){return{id:e.id,target:e.target}})),o={answer:s},e.next=5,(0,c.f0)({homeworkId:k,taskId:j,submittedData:{data:o},pupilHomeworkAssociationId:N});case 5:l=e.sent,u=(l||{}).gradedData,d=u&&"data"in u?u:{data:u},n((0,g.NY)({submittedData:d})),m=Math.round(null!==(i=null===l||void 0===l?void 0:l.scorePercentage)&&void 0!==i?i:0),h=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(j),n((0,g.Pi)({score:m,redirectUrl:h})),t("/pupil/result/tasks/".concat(j)),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),console.log({error:e.t0});case 18:case"end":return e.stop()}}),e,null,[[0,15]])})));return function(t){return e.apply(this,arguments)}}();return(0,b.jsx)(h.Z,{isFullscreen:!0,children:(0,b.jsxs)(p.Z,{children:[(0,b.jsx)(v.Z,{className:"mt-4 matching-game-test-container",children:(0,b.jsx)("div",{children:(0,b.jsx)("div",{className:"words-grid",children:(null===J||void 0===J?void 0:J.length)>0&&J.map((function(e,t){if("number"===typeof e){var n,a=null===(n=A.vocab)||void 0===n?void 0:n.filter((function(t){return t.id===e}))[0];if(a)return(0,b.jsx)("img",{src:a.imageId,alt:"vocab.img",className:"word-box",onClick:function(){return X(e)},style:(0,o.Z)({width:"50px",height:"50px",backgroundColor:"white",padding:"0.2rem",borderRadius:"10px"},$(e))},t)}return(0,b.jsx)("div",{className:"word-box",onClick:function(){return X(e)},style:$(e),children:e},t)}))})})}),(0,b.jsx)("div",{className:"text-center mt-3",children:(0,b.jsx)(f.Z,{text:"Submit",className:"btn btn-effects test-submit-button",onClick:function(){return ee(H)},logToActivityStream:!1,"data-log":JSON.stringify({actionType:"Submitted",taskName:S,homeworkName:(null===I||void 0===I?void 0:I.name)||"-",teacherName:(null===I||void 0===I||null===(e=I.teacher)||void 0===e?void 0:e.name)||"-",className:(null===I||void 0===I?void 0:I.className)||"-",action:"Submit"})})})]})})}},70083:function(e,t,n){var a=n(1413),r=n(74165),i=n(15861),s=n(29439),o=n(54634),l=n(3815),c=n(7410),u=n(85554),d=n(21933),m=n(51855),h=n(63849),p=n(31616),v=n(67203),f=n(22102),g=n(65832),x=n(58467),b=n(3002),w=n(73882),Z=n(44314),y=n(47313),k=n(15439),j=n(46417);t.Z=function(){var e=(0,x.s0)(),t=(0,u.I0)(),n=(0,y.useRef)(null),N=(0,y.useState)(0),S=(0,s.Z)(N,2),I=S[0],A=S[1],D=(0,y.useState)(null),T=(0,s.Z)(D,2),R=T[0],C=T[1],F=(0,u.v9)((function(e){return e})),q=F.selectedTaskSlice,V=q.taskData,_=q.homeworkId,U=q.id,H=q.pupilHomeworkAssociationId,P=q.taskName,G=q.restData,B=F.SelectedResourceSlice,M=V.data.reduce((function(e,t,n){return e[n]="",e}),{}),E=d.Ry(V.data.reduce((function(e,t,n){return e[n]=d.Z_().optional(),e}),{})),L=function(){var n=(0,i.Z)((0,r.Z)().mark((function n(a,i){var s,c,u,d,m,h,p,v;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,(c=V.data.map((function(e,t){return{question:e.question,answer:a[t]}}))).length===V.data.length){n.next=6;break}return(0,l.Z)("warning","Please answer all questions"),i.setSubmitting(!1),n.abrupt("return");case 6:return n.next=8,(0,o.f0)({homeworkId:_,taskId:U,submittedData:{data:c},pupilHomeworkAssociationId:H});case 8:return u=n.sent,d=(u||{}).gradedData,n.prev=10,n.next=13,(0,k.HK)({actionType:"Submitted",taskName:P,homeworkName:(null===G||void 0===G?void 0:G.name)||"-",teacherName:(null===G||void 0===G||null===(m=G.teacher)||void 0===m?void 0:m.name)||"-",className:(null===G||void 0===G?void 0:G.className)||"-",action:"Submit"});case 13:n.next=18;break;case 15:n.prev=15,n.t0=n.catch(10),console.error("Activity log error:",n.t0);case 18:h=d&&"data"in d?d:{data:d},t((0,w.NY)({submittedData:h})),p=Math.round(null!==(s=null===u||void 0===u?void 0:u.scorePercentage)&&void 0!==s?s:0),v=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(U),t((0,w.Pi)({score:p,redirectUrl:v})),e("/pupil/result/tasks/".concat(U)),n.next=29;break;case 26:n.prev=26,n.t1=n.catch(0),console.log({error:n.t1});case 29:return n.prev=29,i.setSubmitting(!1),n.finish(29);case 32:case"end":return n.stop()}}),n,null,[[0,26,29,32],[10,15]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,j.jsx)(m.Z,{children:(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(c.J9,{initialValues:M,validationSchema:E,onSubmit:function(e,t){L(e,t)},children:function(e){var t=e.handleSubmit,r=(e.errors,e.touched,e.isSubmitting),i=e.setFieldValue,s=e.values;return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)("div",{style:{position:"sticky",top:10,zIndex:99,width:"100%",display:"flex",justifyContent:"center",flexDirection:"row"},children:(0,j.jsx)(Z.Z,{language:B.language.target,setWord:function(e){if(R){var t=s[R]||"",a=t.slice(0,I)+e+t.slice(I);i(R,a);var r=I+e.length;A(r),requestAnimationFrame((function(){n.current&&(n.current.focus(),n.current.setSelectionRange(r,r))}))}},setCharacterDirectly:!0})}),(0,j.jsxs)(h.Z,{className:"mx-4 my-2 test-heading-container",children:[(0,j.jsx)(p.Z,{children:(0,j.jsx)("h5",{children:B.language.native})}),(0,j.jsx)(p.Z,{children:(0,j.jsx)("h5",{children:B.language.target})})]}),(0,j.jsxs)(v.Z,{onSubmit:t,children:[(0,j.jsx)(f.Z,{className:"my-4 vocab-in-context-questions-container",children:V.data.map((function(e,t){return(0,j.jsx)(g.Z,{className:"mb-3 shadow",children:(0,j.jsxs)(g.Z.Body,{children:[(0,j.jsxs)("div",{className:"row",children:[(0,j.jsx)("div",{className:"col-md-6 col-sm-12",children:(0,j.jsxs)("span",{className:"mb-3",children:[t+1,". ",e.question]})}),(0,j.jsx)("div",{className:"col-md-6 col-sm-12",children:(0,j.jsx)(c.gN,{name:"".concat(t),children:function(e){var t=e.field,r=e.form;return(0,j.jsx)("textarea",(0,a.Z)((0,a.Z)({},t),{},{className:"form-control",row:1,onFocus:function(e){C(t.name),A(e.target.selectionStart||0),n.current=e.target},onClick:function(e){return A(e.currentTarget.selectionStart||0)},onKeyUp:function(e){return A(e.currentTarget.selectionStart||0)},onSelect:function(e){return A(e.currentTarget.selectionStart||0)},onChange:function(e){r.setFieldValue(t.name,e.target.value),A(e.target.selectionStart||0)}}))}})})]}),(0,j.jsx)(c.Bc,{name:"".concat(t),component:"div",className:"text-danger mt-2"})]})},t)}))}),(0,j.jsx)("div",{className:"text-center",children:(0,j.jsx)(b.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:r,logToActivityStream:!1,type:"submit"})})]})]})}})})})}},22220:function(e,t,n){var a=n(74165),r=n(1413),i=n(15861),s=n(93433),o=n(54634),l=n(3815),c=n(7410),u=n(85554),d=n(21933),m=n(51855),h=n(63849),p=n(31616),v=n(65832),f=n(67203),g=n(22102),x=n(58467),b=n(47313),w=(n(66808),n(73882)),Z=n(3002),y=n(15439),k=n(46417);t.Z=function(){var e=(0,x.s0)(),t=(0,u.I0)(),n=(0,u.v9)((function(e){return e})),j=n.selectedTaskSlice,N=j.taskData,S=j.homeworkId,I=j.id,A=j.pupilHomeworkAssociationId,D=j.taskName,T=j.restData,R=n.SelectedResourceSlice,C={answers:N.data.map((function(e){return Array(e.answer.length).fill("")}))},F=d.Ry().shape({answers:d.IX().of(d.IX().of(d.Z_().length(1,"Each ga
1p must be filled").optional())).required()}),q=(0,c.TA)({initialValues:C,validationSchema:F,onSubmit:function(e,t){U(e,t)}}),V=(0,b.useRef)(N.data.map((function(e){return Array(e.answer.length).fill(null).map((function(){return b.createRef().current}))})));(0,b.useEffect)((function(){V.current=N.data.map((function(e){return Array(e.answer.length).fill(null).map((function(){return b.createRef().current}))}))}),[N]);var _=(0,b.useCallback)((function(e,t){for(var n=[],a=0,r=function(){var r=e[i];if("_"===r){var o,l,c,u,d=a,m=(null===(o=q.touched.answers)||void 0===o||null===(l=o[t])||void 0===l?void 0:l[d])&&(null===(c=q.errors.answers)||void 0===c||null===(u=c[t])||void 0===u?void 0:u[d]);n.push((0,k.jsx)("input",{ref:function(e){e&&(V.current[t][d]=e)},value:q.values.answers[t][d]||"",onChange:function(e){return function(e,t,n){var a=e.target.value.slice(-1),r=(0,s.Z)(q.values.answers);r[t]=(0,s.Z)(r[t]),r[t][n]=a,q.setFieldValue("answers",r),a&&setTimeout((function(){var e;if(n<V.current[t].length-1)null===(e=V.current[t][n+1])||void 0===e||e.focus();else if(t<V.current.length-1){var a;null===(a=V.current[t+1][0])||void 0===a||a.focus()}}),0)}(e,t,d)},onBlur:function(){return q.setFieldTouched("answers[".concat(t,"][").concat(d,"]"),!0)},maxLength:1,className:"fill-blank-input ".concat(m&&!q.values.answers[t][d]?"input-error":""),"aria-label":"Input ".concat(d+1),autoCapitalize:"none"},"input-".concat(t,"-").concat(d))),a++}else n.push((0,k.jsx)("span",{className:"static-char",children:r},"char-".concat(t,"-").concat(i)))},i=0;i<e.length;i++)r();return n}),[q]),U=function(){var n=(0,i.Z)((0,a.Z)().mark((function n(i,s){var c,u,d,m,h,p;return(0,a.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,(d=N.data.map((function(e,t){return(0,r.Z)((0,r.Z)({},e),{},{answer:i.answers[t]})}))).length===N.data.length){n.next=6;break}return(0,l.Z)("warning","Please answer all questions"),s.setSubmitting(!1),n.abrupt("return");case 6:return t((0,w.NY)({submittedData:{data:d}})),n.next=9,(0,o.f0)({homeworkId:S,taskId:I,submittedData:{data:d},pupilHomeworkAssociationId:A});case 9:return m=n.sent,n.next=12,(0,y.HK)({actionType:"Submitted",taskName:D,homeworkName:(null===T||void 0===T?void 0:T.name)||"-",teacherName:(null===T||void 0===T||null===(c=T.teacher)||void 0===c?void 0:c.name)||"-",className:(null===T||void 0===T?void 0:T.className)||"-",action:"Submit"});case 12:h=Math.round(null!==(u=null===m||void 0===m?void 0:m.scorePercentage)&&void 0!==u?u:0),p=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(I),t((0,w.Pi)({score:h,redirectUrl:p})),e("/pupil/result/tasks/".concat(I)),s.setSubmitting(!1),n.next=22;break;case 19:n.prev=19,n.t0=n.catch(0),console.log({error:n.t0});case 22:case"end":return n.stop()}}),n,null,[[0,19]])})));return function(e,t){return n.apply(this,arguments)}}();return(0,k.jsx)(m.Z,{children:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(h.Z,{className:"mx-4 my-2 test-heading-container",children:[(0,k.jsx)(p.Z,{children:(0,k.jsx)("h5",{children:R.language.native})}),(0,k.jsx)(p.Z,{children:(0,k.jsx)("h5",{children:R.language.target})})]}),(0,k.jsx)(v.Z,{className:"fill-blank-card",children:(0,k.jsx)(v.Z.Body,{children:(0,k.jsxs)(f.Z,{onSubmit:q.handleSubmit,children:[(0,k.jsx)(g.Z,{className:"my-3 vocab-gap-fills-test-container",children:N.data.map((function(e,t){return(0,k.jsxs)(h.Z,{className:"mb-3 align-items-start",children:[(0,k.jsx)(p.Z,{md:6,className:"text-left",children:(0,k.jsx)("div",{className:"question-text",children:(0,k.jsx)("strong",{children:e.textToShow})})}),(0,k.jsx)(p.Z,{md:6,className:"text-response",children:_(e.textToFill,t)})]},"sentence-".concat(t))}))}),(0,k.jsx)("div",{className:"text-center",children:(0,k.jsx)(Z.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:q.isSubmitting,type:"submit",logToActivityStream:!1})})]})})})]})})}},60344:function(e,t,n){n.d(t,{Z:function(){return D}});var a=n(1413),r=n(74165),i=n(15861),s=n(29439),o=n(54634),l=n(3815),c=n(7410),u=n(85554),d=n(21933),m=n(51855),h=n(67203),p=n(63849),v=n(31616),f=n(22102),g=n(65832),x=n(58467),b=n(47313),w=n(66301),Z=n(3002),y=n(73882),k=(n(4250),n(32041)),j=n(46417),N=(0,b.memo)((function(e){var t=e.audioUrl,n=e.onAudioSettingsChange,a=(0,b.useState)(!1),r=(0,s.Z)(a,2),i=r[0],o=(r[1],(0,b.useState)(100)),l=(0,s.Z)(o,2),c=l[0],u=l[1],d=(0,b.useState)(50),m=(0,s.Z)(d,2),h=m[0],p=m[1],v=(0,b.useRef)(null),f=(0,b.useRef)(null),g=(0,b.useRef)(null),x=(0,b.useRef)(null),w=(0,b.useRef)(null),Z=0,y=0,N=0,S=(0,b.useRef)(n);(0,b.useEffect)((function(){S.current=n}),[n]),(0,b.useEffect)((function(){w.current&&(w.current.volume=Math.min(Math.max(c,1),100)/100,w.current.playbackRate=Math.min(Math.max(h/100*1.5+.5,.5),2),S.current({volume:w.current.volume,playbackRate:w.current.playbackRate}))}),[c,h]);var I=function(e,t,n,a){e.preventDefault();var r=t.current,i=n.current;if(r&&i){y=i.getBoundingClientRect().bottom,Z=e.pageY,N=y-Z;var s=function(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(("volume"===t?v.current:f.current)&&g.current&&x.current){var n=("volume"===t?g.current:x.current).getBoundingClientRect(),a=n.height,r=e.pageY-n.top,i=100-Math.max(0,Math.min(r,a))/a*100;"volume"===t?u(i):p(i)}}(e,a)};window.addEventListener("mousemove",s),window.addEventListener("mouseup",(function(){window.removeEventListener("mousemove",s)})),"volume"===a?u(N>0?N/i.getBoundingClientRect().height*100:c):p(N>0?N/i.getBoundingClientRect().height*100:h)}};return(0,b.useEffect)((function(){var e=w.current;e&&t&&(e.src=t,e.load())}
1),[t]),(0,j.jsxs)("div",{className:i?"audioplayer audioplayer-playing":"audioplayer audioplayer-stopped",children:[(0,j.jsx)("audio",{ref:w,style:{height:"0px",width:"0px",visibility:"hidden"}}),(0,j.jsxs)("div",{className:"audioplayer-playback tourPlayback",children:[(0,j.jsx)("div",{className:"audioplayer-playback-button",title:"Playback",children:(0,j.jsx)(k.Z,{color:"#fff"})}),(0,j.jsx)("div",{className:"audioplayer-volume-adjust",children:(0,j.jsxs)("div",{onMouseDown:function(e){return I(e,f,x,"pitch")},ref:x,role:"slider","aria-valuenow":h,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Playback speed control",children:[(0,j.jsx)("span",{className:"thumb",style:{top:"".concat(100-h,"%")},"data-log":"audioplayer-PlaybackRate"}),(0,j.jsx)("div",{ref:f,style:{height:"".concat(h,"%"),minHeight:"0%",maxHeight:"100%"}})]})})]}),(0,j.jsxs)("div",{className:"audioplayer-volume tourVolume",children:[(0,j.jsx)("div",{className:"audioplayer-volume-button",title:"Volume",children:(0,j.jsx)("a",{href:"#",children:"Volume"})}),(0,j.jsx)("div",{className:"audioplayer-volume-adjust",children:(0,j.jsx)("div",{onMouseDown:function(e){return I(e,v,g,"volume")},ref:g,role:"slider","aria-valuenow":c,"aria-valuemin":0,"aria-valuemax":100,"aria-label":"Volume control",children:(0,j.jsx)("div",{ref:v,style:{height:"".concat(c,"%"),minHeight:"1%",maxHeight:"100%"},"data-log":"audioplayer-Volume"})})})]})]})})),S=N,I=n(44314),A=n(15439),D=function(){var e=(0,x.s0)(),t=(0,u.I0)(),n=(0,b.useState)([]),k=(0,s.Z)(n,2),N=k[0],D=k[1],T=(0,b.useState)({volume:1,playbackRate:1}),R=(0,s.Z)(T,2),C=R[0],F=R[1],q=(0,b.useRef)(null),V=(0,b.useState)(0),_=(0,s.Z)(V,2),U=_[0],H=_[1],P=(0,b.useState)(null),G=(0,s.Z)(P,2),B=G[0],M=G[1],E=(0,u.v9)((function(e){return e})),L=E.selectedTaskSlice,Y=L.taskData,z=L.homeworkId,W=L.id,K=L.identifier,O=L.pupilHomeworkAssociationId,J=L.taskName,Q=L.restData,X=E.SelectedResourceSlice,$=Y.data.reduce((function(e,t,n){return e[n]="",e}),{}),ee=d.Ry(Y.data.reduce((function(e,t,n){return e[n]=d.Z_().optional(),e}),{})),te=function(){var n=(0,i.Z)((0,r.Z)().mark((function n(a,i){var s,c,u,d,m,h,p,v;return(0,r.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,(c=Y.data.map((function(e,t){return{id:e.id,answer:a[t]}}))).length===Y.data.length){n.next=6;break}return(0,l.Z)("warning","Please answer all questions"),i.setSubmitting(!1),n.abrupt("return");case 6:return n.next=8,(0,o.f0)({homeworkId:z,taskId:W,submittedData:{data:c},pupilHomeworkAssociationId:O});case 8:return u=n.sent,d=(u||{}).gradedData,n.prev=10,n.next=13,(0,A.HK)({actionType:"Submitted",taskName:J,homeworkName:(null===Q||void 0===Q?void 0:Q.name)||"-",teacherName:(null===Q||void 0===Q||null===(m=Q.teacher)||void 0===m?void 0:m.name)||"-",className:(null===Q||void 0===Q?void 0:Q.className)||"-",action:"Submit"});case 13:n.next=18;break;case 15:n.prev=15,n.t0=n.catch(10),console.error("Activity log error:",n.t0);case 18:h=d&&"data"in d?d:{data:d},t((0,y.NY)({submittedData:h})),p=Math.round(null!==(s=null===u||void 0===u?void 0:u.scorePercentage)&&void 0!==s?s:0),v=window.location.pathname.includes("/pupil/language-library/play/")||window.location.pathname.includes("/pupil/reading-room/play/")?sessionStorage.getItem("readingRoomRedirectUrl")||void 0:"/pupil/result/tasks/".concat(W),t((0,y.Pi)({score:p,redirectUrl:v})),e("/pupil/result/tasks/".concat(W)),n.next=29;break;case 26:n.prev=26,n.t1=n.catch(0),console.log({error:n.t1});case 29:return n.prev=29,i.setSubmitting(!1),n.finish(29);case 32:case"end":return n.stop()}}),n,null,[[0,26,29,32],[10,15]])})));return function(e,t){return n.apply(this,arguments)}}();(0,b.useEffect)((function(){var e;if(X.resource_id>=0&&(null===(e=Y.data)||void 0===e?void 0:e.length)>0){var t=Y.data.map((function(e){var t,n=X.vocab.filter((function(t){return t.id===e.id}));return(0,a.Z)((0,a.Z)({},e),{},{audio:(null===(t=n[0])||void 0===t?void 0:t.voiceId)||""})}));D(t)}}),[X,Y]);var ne=function(e){F(e)};return(0,j.jsx)(m.Z,{children:(0,j.jsx)(j.Fragment,{children:(0,j.jsx)(c.J9,{initialValues:$,validationSchema:ee,onSubmit:function(e,t){te(e,t)},children:function(e){var t=e.handleSubmit,n=(e.errors,e.touched,e.isSubmitting),r=e.setFieldValue,i=e.values;return(0,j.jsxs)(h.Z,{onSubmit:t,children:[(0,j.jsx)("div",{style:{position:"sticky",top:10,zIndex:99,width:"100%",display:"flex",justifyContent:"center",flexDirection:"row"},children:(0,j.jsx)(I.Z,{language:X.language.target,setWord:function(e){if(B
1){var t=i[B]||"",n=t.slice(0,U)+e+t.slice(U);r(B,n);var a=U+e.length;H(a),requestAnimationFrame((function(){q.current&&(q.current.focus(),q.current.setSelectionRange(a,a))}))}},setCharacterDirectly:!0})}),(0,j.jsxs)(p.Z,{className:"mx-4 my-2 test-heading-container vocab-listening-heading-container",children:[(0,j.jsx)(v.Z,{children:(0,j.jsx)(S,{audioUrl:N.length>0?"https://static.lingoteach.ai/".concat(N[0].audio):"",onAudioSettingsChange:ne})}),(0,j.jsx)(v.Z,{children:(0,j.jsx)("h5",{children:"vocabListeningAsSpelling"===K?X.language.target:X.language.native})})]}),(0,j.jsx)(f.Z,{className:"my-4 vocab-listening-test-container",children:null===N||void 0===N?void 0:N.map((function(e,t){return(0,j.jsx)(g.Z,{className:"mb-3 shadow",children:(0,j.jsxs)(g.Z.Body,{children:[(0,j.jsxs)("div",{className:"row",children:[(0,j.jsx)("div",{className:"col-md-6 col-sm-12",children:(0,j.jsxs)("strong",{children:[t+1,".\xa0",(0,j.jsx)("span",{style:{cursor:"pointer"},onClick:function(){return function(e){if(e){var t="https://static.lingoteach.ai/".concat(e),n=new Audio(t);n.volume=C.volume,n.playbackRate=C.playbackRate,n.play()}}(e.audio)},children:e.audio&&(0,j.jsx)(w.F,{})})]})}),(0,j.jsx)("div",{className:"col-md-6 col-sm-12",children:(0,j.jsx)(c.gN,{name:"".concat(t),children:function(e){var t=e.field,n=e.form;return(0,j.jsx)("textarea",(0,a.Z)((0,a.Z)({},t),{},{className:"form-control",row:1,onFocus:function(e){M(t.name),H(e.target.selectionStart||0),q.current=e.target},onClick:function(e){return H(e.currentTarget.selectionStart||0)},onKeyUp:function(e){return H(e.currentTarget.selectionStart||0)},onSelect:function(e){return H(e.currentTarget.selectionStart||0)},onChange:function(e){n.setFieldValue(t.name,e.target.value),H(e.target.selectionStart||0)}}))}})})]}),(0,j.jsx)(c.Bc,{name:"".concat(t),component:"div",className:"text-danger mt-2"})]})},t)}))}),(0,j.jsx)("div",{className:"text-center",children:(0,j.jsx)(Z.Z,{className:"btn btn-effects test-submit-button",text:"Submit",disabled:n,type:"submit",logToActivityStream:!1})})]})}})})})}},44314:function(e,t,n){n.d(t,{Z:function(){return o}});var a=n(29439),r=n(47313),i=n(4119),s=n(46417),o=(0,r.forwardRef)((function(e,t){var n=e.setWord,o=e.language,l=e.setCharacterDirectly,c=void 0!==l&&l,u=(0,r.useState)(!0),d=(0,a.Z)(u,2),m=d[0],h=d[1],p=function(e){var a,r;if(c&&n&&n(e),t&&"current"in t&&t.current){var i=t.current;i.focus();var s=null!==(a=i.selectionStart)&&void 0!==a?a:i.value.length,o=null!==(r=i.selectionEnd)&&void 0!==r?r:i.value.length,l=i.value.slice(0,s)+e+i.value.slice(o),u=s+e.length;i.value=l,requestAnimationFrame((function(){i.setSelectionRange(u,u),i.focus()})),n&&n(l)}};return(0,s.jsx)("div",{children:i.Tx[o]&&(0,s.jsxs)(s.Fragment,{children:[!m&&(0,s.jsx)("button",{className:"keyboardbtnHeading my-1 tourKeyboard",onClick:function(e){e.preventDefault(),h(!m)},children:"Click here to add special characters"}),m&&(0,s.jsxs)("div",{className:"pupilKeyboardBody my-1 tourKeyboard",children:["Accents:",i.Tx[o].capitals.map((function(e,t){var n=e.capital,a=e.lower;return(0,s.jsxs)(r.Fragment,{children:["French"!==o&&(0,s.jsx)("div",{className:"pupilKeyboardButtons",onClick:function(){return p(n)},children:n}),(0,s.jsx)("div",{className:"pupilKeyboardButtons",onClick:function(){return p(a)},children:a})]},t)})),i.Tx[o].others.map((function(e,t){return(0,s.jsx)("div",{className:"pupilKeyboardButtons",onClick:function(){return p(e)},children:e},t)}))]})]})})}))},60327:function(e,t,n){var a=n(1413),r=n(95668),i=n(18317),s=n(46417);t.Z=function(e){var t=e.children,n=e.suggestion,o=e.place,l=void 0===o?"top":o,c=e.className;return""!==n?(0,s.jsx)(i.Z,{placement:l,delay:{show:250,hide:100},overlay:function(e){return(0,s.jsx)(r.Z,(0,a.Z)((0,a.Z)({id:"button-tooltip",className:c},e),{},{children:n}))},trigger:["hover","hover"],children:t}):(0,s.jsx)(s.Fragment,{children:t})}},35637:function(e,t,n){n.d(t,{_:function(){return o}});var a=n(29439),r=n(47313),i=n(65832),s=(n(94886),n(46417));t.Z=function(e){var t=e.taskIdentifier,n=(0,r.useState)({heading:"",instructions:""}),l=(0,a.Z)(n,2),c=l[0],u=l[1];return(0,r.useEffect)((function(){t&&o[t]&&u(o[t])}),[t]),o[t]?(0,s.jsx)(i.Z,{className:"mt-3 shadow",children:(0,s.jsx)(i.Z.Body,{children:(0,s.jsxs)("div",{style:{textAlign:"center"},children:[(0,s.jsx)("span",{style:{fontSize:"1.5rem",fontWeight:"bold"},children:c.heading}),(0,s.jsx)("br",{}),(0,s.jsx)("span",{style:{fontSize:"1.2rem",whiteSpace:"pre-line"},children:c.instructions})]})})}):(0,s.jsx)(s.Fragment,{})};var o={vocabTypeAnswer:{heading:"\ud83e\udde0 Vocab quiz \u2013 type the answer",instructions:"Read the words or phrase then type in the correct translation. Scroll down to see every question\ud83d\udc47\u200b"},vocabContextTypeAnswer:{heading:"\ud83e\udde0 Vocab-in-context \u2013 type the answer",instructions:"Read the phrase then type in the correct translation. Scroll down to see every question\ud83d\udc47\u200b"},vocabListeningAsSpelling:{heading:"\ud83c\udfa7\u270d\ufe0f Vocab quiz \u2013 listen and spell",instructions:"Listen to each word, then use your keyboard to spell what you hear. Scroll down to see every question\ud83d\udc47\u200b"},vocabListeningAsTranslation:{heading:"\ud83c\udfa7\ud83c\udf0d Vocab quiz (listen & translate)\u200b\u200b",instructions:"Listen to each word, then use your keyboard to type in the correct translation. Scroll down to see every question\ud83d\udc47\u200b"},vocabTestVowels:{heading:"\ud83c\udd70\ufe0f Vocab quiz (vowels)",instructions:"Use your keyboard to enter the missing vowels into all of the gaps. Scroll down to see every question\ud83d\udc47\u200b"},vocabTestConsonants:{heading:"\ud83c\udd71\ufe0f Vocab quiz (consonants)\u200b",instructions:"Use your keyboard to enter the missing consonants into all of the gaps.\u200b Scroll down to see every question\ud83d\udc47\u200b"},vocabInContextTestConsonants:{heading:"\ud83c\udd71\ufe0f Vocab-in-context quiz \u2013 consonants test",instructions:"User your keyboard to enter the missing consonants into all of the gaps. Scroll down to see every question\ud83d\udc47\u200b\u200b"},vocabInContextTestVowels:{heading:"\ud83c\udd70\ufe0f Vocab-in-context (vowels)\u200b",instructions:"Use your keyboard to enter the missing vowels into all of the gaps.\u200b Scroll down to see every question\ud83d\udc47\u200b"},textsMultipleChoice:{heading:"\ud83d\udcd8 Multiple choice",instructions:"Read the text then answer the questions by selecting the correct option.\u200b"},textsMultipleChoiceInference:{heading:"\ud83e\udde9 Multiple choice (inference)",instructions:"Read the text then answer the questions by selecting the option that best completes the sentence, according to the information in the text.\u200b"},trueFalseStatementQuestions:{heading:"\u2705\u274c True/False",instructions:"Read the text then decide if each statement is true, false, or if it contains information that is \u2018not in text\u2019.\u200b"},comprehensionQuestionsTextInput:{heading:"\u2753 Comprehension questions",instructions:"Answer questions about the main ideas and details in the text."},findThePhraseReading:{heading:"\ud83d\udd0d Find the phrases",instructions:"Search the text for the phrases equivalent to the phrases opposite.\u200b\u200b"},gapFillsReadingVowels:{heading:"\ud83c\udd70\ufe0f Gap fill \u2013 vowels (reading)",instructions:"Use your keyboard to fill the gaps in the text with the correct missing vowels.\u200b"},gapFillsReadingConsonants:{heading:"\ud83c\udd71\ufe0f Gap fill \u2013 consonants (reading)",instructions:"Use your keyboard to fill the gaps in the text with the correct missing consonants."},parallelGapsReadingVowels:{heading:"\ud83e\ude84\ud83c\udd70\ufe0f Gap fill \u2013 vowels (parallel text)",instructions:"Use both texts to work out the missing vowels on each side, then use your keyboard to enter them correctly.\u200b"},parallelGapsReadingConsonants:{heading:"\ud83e\ude84\ud83c\udd71\ufe0f Gap fill \u2013 consonants (parallel text)",instructions:"Use your keyboard to enter the missing consonants into all of the gaps.\u200b"},gapFillsReadingDragDrop:{heading:"\u270f\ufe0f Gap fill \u2013 reading",instructions:"Fill in the blanks in the text using the words provided.\n Mobile users \u2013 tap the gap, then the word you want to insert.\u200b\nLaptop/Ipad users \u2013 drag and drop the word.\n\u200bGap words are at the bottom of the screen.\u200b"},parallelGapsReadingDragDrop:{heading:"\ud83e\ude84 Gap fill \u2013 reading (parallel text)",instructions:"Read each text to help you work out the correct missing words.\nMobile users: tap the gap then the word to fill the gap.\nLaptop users drag and drop the words into the gaps. Gap words are at the bottom of the screen.\u200b"},tangledTranslationDragDrop:{heading:"\u270f\ufe0f Tangled translation \u2013 reading",instructions:"Tap or drag and drop the sentence chunks to replace the corresponding chunks in the text:\u200b\u200b"},openEndQuestionsWriting:{heading:"\u270d\ufe0f Open questions",instructions:"Answer the questions using full sentences."},trueFalseListeningQuestions:{heading:"\ud83c\udfa7\u2705\u274c True/False (listening)",instructions:"Listen to the audio then decide if each statement is true, false, or if it contains information that is \u2018not in text\u2019.\u200b"},comprehensionQuestionsListeningTextInput:{heading:"\ud83c\udfa7\u2753 Comprehension questions (listening)",instructions:"Listen to the audio and answer the questions."},findThePhraseListening:{heading:"\ud83c\udfa7\ud83d\udd0d Find the phrases (listening)",instructions:"Listen to the audio, then type the correct corresponding phrase as you hear it.\u200b"},gapFillsListeningVowels:{heading:"\ud83c\udfa7\ud83c\udd70\ufe0f Gap fill \u2013 vowels (listening)",instructions:"Use your keyboard to enter the missing vowels as you listen to the text.\u200b"},gapFillsListeningConsonants:{heading:"\ud83c\udfa7\ud83c\udd71\ufe0f Gap fill \u2013 consonants (listening)",instructions:"User your keyboard to enter the missing consonants into all of the gaps.\u200b"},parallelGapsListeningVowels:{heading:"\ud83c\udfa7\ud83e\ude84\ud83c\udd70\ufe0f Gap fill \u2013 vowels (parallel text listening)",instructions:"Use your keyboard to enter the missing vowels as you listen to the text, then enter the missing vowels to the translation opposite.\u200b"},parallelGapsListeningConsonants:{heading:"\ud83c\udfa7\ud83e\ude84\ud83c\udd71\ufe0f Gap fill \u2013 consonants (parallel text listening)",instructions:"Use your keyboard to enter the missing consonants as you listen to the text, then enter the missing consonants to the translation opposite.\u200b\u200b"},gapFillsListeningDragDrop:{heading:"\ud83c\udfa7\u270f\ufe0f Gap fill \u2013 listening",instructions:"Fill in the blanks in the text using the words provided.\u200b\nMobile users \u2013 tap the gap, then the word you want to insert.\u200b\nLaptop/Ipad users \u2013 drag and drop the word\u200b\u200b.\nGap words are at the bottom of the screen."},parallelGapsListeningDragDrop:{heading:"\ud83c\udfa7\ud83e\ude84 Gap fill \u2013 listening (parallel text)",instructions:"Tap a gap then a word (or drag on drop on laptops) to enter the words into the gaps that you see on each side.\u200b Read each text to help you work it out. Gap words are at the bottom of the screen.\u200b"},matchingGameChunks:{heading:"Matching game (chunks)",instructions:"Tap or click to match the pairs of sentence chunks.\u200b"},matchingGameVocab:{heading:"Matching game (vocabulary)\u200b",instructions:"Tap or click to match the correct vocabulary items in each language.\u200b"},imageMatchingGameVocab:{heading:"Matching game (images)",instructions:"Tap or click to match the vocabulary with the correct image/icon.\u200b"}}},9497:function(e,t,n){n.d(t,{H:function(){return c}});var a=n(74165),r=n(15861),i=n(3815),s=n(67911),o=function(){var e=(0,r.Z)((0,a.Z)().mark((function e(t){var n,r,o,l;return(0,a.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.text,r=t.lang,o=t.id,e.prev=1,e.next=4,
1s.e.post("/parts_of_speech/interaction",{text:n,lang:r,id:o});case 4:return l=e.sent,e.abrupt("return",l.data);case 8:throw e.prev=8,e.t0=e.catch(1),(0,i.Z)("error",e.t0.message),e.t0;case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),l=n(4648),c=function(e){return function(){var t=(0,r.Z)((0,a.Z)().mark((function t(n){var r;return(0,a.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o(e);case 3:r=t.sent,n((0,l.Yk)({res:r,type:e.type})),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.log({error:t.t0});case 10:case"end":return t.stop()}}),t,null,[[0,7]])})));return function(e){return t.apply(this,arguments)}}()}},59782:function(){},6379:function(){},66808:function(){},94886:function(){}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.