diff --git a/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts b/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts index 9f6651c2c..1abfaa7a0 100644 --- a/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts +++ b/library/ws-widget/collection/src/lib/content-strip-multiple/content-strip-multiple.component.ts @@ -418,9 +418,9 @@ export class ContentStripMultipleComponent extends WidgetBaseComponent // continue learing strip if (content && content.length) { contentNew = content.filter((c: any) => { - if (c.completionPercentage && c.completionPercentage > 0) { + // if (c.completionPercentage && c.completionPercentage > 0) { return c - } + // } }) } this.processStrip( diff --git a/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts b/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts index 37f700e35..77ae7f786 100755 --- a/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts +++ b/project/ws/app/src/lib/routes/app-toc/components/app-toc-banner/app-toc-banner.component.ts @@ -10,7 +10,7 @@ import { viewerRouteGenerator, WidgetContentService, } from '@sunbird-cb/collection' -import { TFetchStatus, UtilityService, ConfigurationsService } from '@sunbird-cb/utils' +import { TFetchStatus, UtilityService, ConfigurationsService, LoggerService } from '@sunbird-cb/utils' import { AccessControlService } from '@ws/author' import { Subscription } from 'rxjs' import { NsAnalytics } from '../../models/app-toc-analytics.model' @@ -88,6 +88,7 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { public configSvc: ConfigurationsService, private tagSvc: TitleTagService, private actionSVC: ActionService, + private logger: LoggerService, ) { } @@ -211,6 +212,9 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { } if (this.resumeData && this.content) { const resumeDataV2 = this.getResumeDataFromList() + if (!resumeDataV2.mimeType) { + resumeDataV2.mimeType = this.getMimeType(this.content, resumeDataV2.identifier) + } this.resumeDataLink = viewerRouteGenerator( resumeDataV2.identifier, resumeDataV2.mimeType, @@ -261,6 +265,26 @@ export class AppTocBannerComponent implements OnInit, OnChanges, OnDestroy { } }) } + getMimeType(content: NsContent.IContent, identifier: string): NsContent.EMimeTypes { + if (content.identifier === identifier) { + return content.mimeType + } else if (content.children.length === 0) { + if (content.children[0].identifier === identifier) { + return content.mimeType + } else { + // big blunder in data + this.logger.log(content.identifier, 'Wrong mimetypes for resume') + return content.mimeType + } + } else { + for (let i = 0; i < content.children.length; i++) { + if (content.children[i].identifier === identifier) { + return this.getMimeType(content.children[i], identifier) + } + } + } + return content.mimeType + } private getBatchId(): string { let batchId = '' diff --git a/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html b/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html index fc3e30722..891bc84c8 100755 --- a/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html +++ b/project/ws/viewer/src/lib/plugins/practice/components/result/result.component.html @@ -20,7 +20,7 @@ {{'Insights'}} - +