Skip to content

Commit

Permalink
Merge pull request #2368 from vishnubansaltarento/assessment-compatib…
Browse files Browse the repository at this point in the history
…ility-level-change

revert compatibility level to 7 again
  • Loading branch information
vishnubansaltarento authored Jul 26, 2024
2 parents 9381b55 + 48653d9 commit 170b1ee
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
</div>
<div class="flex flex-1 blank_box"></div>
</div> -->
<div class="flex flex-col ws-mat-primary-lite-background-important" [ngClass]="selectedAssessmentCompatibilityLevel < 6 ? 'box-height':'box-height-standalone'">
<div class="flex flex-col ws-mat-primary-lite-background-important" [ngClass]="selectedAssessmentCompatibilityLevel < 7 ? 'box-height':'box-height-standalone'">
<div class="assessment-container">
<div [ngClass]="selectedAssessmentCompatibilityLevel < 6 ? 'assessment-stats-count':'standalone-assessment-stats-count'">
<div [ngClass]="selectedAssessmentCompatibilityLevel < 7 ? 'assessment-stats-count':'standalone-assessment-stats-count'">
<div class="flex flex-row justify-between">
<div class="flex flex-row">
<div>
Expand All @@ -76,27 +76,27 @@
</div>
<div>
<div class="flex flex-col stats-label ml-2" *ngIf="questionTYP.FINAL_ASSESSMENT === primaryCategory || questionTYP.PRACTICE_RESOURCE === primaryCategory"
[ngClass]="selectedAssessmentCompatibilityLevel >= 6 ? 'ml-5':''">
[ngClass]="selectedAssessmentCompatibilityLevel >= 7 ? 'ml-5':''">
<div><img src="assets/icons/final-assessment/timer.svg"></div>
<div>{{( timeLimit | pipeDurationTransform: 'hms')}}</div>
</div>
</div>
<div>
<div class="ml-5 start-assessment-cta-standalone block md:hidden" *ngIf="selectedAssessmentCompatibilityLevel >= 6">
<div class="ml-5 start-assessment-cta-standalone block md:hidden" *ngIf="selectedAssessmentCompatibilityLevel >= 7">
<button [disabled]="!consentGiven ? 'disabled': null" *ngIf="canAttempt?.attemptsMade < canAttempt?.attemptsAllowed || forPreview || questionTYP.PRACTICE_RESOURCE == primaryCategory" [class.spinner]="loading" (click)="overviewed('start')" [ngClass]="consentGiven ? 'bg-blue-800 text-white' : 'secondary-standalone text-standalone-black'" class=" text-sm font-semibold py-3 px-5 rounded-full border-none cursor-pointer tracking-wide">
<span class="padding-xs" i18n>{{'playerbrief.startAssessment' | translate}}</span>
</button>
<mat-hint class="mat-title" *ngIf="canAttempt?.attemptsMade >= canAttempt?.attemptsAllowed && !forPreview && questionTYP.FINAL_ASSESSMENT === primaryCategory">{{'playerbrief.maxAllowedRetake' | translate}}</mat-hint>
</div>
</div>
</div>
<div class="start-assessment-cta hidden md:block" *ngIf="selectedAssessmentCompatibilityLevel >= 6">
<div class="start-assessment-cta hidden md:block" *ngIf="selectedAssessmentCompatibilityLevel >= 7">
<button [disabled]="!consentGiven ? 'disabled': null" *ngIf="canAttempt?.attemptsMade < canAttempt?.attemptsAllowed || forPreview || questionTYP.PRACTICE_RESOURCE == primaryCategory" [class.spinner]="loading" (click)="overviewed('start')" [ngClass]="consentGiven ? 'bg-blue-800 text-white' : 'secondary-standalone text-standalone-black'" class="text-sm font-semibold py-3 px-5 rounded-full border-none cursor-pointer tracking-wide">
<span class="padding-xs" i18n>{{'playerbrief.startAssessment' | translate}}</span>
</button>
<mat-hint class="mat-title" *ngIf="canAttempt?.attemptsMade >= canAttempt?.attemptsAllowed && !forPreview && questionTYP.FINAL_ASSESSMENT === primaryCategory">{{'playerbrief.maxAllowedRetake' | translate}}</mat-hint>
</div>
<div class="start-assessment-cta hidden md:block" *ngIf="selectedAssessmentCompatibilityLevel < 6">
<div class="start-assessment-cta hidden md:block" *ngIf="selectedAssessmentCompatibilityLevel < 7">
<button *ngIf="canAttempt?.attemptsMade < canAttempt?.attemptsAllowed || forPreview || questionTYP.PRACTICE_RESOURCE == primaryCategory" [class.spinner]="loading" [disabled]="loading" (click)="overviewed('start')" class="bg-blue-800 text-white text-sm font-semibold py-3 px-5 rounded-full border-none cursor-pointer tracking-wide">
<span class="padding-xs" i18n>{{'playerbrief.startAssessment' | translate}}</span>
</button>
Expand All @@ -106,7 +106,7 @@
</div>

