Skip to content
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"private": true,
"dependencies": {
"@aastrika_npmjs/comptency": "^2.0.0",
"@aastrika_npmjs/comptency": "^2.1.1",
"@aastrika_npmjs/discussions-ui-v8": "^5.0.1",
"@angular/animations": "^21.2.7",
"@angular/cdk": "^21.2.5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import { ActivatedRoute } from '@angular/router'
import { LoggerService } from '../../../../../../../../../library/ws-widget/utils/src/public-api'

@Component({
standalone: false,
selector: 'ws-app-assessment-detail',
templateUrl: './assessment-detail.component.html',
styleUrls: ['./assessment-detail.component.scss'],
standalone: false,
selector: 'ws-app-assessment-detail',
templateUrl: './assessment-detail.component.html',
styleUrls: ['./assessment-detail.component.scss'],

})
export class AssessmentDetailComponent implements OnInit {

Expand Down Expand Up @@ -123,7 +123,7 @@ export class AssessmentDetailComponent implements OnInit {
if (content.artifactUrl) {
const artifactUrl = this.forPreview
? this.viewSvc.getAuthoringUrl(content.artifactUrl)
: content.artifactUrl
: this.viewSvc.getCompetencyAuthoringUrl(content.artifactUrl.split('/content')[1])
let quizJSON: NSQuiz.IQuiz = await this.http
.get<any>(artifactUrl || '')
.toPromise()
Expand Down Expand Up @@ -151,7 +151,7 @@ export class AssessmentDetailComponent implements OnInit {
).toPromise()
const artifactUrl = this.forPreview
? this.viewSvc.getAuthoringUrl(contents.result.content.artifactUrl)
: contents.result.content.artifactUrl
: this.viewSvc.getCompetencyAuthoringUrl(contents.result.content.artifactUrl.split('/content')[1])
let quizJSON: NSQuiz.IQuiz = await this.http
.get<any>(artifactUrl || '')
.toPromise()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { PlayerStateService } from '../../player-state.service'
import { ValueService } from '@ws-widget/utils'

@Component({
standalone: false,
selector: 'viewer-quiz-container',
templateUrl: './quiz.component.html',
styleUrls: ['./quiz.component.scss'],
standalone: false,
selector: 'viewer-quiz-container',
templateUrl: './quiz.component.html',
styleUrls: ['./quiz.component.scss'],

})
export class QuizComponent implements OnInit {
@Input() isFetchingDataComplete = false
Expand All @@ -21,6 +21,7 @@ export class QuizComponent implements OnInit {
timeLimit: 0,
questions: [],
isAssessment: false,
passPercentage: 0
}
@Input() isPreviewMode = false
stateChange = false
Expand Down
13 changes: 7 additions & 6 deletions project/ws/viewer/src/lib/routes/quiz/quiz.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { WsEvents, EventService } from '@ws-widget/utils'
import { ViewerUtilService } from '../../viewer-util.service'

@Component({
standalone: false,
selector: 'viewer-quiz',
templateUrl: './quiz.component.html',
styleUrls: ['./quiz.component.scss'],
standalone: false,
selector: 'viewer-quiz',
templateUrl: './quiz.component.html',
styleUrls: ['./quiz.component.scss'],

})
export class QuizComponent implements OnInit, OnDestroy {
private dataSubscription: Subscription | null = null
Expand All @@ -26,6 +26,7 @@ export class QuizComponent implements OnInit, OnDestroy {
timeLimit: 0,
questions: [],
isAssessment: false,
passPercentage: 60
}
constructor(
private activatedRoute: ActivatedRoute,
Expand Down Expand Up @@ -148,7 +149,7 @@ export class QuizComponent implements OnInit, OnDestroy {
} {
const artifactUrl = this.forPreview
? this.viewSvc.getAuthoringUrl(content.artifactUrl)
: content.artifactUrl
: this.viewSvc.getCompetencyAuthoringUrl(content.artifactUrl.split('/content')[1])
let quizJSON: NSQuiz.IQuiz = await this.http
.get<any>(artifactUrl || '')
.toPromise()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import { EventService, WsEvents } from '@ws-widget/utils'
import { ViewerUtilService } from '../../viewer-util.service'

@Component({
standalone: false,
selector: 'viewer-resource-collection',
templateUrl: './resource-collection.component.html',
styleUrls: ['./resource-collection.component.scss'],
standalone: false,
selector: 'viewer-resource-collection',
templateUrl: './resource-collection.component.html',
styleUrls: ['./resource-collection.component.scss'],

})
export class ResourceCollectionComponent implements OnInit, OnDestroy {
private dataSubscription: Subscription | null = null
Expand Down Expand Up @@ -95,7 +95,7 @@ export class ResourceCollectionComponent implements OnInit, OnDestroy {
if (this.resourceCollectionData && this.resourceCollectionData.artifactUrl) {
const artifactUrl = this.forPreview
? this.viewSvc.getAuthoringUrl(this.resourceCollectionData.artifactUrl)
: this.resourceCollectionData.artifactUrl
: this.viewSvc.getCompetencyAuthoringUrl(this.resourceCollectionData.artifactUrl.split('/content')[1])
manifestFile = await this.http
.get<any>(artifactUrl || '')
.toPromise()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ export class MobileDashboardService {
map(({ searchResult, progress }) => {
// Enrich titles from search results — never reduces count
const rawCourses: any[] = searchResult?.result?.content || searchResult?.content || []
if (rawCourses.length) {
const named = this.getFormattedCompetencyCoursesWithFilter(rawCourses, competencyLevels, competencyIds)
const named = rawCourses.length
? this.getFormattedCompetencyCoursesWithFilter(rawCourses, competencyLevels, competencyIds)
: []

if (named.length > 0) {
named.forEach((n: any) => {
const key = String(n.competencyID)
if (competencyMap.has(key)) {
Expand All @@ -118,10 +121,12 @@ export class MobileDashboardService {
})
}
})
const enrichedCourses = Array.from(competencyMap.values())
const withProgress = this.mergeProgressData(enrichedCourses, progress?.data || [])
return this.setCoursesState(withProgress)
}
const enrichedCourses = Array.from(competencyMap.values())
const withProgress = this.mergeProgressData(enrichedCourses, progress?.data || [])
return this.setCoursesState(withProgress)

return empty
}),
catchError(() => {
const withProgress = this.mergeProgressData(courses, [])
Expand Down
4 changes: 4 additions & 0 deletions src/app/component/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ import { TranslateService } from '@ngx-translate/core'
import { PlaylistService } from '../../services/playlist.service'
import { DowntimeConfigService } from '../../services/downtime-config.service'
import { ThemeService } from '../../services/theme.service'
import { LanguageService } from '../../services/language.service'

@Component({
standalone: false,
Expand Down Expand Up @@ -144,6 +145,7 @@ export class RootComponent implements OnInit, AfterViewInit, OnDestroy {
private themeSvc: ThemeService,
private seoSvc: SeoService,
@Inject(PLATFORM_ID) private platformId: object,
private langSvc: LanguageService
) {
const isBrowser = isPlatformBrowser(this.platformId)
this.userEnrollCourse = toSignal(
Expand Down Expand Up @@ -498,6 +500,8 @@ export class RootComponent implements OnInit, AfterViewInit, OnDestroy {
}
}
this.orgDetails = { ...this.playlistSvc.orgDetails(), ...this.playlistSvc.headerConfig() }
let language = this.configSvc.userProfile.language || this.orgDetails.defaultLang || 'hi'
this.langSvc.setLanguage(language)
const homeTabConfig = this.playlistSvc.sections()?.['homeTab']
this.programConfig = this.playlistSvc.programs()
this.hasProgramConfig = !!this.programConfig && Object.keys(this.programConfig).length > 0
Expand Down
Loading