1"use strict";(self.webpackChunkangular_client=self.webpackChunkangular_client||[]).push([[6152],{96152:(m,h,s)=>{s.r(h),s.d(h,{QUIZ_ROUTES:()=>Q});var d=s(10467),n=s(54438),p=s(60177),l=s(84341),f=s(93121),c=s(20060),u=s(45383),g=s(90614),_=s(24993),x=s(56977),C=s(21413),b=s(20520),v=s(69521),M=s(39077),P=s(7928);const k=["modalBody"],w=["quizBlock1"],O=["quizBlock2"],y=e=>({"no-select":e});function z(e,a){if(1&e&&(n.j41(0,"p",6),n.EFF(1),n.k0s()),2&e){const t=n.XpG(2);n.R7$(),n.Lme("(",t.questionIndex," / ",null==t.config||null==t.config.questions?null:t.config.questions.length,")")}}function q(e,a){if(1&e&&(n.j41(0,"app-code",28),n.EFF(1),n.k0s()),2&e){const t=n.XpG().$implicit;n.Y8G("lang","python")("code",t.choice),n.R7$(),n.SpI(" ",t.choice," ")}}function E(e,a){if(1&e&&n.nrm(0,"img",29),2&e){const t=n.XpG().$implicit;n.Y8G("src",t.choice,n.B4B)}}function B(e,a){if(1&e&&(n.nrm(0,"span",30),n.nI1(1,"newline")),2&e){const t=n.XpG().$implicit;n.Y8G("innerHTML",n.bMT(1,1,t.choice),n.npT)}}function T(e,a){if(1&e&&(n.j41(0,"div")(1,"label",24),n.nrm(2,"input",25)(3,"span",26),n.j41(4,"span",27)(5,"span"),n.EFF(6),n.k0s(),n.DNE(7,q,2,3,"app-code",28)(8,E,1,1,"img",29)(9,B,2,3,"span",30),n.k0s()()()),2&e){const t=a.$implicit,o=a.$index,i=n.XpG(4);n.R7$(2),n.Y8G("formControl",i.questionAnswerControl)("value",o),n.R7$(4),n.SpI("",i.indexToChar(o),")\xa0"),n.R7$(),n.vxM(null!=t&&t.isCodeBlock?7:-1),n.R7$(),n.vxM(null!=t&&t.isImage?8:-1),n.R7$(),n.vxM(null!=t&&t.isCodeBlock||null!=t&&t.isImage?-1:9)}}function R(e,a){if(1&e&&(n.j41(0,"article",20)(1,"div",31),n.EFF(2),n.k0s()()),2&e){const t=n.XpG(4);n.R7$(2),n.SpI(" ",t.errorMessage," ")}}function $(e,a){if(1&e&&(n.j41(0,"article",21)(1,"div",31),n.EFF(2),n.k0s()()),2&e){const t=n.XpG(4);n.R7$(2),n.JRh(t.explanation)}}function F(e,a){if(1&e){const t=n.RV6();n.j41(0,"button",32),n.bIt("click",function(){n.eBV(t);const i=n.XpG(4);return n.Njj(i.submitAnswer())}),n.EFF(1," Submit "),n.k0s()}}function S(e,a){if(1&e){const t=n.RV6();n.j41(0,"button",33),n.bIt("click",function(){n.eBV(t);const i=n.XpG(4);return n.Njj(i.moveNextQuestion())}),n.EFF(1," Next "),n.k0s()}}function I(e,a){if(1&e&&(n.j41(0,"div",19,2),n.nrm(2,"app-article",14),n.Z7z(3,T,10,6,"div",null,n.fX1),n.DNE(5,R,3,1,"article",20)(6,$,3,1,"article",21)(7,F,2,0,"button",22)(8,S,2,0,"button",23),n.k0s()),2&e){let t;const o=n.XpG(3);n.xc7("width",o.quizBlock2WidthStyle),n.R7$(2),n.Y8G("noCard",!0)("html",null!==(t=null==o.config||null==o.config.questions||null==o.config.questions[o.questionIndex]?null:o.config.questions[o.questionIndex].questionPrompt)&&void 0!==t?t:""),n.R7$(),n.Dyx(null==o.config||null==o.config.questions||null==o.config.questions[o.questionIndex]?null:o.config.questions[o.questionIndex].choices),n.R7$(2),n.vxM(o.showError?5:-1),n.R7$(),n.vxM(o.showExplanation&&o.explanation?6:-1),n.R7$(),n.vxM(o.showExplanation?-1:7),n.R7$(),n.vxM(o.showExplanation?8:-1)}}function G(e,a){1&e&&n.nrm(0,"app-sign-in")}function j(e,a){1&e&&(n.j41(0,"button",35),n.EFF(1," Get Unlimited Access "),n.k0s())}function W(e,a){if(1&e&&(n.j41(0,"div",34),n.DNE(1,G,1,0,"app-sign-in")(2,j,2,0,"button",35),n.k0s()),2&e){const t=n.XpG(3);n.xc7("width",t.quizBlock2WidthStyle),n.R7$(),n.vxM(t.isAuth?-1:1),n.R7$(),n.vxM(t.isAuth?2:-1)}}function D(e,a){if(1&e){const t=n.RV6();n.j41(0,"div",10)(1,"div",12,0)(3,"div",13,1),n.nrm(5,"app-article",14)(6,"br")(7,"div",15),n.k0s(),n.j41(8,"div",16),n.bIt("mousedown",function(i){n.eBV(t);const r=n.XpG(2);return n.Njj(r.onMouseDown(i))}),n.k0s(),n.DNE(9,I,9,8,"div",17)(10,W,3,4,"div",18),n.k0s()()}if(2&e){let t;const o=n.XpG(2);n.R7$(),n.Y8G("ngClass",n.eq3(6,y,o.disableSelection)),n.R7$(2),n.xc7("width",o.quizBlock1WidthStyle),n.R7$(2),n.Y8G("noCard",!0)("html",null!==(t=null==o.config?null:o.config.prompt)&&void 0!==t?t:""),n.R7$(4),n.vxM(o.quizAccess()?9:10)}}function X(e,a){if(1&e){const t=n.RV6();n.nrm(0,"textarea",45)(1,"br")(2,"div"),n.j41(3,"button",46),n.bIt("click",function(){n.eBV(t);const i=n.XpG(3);return n.Njj(i.submitFeedback())}),n.EFF(4,"Submit Feedback"),n.k0s()}if(2&e){const t=n.XpG(3);n.Y8G("formControl",t.quizFeedbackControl)}}function U(e,a){1&e&&(n.j41(0,"p"),n.EFF(1,"Thank you for your feedback! \u{1f64f}"),n.k0s())}function A(e,a){if(1&e){const t=n.RV6();n.j41(0,"section",11)(1,"div",36,0)(3,"div",37)(4,"div",38)(5,"div",39),n.nrm(6,"iframe",40),n.nI1(7,"safe"),n.k0s()()(),n.j41(8,"div",41)(9,"div",42)(10,"div")(11,"button",43),n.bIt("click",function(){n.eBV(t);const i=n.XpG(2);return n.Njj(i.handleThumbsUp())}),n.nrm(12,"fa-icon",44),n.k0s(),n.j41(13,"button",43),n.bIt("click",function(){n.eBV(t);const i=n.XpG(2);return n.Njj(i.handleThumbsDown())}),n.nrm(14,"fa-icon",44),n.k0s()(),n.nrm(15,"br"),n.DNE(16,X,5,1)(17,U,2,0,"p"),n.nrm(18,"br")(19,"div"),n.k0s()(),n.nrm(20,"br"),n.k0s()()}if(2&e){const t=n.XpG(2);n.R7$(6),n.Y8G("src",n.bMT(7,5,"https://youtube.com/embed/"+(null==t.config?null:t.config.video)),n.f$h),n.R7$(6),n.Y8G("icon",!0===(null==t.config?null:t.config.rating)?t.faThumbsUpSolid:t.faThumbsUp),n.R7$(2),n.Y8G("icon",!1===(null==t.config?null:t.config.rating)?t.faThumbsDownSolid:t.faThumbsDown),n.R7$(2),n.vxM(null!=t.config&&t.config.feedback?-1:16),n.R7$(),n.vxM(null!=t.config&&t.config.feedback?17:-1)}}function N(e,a){if(1&e&&(n.j41(0,"div",3)(1,"div",4)(2,"div",5),n.DNE(3,z,2,2,"p",6),n.j41(4,"h1",7)(5,"a",8)(6,"b"),n.EFF(7),n.k0s()()()(),n.nrm(8,"progress",9),n.k0s(),n.DNE(9,D,11,8,"div",10)(10,A,21,7,"section",11),n.k0s()),2&e){let t;const o=n.XpG();n.R7$(3),n.vxM(null!=o.config&&null!=o.config.questions&&o.config.questions.length?3:-1),n.R7$(2),n.Y8G("href","https://youtube.com/watch?v="+(null==o.config?null:o.config.video),n.B4B),n.R7$(2),n.JRh(null==o.config?null:o.config.name),n.R7$(),n.Y8G("value",100*o.questionIndex/(null!==(t=null==o.config||null==o.config.questions?null:o.config.questions.length)&&void 0!==t?t:1)),n.R7$(),n.vxM(o.showEndScreen()?10:9)}}let Y=(()=>{class e{transform(t){return t.replace(/\n/g,"<br/>")}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275pipe=n.EJ8({name:"newline",type:e,pure:!0,standalone:!0})}}return e})();const Q=[{path:":quizId",component:(()=>{class e{constructor(){this.route=(0,n.WQX)(f.nX),this.courseService=(0,n.WQX)(_.f),this.questionIndex=0,this.questionAnswerControl=new l.MJ(-1),this.quizFeedbackControl
1=new l.MJ(""),this.showError=!1,this.showExplanation=!1,this.errorMessage="",this.explanation="",this.resizing=!1,this.disableSelection=!1,this.startX=0,this.quizBlock1Width="55",this.quizBlock2Width="45",this.initialWidth1=0,this.initialWidth2=0,this.quizBlock1WidthStyle=`calc(${this.quizBlock1Width} - 10px)`,this.quizBlock2WidthStyle=`calc(${this.quizBlock2Width} - 10px)`,this.isAuth=!1,this.resolverComplete=!1,this.quizFetchComplete=!1,this.faThumbsUp=g.Wcv,this.faThumbsUpSolid=u.Wcv,this.faThumbsDown=g.lS9,this.faThumbsDownSolid=u.lS9,this.faBolt=u.zm_,this.destroy$=new C.B}ngOnInit(){var t=this;this.route.params.pipe((0,x.Q)(this.destroy$)).subscribe(o=>{this.courseService.getQuizConfig(o.quizId).then(i=>{this.config=i}).catch(()=>{this.config=void 0}).finally(()=>{this.quizFetchComplete=!0})}),this.route.data.pipe((0,x.Q)(this.destroy$)).subscribe(function(){var o=(0,d.A)(function*(i){t.isAuth=!!i.userInfo,t.resolverComplete=!0});return function(i){return o.apply(this,arguments)}}())}ngOnDestroy(){this.destroy$.next(),this.destroy$.complete()}resetMessages(){this.errorMessage="",this.explanation="",this.showError=!1,this.showExplanation=!1}indexToChar(t){return String.fromCharCode(65+t)}submitAnswer(){this.questionAnswerControl?.value===this.config?.questions[this.questionIndex].answerIndex?(this.showError=!1,this.showExplanation=!0,this.errorMessage="",this.explanation=this.config?.questions[this.questionIndex].explanation||""):(this.showError=!0,this.errorMessage="Sorry, that's incorrect. Please try again.",this.showExplanation=!1,this.explanation=""),setTimeout(()=>this.quizBlock2.nativeElement.scrollTop=this.quizBlock2.nativeElement.scrollHeight),setTimeout(()=>this.modalBody.nativeElement.scrollTop=this.modalBody?.nativeElement.scrollHeight)}showEndScreen(){return this.quizAccess()&&this.questionIndex===this.config?.questions.length}quizAccess(){return this.isAuth&&!!this.config}submitFeedback(){const t=this.quizFeedbackControl?.value;t&&0!==t.trim().length?t.length>1e3?(this.errorMessage="Feedback must be less than 1000 characters.",this.showError=!0):(this.courseService.sendTextFeedback(this.config.id,t.trim()),this.errorMessage="",this.showError=!1,this.config.feedback=t,this.quizFeedbackControl?.reset()):(this.errorMessage="Feedback must be non-empty.",this.showError=!0)}handleThumbsUp(){!0!==this.config.rating&&(this.config.rating=!0,this.courseService.sendRating(this.config.id,!0))}handleThumbsDown(){!1!==this.config.rating&&(this.config.rating=!1,this.courseService.sendRating(this.config.id,!1))}moveNextQuestion(){this.questionIndex++,this.questionAnswerControl?.reset(),this.resetMessages(),this.showEndScreen()&&(this.courseService.markQuizComplete(this.config.pattern,this.config.id),this.config.completed=!0)}onMouseDown(t){this.resizing=!0,this.startX=t.clientX,this.disableSelection=!0,this.initialWidth1=Number(this.quizBlock1Width),this.initialWidth2=Number(this.quizBlock2Width)}onMouseUp(){this.resizing=!1,this.disableSelection=!1}onMouseMove(t){if(this.resizing){const r=(t.clientX-this.startX)/this.modalBody.nativeElement.offsetWidth*100;this.quizBlock1Width=String(this.initialWidth1+r),this.quizBlock2Width=String(this.initialWidth2-r),this.quizBlock1WidthStyle=`calc(${this.quizBlock1Width}
1% - 10px)`,this.quizBlock2WidthStyle=`calc(${this.quizBlock2Width}% - 10px)`}}static{this.\u0275fac=function(o){return new(o||e)}}static{this.\u0275cmp=n.VBU({type:e,selectors:[["app-page"]],viewQuery:function(o,i){if(1&o&&(n.GBs(k,5),n.GBs(w,5),n.GBs(O,5)),2&o){let r;n.mGM(r=n.lsd())&&(i.modalBody=r.first),n.mGM(r=n.lsd())&&(i.quizBlock1=r.first),n.mGM(r=n.lsd())&&(i.quizBlock2=r.first)}},hostBindings:function(o,i){1&o&&n.bIt("mouseup",function(){return i.onMouseUp()},!1,n.EBC)("mousemove",function(H){return i.onMouseMove(H)},!1,n.EBC)},standalone:!0,features:[n.aNF],decls:1,vars:1,consts:[["modalBody",""],["quizBlock1",""],["quizBlock2",""],[2,"height","calc(100vh - 66px - 75px)"],[1,"modal-card-head","flex-container-col"],[1,"header-text","flex-container-row"],[1,"modal-card-title",2,"margin-bottom","4px","text-align","start"],[1,"modal-card-title",2,"margin-bottom","0px","text-align","end"],["target","_blank",1,"header-text",3,"href"],["max","100",1,"progress","is-small","is-success",3,"value"],[1,"modal-card-body",2,"position","relative"],[1,"modal-card-body2"],[1,"quiz-container",3,"ngClass"],[1,"quiz-block1"],[3,"noCard","html"],[1,"divider"],[1,"dragger",3,"mousedown"],[1,"quiz-block2",3,"width"],[1,"flex-container-row","quiz-block2",3,"width"],[1,"quiz-block2"],[1,"message","is-danger"],[1,"message","is-success"],[1,"button","is-info",2,"margin-top","10px","margin-right","10px"],[1,"button","is-success",2,"margin-top","10px"],[1,"container"],["type","radio","name","question",3,"formControl","value"],[1,"checkbox"],[1,"question-answer"],[3,"lang","code"],[2,"max-height","300px","width","auto",3,"src"],[3,"innerHTML"],[1,"message-body"],[1,"button","is-info",2,"margin-top","10px","margin-right","10px",3,"click"],[1,"button","is-success",2,"margin-top","10px",3,"click"],[1,"flex-container-row","quiz-block2"],["routerLink","/pro",1,"pro-btn-cta",2,"margin-top","10px"],[1,"quiz-container"],[1,"end-screen-block1"],[1,"video-outer-container"],[1,"video-container"],["title","YouTube video player","frameborder","0","allow","\n accelerometer;\n autoplay;\n clipboard-write;\n encrypted-media;\n gyroscope;\n picture-in-picture;\n ","allowfullscreen","",1,"video",3,"src"],[1,"end-screen-block2"],[1,"flex-container-col",2,"font-size","18px","max-width","900px","flex-basis","100%"],[1,"button","navbar-btn",3,"click"],[3,"icon"],["placeholder","Any feedback?",1,"textarea",3,"formControl"],[1,"button","is-info",2,"margin-top","8px",3,"click"]],template:function(o,i){1&o&&n.DNE(0,N,11,5,"div",3),2&o&&n.vxM(i.resolverComplete&&i.quizFetchComplete?0:-1)},dependencies:[p.MD,p.YU,l.X1,l.me,l.Fm,l.BC,l.l_,f.Wk,c.dX,c.aY,b.o,v.J,M.k,P.m,Y],styles:['p[_ngcontent-%COMP%], span[_ngcontent-%COMP%], label[_ngcontent-%COMP%]{font-family:Arial,sans-serif;font-size:19px}ol[_ngcontent-%COMP%]{position:relative;left:20px;list-style-position:inside}img[_ngcontent-%COMP%]{vertical-align:top}h3[_ngcontent-%COMP%]{font-family:Arial,sans-serif;font-weight:700;font-size:26px}.question-prompt[_ngcontent-%COMP%]{margin-right:70px}.video-outer-container[_ngcontent-%COMP%]{max-width:900px}.header-text[_ngcontent-%COMP%]{width:100%;justify-content:space-between;align-items:flex-end;margin-bottom:10px;font-size:22px}.modal-card-title[_ngcontent-%COMP%]{margin-top:0!important}
1.modal-card-body[_ngcontent-%COMP%], .modal-card-body2[_ngcontent-%COMP%]{padding:0;position:relative}.modal-card-head[_ngcontent-%COMP%]{padding:28px 14px;margin-bottom:40px;border-color:transparent;max-width:900px;margin-left:auto;margin-right:auto;width:100%}.modal-card-head[_ngcontent-%COMP%]:hover{border-color:transparent;cursor:default}.progress.is-small[_ngcontent-%COMP%]{height:.6rem;width:100%;position:relative;margin-left:auto;margin-right:auto}.navbar-btn[_ngcontent-%COMP%]{font-size:22px}.container[_ngcontent-%COMP%]{display:flex;position:relative;padding-left:40px;margin-bottom:12px;cursor:pointer;font-size:22px;-webkit-user-select:none;user-select:none}.container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.checkbox[_ngcontent-%COMP%]{position:absolute;top:2px;left:0;height:25px;width:25px;background-color:#eee;border-radius:50%}.container[_ngcontent-%COMP%]:hover input[_ngcontent-%COMP%] ~ .checkbox[_ngcontent-%COMP%]{background-color:#ccc}.container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkbox[_ngcontent-%COMP%]{background-color:#2196f3}.checkbox[_ngcontent-%COMP%]:after{content:"";position:absolute;display:none}.container[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:checked ~ .checkbox[_ngcontent-%COMP%]:after{display:block}.container[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]:after{bottom:9px;left:8.5px;width:8px;height:8px;border-radius:50%;background:#fff}.modal-card-body[_ngcontent-%COMP%]{overflow-y:hidden;height:100%;display:flex;justify-content:center;max-width:900px;margin-left:auto;margin-right:auto;width:100%}.modal-card-body2[_ngcontent-%COMP%]{overflow-y:auto;padding:20px;height:100%;display:flex;justify-content:center;max-width:900px;margin-left:auto;margin-right:auto;width:100%}.quiz-container[_ngcontent-%COMP%]{font-size:18px;display:flex;flex-direction:row;overflow-y:hidden;height:100%;width:100%}.quiz-block1[_ngcontent-%COMP%]{flex-grow:0%;width:calc(55% - 10px);padding:30px;height:100%;overflow-y:auto}.divider[_ngcontent-%COMP%]{flex-grow:0%;flex-basis:.5%;max-width:.5%}.dragger[_ngcontent-%COMP%]{width:10px}.dragger[_ngcontent-%COMP%]:hover{cursor:col-resize;background-color:#2196f3}.quiz-block2[_ngcontent-%COMP%]{flex:1;flex-grow:0%;width:calc(45% - 10px);padding:30px 20px 20px 30px;height:100%;overflow-y:auto}.end-screen-block1[_ngcontent-%COMP%]{flex-grow:0;flex-basis:70%;max-width:70%;padding:30px;height:100%;overflow-y:auto}.end-screen-block1-expanded[_ngcontent-%COMP%]{flex-grow:0;flex-basis:100%;max-width:100%;padding:30px;height:100%;overflow-y:auto}.end-screen-block2[_ngcontent-%COMP%]{flex-grow:0;flex-basis:30%;max-width:30%;padding:30px 20px 20px 30px;height:100%;overflow-y:auto}@media screen and (max-width: 1050px){.quiz-block1[_ngcontent-%COMP%], .quiz-block2[_ngcontent-%COMP%], .end-screen-block1[_ngcontent-%COMP%], .end-screen-block2[_ngcontent-%COMP%]{width:100%!important;height:auto}.quiz-block1[_ngcontent-%COMP%], .end-screen-block1[_ngcontent-%COMP%]{margin-bottom:2px}.quiz-block2[_ngcontent-%COMP%], .end-screen-block2[_ngcontent-%COMP%]{margin-top:2px}.divider[_ngcontent-%COMP%]{flex-grow:0;flex-basis:100%;max-width:100%;width:100%;max-height:2px;height:2px}.quiz-container[_ngcontent-%COMP%]{flex-direction:column}.section[_ngcontent-%COMP%], .quiz-container[_ngcontent-%COMP%]{overflow-y:auto}.quiz-block1[_ngcontent-%COMP%], .quiz-block2[_ngcontent-%COMP%], .end-screen-block1[_ngcontent-%COMP%], .end-screen-block2[_ngcontent-%COMP%]{overflow-y:visible}.quiz-block2[_ngcontent-%COMP%], .end-screen-block2[_ngcontent-%COMP%]{padding:0 35px 35px}}.no-select[_ngcontent-%COMP%]{user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}@media screen and (max-width: 800px){p[_ngcontent-%COMP%], span[_ngcontent-%COMP%]{font-size:18px}.header-text[_ngcontent-%COMP%]{font-size:20px}.container[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]:after{bottom:6px;left:6px}.checkbox[_ngcontent-%COMP%]{height:20px;width:20px;top:8px}.modal-card-head[_ngcontent-%COMP%]{padding-left:20px;padding-right:20px}}@media screen and (max-width: 600px){.header-text[_ngcontent-%COMP%]{font-size:18px}}']})}}return e})(),resolve:{userInfo:s(90824).L}}]},90824:(m,h,s)=>{s.d(h,{L:()=>f});
1var d=s(54438),n=s(60177),p=s(54843),l=s(55117);let f=(()=>{class c{constructor(g,_){this.userService=g,this.platformId=_}resolve(g,_){return(0,n.UE)(this.platformId)?(0,p._)(this.userService.getUserInfo$()):Promise.resolve(null)}static{this.\u0275fac=function(_){return new(_||c)(d.KVO(l.D),d.KVO(d.Agw))}}static{this.\u0275prov=d.jDH({token:c,factory:c.\u0275fac,providedIn:"root"})}}return c})()},7928:(m,h,s)=>{s.d(h,{m:()=>p});var d=s(54438),n=s(345);let p=(()=>{class l{constructor(c){this.domSanitizer=c}transform(c){const u=this.domSanitizer.sanitize(d.WPN.URL,c);return this.domSanitizer.bypassSecurityTrustResourceUrl(u||"")}static{this.\u0275fac=function(u){return new(u||l)(d.rXU(n.up,16))}}static{this.\u0275pipe=d.EJ8({name:"safe",type:l,pure:!0,standalone:!0})}}return l})()}}]);
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.