-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11-es5.6b02af23bee91bad30c9.js
1 lines (1 loc) · 7.47 KB
/
11-es5.6b02af23bee91bad30c9.js
1
!function(){function n(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(n)||function(n,t){if(!n)return;if("string"==typeof n)return e(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);"Object"===i&&n.constructor&&(i=n.constructor.name);if("Map"===i||"Set"===i)return Array.from(n);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return e(n,t)}(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(n,e){(null==e||e>n.length)&&(e=n.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=n[t];return i}function t(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function i(n,e){for(var t=0;t<e.length;t++){var i=e[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}}function r(n,e,t){return e&&i(n.prototype,e),t&&i(n,t),n}(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{DOAJ:function(e,i,o){"use strict";o.r(i),o.d(i,"LearnNumsPageModule",(function(){return j}));var c,a,u=o("ofXK"),s=o("3Pt+"),b=o("TEn/"),h=o("tyNb"),f=o("fXoL"),l=o("Bcx0"),d=((c=function(){function e(){t(this,e)}return r(e,[{key:"check",value:function(n,e){return e.length==n.length?this.checkSameLength(n,e):e.length<n.length?this.checkDifferentLength(n,e):this.checkDifferentLength(e,n)}},{key:"checkDifferentLength",value:function(n,e){var t=this.checkSameLength(n.substr(-e.length),e),i=n.substring(0,n.length-e.length).split("").map((function(e,t){return{digit:+e,exp:n.length-t-1}}));return t.bads=t.bads.concat(i),t}},{key:"checkSameLength",value:function(e,t){var i,r=e.length-1,o=e.split("").map((function(n,e){return{q:+n,a:+t[e],exponent:r-e}})),c=o.filter((function(n){return n.a==n.q})).map((function(n){return{digit:n.a,exp:n.exponent}})),a=o.filter((function(n){return n.a!=n.q})).map((function(n){return[{digit:n.a,exp:n.exponent},{digit:n.q,exp:n.exponent}]}));return{goods:c,bads:(i=[]).concat.apply(i,n(a))}}}]),e}()).\u0275fac=function(n){return new(n||c)},c.\u0275prov=f.Db({token:c,factory:c.\u0275fac,providedIn:"root"}),c),p=o("Zjgs"),g=((a=function(){function n(){t(this,n)}return r(n,[{key:"newHint",value:function(n){var e=0,t=this.indexesInRandomOrder(n.length);return function(){var i=Array(n.length).fill("?"),r=t[e];return e=e>=t.length-1?0:e+1,i[r]=n[r],i.join("")}}},{key:"indexesInRandomOrder",value:function(n){return Array(n).fill(0).map((function(n,e){return e})).map((function(n){return[Math.random(),n]})).sort().map((function(n){return n[1]}))}}]),n}()).\u0275fac=function(n){return new(n||a)},a.\u0275prov=f.Db({token:a,factory:a.\u0275fac,providedIn:"root"}),a),m=["numberInput"];function w(n,e){if(1&n){var t=f.Lb();f.Kb(0,"ion-button",13),f.Sb("click",(function(){return f.cc(t),f.Ub().checkAnswer()})),f.Ib(1,"ion-icon",14),f.Jb()}if(2&n){var i=f.Ub();f.Zb("disabled",i.answerIsEmpty)}}function y(n,e){if(1&n){var t=f.Lb();f.Kb(0,"ion-button",15),f.Sb("click",(function(){return f.cc(t),f.Ub().newQuestion()})),f.Ib(1,"ion-icon",16),f.Jb()}}function v(n,e){if(1&n){var t=f.Lb();f.Kb(0,"ion-button",17),f.Sb("click",(function(){f.cc(t);var n=f.Ub();return n.say(n.answer)})),f.Ib(1,"ion-icon",1),f.Jb()}}var k,I,A,S,x=((k=function(){function n(e,i,r,o){t(this,n),this.probdbService=e,this.answerChecker=i,this.speechService=r,this.hintService=o,this.wrongAnswer=!1,this.answerIsEmpty=!0,this.hint=""}return r(n,[{key:"newQuestion",value:function(){var n=this,e=this.probdbService.getNumberToAsk();this.question=e.join(""),this.answer="",this.wrongAnswer=!1,this.say(this.question),this.hintFunction=this.hintService.newHint(this.question),this.hint="?".repeat(this.question.length),setTimeout((function(){return n.numberInput.setFocus()}),0)}},{key:"checkAnswer",value:function(){var n=this,e=this.answerChecker.check(this.question,""+this.answer);e.bads.forEach((function(e){return n.probdbService.bad(e.exp,e.digit)})),e.goods.forEach((function(e){return n.probdbService.good(e.exp,e.digit)})),this.wrongAnswer=e.bads.length>0,this.wrongAnswer?this.hint=this.question:this.newQuestion()}},{key:"inputChanged",value:function(n){this.answerIsEmpty=!n||""==n}},{key:"say",value:function(n){this.speechService.say(n)}},{key:"showHint",value:function(){this.hint=this.hintFunction()}}]),n}()).\u0275fac=function(n){return new(n||k)(f.Hb(l.a),f.Hb(d),f.Hb(p.a),f.Hb(g))},k.\u0275cmp=f.Bb({type:k,selectors:[["teacher"]],viewQuery:function(n,e){var t;1&n&&f.jc(m,!0),2&n&&f.bc(t=f.Tb())&&(e.numberInput=t.first)},decls:16,vars:11,consts:[["name","say",3,"click"],["name","megaphone"],["name","hint",3,"disabled","click"],["autofocus","true","type","number","inputmode","numeric",3,"disabled","ngModel","ionChange","ngModelChange"],["numberInput",""],["name","check",3,"disabled","click",4,"ngIf"],["name","new",3,"click",4,"ngIf"],["color","danger","name","sayAnswer",3,"click",4,"ngIf"],["min","0","max","100","step","1","ticks","10",3,"disabled","ngModel"],["slot","start"],["name","rainy"],["slot","end"],["name","happy"],["name","check",3,"disabled","click"],["name","checkmark"],["name","new",3,"click"],["name","caret-forward"],["color","danger","name","sayAnswer",3,"click"]],template:function(n,e){1&n&&(f.Kb(0,"p"),f.Kb(1,"ion-button",0),f.Sb("click",(function(){return e.say(e.question)})),f.Ib(2,"ion-icon",1),f.Jb(),f.Kb(3,"ion-button",2),f.Sb("click",(function(){return e.showHint()})),f.gc(4),f.Jb(),f.Kb(5,"ion-input",3,4),f.Sb("ionChange",(function(n){return e.inputChanged(n.detail.value)}))("ngModelChange",(function(n){return e.answer=n})),f.Jb(),f.fc(7,w,2,1,"ion-button",5),f.fc(8,y,2,0,"ion-button",6),f.fc(9,v,2,0,"ion-button",7),f.Kb(10,"ion-range",8),f.Vb(11,"async"),f.Kb(12,"span",9),f.Ib(13,"ion-icon",10),f.Jb(),f.Kb(14,"span",11),f.Ib(15,"ion-icon",12),f.Jb(),f.Jb(),f.Jb()),2&n&&(f.xb(3),f.Zb("disabled",e.wrongAnswer),f.xb(1),f.hc(e.hint),f.xb(1),f.Zb("disabled",e.wrongAnswer)("ngModel",e.answer),f.xb(2),f.Zb("ngIf",!e.wrongAnswer),f.xb(1),f.Zb("ngIf",e.wrongAnswer),f.xb(1),f.Zb("ngIf",e.wrongAnswer),f.xb(1),f.Zb("disabled",!0)("ngModel",f.Wb(11,9,e.probdbService.watchScore())))},directives:[b.d,b.h,b.i,b.x,s.d,s.e,u.j,b.o,b.A],pipes:[u.b],styles:["ion-input[_ngcontent-%COMP%]{--background:#ddd;width:10em}"]}),k),J=[{path:"",component:(I=function(){function n(e){t(this,n),this.service=e}return r(n,[{key:"ionViewDidEnter",value:function(){this.teacherComponent&&this.teacherComponent.newQuestion()}}]),n}(),I.\u0275fac=function(n){return new(n||I)(f.Hb(l.a))},I.\u0275cmp=f.Bb({type:I,selectors:[["app-learn-nums"]],viewQuery:function(n,e){var t;1&n&&f.jc(x,!0),2&n&&f.bc(t=f.Tb())&&(e.teacherComponent=t.first)},decls:11,vars:3,consts:[["slot","start"],["color","dark"],["name","school"]],template:function(n,e){1&n&&(f.Kb(0,"ion-header"),f.Kb(1,"ion-toolbar"),f.Kb(2,"ion-buttons",0),f.Ib(3,"ion-menu-button",1),f.Ib(4,"ion-back-button"),f.Jb(),f.Kb(5,"ion-title"),f.Ib(6,"ion-icon",2),f.gc(7),f.Vb(8,"async"),f.Jb(),f.Jb(),f.Jb(),f.Kb(9,"ion-content"),f.Ib(10,"teacher"),f.Jb()),2&n&&(f.xb(7),f.hc(f.Wb(8,1,e.service.watchName())))},directives:[b.g,b.t,b.e,b.m,b.b,b.c,b.s,b.h,b.f,x],pipes:[u.b],styles:[""]}),I)}],K=((A=function n(){t(this,n)}).\u0275mod=f.Fb({type:A}),A.\u0275inj=f.Eb({factory:function(n){return new(n||A)},imports:[[h.i.forChild(J)],h.i]}),A),C=o("mmKz"),j=((S=function n(){t(this,n)}).\u0275mod=f.Fb({type:S}),S.\u0275inj=f.Eb({factory:function(n){return new(n||S)},imports:[[u.c,s.a,b.u,C.a,K]]}),S)}}])}();