import{I as o}from"./CG1PE8VW.chunk.js";import{I as s}from"./uoUaCILN.chunk.js";var u=(e=>(e[e.Incorrect=0]="Incorrect",e[e.Correct=1]="Correct",e[e.PendingReview=2]="PendingReview",e))(u||{});function a(){return o.NotApplicable}function g(){return o.AwaitingMarking}function l(e,t){const n=e.actionableItems.filter(r=>r.isCorrect);return n.every(r=>!t(r.id))?o.UnAnswered:n.every(r=>{var i;return r.name.trim().toLowerCase()===((i=t(r.id))==null?void 0:i.trim().toLowerCase())})?o.Correct:o.Incorrect}function p(e,t){return e.actionableItems.every(r=>!t(r.id))?o.UnAnswered:e.actionableItems.filter(r=>r.isCorrect).every(r=>{var C;const i=t(r.id);return(i==null?void 0:i.toString())===((C=r.id)==null?void 0:C.toString())||i===r.name})?o.Correct:o.Incorrect}function m(e,t){let n;return e.actionableItems.forEach(c=>{const r=t(c.id);if(!r){n=o.UnAnswered;return}if(r.status===u.Correct){n=o.Correct;return}if(r.status===u.Incorrect){n=o.Incorrect;return}n=o.AwaitingMarking}),n}function d(e,t){return n=>{const c=t==null?void 0:t.attempts.find(r=>r.id===e.id);return c==null?void 0:c.answers.find(r=>r.id===n)}}function M(e,t){const n=d(e,t);return l(e,c=>{const r=n(c);return r==null?void 0:r.text})}function f(e,t){const n=d(e,t);return p(e,c=>{const r=n(c);return r==null?void 0:r.text})}function I(e,t){const n=d(e,t);return m(e,n)}const w={[s.Annotation]:a,[s.Image]:a,[s.MissingWord]:M,[s.MultipleChoice]:f,[s.ShortAnswer]:I,[s.TrueOrFalse]:f,[s.Illustration]:I};function b(e,t){const n=w[e.typeId];return n(e,t)}const y={notApplicable:a,awaitingMarking:g,isMissingWordCorrect:l,isMultipleChoiceCorrect:p,isInteractionCorrect:b};export{y as I,u as a};
//# sourceMappingURL=CNtKSILN.chunk.js.map
