File tree Expand file tree Collapse file tree 5 files changed +22
-17
lines changed
addons/mod/page/tests/behat
core/features/course/components
module-completion-details Expand file tree Collapse file tree 5 files changed +22
-17
lines changed Original file line number Diff line number Diff line change @@ -74,8 +74,10 @@ Feature: View activity completion information in the Page resource
7474 | intro | A lesson learned in life |
7575 | completion | 1 |
7676 When I entered the course "Course 1" as "teacher1" in the app
77+ And I press "Completion" within "Music history" "ion-card" in the app
7778 Then I should find "Mark as done" in the app
78- When I press "Music history" in the app
79+ When I close the popup in the app
80+ And I press "Music history" in the app
7981 Then the header should be "Music history" in the app
8082 And I should find "Mark as done" in the app
8183 But I should not be able to press "Mark as done" in the app
@@ -110,6 +112,7 @@ Feature: View activity completion information in the Page resource
110112 | completion | 1 |
111113 When I entered the course "Course 2" as "teacher1" in the app
112114 Then I should not find "Mark as done" in the app
115+ Then I should not find "Completion" in the app
113116 When I press "Music history" in the app
114117 Then the header should be "Music history" in the app
115118 And I should find "Mark as done" in the app
Original file line number Diff line number Diff line change 1- @if (completionDetails.length > 0) {
1+ @if (completionDetails.length > 0 || (isManual && !isTrackedUser) ) {
22 <!-- Completion criterias. -->
33 < div class ="ion-padding ">
44 <!-- Dialog header. -->
Original file line number Diff line number Diff line change 4141 </ ion-button >
4242 }
4343 }
44+ <!-- Show a generic completion menu button for non-tracked users when either
45+ the activity uses automatic completion or the user is currently viewing
46+ the activity in the course context. -->
47+ } @else if (completion.isautomatic || inCourse) {
48+ < ion-button fill ="outline " class ="chip ion-text-nowrap " (click) ="completionClicked($event) ">
49+ {{ 'core.course.completionmenuitem' | translate }}
50+ < div class ="select-icon " role ="presentation " aria-hidden ="true ">
51+ < div class ="select-icon-inner "> </ div >
52+ </ div >
53+ </ ion-button >
4454 } @else {
45- @if (completion.isautomatic) {
46- < ion-button fill ="outline " class ="chip ion-text-nowrap " (click) ="completionClicked($event) ">
47- {{ 'core.course.completionmenuitem' | translate }}
48- < div class ="select-icon " role ="presentation " aria-hidden ="true ">
49- < div class ="select-icon-inner "> </ div >
50- </ div >
51- </ ion-button >
52- } @else {
53- < ion-button fill ="outline " [ariaLabel] ="accessibleDescription " disabled
54- class ="completioninfo completion_incomplete chip ion-text-nowrap ">
55- {{ 'core.course.completion_manual:markdone' | translate }}
56- </ ion-button >
57- }
55+ < ion-button fill ="outline " [ariaLabel] ="accessibleDescription " disabled
56+ class ="completioninfo completion_incomplete chip ion-text-nowrap ">
57+ {{ 'core.course.completion_manual:markdone' | translate }}
58+ </ ion-button >
5859 }
5960}
Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ export class CoreCourseModuleCompletionComponent
4747
4848 @Input ( { transform : toBoolean } ) showCompletionConditions = false ; // Whether to show activity completion conditions.
4949 @Input ( { transform : toBoolean } ) showManualCompletion = false ; // Whether to show manual completion.
50+ @Input ( { transform : toBoolean } ) inCourse = false ; // Whether the component is displayed in a course.
5051
5152 completed = false ;
5253 accessibleDescription : string | null = null ;
Original file line number Diff line number Diff line change 6565 @if (hasCompletion && !showLegacyCompletion) {
6666 < core-course-module-completion [completion] ="module.completiondata " [moduleName] ="module.name "
6767 [moduleId] ="module.id " [showCompletionConditions] ="showCompletionConditions "
68- [showManualCompletion] ="showManualCompletion "
68+ [showManualCompletion] ="showManualCompletion " [inCourse] =" true "
6969 (completionChanged) ="completionChanged.emit($event) " />
7070 }
7171
9292
9393 <!-- Activity completion. -->
9494 @if (hasCompletion && !showLegacyCompletion) {
95- < core-course-module-completion class ="activity-extra " [completion] ="module.completiondata "
95+ < core-course-module-completion class ="activity-extra " [completion] ="module.completiondata " [inCourse] =" true "
9696 [moduleName] ="module.name " [moduleId] ="module.id " [showCompletionConditions] ="showCompletionConditions "
9797 [showManualCompletion] ="showManualCompletion " (completionChanged) ="completionChanged.emit($event) " />
9898 }
You can’t perform that action at this time.
0 commit comments