1"use strict";(self.webpackChunkcitizen_code=self.webpackChunkcitizen_code||[]).push([[501,8729],{501(G,L,c){c.d(L,{OrdOnComponent:()=>Y});var O=c(2615),e=c(73664),s=c(72200),A=c(25596),E=c(99213),M=c(73955),C=c(26708),g=c(78729),R=c(2687),D=c(42364),b=c(12809),S=c(7673),I=c(84923),v=c(33446),P=c(47581),x=c(66475);const U=o=>({"two-columns-layout":o}),h=o=>({"button-row-flex":o}),m=o=>({consigneImg:o}),i=o=>({"div-consignes":o}),a=(o,u)=>({cannotMove:o,"row-btn-container":u});function l(o,u){if(1&o&&(e.nrm(0,"app-consignes",1),e.nI1(1,"translate")),2&o){const t=e.XpG();e.Y8G("questionTypeName",e.mNQ(e.bMT(1,7,"activities.questionTypeName.app-consignes")))("wording",t.wording)("ngClass",e.eq3(9,m,t.isWordingImg()))("wordingAudio",t.wordingAudio)("autoRead",t.isAutoReadActive("wording"))("readable",!t.isConsigneContainMedia(t.wording))}}function _(o,u){if(1&o&&(e.nrm(0,"app-consignes",4),e.nI1(1,"translate")),2&o){const t=e.XpG();e.Y8G("questionTypeName",e.mNQ(e.bMT(1,8,"activities.questionTypeName.app-consignes")))("ngClass",e.eq3(10,i,!t.isVertical))("instruction",t.instruction)("ngClass",e.eq3(12,m,t.isInstructionImg()))("instructionAudio",t.instructionAudio)("autoRead",t.isAutoReadActive("instruction"))("readable",!t.isConsigneContainMedia(t.instruction))}}function T(o,u){1&o&&(e.j41(0,"span",15)(1,"mat-icon"),e.EFF(2,"check"),e.k0s()())}function y(o,u){1&o&&(e.j41(0,"span",16)(1,"mat-icon"),e.EFF(2,"close"),e.k0s()())}function k(o,u){1&o&&(e.j41(0,"span",17)(1,"mat-icon"),e.EFF(2,"info_outline"),e.k0s()())}function B(o,u){if(1&o&&(e.nVh(0,T,3,0,"span",15),e.nVh(1,y,3,0,"span",16),e.nVh(2,k,3,0,"span",17)),2&o){const t=e.XpG().$implicit,r=e.XpG();e.vxM(1==r.correctAnswer[t.id]?0:-1),e.R7$(),e.vxM(2==r.correctAnswer[t.id]?1:-1),e.R7$(),e.vxM(3==r.correctAnswer[t.id]?2:-1)}}function V(o,u){1&o&&(e.j41(0,"span",14)(1,"mat-icon"),e.EFF(2,"save"),e.k0s()())}function W(o,u){if(1&o&&(e.j41(0,"div",7)(1,"span",10),e.EFF(2),e.k0s(),e.j41(3,"button",11)(4,"span",12),e.EFF(5),e.k0s(),e.nrm(6,"span",13),e.nI1(7,"stringToHtml"),e.k0s(),e.nVh(8,B,3,3),e.nVh(9,V,3,0,"span",14),e.k0s()),2&o){const t=u.$implicit,r=e.XpG();e.Y8G("ngClass",e.l_i(9,a,0==r.canMove,!r.isVertical)),e.R7$(2),e.JRh(t.orderno),e.R7$(),e.Y8G("ngClass",r.answerState(t)),e.R7$(2),e.JRh(t.id),e.R7$(),e.Y8G("innerHTML",e.bMT(7,7,t.answer),e.npT),e.R7$(2),e.vxM(r.displaySolution||r.testAnswer?8:-1),e.R7$(),e.vxM(!r.correctAnswer[t.id]||r.testAnswer||r.displaySolution||r.isPreview?-1:9)}}function j(o,u){1&o&&(e.j41(0,"div",8)(1,"p"),e.EFF(2),e.nI1(3,"translate"),e.k0s()()),2&o&&(e.R7$(2),e.JRh(e.bMT(3,1,"activities.feedback.ord.wrong")))}function $(o,u){if(1&o&&(e.j41(0,"div",9),e.EFF(1),e.nI1(2,"translate"),e.k0s()),2&o){const t=e.XpG();e.R7$(),e.Lme("",e.bMT(2,2,"generic.score"),"",t.showPercentile)}}function K(o,u){if(1&o&&e.nrm(0,"mat-icon",20),2&o){const t=e.XpG(2).$implicit;e.Y8G("svgIcon",t.svgIcon)}}function X(o,u){if(1&o){const t=e.RV6();e.j41(0,"button",19),e.bIt("click",function(){O.eBV(t);const n=e.XpG().$implicit,d=e.XpG();return O.Njj(d.onAction(n))}),e.nVh(1,K,1,1,"mat-icon",20),e.j41(2,"span"),e.EFF(3),e.nI1(4,"translate"),e.k0s()()}if(2&o){const t=e.XpG().$implicit;e.Y8G("disabled",t.disable),e.R7$(),e.vxM(t.svgIcon?1:-1),e.R7$(2),e.JRh(e.bMT(4,3,t.title))}}function N(o,u){1&o&&e.nVh(0,X,5,5,"button",18),2&o&&e.vxM(u.$implicit.display?0:-1)}let Y=(()=>{class o extends I.aO{constructor(){super(),this.answers=[],this.answerValidated=!1,this.brand=b.wk,this.canMove=1,this.correctAnswer=[],this.orderList=[],this.recordAnswer=[],this.shuffledOptions=[],this.userOrderList=[],this.dragulaService=(0,O.WQX)(C.g$),this.elementRef=(0,O.WQX)(e.aKT),this.dragulaService.drop().subscribe(({})=>{this.onDragChange()}),this.dragulaService.createGroup("bag-1",{})}setContentData(t){if(this.activityType=t.metadatas.typology.label,t.reference.config&&(this.isVertical="vertical"===t.reference.config.direction||!0),this.referenceActivityGranule=t.reference,this.instruction=this.referenceActivityGranule.instruction,this.wording=this.referenceActivityGranule.wording,this.instructionAudio=this.referenceActivityGranule.instructionAudio,this.wordingAudio=this.referenceActivityGranule.wordingAudio,this.options=this.referenceActivityGranule.activity_content.answers,this.options.length){const n=this.options;
1this.options=[],n.forEach((d,p)=>{d.orderno=p+1,d.errorstat=0,this.options[p]=d})}else this.options=[];const r=this.referenceActivityGranule.activity_content.answers;r.length&&r.forEach((n,d)=>{this.answers[d]=n.id}),this.orderList=this.options,this.orderList=this.derange(this.orderList),this.shuffledOptions=this.orderList.slice(),this.userOrderList=(0,v.A)(this.orderList),this.changeOrderNo(),this.isActivityEmbedded||this.loadUserSave(),this.activityStepIndex=this.lessonsService.activityIndex,this.lessonsService.isTrainerSeeCorrection()&&(this.testAnswer=!0)}setAnswer(){if(this.userSave?.get("userActivity")?.entitySave?.answers&&!this.displayForSummary){const t=this.userSave.get("userActivity").entitySave.answers;this.orderList=t.map(r=>this.options.find(n=>n.id===r.id)),this.userOrderList=(0,v.A)(this.orderList),this.shuffledOptions=(0,v.A)(this.orderList),this.changeOrderNo(),!this.lessonsService.isTrainerSeeCorrection()&&this.lessonsConfigurationService.checkAnswersAfterLoadUserSave()&&(this.checkAnswer(),this.activitiesService.userAnswer.next(t),this.testAnswer=!0)}}onDragChange(){this.elementRef.nativeElement.querySelectorAll(".counting-circle").forEach((p,w)=>{p.innerText=w+1});const r=this.shuffledOptions;this.userOrderList=[];const n=[];r.forEach(p=>{n[p.id]=p}),this.elementRef.nativeElement.querySelectorAll(".orderlist-id").forEach((p,w)=>{const f=p.innerText.trim();n[f]&&(this.userOrderList[w]=n[f])}),this.answerValidated=!0,this.activitiesService.doesUserResponsed.next(!0),this.onOptionChange(!0)}changeOrderNo(){(0,v.A)(this.orderList).forEach((r,n)=>{r.orderno=n+1,this.orderList[n]=r})}checkAnswer(){let t=0;this.answerStatus=2,this.userOrderList.forEach((r,n)=>{const d=r.id;this.correctAnswer[d]=3,this.answers[n]!==d?this.correctAnswer[d]=2:this.answers[n]===d&&(this.correctAnswer[d]=1,t++)}),this.orderList.length===t?this.answerStatus=1:this.answerValidated&&(this.answerStatus=3),this.recordAnswer=(0,v.A)(this.correctAnswer),this.canMove=0,(this.lessonsService.isLessonTest()||this.lessonsService.isLessonTraining())&&(this.displayFeedback=this.lessonsConfigurationService.settings.displayFeedback&&1!==this.answerStatus&&this.lessonsService.isLessonTraining()&&!this.lessonsService.isAtLeastTrainer(),this.recordAnswerWrong=this.displayFeedback),this.activitiesService.isUserAnswerStatus.next({status:this.answerStatus,index:this.activityStepIndex}),this.testAnswer&&this.activitiesService.checkAnswers.next({lessonCorrected:!0})}answerState(t){if(this.displaySolution||this.testAnswer)switch(this.correctAnswer[t.id]){case 1:return"correctAnswer";case 2:return"wrongAnswer";case 3:return"answerMissed"}else if(this.correctAnswer[t.id])return"validated";return""}getGrade(){let t,r,n=0,d=0;return this.userSave&&this.userSave.get("userActivity").entitySave.answers.forEach((p,w)=>{this.answers[w]===p.id&&(n+=1)}),this.userOrderList.forEach((p,w)=>{this.answers[w]===p.id&&(d+=1)}),t=n/this.answers.length,r=d/this.answers.length,{newGrade:r,oldGrade:t}}saveAnswer(){const t=this.userOrderList.map(r=>r.id);return(0,S.of)(t)}derange(t){const r=t.slice();if(r.length<2)return r;let d,n=[],f=!1;for(let F=0,H=r.length-1;F<H;F++){if(2===r.length&&!f){n=n.concat(r.reverse().splice(0,2));break}do{d=Math.random()*r.length|0}while(t.indexOf(r[d])===n.length);n.push(r.splice(d,1)[0]),f=f||d===r.length}return r.length&&n.push(r[0]),n}seeAnswerSolution(){this.options&&(this.options.forEach((t,r)=>{this.correctAnswer[t.id]=1}),this.orderList=[],this.orderList=this.referenceActivityGranule.activity_content.answers,this.changeOrderNo(),this.displaySolution=!0,this.displayFeedback=!1)}reset(t=!1,r=null){return this.recordAnswerWrong=!1,this.orderList=(0,v.A)(this.shuffledOptions),this.userOrderList=(0,v.A)(this.shuffledOptions),this.recordAnswer=[],this.correctAnswer=[],this.canMove=1,this.lessonsService.isAtLeastTrainerAndAssignmentExist&&(this.canMove=0),this.answerValidated=!1,this.changeOrderNo(),super.reset(t,r)}reviewAnswer(){this.canMove=1,this.orderList=[],this.orderList=(0,v.A)(this.userOrderList),this.changeOrderNo(),this.correctAnswer=(0,v.A)(this.recordAnswer),this.answerValidated=!1,this.displaySolution=!1,this.displayFeedback=this.recordAnswerWrong=1!==this.answerStatus&&this.lessonsService.isLessonTraining()&&!this.lessonsService.isAtLeastTrainer()&&this.lessonsConfigurationService.settings.displayFeedback}get isPreview(){return this.lessonsService.isLessonTest()||this.lessonsService.isLessonTraining()}getAttempts(){throw new Error("Method not implemented.")}validate(){throw new Error("Method not implemented.")}static{this.\u0275fac=function(r){return new(r||o)}}static{this.\u0275cmp=e.VBU({type:o,selectors:[["app-ordon"]],features:[e.Jv_([C.g$]),e.Vt3],decls:16,vars:16,consts:[[1,"activities-card","inner-scroll","mat-elevation-z0",3,"ngClass"],[3,"wording","ngClass","wordingAudio","autoRead","readable","questionTypeName"],[3,"mode","activityId","contextId","answerStatus"],[1,"page-layout","ord-page","center-box","map-page"],[3,"ngClass","instruction","instructionAudio","autoRead","readable","questionTypeName"],["id","ord",1,"ans-part"],[1,"button-row",3,"ngClass","dragula","dragulaModel"],[1,"btn-container","disabled",3,"ngClass"],[1,"answer-state-msg","wrongreply"],[1,"gradePercentil"],[1,"counting-circle"],[1,"orderlist",3,"ngClass"],[1,"orderlist-id",2,"display","none"],[1,"options","orderlist-value",3,"innerHTML"],[1,"check"],[1,"success"],[1,"error"],[1,"warning"],[3,"disabled"],[3,"click","disabled"],[3,"svgIcon"]],template:function(r,n){1&r&&(e.j41(0,"mat-card",0)(1,"mat-card-header")(2,"mat-card-title"),e.nV
1h(3,l,2,11,"app-consignes",1),e.nrm(4,"app-options",2),e.k0s()(),e.j41(5,"mat-card-content",3),e.nVh(6,_,2,14,"app-consignes",4),e.j41(7,"div",5)(8,"div",6),e.Z7z(9,W,10,12,"div",7,e.fX1),e.k0s()()(),e.nVh(11,j,4,3,"div",8),e.j41(12,"mat-card-footer"),e.nVh(13,$,3,4,"div",9),e.Z7z(14,N,1,1,null,null,e.fX1),e.k0s()()),2&r&&(e.Y8G("ngClass",e.eq3(12,U,n.isVertical)),e.R7$(3),e.vxM(n.isConsigneContainMedia(n.wording)||!n.isDataEmpty(n.wording)&&!n.isDataEmpty(n.wordingAudio)||!n.isDataEmpty(n.wording)&&n.isDataEmpty(n.wordingAudio)?3:-1),e.R7$(),e.Y8G("mode","ordon")("activityId",n.activityId)("contextId",n.assignmentId)("answerStatus",n.answerStatus),e.R7$(2),e.vxM(n.isConsigneContainMedia(n.instruction)||!n.isDataEmpty(n.instruction)&&!n.isDataEmpty(n.instructionAudio)||!n.isDataEmpty(n.instruction)&&n.isDataEmpty(n.instructionAudio)?6:-1),e.R7$(2),e.Y8G("ngClass",e.eq3(14,h,!n.isVertical))("dragula","bag-1")("dragulaModel",n.orderList),e.R7$(),e.Dyx(n.orderList),e.R7$(2),e.vxM(n.displayFeedback?11:-1),e.R7$(2),e.vxM(n.isPercentileDisplayAllowed?13:-1),e.R7$(),e.Dyx(n.buttons))},dependencies:[s.MD,s.YU,A.Hu,A.RN,A.m2,A.WQ,A.MM,A.dh,E.m_,E.An,M.h,C.d0,C.Am,D.X,R.z,P.x,g.o,M.D9,x.i],encapsulation:2})}}return o})()},78729(G,L,c){c.d(L,{o:()=>U});var O=c(56977),e=c(88141),s=c(73664),A=c(72200),E=c(5951),M=c(21413),C=c(92771),g=c(2615),R=c(83243),D=c(8816),b=c(22286);const S=(h,m)=>({showFinalAnswers:h,answersChecked:m});function I(h,m){if(1&h){const i=s.RV6();s.j41(0,"mat-checkbox",3),s.bIt("change",function(l){g.eBV(i);const _=s.XpG(2);return g.Njj(_.informThatUserInteracted(l))}),s.mxI("ngModelChange",function(l){const _=g.eBV(i).$implicit;return s.DH7(_.select,l)||(_.select=l),g.Njj(l)}),s.nrm(1,"span",4),s.nI1(2,"stringToHtml"),s.k0s()}if(2&h){const i=m.$implicit,a=s.XpG(2);s.Y8G("ngClass",a.optionState(i))("disableRipple",!0)("disabled",a.showFinalAnswers||a.testAnswer||a.validated||a.lessonsService.isAtLeastTrainerAndAssignmentExist||a.disabled),s.R50("ngModel",i.select),s.R7$(),s.Y8G("innerHTML",s.bMT(2,5,i.answer),s.npT)}}function v(h,m){if(1&h&&(s.j41(0,"div",0),s.Z7z(1,I,3,7,"mat-checkbox",2,s.fX1),s.n
1I1(3,"intToBoolean"),s.k0s()),2&h){const i=s.XpG();s.Y8G("ngClass",s.l_i(5,S,i.showFinalAnswers,i.testAnswer)),s.R7$(),s.Dyx(s.brH(3,1,i.availableAnswers,"correct_answer","select"))}}function P(h,m){if(1&h){const i=s.RV6();s.j41(0,"mat-radio-button",7),s.bIt("change",function(l){g.eBV(i);const _=s.XpG(2);return g.Njj(_.radioChange(l.value))}),s.nrm(1,"span",4),s.nI1(2,"stringToHtml"),s.k0s()}if(2&h){const i=m.$implicit,a=s.XpG(2);s.Y8G("disabled",a.showFinalAnswers||a.testAnswer||a.validated||a.lessonsService.isAtLeastTrainerAndAssignmentExist||a.disabled)("ngClass",a.optionState(i))("disableRipple",!0)("value",i.answer),s.R7$(),s.Y8G("innerHTML",s.bMT(2,5,i.answer),s.npT)}}function x(h,m){if(1&h){const i=s.RV6();s.j41(0,"mat-radio-group",5),s.mxI("ngModelChange",function(l){g.eBV(i);const _=s.XpG();return s.DH7(_.valueChecked,l)||(_.valueChecked=l),g.Njj(l)}),s.Z7z(1,P,3,7,"mat-radio-button",6,s.fX1),s.nI1(3,"intToBoolean"),s.k0s()}if(2&h){const i=s.XpG();s.Y8G("ngClass",s.l_i(6,S,i.showFinalAnswers,i.testAnswer)),s.R50("ngModel",i.valueChecked),s.R7$(),s.Dyx(s.brH(3,2,i.availableAnswers,"correct_answer","select"))}}let U=(()=>{class h{constructor(i,a,l){this.router=i,this.activityService=a,this.lessonsService=l,this.reset=new C.m(1),this.onOptionChange=new s.bkB,this.validated=!1,this.answersChecked=!1,this.showFinalAnswers=!1,this.unsubscribeInTakeUntil=new M.B,this.userAnswerTakeUntil=new M.B,this.activityService.userAnswer.pipe((0,O.Q)(this.userAnswerTakeUntil)).subscribe(_=>{this.activityService.checkAnswers.next({showAnswers:!0,withoutAnyUserResponse:!1,reinitializeOptions:!1}),_&&(this.usersSaved=_,this.checkAnswers())})}ngOnInit(){this.activityService.doesUserResponsed.next(!1),this.reset.pipe((0,e.M)(i=>{!0===i&&this.resetAllOptions()})).subscribe(),this.reset.pipe((0,e.M)(i=>{!0===i&&this.resetAllOptions()})).subscribe()}ngOnDestroy(){this.unsubscribeInTakeUntil.next(),this.unsubscribeInTakeUntil.complete()}get getUserAccessCorrection(){return this.lessonsService.isLessonEvaluation()&&this.lessonsService.isAtLeastTrainer()}get valueChecked(){const i=this.availableAnswers&&this.availableAnswers.find(a=>a.select);return i&&i.answer||null}set valueChecked(i){this.availableAnswers.forEach(a=>{a.select=i===a.answer})}radioChange(i){this.valueChecked=i,this.sendOptionChangeEvent(!!i)}sendOptionChangeEvent(i){this.onOptionChange.emit(!!i),this.activityService.doesUserResponsed.next(!0)}checkAnswers(i=!1){this.lessonsService.isLessonTest()&&this.valueChecked||this.lessonsService.isLessonTraining()||i?this.testAnswer=!0:this.lessonsService.isLessonEvaluation()&&(this.validated=!0),this.activityService.doesUserResponsed.next(!0)}saveAnswer(i,a,l,_){const T=i.filter(y=>y.select).map(y=>y.id);return this.testAnswer||(this.validated=!0),this.activityService.saveUserSave(this.activityId.id.toString(),this.contextId,T,a,"qcm-save",l,_)}informThatUserInteracted(i){this.onOptionChange.emit(this.isAnyOtherOptionsChecked(this.availableAnswers)),this.activityService.doesUserResponsed.next(this.isAnyOtherOptionsChecked(this.availableAnswers))}isAnyOtherOptionsChecked(i){return i.map(l=>l.select).includes(!0)}optionState(i){if(this.displaySolution){if(i.correct_answer)return"correctAnswer"}else{if(!this.hideCorrection&&this.testAnswer){if(i.select)return i.correct_answer?"correctAnswer":"wrongAnswer";if(i.correct_answer&&!this.hideMissing)return"answerMissed"}if(i.select)return this.validated?"validated":"selected"}return""}resetAllOptions(){this.testAnswer=!1,this.displaySolution=!1,this.validated=!1,this.hideMissing=!this.getUserAccessCorrection&&!this.lessonsService.isLessonTest(),this.validated=!1,"qcu"===this.mode&&(this.valueChecked=void 0),"qcm"===this.mode&&this.availableAnswers.forEach(i=>{i.select=!1}),this.activityService.doesUserResponsed.next(!1)}static{this.\u0275fac=function(a){return new(a||h)(s.rXU(R.Ix),s.rXU(D.B),s.rXU(b.L))}}static{this.\u0275cmp=s.VBU({type:h,selectors:[["app-options"]],inputs:{options:[0,"answer","options"],autoCorrection:"autoCorrection",availableAnswers:"availableAnswers",optionText:[0,"optionsText","optionText"],usersSaved:"usersSaved",mode:"mode",activityId:"activityId",contextId:"contextId",answerStatus:"answerStatus",isAnswered:"isAnswered",hideCorrection:"hideCorrection",hideMissing:"hideMissing",disabled:"disabled",displaySolution:"displaySolution",testAnswer:"testAnswer",reset:"reset"},outputs:{onOptionChange:"onOptionChange"},decls:2,vars:2,consts:[[1,"checkbox-group",3,"ngClass"],[3,"ngClass","ngModel"],[3,"ngClass","disableRipple","disabled","ngModel"],[3,"change","ngModelChange","ngClass","disableRipple","disabled","ngModel"],[3,"innerHTML"],[3,"ngModelChange","ngClass","ngModel"],[3,"disabled","ngClass","disableRipple","value"],[3,"change","disabled","ngClass","disableRipple","value"]],template:function(a,l){1&a&&(s.nVh(0,v,4,8,"div",0),s.nVh(1,x,4,9,"mat-radio-group",1)),2&a&&(s.vxM("qcm"===l.mode?0:-1),s.R7$(),s.vxM("qcu"===l.mode?1:-1))},dependencies:[A.MD,A.YU,E.Wk,E.VT,E._g],encapsulation:2})}}return h})()}}]);
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.