-
Notifications
You must be signed in to change notification settings - Fork 307
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
[C4GT] - Support for Optional Material #8911
Conversation
@rajeevsathish sir, @princegupta1131 sir PTAL!! |
@@ -541,10 +543,11 @@ export class AssessmentPlayerComponent implements OnInit, OnDestroy, ComponentCa | |||
unit.isUnitConsumed = consumedContent.length === 1; | |||
unit.progress = consumedContent.length ? 100 : 0; | |||
unit.isUnitConsumptionStart = Boolean(consumedContent.length); | |||
if(unit?.relationalMetadata?.optional=== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Saurabhbalke please describe the code in a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hii @princegupta1131 sir,
added comments on the changes, PTAL!
thanks
...modules/learn/components/course-consumption/assessment-player/assessment-player.component.ts
Show resolved
Hide resolved
...modules/learn/components/course-consumption/assessment-player/assessment-player.component.ts
Outdated
Show resolved
Hide resolved
@@ -595,6 +604,10 @@ export class CoursePlayerComponent implements OnInit, OnDestroy { | |||
unit.isUnitConsumed = consumedContent.length === 1; | |||
unit.progress = consumedContent.length ? 100 : 0; | |||
unit.isUnitConsumptionStart = Boolean(consumedContent.length); | |||
if(unit?.relationalMetadata?.optional=== false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Saurabhbalke please try to make it more concise using this if (!unit?.relationalMetadata?.optional)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -566,7 +571,7 @@ export class CoursePlayerComponent implements OnInit, OnDestroy { | |||
|
|||
/* istanbul ignore else */ | |||
if (_.get(unit, 'children.length')) { | |||
flattenDeepContents = this.courseConsumptionService.flattenDeep(unit.children).filter(item => item.mimeType !== 'application/vnd.ekstep.content-collection' && item.mimeType !== 'application/vnd.sunbird.question'); | |||
flattenDeepContents = this.courseConsumptionService.flattenDeep(unit.children).filter(item => item.mimeType !== 'application/vnd.ekstep.content-collection' && item.mimeType !== 'application/vnd.sunbird.question' && item?.relationalMetadata?.optional === false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Saurabhbalke please try to make it more concise using this && !(item?.relationalMetadata?.optional)
SonarCloud Quality Gate failed. 0 Bugs 0.0% Coverage The version of Java (11.0.11) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
overwiew
Contents marked as optional should be excluded from the course progress calculation.
This PR fixes Support for Optional Material in Course #8664
Code Requirement
The Optional material shouldn’t contribute to the users' progress % of the trackable collection and hence doesn’t contribute in the completion certificate criteria. For ex., if a course (which is a trackable collection) has 3 resources - 2 mandatory and 1 optional. If the batch which is offering this course has a certificate issue criteria = ‘issue certs to all users whose course progress is 100%’ then the certificate should be issued as soon as the user completes the 2 mandatory resources.
The optional material shouldn’t contribute to the final score calculation of the collection and hence doesn’t contribute in the merit certificate criteria. For ex., if a course (which is a trackable collection) has 3 resources - 2 mandatory and 1 optional. The optional resource is a course assessment. In this scenario, the certificate issue criteria should not show the option to issue certs based on score. Any batches which are offering this course should only be able to issue completion certificates. In the course ToC page, user should be able to view their latest attempt score. In the course progress exhaust as well the assessment score details should be shown.
Additional material can be a content within a module or all of them can be bundled together as a module.
Proof that changes are correct
cinnamon-2023-09-06T171015+0530.webm
Type of change
Please choose appropriate options.
Checklist: