diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index ef0cd7d5d..1efbaa292 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -1,15 +1,14 @@ - + + [priority]="800" [content]="'core.moduleintro' | translate" (action)="expandDescription()" iconAction="fas-arrow-right"> - + @@ -31,26 +30,15 @@ - + + + + + - - - - - - - - - - - - - @@ -90,8 +78,7 @@ - + {{ 'addon.mod_assign.numberofteams' | translate }} {{ 'addon.mod_assign.numberofparticipants' | translate }} @@ -109,48 +96,48 @@ - {{ 'addon.mod_assign.numberofdraftsubmissions' | translate }} + + {{ 'addon.mod_assign.numberofdraftsubmissions' | translate }} + {{ summary.submissiondraftscount }} {{ 'addon.mod_assign.numberofdraftsubmissionscountdescription' | translate: - {count: summary.submissiondraftscount} }} + {count: summary.submissiondraftscount} }} - {{ 'addon.mod_assign.numberofsubmittedassignments' | translate }} + + {{ 'addon.mod_assign.numberofsubmittedassignments' | translate }} + {{ summary.submissionssubmittedcount }} {{ 'addon.mod_assign.numberofsubmittedassignmentscountdescription' | translate: - {count: summary.submissionssubmittedcount} }} + {count: summary.submissionssubmittedcount} }} - {{ 'addon.mod_assign.numberofsubmissionsneedgrading' | translate }} + + {{ 'addon.mod_assign.numberofsubmissionsneedgrading' | translate }} + {{ summary.submissionsneedgradingcount }} {{ 'addon.mod_assign.numberofsubmissionsneedgradingcountdescription' | translate: - {count: summary.submissionsneedgradingcount} }} + {count: summary.submissionsneedgradingcount} }} diff --git a/src/addons/mod/book/components/index/addon-mod-book-index.html b/src/addons/mod/book/components/index/addon-mod-book-index.html index 7be6e735b..f6f090647 100644 --- a/src/addons/mod/book/components/index/addon-mod-book-index.html +++ b/src/addons/mod/book/components/index/addon-mod-book-index.html @@ -4,12 +4,12 @@ - + - + - + - - @@ -39,9 +36,8 @@ - + - + diff --git a/src/addons/mod/chat/components/index/addon-mod-chat-index.html b/src/addons/mod/chat/components/index/addon-mod-chat-index.html index 8f1069746..93265acea 100644 --- a/src/addons/mod/chat/components/index/addon-mod-chat-index.html +++ b/src/addons/mod/chat/components/index/addon-mod-chat-index.html @@ -1,14 +1,14 @@ - + - + @@ -27,14 +27,10 @@ - + - - - diff --git a/src/addons/mod/choice/components/index/addon-mod-choice-index.html b/src/addons/mod/choice/components/index/addon-mod-choice-index.html index 60a41827e..f0e2aa0f5 100644 --- a/src/addons/mod/choice/components/index/addon-mod-choice-index.html +++ b/src/addons/mod/choice/components/index/addon-mod-choice-index.html @@ -1,14 +1,14 @@ - + - + @@ -29,14 +29,10 @@ - + - - - @@ -54,8 +50,7 @@ {{ 'addon.mod_choice.yourselection' | translate }} - + {{ 'addon.mod_choice.expired' | translate:{$a: closeTimeReadable} }} @@ -145,10 +140,12 @@
{{ 'addon.mod_choice.yourselection' | translate }} - +
{{ 'addon.mod_choice.expired' | translate:{$a: closeTimeReadable} }}
{{user.fullname}}
{{ 'addon.mod_choice.noresultsviewable' | translate }}
{{item.num}}. + contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
- +
{{ 'addon.mod_feedback.average' | translate }}: {{item.average | number : '1.2-2'}} diff --git a/src/addons/mod/folder/components/index/addon-mod-folder-index.html b/src/addons/mod/folder/components/index/addon-mod-folder-index.html index 4763418b3..e44e8a1b7 100644 --- a/src/addons/mod/folder/components/index/addon-mod-folder-index.html +++ b/src/addons/mod/folder/components/index/addon-mod-folder-index.html @@ -1,14 +1,14 @@ - + - + @@ -26,14 +26,11 @@ - + + {{subfolder.filename}} - - - 0)"> diff --git a/src/addons/mod/forum/components/index/index.html b/src/addons/mod/forum/components/index/index.html index 3703497a6..642a96d2f 100644 --- a/src/addons/mod/forum/components/index/index.html +++ b/src/addons/mod/forum/components/index/index.html @@ -1,38 +1,30 @@ - + - + - - - + - + - @@ -46,15 +38,16 @@ - + + + + {{descriptionNote}} + + - - - @@ -72,23 +65,17 @@ - + - - @@ -98,15 +85,12 @@ [attr.aria-label]="'addon.mod_forum.discussionpinned' | translate"> - +
{{ rule }}
{{ 'addon.mod_quiz.outof' | translate: { $a: { grade: bestGrade.gradetopass, maxgrade: quiz.gradeFormatted - } } }}
{{ 'addon.mod_quiz.comment' | translate }}
-
+ + +
{{ 'addon.mod_quiz.overallfeedback' | translate }}
{{ message }}
{{ 'addon.mod_quiz.noquestions' | translate }}
{{ currentOrganization.title }}
- + - 0 && !incomplete && attemptsLeft > 0"> + 0 && !incomplete && attemptsLeft > 0"> {{ 'addon.mod_scorm.newattempt' | translate }} diff --git a/src/addons/mod/survey/components/index/addon-mod-survey-index.html b/src/addons/mod/survey/components/index/addon-mod-survey-index.html index 5bf012e3e..16ebaa871 100644 --- a/src/addons/mod/survey/components/index/addon-mod-survey-index.html +++ b/src/addons/mod/survey/components/index/addon-mod-survey-index.html @@ -1,21 +1,21 @@ - + - + + [content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [iconAction]="syncIcon" + [closeOnClick]="false"> @@ -30,15 +30,11 @@ - + - - - {{ 'addon.mod_survey.surveycompletednograph' | translate }} @@ -63,7 +59,7 @@ - + {{ question.text }} {{ 'addon.mod_survey.responses' | translate }} @@ -73,15 +69,16 @@ - {{ question.intro }} + + {{ question.intro }} + - + @@ -93,19 +90,17 @@ + *ngFor="let option of question.optionsArray; let value=index;"> + [attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet" [name]="question.name" + [interfaceOptions]="{header: question.text}"> {{ 'core.choose' | translate }} - + {{option}} @@ -126,8 +121,8 @@ + [attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet" [name]="question.name" + [interfaceOptions]="{header: question.text}"> {{option}} diff --git a/src/addons/mod/url/components/index/addon-mod-url-index.html b/src/addons/mod/url/components/index/addon-mod-url-index.html index 722bdfafd..491e186eb 100644 --- a/src/addons/mod/url/components/index/addon-mod-url-index.html +++ b/src/addons/mod/url/components/index/addon-mod-url-index.html @@ -1,12 +1,12 @@ - + - + @@ -16,14 +16,10 @@ - + - - - diff --git a/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html b/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html index 07a1a2638..5eecab5a1 100644 --- a/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html +++ b/src/addons/mod/wiki/components/index/addon-mod-wiki-index.html @@ -1,8 +1,8 @@ - 1" (click)="showSubwikiPicker($event)" - [attr.aria-label]="'addon.mod_wiki.subwiki' | translate" aria-haspopup="true"> + 1" (click)="showSubwikiPicker($event)" [attr.aria-label]="'addon.mod_wiki.subwiki' | translate" + aria-haspopup="true"> @@ -13,18 +13,17 @@ - + - + + [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> - + @@ -49,15 +48,12 @@ - + + {{pageTitle}} - - - - + @@ -82,8 +78,7 @@ - + diff --git a/src/addons/mod/wiki/pages/index/index.ts b/src/addons/mod/wiki/pages/index/index.ts index 3b6058055..e98a10c9f 100644 --- a/src/addons/mod/wiki/pages/index/index.ts +++ b/src/addons/mod/wiki/pages/index/index.ts @@ -52,9 +52,7 @@ export class AddonModWikiIndexPage extends CoreCourseModuleMainActivityPage - + - + @@ -22,15 +22,15 @@ - + + - + @@ -87,9 +87,8 @@ {{ 'addon.mod_workshop.conclusion' | translate }} - + @@ -97,7 +96,9 @@ - {{ 'addon.mod_workshop.yourgrades' | translate }} + + {{ 'addon.mod_workshop.yourgrades' | translate }} + @@ -120,8 +121,7 @@ {{ 'addon.mod_workshop.areainstructauthors' | translate }} + [text]="workshop!.instructauthors" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> @@ -166,7 +166,9 @@ = PHASE_CLOSED"> - {{ 'addon.mod_workshop.publishedsubmissions' | translate }} + + {{ 'addon.mod_workshop.publishedsubmissions' | translate }} + - {{ 'addon.mod_workshop.assignedassessments' | translate }} + + {{ 'addon.mod_workshop.assignedassessments' | translate }} + - {{ 'addon.mod_workshop.assignedassessmentsnone' | translate }} + + {{ 'addon.mod_workshop.assignedassessmentsnone' | translate }} + - + diff --git a/src/core/features/course/classes/main-resource-component.ts b/src/core/features/course/classes/main-resource-component.ts index e01d48d86..722907a73 100644 --- a/src/core/features/course/classes/main-resource-component.ts +++ b/src/core/features/course/classes/main-resource-component.ts @@ -70,7 +70,6 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, isDestroyed = false; // Whether the component is destroyed, used when calling fillContextMenu. contextMenuStatusObserver?: CoreEventObserver; // Observer of package status, used when calling fillContextMenu. contextFileStatusObserver?: CoreEventObserver; // Observer of file status, used when calling fillContextMenu. - showCompletion = false; // Whether to show completion inside the activity. protected fetchContentDefaultError = 'core.course.errorgetmodule'; // Default error to show when loading contents. protected isCurrentView = false; // Whether the component is in the current view. @@ -80,6 +79,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, protected completionObserver?: CoreEventObserver; protected logger: CoreLogger; protected debouncedUpdateModule?: () => void; // Update the module after a certain time. + protected showCompletion = false; // Whether to show completion inside the activity. constructor( @Optional() @Inject('') loggerName: string = 'CoreCourseModuleMainResourceComponent', @@ -97,7 +97,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, this.componentId = this.module.id; this.externalUrl = this.module.url; this.courseId = this.courseId || this.module.course!; - this.showCompletion = !!CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.11'); + this.showCompletion = !!CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11'); if (this.showCompletion) { CoreCourseHelper.calculateModuleCompletionData(this.module, this.courseId); diff --git a/src/core/features/course/components/module-description/module-description.ts b/src/core/features/course/components/module-description/module-description.ts index d5fcf1139..6fc2ed236 100644 --- a/src/core/features/course/components/module-description/module-description.ts +++ b/src/core/features/course/components/module-description/module-description.ts @@ -28,7 +28,9 @@ import { Component, Input } from '@angular/core'; * * Example usage: * - * + * + * @deprecated since 4.0 use core-course-module-info */ @Component({ selector: 'core-course-module-description', diff --git a/src/core/features/course/components/module-info/core-course-module-info.html b/src/core/features/course/components/module-info/core-course-module-info.html index d69b3148a..acd0b90e5 100644 --- a/src/core/features/course/components/module-info/core-course-module-info.html +++ b/src/core/features/course/components/module-info/core-course-module-info.html @@ -1,18 +1,37 @@ - - - - - - - {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} - - + + + + + + + + + + + + + + + + + + + + + + + + {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} + + - - - - - - + + + + + + diff --git a/src/core/features/course/components/module-info/course-module-info.scss b/src/core/features/course/components/module-info/course-module-info.scss index ddf0beb55..a4d1bf7e1 100644 --- a/src/core/features/course/components/module-info/course-module-info.scss +++ b/src/core/features/course/components/module-info/course-module-info.scss @@ -2,5 +2,9 @@ :host { display: block; + box-shadow: 0px 3px 3px rgba(var(--drop-shadow)); + margin-bottom: 8px; + background-color: var(--contrast-background); + @include padding-horizontal(var(--ion-safe-area-left), var(--ion-safe-area-right)); -} \ No newline at end of file +} diff --git a/src/core/features/course/components/module-info/module-info.ts b/src/core/features/course/components/module-info/module-info.ts index 254ad3c7c..13cbd4e40 100644 --- a/src/core/features/course/components/module-info/module-info.ts +++ b/src/core/features/course/components/module-info/module-info.ts @@ -12,21 +12,48 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { CoreCourseModule, CoreCourseModuleCompletionData } from '@features/course/services/course-helper'; +import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; +import { CoreSites } from '@services/sites'; /** - * Display info about a module: dates and completion. + * Display info about a module: + * + * Description: + * Module descriptions are shortened by default, allowing the user to see the full description by clicking in it. + * + * Completion dates, status and buttons. + * + * You can add also add custom information that will be included at the end. */ @Component({ selector: 'core-course-module-info', templateUrl: 'core-course-module-info.html', styleUrls: ['course-module-info.scss'], }) -export class CoreCourseModuleInfoComponent { +export class CoreCourseModuleInfoComponent implements OnInit { @Input() module!: CoreCourseModule; // The module to render. - @Input() showManualCompletion = false; // Whether to show manual completion. + @Input() courseId!: number; // The courseId the module belongs to. + + @Input() component!: string; // Component for format text directive. + @Input() componentId!: string | number; // Component ID to use in conjunction with the component. + + @Input() description?: string | false; // The description to display. If false, no description will be shown. + @Output() completionChanged = new EventEmitter(); // Notify when completion changes. + modicon = ''; + showCompletion = false; // Whether to show completion. + + /** + * @inheritdoc + */ + async ngOnInit(): Promise { + this.modicon = await CoreCourseModuleDelegate.getModuleIconSrc(this.module.modname, this.module.modicon, this.module); + + this.showCompletion = CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11'); + } + } diff --git a/src/core/features/course/components/unsupported-module/core-course-unsupported-module.html b/src/core/features/course/components/unsupported-module/core-course-unsupported-module.html index 10fb79074..4e27e6c44 100644 --- a/src/core/features/course/components/unsupported-module/core-course-unsupported-module.html +++ b/src/core/features/course/components/unsupported-module/core-course-unsupported-module.html @@ -1,7 +1,6 @@ - - + + {{ 'core.whoops' | translate }} {{ 'core.uhoh' | translate }}
{{ 'addon.mod_survey.surveycompletednograph' | translate }}
{{ question.intro }}
{{ 'addon.mod_workshop.assignedassessmentsnone' | translate }}
- {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} -
+ {{ date.label }} {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} +