</div>
<div class="summary flex flex-col" *ngIf="selectedAssessmentCompatibilityLevel < 6">
<div class="summary flex flex-col" *ngIf="selectedAssessmentCompatibilityLevel < 7">
<div>
<h2 class="summary-label">{{ 'practiceoverview.summary' | translate }}</h2>
</div>
Expand All @@ -128,7 +128,7 @@ <h2 class="summary-label">{{ 'practiceoverview.summary' | translate }}</h2>
</ul>
</div>
</div>
<div class="summary-standalone flex flex-col" *ngIf="selectedAssessmentCompatibilityLevel >= 6">
<div class="summary-standalone flex flex-col" *ngIf="selectedAssessmentCompatibilityLevel >= 7">
<!-- <div>
<h2 class="summary-label">{{ 'practiceoverview.summary' | translate }}</h2>
</div> -->
Expand Down Expand Up @@ -161,7 +161,7 @@ <h2 class="summary-label">{{ 'practiceoverview.summary' | translate }}</h2>


</div>
<div class="start-assessment-cta block md:hidden" *ngIf="selectedAssessmentCompatibilityLevel < 6">
<div class="start-assessment-cta block md:hidden" *ngIf="selectedAssessmentCompatibilityLevel < 7">
<button *ngIf="canAttempt?.attemptsMade < canAttempt?.attemptsAllowed || questionTYP.PRACTICE_RESOURCE == primaryCategory" [class.spinner]="loading" [disabled]="loading" (click)="overviewed('start')" class="bg-blue-800 text-sm font-semibold text-white py-3 px-5 rounded-full border-none cursor-pointer tracking-wide">
<span class="padding-xs" i18n>{{'playerbrief.startAssessment' | translate}}</span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class OverviewComponent implements OnInit, OnChanges, OnDestroy {

checkForAssessmentSubmitAlready(identifier: any) {
if (this.selectedAssessmentCompatibilityLevel) {
if (this.selectedAssessmentCompatibilityLevel < 6) {
if (this.selectedAssessmentCompatibilityLevel < 7) {
this.quizSvc.canAttend(identifier).subscribe(response => {
if (response && response.attemptsMade > 0) {
this.quizSvc.checkAlreadySubmitAssessment.next(true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<ng-container *ngIf="selectedAssessmentCompatibilityLevel < 6">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel < 7">
<mat-card *ngIf="!(question?.questionType === 'mtf' || question?.questionType === 'ftb')"
class="flex flex-1 respo margin-bottom-m no-shadow">
<div class="flex flex-column width-100" [ngClass]="mobileQuestionSetExpand ? 'mobile-responsive-question-container-expand' : 'mobile-responsive-question-container'">
Expand Down Expand Up @@ -196,7 +196,7 @@ <h2 [innerHTML]="question?.question" class="m-auto quiz-question mat-h2 flex-cen
</ng-container>

<!-- Standalone Assessment-->
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 6 && !showMarkForReview">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 7 && !showMarkForReview">
<mat-card *ngIf="!(question?.questionType === 'mtf' || question?.questionType === 'ftb')"
class="flex flex-1 respo margin-bottom-m no-shadow standalone-assessment" [ngClass]="showOnlyQuestion ? 'show-only-question': 'show-only-answer'">
<!-- [ngClass]="mobileQuestionSetExpand ? 'mobile-responsive-question-container-expand' : 'mobile-responsive-question-container'" -->
Expand Down Expand Up @@ -339,7 +339,7 @@ <h2 [innerHTML]="question?.question" class="m-auto quiz-question mat-h2 flex-cen
</mat-card>
</ng-container>

<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 6 && showMarkForReview" >
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 7 && showMarkForReview" >
<div class="Mweb-btns">
<a
class="text-black margin-xs quest_btn_review" mat-button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class QuestionComponent implements OnInit, OnChanges, AfterViewInit {
this.markedQuestions.delete(this.question.questionId)
} else {
this.markedQuestions.add(this.question.questionId)
if (this.selectedAssessmentCompatibilityLevel >= 6) {
if (this.selectedAssessmentCompatibilityLevel >= 7) {
this.getNextQuestion.emit(true)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div [ngClass]="selectedAssessmentCompatibilityLevel < 6 ? 'blue-bg':''">
<div class="flex flex-col" [ngClass]="selectedAssessmentCompatibilityLevel >= 6 ? 'box-height-standalone-assessment':'box-height'">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel < 6 && quizResponse">
<div [ngClass]="selectedAssessmentCompatibilityLevel < 7 ? 'blue-bg':''">
<div class="flex flex-col" [ngClass]="selectedAssessmentCompatibilityLevel >= 7 ? 'box-height-standalone-assessment':'box-height'">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel < 7 && quizResponse">
<div class="assessment-container">
<div class="assessment-stats-count">
<div class="flex flex-row justify-end">
Expand Down Expand Up @@ -274,7 +274,7 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 6 && quizResponse && !showInsight">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 7 && quizResponse && !showInsight">
<div class="results flex flex-col gap-6 px-5 py-4">
<div class="header-text flex flex-col">
{{ 'quizresult.myOverallPerformanceSummary' | translate}}
Expand Down Expand Up @@ -433,7 +433,7 @@

</div>
</ng-container>
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 6 && quizResponse && showInsight">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 7 && quizResponse && showInsight">
<div class="results result-insight flex flex-col gap-6 px-5 py-4">
<ng-container *ngIf="questionTYP.PRACTICE_RESOURCE !== quizCategory; else overAllPerformance">
<div class="flex overAllScore justify-center items-center">
Expand Down Expand Up @@ -550,7 +550,7 @@
</div>
</ng-container>
</div>
<div class="footer flex justify-center items-center gap-2" *ngIf="selectedAssessmentCompatibilityLevel >= 6 && quizResponse">
<div class="footer flex justify-center items-center gap-2" *ngIf="selectedAssessmentCompatibilityLevel >= 7 && quizResponse">
<ng-container *ngIf="!showInsight">
<button mat-button class="flex justify-center items-center px-4 inSight gap-2" (click)="showInsight = true">
<img class="mr-2" src="/assets/icons/final-assessment/insight.svg">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

</div>
<!-- Course Assessment-->
<ng-container *ngIf="selectedAssessmentCompatibilityLevel < 6">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel < 7">
<!-- Desktop Not Standalone Assessment -->
<div #quizContainer class="quiz-container"
*ngIf="viewState !== 'initial' && !isMobile && fetchingQuestionsStatus === 'done'">
Expand Down Expand Up @@ -1110,7 +1110,7 @@ <h3 class="mat-subheading-2">
<!------------------------------------------------------------------------------------------------------------------------------------>

<!-- Desktop Standalone Assessment-->
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 6">
<ng-container *ngIf="selectedAssessmentCompatibilityLevel >= 7">
<div #quizContainer class="quiz-container-standalone"
*ngIf="viewState !== 'initial' && !isMobile && fetchingQuestionsStatus === 'done'">
<div class="margin-m"
Expand Down
16 changes: 8 additions & 8 deletions project/ws/viewer/src/lib/plugins/practice/practice.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
// this.updateVisivility()
// } else {
if (this.selectedAssessmentCompatibilityLevel) {
if (this.selectedAssessmentCompatibilityLevel < 6) {
if (this.selectedAssessmentCompatibilityLevel < 7) {
this.quizSvc.canAttend(this.identifier).subscribe(response => {
if (response) {
this.canAttempt = response
Expand Down Expand Up @@ -424,7 +424,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
this.viewState = 'detail'
this.startIfonlySection()
} else {
if (this.selectedAssessmentCompatibilityLevel < 6) {
if (this.selectedAssessmentCompatibilityLevel < 7) {
this.quizSvc.getSectionV4(this.identifier).subscribe((section: NSPractice.ISectionResponse) => {
// console.log(section)
this.fetchingSectionsStatus = 'done'
Expand Down Expand Up @@ -552,7 +552,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
const setStartIndex = this.noOfQuestionsPerSet * this.currentSetNumber
const setEndIndex = setStartIndex + this.noOfQuestionsPerSet
const secQuestions = qq.slice(setStartIndex, setEndIndex)
return this.selectedAssessmentCompatibilityLevel < 6 ? qq : secQuestions
return this.selectedAssessmentCompatibilityLevel < 7 ? qq : secQuestions
}

get hasNextSet(): boolean {
Expand Down Expand Up @@ -655,7 +655,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
}
}
getMultiQuestions(ids: string[]) {
if (this.selectedAssessmentCompatibilityLevel < 6) {
if (this.selectedAssessmentCompatibilityLevel < 7) {
return this.quizSvc.getQuestionsV4(ids, this.identifier).toPromise()
}
return this.quizSvc.getQuestions(ids, this.identifier).toPromise()
Expand Down Expand Up @@ -1115,7 +1115,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
proceedToSubmit() {
// if (this.timeLeft || this.primaryCategory === this.ePrimaryCategory.PRACTICE_RESOURCE) {
// if (this.coursePrimaryCategory === 'Standalone Assessment') {
if (this.selectedAssessmentCompatibilityLevel >= 6) {
if (this.selectedAssessmentCompatibilityLevel >= 7) {
const submitAssessment = true
this.openSectionPopup(submitAssessment)
} else {
Expand Down Expand Up @@ -1484,7 +1484,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
}

async submitAfterAllPromiseResolved() {
if (this.selectedAssessmentCompatibilityLevel < 6) {
if (this.selectedAssessmentCompatibilityLevel < 7) {
const quizV4Res: any = await this.quizSvc.submitQuizV4(this.generateRequest).toPromise().catch(_error => {})
if (quizV4Res && quizV4Res.params && quizV4Res.params.status.toLowerCase() === 'success') {
if (quizV4Res.result.primaryCategory === 'Course Assessment') {
Expand Down Expand Up @@ -1684,7 +1684,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
this.retake = true

// this.init()
if(this.selectedAssessmentCompatibilityLevel < 6) {
if(this.selectedAssessmentCompatibilityLevel < 7) {
this.init()
} else {
if(this.ePrimaryCategory.FINAL_ASSESSMENT == this.primaryCategory) {
Expand Down Expand Up @@ -1807,7 +1807,7 @@ export class PracticeComponent implements OnInit, OnChanges, OnDestroy {
courseId: this.generateRequest.courseId,
},
}
if(this.selectedAssessmentCompatibilityLevel < 6) {
if(this.selectedAssessmentCompatibilityLevel < 7) {
const resultRes: any = await this.quizSvc.quizResult(req).toPromise().catch(_error => {})
if (resultRes && resultRes.params && resultRes.params.status.toLowerCase() === 'success') {
if (resultRes.result) {
Expand Down
4 changes: 2 additions & 2 deletions project/ws/viewer/src/lib/viewer.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
</ng-container>
</mat-sidenav>

<mat-sidenav-content #scrollableContent [ngClass]="isAssessmentScreen && compatibilityLevel < 6 ? 'isAssessmentScreen':'isAssessmentScreenNew'">
<mat-sidenav-content #scrollableContent [ngClass]="isAssessmentScreen && compatibilityLevel < 7 ? 'isAssessmentScreen':'isAssessmentScreenNew'">
<ng-container *ngIf="viewerHeaderSideBarToggleFlag">
<!-- *ngIf="fullScreenContainer" -->
<viewer-viewer-secondary-top-bar [forPreview]="forPreview" [contentMIMEType]="contentMIMEType" [completedCount]="completedCount"
Expand Down Expand Up @@ -116,7 +116,7 @@
</div>
</div>

<div class="viewer-player-container" [ngClass]="contentMIMEType == 'application/vnd.sunbird.questionset' && compatibilityLevel < 6 ? 'sidenavContent':'standaloneSidenavContent'">
<div class="viewer-player-container" [ngClass]="contentMIMEType == 'application/vnd.sunbird.questionset' && compatibilityLevel < 7 ? 'sidenavContent':'standaloneSidenavContent'">
<router-outlet (activate)="getContentData($event)"></router-outlet>
</div>

Expand Down

0 comments on commit 170b1ee

Please sign in to comment.