Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #Q-768 fix : Audio is audible if user move to next question or next page #151

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"@project-sunbird/ng2-semantic-ui": "8.0.2",
"@project-sunbird/sb-styles": "0.0.16",
"@project-sunbird/sunbird-file-upload-library": "1.0.2",
"@project-sunbird/sunbird-quml-player-web-component": "4.0.0",
"@project-sunbird/sunbird-resource-library": "8.0.0",
"@project-sunbird/sunbird-quml-player-web-component": "4.0.1",
"@project-sunbird/sunbird-resource-library": "8.0.1",
"@project-sunbird/telemetry-sdk": "1.3.0",
"@types/jquery": "^3.5.29",
"alphanum-sort": "^1.0.2",
Expand Down
2 changes: 1 addition & 1 deletion projects/questionset-editor-library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@project-sunbird/sunbird-questionset-editor",
"version": "8.0.1",
"version": "8.0.2",
"dependencies": {
"tslib": "^2.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3479,7 +3479,7 @@
/*! ../../quml-question-cursor.service */
5336),M=t(
/*! ../transformation-service/transformation.service */
8396);class w{constructor(c,B,b,h){this.qumlLibraryService=c,this.utilService=B,this.questionCursor=b,this.transformationService=h,this.qumlPlayerEvent=new e.EventEmitter,this.qumlQuestionEvent=new e.EventEmitter,this.version="1.0",this.timeSpent="0:0",this.isAvailableLocally=!1,this.isSectionsAvailable=!1,this.sectionQuestions=[]}initialize(c,B,b,h){this.qumlLibraryService.initializeTelemetry(c,h),this.identifiers=d.default(b),this.parentIdentifier=c.metadata.identifier,this.threshold=B,this.rotation=0,this.totalNumberOfQuestions=c.metadata.childNodes.length||0,this.qumlPlayerStartTime=this.qumlPlayerLastPageTime=(new Date).getTime(),this.currentQuestionIndex=1,this.contentName=c.metadata.name,this.isAvailableLocally=h.isAvailableLocally,this.isSectionsAvailable=h?.isSectionsAvailable,this.src=c.metadata.artifactUrl||"",this.questionSetId=c.metadata.identifier,c?.context?.userData&&(this.userName=(c.context.userData?.firstName??"")+" "+(c.context.userData?.lastName??"")),this.metaData={pagesHistory:[],totalPages:0,duration:0,rotation:[],progressBar:[],questions:[],questionIds:[],lastQuestionId:""},this.loadingProgress=0,this.endPageSeen=!1}raiseStartEvent(c){this.currentQuestionIndex=c;const B=(new Date).getTime()-this.qumlPlayerStartTime;this.qumlPlayerEvent.emit({eid:"START",ver:this.version,edata:{type:"START",currentIndex:this.currentQuestionIndex,duration:B},metaData:this.metaData}),this.qumlPlayerLastPageTime=this.qumlPlayerStartTime=(new Date).getTime(),this.qumlLibraryService.start(B)}raiseEndEvent(c,B,b){this.metaData.questions=this.sectionQuestions;const h=(new Date).getTime()-this.qumlPlayerStartTime;this.qumlPlayerEvent.emit({eid:"END",ver:this.version,edata:{type:"END",currentPage:c,totalPages:this.totalNumberOfQuestions,duration:h},metaData:this.metaData}),this.timeSpent=this.utilService.getTimeSpentText(this.qumlPlayerStartTime),this.qumlLibraryService.end(h,c,this.totalNumberOfQuestions,this.totalNumberOfQuestions,B,b)}raiseHeartBeatEvent(c,B,b,h){const E={eid:"HEARTBEAT",ver:this.version,edata:{type:c,questionIndex:this.currentQuestionIndex},metaData:this.metaData};c===r.eventName.nextContentPlay&&h&&(E.edata.nextContentId=h),this.isSectionsAvailable&&(E.edata.sectionId=this.questionSetId),this.qumlPlayerEvent.emit(E),r.TelemetryType.interact===B?this.qumlLibraryService.interact(c.toLowerCase(),b):r.TelemetryType.impression===B&&this.qumlLibraryService.impression(b)}raiseAssesEvent(c,B,b,h,E,T){const I={item:c,index:B,pass:b,score:h,resvalues:E,duration:T};this.qumlPlayerEvent.emit(I),this.qumlLibraryService.startAssesEvent(I)}raiseResponseEvent(c,B,b){this.qumlPlayerEvent.emit({target:{id:c,ver:this.version,type:B},values:[{optionSelected:b}]}),this.qumlLibraryService.response(c,this.version,B,b)}raiseSummaryEvent(c,B,b,h){let E=(new Date).getTime()-this.qumlPlayerStartTime;E=Number((E%6e4/1e3).toFixed(2));const T={type:"content",mode:"play",starttime:this.qumlPlayerStartTime,endtime:(new Date).getTime(),timespent:E,pageviews:this.totalNumberOfQuestions,interactions:h.correct+h.wrong+h.partial,extra:[{id:"progress",value:(c/this.totalNumberOfQuestions*100).toFixed(0).toString()},{id:"endpageseen",value:B.toString()},{id:"score",value:b.toString()},{id:"correct",value:h.correct.toString()},{id:"incorrect",value:h.wrong.toString()},{id:"partial",value:h.partial.toString()},{id:"skipped",value:h.skipped.toString()}]};this.qumlPlayerEvent.emit({eid:"QUML_SUMMARY",ver:this.version,edata:T,metaData:this.metaData}),this.qumlLibraryService.summary(T)}raiseExceptionLog(c,B,b,h){this.qumlPlayerEvent.emit({eid:"ERROR",edata:{err:c,errtype:B,requestid:h||"",stacktrace:b||""}}),this.qumlLibraryService.error(b,{err:c,errtype:B})}getSectionQuestionData(c,B){const b=[];let h=[];if(n.default(c))h=B;else{const E=c.filter(T=>B.includes(T.identifier));for(const T of E)l.default(T,"body")?b.push(T):h.push(T.identifier)}return n.default(h)?(0,f.of)({questions:b,count:b.length}):this.fetchIncompleteQuestionsData(b,h)}fetchIncompleteQuestionsData(c,B){return this.questionCursor.getQuestions(B,this.parentIdentifier).pipe((0,v.switchMap)(b=>{const E=o.default(c,b.questions);return(0,f.of)({questions:E,count:E.length})}))}getQuestions(c,B){const b=this.sectionConfig?.metadata?.children;let h;if(void 0!==c&&B?h=this.identifiers.splice(c,B):!c&&!B&&(h=this.identifiers.splice(0,this.threshold)),!n.default(h)){let E;const T=s.default(h,10);p.default(T,I=>{E=this.getSectionQuestionData(b,I)}),(0,y.forkJoin)(E).subscribe(I=>{p.default(I,S=>{const L=this.transformationService.getTransformedQuestionMetadata(S);this.qumlQuestionEvent.emit(L)})},I=>{this.qumlQuestionEvent.emit({error:I})})}}getQuestion(){const c=this.sectionConfig?.metadata?.children;if(this.identifiers.length){let B=this.identifiers.splice(0,this.threshold);const b=u.default(c,h=>g.default(B,h.identifier));if(l.default(b,"body")){const E=this.transformationService.getTransformedQuestionMetadata({questions:[b],count:1});this.qumlQuestionEvent.emit(E)}else this.questionCursor.getQuestion(B[0]).subscribe(h=>{const T=this.transformationService.getTransformedQuestionMetadata(h);this.qumlQuestionEvent.emit(T)},h=>{this.qumlQuestionEvent.emit({error:h})})}}generateMaxAttemptEvents(c,B,b){return{eid:"exdata",ver:this.version,edata:{type:"exdata",currentattempt:c,maxLimitExceeded:B,isLastAttempt:b},metaData:this.metaData}}updateSectionQuestions(c,B){const b=this.sectionQuestions.findIndex(h=>h.id===c);b>-1?this.sectionQuestions[b].questions=B:this.sectionQuestions.push({id:c,questions:B})}getSectionQuestions(c){return this.sectionQuestions.find(B=>B.id===c)?.questions||[]}pauseVideo(){Array.from(document.getElementsByTagName("video")).forEach(B=>B.pause())}static#e=this.\u0275fac=function(B){return new(B||w)(e.\u0275\u0275inject(_.QumlLibraryService),e.\u0275\u0275inject(O.UtilService),e.\u0275\u0275inject(D.QuestionCursor),e.\u0275\u0275inject(M.TransformationService))};static#t=this.\u0275prov=e.\u0275\u0275defineInjectable({token:w,factory:w.\u0275fac,providedIn:"root"})}},444:
8396);class w{constructor(c,B,b,h){this.qumlLibraryService=c,this.utilService=B,this.questionCursor=b,this.transformationService=h,this.qumlPlayerEvent=new e.EventEmitter,this.qumlQuestionEvent=new e.EventEmitter,this.version="1.0",this.timeSpent="0:0",this.isAvailableLocally=!1,this.isSectionsAvailable=!1,this.sectionQuestions=[]}initialize(c,B,b,h){this.qumlLibraryService.initializeTelemetry(c,h),this.identifiers=d.default(b),this.parentIdentifier=c.metadata.identifier,this.threshold=B,this.rotation=0,this.totalNumberOfQuestions=c.metadata.childNodes.length||0,this.qumlPlayerStartTime=this.qumlPlayerLastPageTime=(new Date).getTime(),this.currentQuestionIndex=1,this.contentName=c.metadata.name,this.isAvailableLocally=h.isAvailableLocally,this.isSectionsAvailable=h?.isSectionsAvailable,this.src=c.metadata.artifactUrl||"",this.questionSetId=c.metadata.identifier,c?.context?.userData&&(this.userName=(c.context.userData?.firstName??"")+" "+(c.context.userData?.lastName??"")),this.metaData={pagesHistory:[],totalPages:0,duration:0,rotation:[],progressBar:[],questions:[],questionIds:[],lastQuestionId:""},this.loadingProgress=0,this.endPageSeen=!1}raiseStartEvent(c){this.currentQuestionIndex=c;const B=(new Date).getTime()-this.qumlPlayerStartTime;this.qumlPlayerEvent.emit({eid:"START",ver:this.version,edata:{type:"START",currentIndex:this.currentQuestionIndex,duration:B},metaData:this.metaData}),this.qumlPlayerLastPageTime=this.qumlPlayerStartTime=(new Date).getTime(),this.qumlLibraryService.start(B)}raiseEndEvent(c,B,b){this.metaData.questions=this.sectionQuestions;const h=(new Date).getTime()-this.qumlPlayerStartTime;this.qumlPlayerEvent.emit({eid:"END",ver:this.version,edata:{type:"END",currentPage:c,totalPages:this.totalNumberOfQuestions,duration:h},metaData:this.metaData}),this.timeSpent=this.utilService.getTimeSpentText(this.qumlPlayerStartTime),this.qumlLibraryService.end(h,c,this.totalNumberOfQuestions,this.totalNumberOfQuestions,B,b)}raiseHeartBeatEvent(c,B,b,h){const E={eid:"HEARTBEAT",ver:this.version,edata:{type:c,questionIndex:this.currentQuestionIndex},metaData:this.metaData};c===r.eventName.nextContentPlay&&h&&(E.edata.nextContentId=h),this.isSectionsAvailable&&(E.edata.sectionId=this.questionSetId),this.qumlPlayerEvent.emit(E),r.TelemetryType.interact===B?this.qumlLibraryService.interact(c.toLowerCase(),b):r.TelemetryType.impression===B&&this.qumlLibraryService.impression(b)}raiseAssesEvent(c,B,b,h,E,T){const I={item:c,index:B,pass:b,score:h,resvalues:E,duration:T};this.qumlPlayerEvent.emit(I),this.qumlLibraryService.startAssesEvent(I)}raiseResponseEvent(c,B,b){this.qumlPlayerEvent.emit({target:{id:c,ver:this.version,type:B},values:[{optionSelected:b}]}),this.qumlLibraryService.response(c,this.version,B,b)}raiseSummaryEvent(c,B,b,h){let E=(new Date).getTime()-this.qumlPlayerStartTime;E=Number((E%6e4/1e3).toFixed(2));const T={type:"content",mode:"play",starttime:this.qumlPlayerStartTime,endtime:(new Date).getTime(),timespent:E,pageviews:this.totalNumberOfQuestions,interactions:h.correct+h.wrong+h.partial,extra:[{id:"progress",value:(c/this.totalNumberOfQuestions*100).toFixed(0).toString()},{id:"endpageseen",value:B.toString()},{id:"score",value:b.toString()},{id:"correct",value:h.correct.toString()},{id:"incorrect",value:h.wrong.toString()},{id:"partial",value:h.partial.toString()},{id:"skipped",value:h.skipped.toString()}]};this.qumlPlayerEvent.emit({eid:"QUML_SUMMARY",ver:this.version,edata:T,metaData:this.metaData}),this.qumlLibraryService.summary(T)}raiseExceptionLog(c,B,b,h){this.qumlPlayerEvent.emit({eid:"ERROR",edata:{err:c,errtype:B,requestid:h||"",stacktrace:b||""}}),this.qumlLibraryService.error(b,{err:c,errtype:B})}getSectionQuestionData(c,B){const b=[];let h=[];if(n.default(c))h=B;else{const E=c.filter(T=>B.includes(T.identifier));for(const T of E)l.default(T,"body")?b.push(T):h.push(T.identifier)}return n.default(h)?(0,f.of)({questions:b,count:b.length}):this.fetchIncompleteQuestionsData(b,h)}fetchIncompleteQuestionsData(c,B){return this.questionCursor.getQuestions(B,this.parentIdentifier).pipe((0,v.switchMap)(b=>{const E=o.default(c,b.questions);return(0,f.of)({questions:E,count:E.length})}))}getQuestions(c,B){const b=this.sectionConfig?.metadata?.children;let h;if(void 0!==c&&B?h=this.identifiers.splice(c,B):!c&&!B&&(h=this.identifiers.splice(0,this.threshold)),!n.default(h)){let E;const T=s.default(h,10);p.default(T,I=>{E=this.getSectionQuestionData(b,I)}),(0,y.forkJoin)(E).subscribe(I=>{p.default(I,S=>{const L=this.transformationService.getTransformedQuestionMetadata(S);this.qumlQuestionEvent.emit(L)})},I=>{this.qumlQuestionEvent.emit({error:I})})}}getQuestion(){const c=this.sectionConfig?.metadata?.children;if(this.identifiers.length){let B=this.identifiers.splice(0,this.threshold);const b=u.default(c,h=>g.default(B,h.identifier));if(l.default(b,"body")){const E=this.transformationService.getTransformedQuestionMetadata({questions:[b],count:1});this.qumlQuestionEvent.emit(E)}else this.questionCursor.getQuestion(B[0]).subscribe(h=>{const T=this.transformationService.getTransformedQuestionMetadata(h);this.qumlQuestionEvent.emit(T)},h=>{this.qumlQuestionEvent.emit({error:h})})}}generateMaxAttemptEvents(c,B,b){return{eid:"exdata",ver:this.version,edata:{type:"exdata",currentattempt:c,maxLimitExceeded:B,isLastAttempt:b},metaData:this.metaData}}updateSectionQuestions(c,B){const b=this.sectionQuestions.findIndex(h=>h.id===c);b>-1?this.sectionQuestions[b].questions=B:this.sectionQuestions.push({id:c,questions:B})}getSectionQuestions(c){return this.sectionQuestions.find(B=>B.id===c)?.questions||[]}pauseVideo(){Array.from(document.getElementsByTagName("video")).forEach(b=>b.pause()),Array.from(document.getElementsByTagName("audio")).forEach(b=>b.pause())}static#e=this.\u0275fac=function(B){return new(B||w)(e.\u0275\u0275inject(_.QumlLibraryService),e.\u0275\u0275inject(O.UtilService),e.\u0275\u0275inject(D.QuestionCursor),e.\u0275\u0275inject(M.TransformationService))};static#t=this.\u0275prov=e.\u0275\u0275defineInjectable({token:w,factory:w.\u0275fac,providedIn:"root"})}},444:
/*!************************************************************************!*\
!*** ./projects/quml-library/src/lib/startpage/startpage.component.ts ***!
\************************************************************************/(R,C,t)=>{t.r(C),t.d(C,{StartpageComponent:()=>g});var e=t(
Expand Down
2 changes: 1 addition & 1 deletion web-component/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@project-sunbird/sunbird-questionset-editor-web-component",
"version": "4.0.0",
"version": "4.0.1",
"description": "The web component package for the sunbird questionset editor",
"main": "sunbird-questionset-editor.js",
"scripts": {
Expand Down
Loading