MOBILE-3810 module: Add basic info to core-course-module-info

main
Pau Ferrer Ocaña 2021-11-16 12:58:46 +01:00
parent 8a3ae5e081
commit dace9898d0
28 changed files with 365 additions and 409 deletions

View File

@ -1,15 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="assign && (description || (assign.introattachments && assign.introattachments.length))" <core-context-menu-item *ngIf="assign && (description || (assign.introattachments && assign.introattachments.length))"
[priority]="800" [content]="'core.moduleintro' | translate" (action)="expandDescription()" [priority]="800" [content]="'core.moduleintro' | translate" (action)="expandDescription()" iconAction="fas-arrow-right">
iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -31,26 +30,15 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
<ion-list inset="true" description *ngIf="assign && assign.introattachments && assign.introattachments.length">
<core-file *ngFor="let file of assign.introattachments" [file]="file" [component]="component" [componentId]="componentId">
</core-file>
</ion-list>
</core-course-module-info> </core-course-module-info>
<!-- Description and intro attachments. -->
<ion-card *ngIf="description">
<ion-item class="ion-text-wrap">
<ion-label>
<core-format-text [text]="description" [component]="component" [componentId]="componentId" maxHeight="120"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"
(onClick)="expandDescription($event)">
</core-format-text>
</ion-label>
</ion-item>
</ion-card>
<ion-card *ngIf="assign && assign.introattachments && assign.introattachments.length">
<core-file *ngFor="let file of assign.introattachments" [file]="file" [component]="component" [componentId]="componentId">
</core-file>
</ion-card>
<!-- Assign has something offline. --> <!-- Assign has something offline. -->
<ion-card class="core-warning-card" *ngIf="hasOffline"> <ion-card class="core-warning-card" *ngIf="hasOffline">
@ -90,8 +78,7 @@
</ion-item> </ion-item>
<!-- Summary of all submissions. --> <!-- Summary of all submissions. -->
<ion-item class="ion-text-wrap" *ngIf="summary && summary.participantcount" (click)="goToSubmissionList()" detail="true" <ion-item class="ion-text-wrap" *ngIf="summary && summary.participantcount" (click)="goToSubmissionList()" detail="true" button>
button>
<ion-label> <ion-label>
<h2 *ngIf="assign.teamsubmission">{{ 'addon.mod_assign.numberofteams' | translate }}</h2> <h2 *ngIf="assign.teamsubmission">{{ 'addon.mod_assign.numberofteams' | translate }}</h2>
<h2 *ngIf="!assign.teamsubmission">{{ 'addon.mod_assign.numberofparticipants' | translate }}</h2> <h2 *ngIf="!assign.teamsubmission">{{ 'addon.mod_assign.numberofparticipants' | translate }}</h2>
@ -109,48 +96,48 @@
<!-- Summary of submissions with draft status. --> <!-- Summary of submissions with draft status. -->
<ion-item class="ion-text-wrap" *ngIf="assign.submissiondrafts && summary && summary.submissionsenabled" <ion-item class="ion-text-wrap" *ngIf="assign.submissiondrafts && summary && summary.submissionsenabled"
[class.hide-detail]="!summary.submissiondraftscount" [class.hide-detail]="!summary.submissiondraftscount" detail="true" [button]="summary.submissiondraftscount"
detail="true"
[button]="summary.submissiondraftscount"
(click)="goToSubmissionList(submissionStatusDraft, !!summary.submissiondraftscount)"> (click)="goToSubmissionList(submissionStatusDraft, !!summary.submissiondraftscount)">
<ion-label><h2>{{ 'addon.mod_assign.numberofdraftsubmissions' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_assign.numberofdraftsubmissions' | translate }}</h2>
</ion-label>
<ion-badge slot="end" color="primary"> <ion-badge slot="end" color="primary">
<span aria-hidden="true">{{ summary.submissiondraftscount }}</span> <span aria-hidden="true">{{ summary.submissiondraftscount }}</span>
<span class="sr-only"> <span class="sr-only">
{{ 'addon.mod_assign.numberofdraftsubmissionscountdescription' | translate: {{ 'addon.mod_assign.numberofdraftsubmissionscountdescription' | translate:
{count: summary.submissiondraftscount} }} {count: summary.submissiondraftscount} }}
</span> </span>
</ion-badge> </ion-badge>
</ion-item> </ion-item>
<!-- Summary of submissions with submitted status. --> <!-- Summary of submissions with submitted status. -->
<ion-item class="ion-text-wrap" *ngIf="summary && summary.submissionsenabled" <ion-item class="ion-text-wrap" *ngIf="summary && summary.submissionsenabled"
[class.hide-detail]="!summary.submissionssubmittedcount" [class.hide-detail]="!summary.submissionssubmittedcount" detail="true" [button]="summary.submissionssubmittedcount"
detail="true"
[button]="summary.submissionssubmittedcount"
(click)="goToSubmissionList(submissionStatusSubmitted, !!summary.submissionssubmittedcount)"> (click)="goToSubmissionList(submissionStatusSubmitted, !!summary.submissionssubmittedcount)">
<ion-label><h2>{{ 'addon.mod_assign.numberofsubmittedassignments' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_assign.numberofsubmittedassignments' | translate }}</h2>
</ion-label>
<ion-badge slot="end" color="primary"> <ion-badge slot="end" color="primary">
<span aria-hidden="true">{{ summary.submissionssubmittedcount }}</span> <span aria-hidden="true">{{ summary.submissionssubmittedcount }}</span>
<span class="sr-only"> <span class="sr-only">
{{ 'addon.mod_assign.numberofsubmittedassignmentscountdescription' | translate: {{ 'addon.mod_assign.numberofsubmittedassignmentscountdescription' | translate:
{count: summary.submissionssubmittedcount} }} {count: summary.submissionssubmittedcount} }}
</span> </span>
</ion-badge> </ion-badge>
</ion-item> </ion-item>
<!-- Summary of submissions that need grading. --> <!-- Summary of submissions that need grading. -->
<ion-item class="ion-text-wrap" *ngIf="summary && summary.submissionsenabled && !assign.teamsubmission" <ion-item class="ion-text-wrap" *ngIf="summary && summary.submissionsenabled && !assign.teamsubmission"
[class.hide-detail]="!needsGradingAvailable" [class.hide-detail]="!needsGradingAvailable" detail="true" [button]="needsGradingAvailable"
detail="true"
[button]="needsGradingAvailable"
(click)="goToSubmissionList(needGrading, needsGradingAvailable)"> (click)="goToSubmissionList(needGrading, needsGradingAvailable)">
<ion-label><h2>{{ 'addon.mod_assign.numberofsubmissionsneedgrading' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_assign.numberofsubmissionsneedgrading' | translate }}</h2>
</ion-label>
<ion-badge slot="end" color="primary"> <ion-badge slot="end" color="primary">
<span aria-hidden="true">{{ summary.submissionsneedgradingcount }}</span> <span aria-hidden="true">{{ summary.submissionsneedgradingcount }}</span>
<span class="sr-only"> <span class="sr-only">
{{ 'addon.mod_assign.numberofsubmissionsneedgradingcountdescription' | translate: {{ 'addon.mod_assign.numberofsubmissionsneedgradingcountdescription' | translate:
{count: summary.submissionsneedgradingcount} }} {count: summary.submissionsneedgradingcount} }}
</span> </span>
</ion-badge> </ion-badge>
</ion-item> </ion-item>

View File

@ -4,12 +4,12 @@
<ion-icon name="fas-bookmark" slot="icon-only" aria-hidden="true"></ion-icon> <ion-icon name="fas-bookmark" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"></core-context-menu-item> iconAction="fas-external-link-alt" [showBrowserWarning]="false"></core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"></core-context-menu-item> (action)="expandDescription()" iconAction="fas-arrow-right"></core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"></core-context-menu-item> (action)="gotoBlog()"></core-context-menu-item>
<core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" <core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)"
[iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item> [iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item>
<core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="600" [content]="prefetchText" (action)="prefetch($event)" <core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="600" [content]="prefetchText" (action)="prefetch($event)"
@ -24,13 +24,10 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"></core-course-module-description>
<ion-card class="core-warning-card" *ngIf="warning"> <ion-card class="core-warning-card" *ngIf="warning">
<ion-item> <ion-item>
<ion-icon name="fas-exclamation-triangle" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-exclamation-triangle" slot="start" aria-hidden="true"></ion-icon>
@ -39,9 +36,8 @@
</ion-card> </ion-card>
<div class="ion-padding safe-area-padding-horizontal"> <div class="ion-padding safe-area-padding-horizontal">
<core-navigation-bar *ngIf="displayNavBar" [previous]="previousChapter?.id" <core-navigation-bar *ngIf="displayNavBar" [previous]="previousChapter?.id" [previousTitle]="previousNavBarTitle"
[previousTitle]="previousNavBarTitle" [next]="nextChapter?.id" [nextTitle]="nextNavBarTitle" [next]="nextChapter?.id" [nextTitle]="nextNavBarTitle" (action)="changeChapter($event)">
(action)="changeChapter($event)">
</core-navigation-bar> </core-navigation-bar>
<core-format-text [component]="component" [componentId]="componentId" [text]="chapterContent" contextLevel="module" <core-format-text [component]="component" [componentId]="componentId" [text]="chapterContent" contextLevel="module"
@ -51,9 +47,8 @@
<core-tag-list [tags]="tags"></core-tag-list> <core-tag-list [tags]="tags"></core-tag-list>
</div> </div>
<core-navigation-bar *ngIf="displayNavBar" [previous]="previousChapter?.id" <core-navigation-bar *ngIf="displayNavBar" [previous]="previousChapter?.id" [previousTitle]="previousNavBarTitle"
[previousTitle]="previousNavBarTitle" [next]="nextChapter?.id" [nextTitle]="nextNavBarTitle" [next]="nextChapter?.id" [nextTitle]="nextNavBarTitle" (action)="changeChapter($event)"></core-navigation-bar>
(action)="changeChapter($event)"></core-navigation-bar>
</div> </div>
</core-loading> </core-loading>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -27,14 +27,10 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<ion-card *ngIf="chatInfo" class="core-info-card"> <ion-card *ngIf="chatInfo" class="core-info-card">
<ion-item> <ion-item>
<ion-icon name="fas-clock" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-clock" slot="start" aria-hidden="true"></ion-icon>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -29,14 +29,10 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Activity availability messages --> <!-- Activity availability messages -->
<ion-card class="core-info-card" *ngIf="choiceNotOpenYet"> <ion-card class="core-info-card" *ngIf="choiceNotOpenYet">
<ion-item> <ion-item>
@ -54,8 +50,7 @@
<ion-label> <ion-label>
<p *ngIf="options.length"> <p *ngIf="options.length">
{{ 'addon.mod_choice.yourselection' | translate }} {{ 'addon.mod_choice.yourselection' | translate }}
<core-format-text [text]="options[0].text" contextLevel="module" [contextInstanceId]="module.id" <core-format-text [text]="options[0].text" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
[courseId]="courseId">
</core-format-text> </core-format-text>
</p> </p>
<p>{{ 'addon.mod_choice.expired' | translate:{$a: closeTimeReadable} }}</p> <p>{{ 'addon.mod_choice.expired' | translate:{$a: closeTimeReadable} }}</p>
@ -145,10 +140,12 @@
</p> </p>
</ion-label> </ion-label>
</ion-item-divider> </ion-item-divider>
<ion-item *ngFor="let user of result.userresponses" core-user-link [courseId]="courseId" <ion-item *ngFor="let user of result.userresponses" core-user-link [courseId]="courseId" [userId]="user.userid"
[userId]="user.userid" [attr.aria-label]="user.fullname" class="ion-text-wrap"> [attr.aria-label]="user.fullname" class="ion-text-wrap">
<core-user-avatar [user]="user" slot="start" [courseId]="courseId"></core-user-avatar> <core-user-avatar [user]="user" slot="start" [courseId]="courseId"></core-user-avatar>
<ion-label><p>{{user.fullname}}</p></ion-label> <ion-label>
<p>{{user.fullname}}</p>
</ion-label>
</ion-item> </ion-item>
</ion-item-group> </ion-item-group>
</ion-col> </ion-col>
@ -159,7 +156,9 @@
<ion-card class="core-info-card" *ngIf="!canSeeResults && !choiceNotOpenYet"> <ion-card class="core-info-card" *ngIf="!canSeeResults && !choiceNotOpenYet">
<ion-item> <ion-item>
<ion-icon name="fas-info-circle" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-info-circle" slot="start" aria-hidden="true"></ion-icon>
<ion-label><p>{{ 'addon.mod_choice.noresultsviewable' | translate }}</p></ion-label> <ion-label>
<p>{{ 'addon.mod_choice.noresultsviewable' | translate }}</p>
</ion-label>
</ion-item> </ion-item>
</ion-card> </ion-card>
</core-loading> </core-loading>

View File

@ -4,28 +4,27 @@
<ion-icon name="fas-search" slot="icon-only" aria-hidden="true"></ion-icon> <ion-icon name="fas-search" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !(hasOffline || hasOfflineRatings) && isOnline" [priority]="700" <core-context-menu-item *ngIf="loaded && !(hasOffline || hasOfflineRatings) && isOnline" [priority]="700"
[content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
[closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && (hasOffline || hasOfflineRatings) && isOnline" [priority]="600" <core-context-menu-item *ngIf="loaded && (hasOffline || hasOfflineRatings) && isOnline" [priority]="600"
[content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [iconAction]="syncIcon" [content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [iconAction]="syncIcon"
[closeOnClick]="false"> [closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item [priority]="500" *ngIf="canAdd" [content]="'addon.mod_data.addentries' | translate" <core-context-menu-item [priority]="500" *ngIf="canAdd" [content]="'addon.mod_data.addentries' | translate" iconAction="fas-plus"
iconAction="fas-plus" (action)="gotoAddEntries()"> (action)="gotoAddEntries()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item [priority]="400" *ngIf="firstEntry" [content]="'addon.mod_data.single' | translate" <core-context-menu-item [priority]="400" *ngIf="firstEntry" [content]="'addon.mod_data.single' | translate" iconAction="fas-file"
iconAction="fas-file" (action)="gotoEntry(firstEntry)"> (action)="gotoEntry(firstEntry)">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="300" [content]="prefetchText" (action)="prefetch($event)" <core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="300" [content]="prefetchText" (action)="prefetch($event)"
[iconAction]="prefetchStatusIcon" [closeOnClick]="false"> [iconAction]="prefetchStatusIcon" [closeOnClick]="false">
@ -40,14 +39,10 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Data done in offline but not synchronized --> <!-- Data done in offline but not synchronized -->
<ion-card class="core-warning-card" *ngIf="hasOffline || hasOfflineRatings"> <ion-card class="core-warning-card" *ngIf="hasOffline || hasOfflineRatings">
<ion-item> <ion-item>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -29,22 +29,18 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<core-tabs [hideUntil]="tabsReady" [selectedIndex]="firstSelectedTab"> <core-tabs [hideUntil]="tabsReady" [selectedIndex]="firstSelectedTab">
<core-tab [title]="'addon.mod_feedback.overview' | translate" id="overview" (ionSelect)="tabChanged('overview')"> <core-tab [title]="'addon.mod_feedback.overview' | translate" id="overview" (ionSelect)="tabChanged('overview')">
<ng-template> <ng-template>
<ng-container *ngTemplateOutlet="tabOverview"></ng-container> <ng-container *ngTemplateOutlet="tabOverview"></ng-container>
</ng-template> </ng-template>
</core-tab> </core-tab>
<core-tab *ngIf="showAnalysis && access && access.canviewreports" id="analysis" <core-tab *ngIf="showAnalysis && access && access.canviewreports" id="analysis" [title]="'addon.mod_feedback.analysis' | translate"
[title]="'addon.mod_feedback.analysis' | translate" (ionSelect)="tabChanged('analysis')"> (ionSelect)="tabChanged('analysis')">
<ng-template> <ng-template>
<ng-container *ngTemplateOutlet="tabAnalysis"></ng-container> <ng-container *ngTemplateOutlet="tabAnalysis"></ng-container>
</ng-template> </ng-template>
@ -73,10 +69,8 @@
</ion-select-option> </ion-select-option>
</ion-select> </ion-select>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap" (click)="openRespondents()" <ion-item class="ion-text-wrap" (click)="openRespondents()" [class.hide-detail]="!(access.canviewreports && completedCount > 0)"
[class.hide-detail]="!(access.canviewreports && completedCount > 0)" detail="true" [button]="access.canviewreports && completedCount > 0">
detail="true"
[button]="access.canviewreports && completedCount > 0">
<ion-label> <ion-label>
<h2>{{ 'addon.mod_feedback.completed_feedbacks' | translate }}</h2> <h2>{{ 'addon.mod_feedback.completed_feedbacks' | translate }}</h2>
</ion-label> </ion-label>
@ -87,8 +81,8 @@
</span> </span>
</ion-badge> </ion-badge>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap" *ngIf="!access.isanonymous && access.canviewreports" (click)="openNonRespondents()" <ion-item class="ion-text-wrap" *ngIf="!access.isanonymous && access.canviewreports" (click)="openNonRespondents()" detail="true"
detail="true" button> button>
<ion-label> <ion-label>
<h2>{{ 'addon.mod_feedback.show_nonrespondents' | translate }}</h2> <h2>{{ 'addon.mod_feedback.show_nonrespondents' | translate }}</h2>
</ion-label> </ion-label>
@ -208,12 +202,12 @@
<ion-label> <ion-label>
<p class="item-heading"> <p class="item-heading">
{{item.num}}. <core-format-text [component]="component" [componentId]="componentId" [text]="item.name" {{item.num}}. <core-format-text [component]="component" [componentId]="componentId" [text]="item.name"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-format-text> </core-format-text>
</p> </p>
<p> <p>
<core-format-text [component]="component" [componentId]="componentId" [text]="item.label" <core-format-text [component]="component" [componentId]="componentId" [text]="item.label" contextLevel="module"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> [contextInstanceId]="module.id" [courseId]="courseId">
</core-format-text> </core-format-text>
</p> </p>
<ng-container [ngSwitch]="item.templateName"> <ng-container [ngSwitch]="item.templateName">
@ -232,8 +226,7 @@
</ng-container> </ng-container>
<ng-container *ngSwitchCase="'chart'"> <ng-container *ngSwitchCase="'chart'">
<core-chart [type]="item.chartType" [data]="item.chartData" [labels]="item.labels" height="300" <core-chart [type]="item.chartType" [data]="item.chartData" [labels]="item.labels" height="300"
contextLevel="module" [contextInstanceId]="module.id" [wsNotFiltered]="true" contextLevel="module" [contextInstanceId]="module.id" [wsNotFiltered]="true" [courseId]="courseId">
[courseId]="courseId">
</core-chart> </core-chart>
<p *ngIf="item.average"> <p *ngIf="item.average">
{{ 'addon.mod_feedback.average' | translate }}: {{item.average | number : '1.2-2'}} {{ 'addon.mod_feedback.average' | translate }}: {{item.average | number : '1.2-2'}}

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="!subfolder" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="!subfolder" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -26,14 +26,11 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
<h3 *ngIf="subfolder" title>{{subfolder.filename}}</h3>
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<ion-list *ngIf="contents && (contents.files.length + contents.folders.length > 0)"> <ion-list *ngIf="contents && (contents.files.length + contents.folders.length > 0)">
<ng-container *ngFor="let folder of contents.folders"> <ng-container *ngFor="let folder of contents.folders">
<ion-item class="item-file" (click)="openFolder(folder)" detail="true" button> <ion-item class="item-file" (click)="openFolder(folder)" detail="true" button>

View File

@ -1,38 +1,30 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl" iconAction="fas-external-link-alt" iconAction="fas-external-link-alt" [showBrowserWarning]="false">
[showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
[priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item <core-context-menu-item *ngIf="discussions.loaded && !(hasOffline || hasOfflineRatings) && isOnline" [priority]="700"
*ngIf="discussions.loaded && !(hasOffline || hasOfflineRatings) && isOnline" [content]="'addon.mod_forum.refreshdiscussions' | translate" [iconAction]="refreshIcon" [closeOnClick]="false"
[priority]="700" [content]="'addon.mod_forum.refreshdiscussions' | translate" [iconAction]="refreshIcon" [closeOnClick]="false"
(action)="doRefresh(null, $event)"> (action)="doRefresh(null, $event)">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item <core-context-menu-item *ngIf="discussions.loaded && (hasOffline || hasOfflineRatings) && isOnline" [priority]="600"
*ngIf="discussions.loaded && (hasOffline || hasOfflineRatings) && isOnline" [content]="'core.settings.synchronizenow' | translate" [iconAction]="syncIcon" [closeOnClick]="false"
[priority]="600" [content]="'core.settings.synchronizenow' | translate" [iconAction]="syncIcon" [closeOnClick]="false"
(action)="doRefresh(null, $event, true)"> (action)="doRefresh(null, $event, true)">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="prefetchStatusIcon" <core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="500" [content]="prefetchText" [iconAction]="prefetchStatusIcon"
[priority]="500" [content]="prefetchText" [iconAction]="prefetchStatusIcon" [closeOnClick]="false" [closeOnClick]="false" (action)="prefetch($event)">
(action)="prefetch($event)">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="size" <core-context-menu-item *ngIf="size" iconDescription="fas-archive" iconAction="fas-trash" [priority]="400"
iconDescription="fas-archive" iconAction="fas-trash" [content]="'core.clearstoreddata' | translate:{$a: size}" [closeOnClick]="false" (action)="removeFiles($event)">
[priority]="400" [content]="'core.clearstoreddata' | translate:{$a: size}" [closeOnClick]="false"
(action)="removeFiles($event)">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="sortingAvailable" <core-context-menu-item *ngIf="sortingAvailable" iconAction="fas-sort" [priority]="300" [content]="'core.sort' | translate"
iconAction="fas-sort"
[priority]="300" [content]="'core.sort' | translate"
(action)="showSortOrderSelector()"> (action)="showSortOrderSelector()">
</core-context-menu-item> </core-context-menu-item>
</core-context-menu> </core-context-menu>
@ -46,15 +38,16 @@
<core-loading [hideUntil]="discussions.loaded"> <core-loading [hideUntil]="discussions.loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()"
(completionChanged)="onCompletionChange()"> [description]="forum && forum.type != 'single' && description" [component]="component"
[componentId]="componentId" [courseId]="courseId">
<ion-item>
<ion-label>
{{descriptionNote}}
</ion-label>
</ion-item>
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="forum && forum.type != 'single'"
[description]="description" [component]="component" [componentId]="componentId" [note]="descriptionNote"
contextLevel="module" [contextInstanceId]="module && module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Forum discussions found to be synchronized --> <!-- Forum discussions found to be synchronized -->
<ion-card class="core-warning-card" *ngIf="hasOffline || hasOfflineRatings"> <ion-card class="core-warning-card" *ngIf="hasOffline || hasOfflineRatings">
<ion-item> <ion-item>
@ -72,23 +65,17 @@
</ion-card> </ion-card>
<ng-container *ngIf="forum"> <ng-container *ngIf="forum">
<core-empty-box *ngIf="discussions.empty" icon="far-comments" <core-empty-box *ngIf="discussions.empty" icon="far-comments" [message]="'addon.mod_forum.forumnodiscussionsyet' | translate">
[message]="'addon.mod_forum.forumnodiscussionsyet' | translate">
</core-empty-box> </core-empty-box>
<div *ngIf="!discussions.empty && sortingAvailable && selectedSortOrder" class="ion-text-wrap"> <div *ngIf="!discussions.empty && sortingAvailable && selectedSortOrder" class="ion-text-wrap">
<core-combobox <core-combobox [modalOptions]="sortOrderSelectorModalOptions" listboxId="addon-mod-forum-sort-selector"
[modalOptions]="sortOrderSelectorModalOptions" [label]="('core.sort' | translate)" (onChange)="setSortOrder($event)" [selection]="selectedSortOrder.label | translate"
listboxId="addon-mod-forum-sort-selector"
[label]="('core.sort' | translate)"
(onChange)="setSortOrder($event)"
[selection]="selectedSortOrder.label | translate"
interface="modal"> interface="modal">
</core-combobox> </core-combobox>
</div> </div>
<ion-item *ngFor="let discussion of discussions.items" <ion-item *ngFor="let discussion of discussions.items" class="addon-mod-forum-discussion" detail="true"
class="addon-mod-forum-discussion" detail="true"
[lines]="discussion.groupname && 'none'" [attr.aria-current]="discussions.getItemAriaCurrent(discussion)" [lines]="discussion.groupname && 'none'" [attr.aria-current]="discussions.getItemAriaCurrent(discussion)"
(click)="discussions.select(discussion)" button> (click)="discussions.select(discussion)" button>
<ion-label> <ion-label>
@ -98,15 +85,12 @@
[attr.aria-label]="'addon.mod_forum.discussionpinned' | translate"></ion-icon> [attr.aria-label]="'addon.mod_forum.discussionpinned' | translate"></ion-icon>
<ion-icon name="fas-star" class="addon-forum-star" *ngIf="!discussion.pinned && discussion.starred" <ion-icon name="fas-star" class="addon-forum-star" *ngIf="!discussion.pinned && discussion.starred"
[attr.aria-label]="'addon.mod_forum.favourites' | translate"></ion-icon> [attr.aria-label]="'addon.mod_forum.favourites' | translate"></ion-icon>
<core-format-text <core-format-text [text]="discussion.subject" contextLevel="module" [contextInstanceId]="module && module.id"
[text]="discussion.subject" [courseId]="courseId">
contextLevel="module" [contextInstanceId]="module && module.id" [courseId]="courseId">
</core-format-text> </core-format-text>
</p> </p>
<ion-button *ngIf="canPin || discussion.canlock || discussion.canfavourite" <ion-button *ngIf="canPin || discussion.canlock || discussion.canfavourite" fill="clear" color="dark"
fill="clear" color="dark" [attr.aria-label]="('core.displayoptions' | translate)" (click)="showOptionsMenu($event, discussion)">
[attr.aria-label]="('core.displayoptions' | translate)"
(click)="showOptionsMenu($event, discussion)">
<ion-icon name="ellipsis-vertical" slot="icon-only" aria-hidden="true"> <ion-icon name="ellipsis-vertical" slot="icon-only" aria-hidden="true">
</ion-icon> </ion-icon>
</ion-button> </ion-button>
@ -158,8 +142,7 @@
</ion-label> </ion-label>
</ion-item> </ion-item>
<core-infinite-loading <core-infinite-loading [enabled]="discussions.onlineLoaded && !discussions.completed" [error]="discussions.fetchFailed"
[enabled]="discussions.onlineLoaded && !discussions.completed" [error]="discussions.fetchFailed"
(action)="fetchMoreDiscussions($event)"> (action)="fetchMoreDiscussions($event)">
</core-infinite-loading> </core-infinite-loading>
</ng-container> </ng-container>

View File

@ -10,18 +10,17 @@
</ion-button> </ion-button>
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !(hasOffline || hasOfflineRatings) && isOnline" [priority]="700" <core-context-menu-item *ngIf="loaded && !(hasOffline || hasOfflineRatings) && isOnline" [priority]="700"
[content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
[closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && (hasOffline || hasOfflineRatings) && isOnline" [priority]="600" <core-context-menu-item *ngIf="loaded && (hasOffline || hasOfflineRatings) && isOnline" [priority]="600"
(action)="doRefresh(null, $event, true)" [content]="'core.settings.synchronizenow' | translate" [iconAction]="syncIcon" (action)="doRefresh(null, $event, true)" [content]="'core.settings.synchronizenow' | translate" [iconAction]="syncIcon"
@ -51,14 +50,10 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion && !isSearch" [module]="module" [showManualCompletion]="true" <core-course-module-info *ngIf="!isSearch" [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="!isSearch" [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Has offline data to be synchronized --> <!-- Has offline data to be synchronized -->
<ion-card class="core-warning-card" *ngIf="hasOffline || hasOfflineRatings"> <ion-card class="core-warning-card" *ngIf="hasOffline || hasOfflineRatings">
<ion-item> <ion-item>
@ -69,7 +64,9 @@
<ion-list *ngIf="!isSearch && entries.offlineEntries.length > 0"> <ion-list *ngIf="!isSearch && entries.offlineEntries.length > 0">
<ion-item-divider> <ion-item-divider>
<ion-label><h2>{{ 'addon.mod_glossary.entriestobesynced' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_glossary.entriestobesynced' | translate }}</h2>
</ion-label>
</ion-item-divider> </ion-item-divider>
<ion-item *ngFor="let entry of entries.offlineEntries" (click)="entries.select(entry)" detail="false" button <ion-item *ngFor="let entry of entries.offlineEntries" (click)="entries.select(entry)" detail="false" button
[attr.aria-current]="entries.getItemAriaCurrent(entry)"> [attr.aria-current]="entries.getItemAriaCurrent(entry)">
@ -84,11 +81,12 @@
<ion-list *ngIf="entries.onlineEntries.length > 0"> <ion-list *ngIf="entries.onlineEntries.length > 0">
<ng-container *ngFor="let entry of entries.onlineEntries; let index = index"> <ng-container *ngFor="let entry of entries.onlineEntries; let index = index">
<ion-item-divider *ngIf="getDivider && showDivider(entry, entries.onlineEntries[index - 1])"> <ion-item-divider *ngIf="getDivider && showDivider(entry, entries.onlineEntries[index - 1])">
<ion-label><h2>{{ getDivider!(entry) }}</h2></ion-label> <ion-label>
<h2>{{ getDivider!(entry) }}</h2>
</ion-label>
</ion-item-divider> </ion-item-divider>
<ion-item button (click)="entries.select(entry)" [attr.aria-current]="entries.getItemAriaCurrent(entry)" <ion-item button (click)="entries.select(entry)" [attr.aria-current]="entries.getItemAriaCurrent(entry)" detail="false">
detail="false">
<ion-label> <ion-label>
<core-format-text [text]="entry.concept" contextLevel="module" [contextInstanceId]="glossary!.coursemodule" <core-format-text [text]="entry.concept" contextLevel="module" [contextInstanceId]="glossary!.coursemodule"
[courseId]="courseId"> [courseId]="courseId">

View File

@ -5,18 +5,17 @@
[priority]="1000" [content]="'addon.mod_h5pactivity.review_my_attempts' | translate" (action)="viewMyAttempts()" [priority]="1000" [content]="'addon.mod_h5pactivity.review_my_attempts' | translate" (action)="viewMyAttempts()"
iconAction="stats-chart"> iconAction="stats-chart">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="canViewAllAttempts" <core-context-menu-item *ngIf="canViewAllAttempts" [priority]="1000" [content]="'addon.mod_h5pactivity.review_attempts' | translate"
[priority]="1000" [content]="'addon.mod_h5pactivity.review_attempts' | translate" (action)="viewAllAttempts()" (action)="viewAllAttempts()" iconAction="stats-chart">
iconAction="stats-chart">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -37,14 +36,10 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Offline data stored. --> <!-- Offline data stored. -->
<ion-card class="core-warning-card" *ngIf="hasOffline"> <ion-card class="core-warning-card" *ngIf="hasOffline">
<ion-item> <ion-item>
@ -79,8 +74,7 @@
</ion-item> </ion-item>
<!-- Button to download the package. --> <!-- Button to download the package. -->
<ion-button *ngIf="!downloading && needsDownload" class="ion-text-wrap ion-margin" expand="block" <ion-button *ngIf="!downloading && needsDownload" class="ion-text-wrap ion-margin" expand="block" (click)="downloadAndPlay($event)">
(click)="downloadAndPlay($event)">
{{ 'addon.mod_h5pactivity.downloadh5pfile' | translate }} {{ 'addon.mod_h5pactivity.downloadh5pfile' | translate }}
</ion-button> </ion-button>

View File

@ -4,14 +4,14 @@
<ion-icon name="fas-bookmark" slot="icon-only" aria-hidden="true"></ion-icon> <ion-icon name="fas-bookmark" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" <core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)"
[iconAction]="refreshIcon" [closeOnClick]="false"> [iconAction]="refreshIcon" [closeOnClick]="false">
@ -29,8 +29,7 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()">
(completionChanged)="onCompletionChange()">
</core-course-module-info> </core-course-module-info>
<ion-card class="core-warning-card" *ngIf="warning"> <ion-card class="core-warning-card" *ngIf="warning">

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -33,14 +33,10 @@
<ng-template> <ng-template>
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Prevent access messages. Only show the first one. --> <!-- Prevent access messages. Only show the first one. -->
<ion-card class="core-info-card" *ngIf="lesson && preventReasons.length"> <ion-card class="core-info-card" *ngIf="lesson && preventReasons.length">
<ion-item> <ion-item>
@ -132,13 +128,11 @@
<ng-container *ngIf="!leftDuringTimed && !finishedOffline"> <ng-container *ngIf="!leftDuringTimed && !finishedOffline">
<!-- User hasn't left during the session, show a start button. --> <!-- User hasn't left during the session, show a start button. -->
<ion-button class="ion-text-wrap ion-margin" expand="block" *ngIf="!canManage" <ion-button class="ion-text-wrap ion-margin" expand="block" *ngIf="!canManage" (click)="start(false)">
(click)="start(false)">
{{ 'core.start' | translate }} {{ 'core.start' | translate }}
<ion-icon name="fas-chevron-right" slot="end" aria-hidden="true"></ion-icon> <ion-icon name="fas-chevron-right" slot="end" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
<ion-button class="ion-text-wrap ion-margin" expand="block" *ngIf="canManage" <ion-button class="ion-text-wrap ion-margin" expand="block" *ngIf="canManage" (click)="start(false)">
(click)="start(false)">
{{ 'addon.mod_lesson.preview' | translate }} {{ 'addon.mod_lesson.preview' | translate }}
<ion-icon name="fas-search" slot="end" aria-hidden="true"></ion-icon> <ion-icon name="fas-search" slot="end" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
@ -295,8 +289,8 @@
<ion-card-title>{{ 'addon.mod_lesson.overview' | translate }}</ion-card-title> <ion-card-title>{{ 'addon.mod_lesson.overview' | translate }}</ion-card-title>
</ion-card-header> </ion-card-header>
<ion-item class="ion-text-wrap" *ngFor="let student of overview.students" button <ion-item class="ion-text-wrap" *ngFor="let student of overview.students" button (click)="openRetake(student.id)"
(click)="openRetake(student.id)" detail="true"> detail="true">
<core-user-avatar [user]="student" slot="start" [userId]="student.id" [courseId]="courseId"> <core-user-avatar [user]="student" slot="start" [userId]="student.id" [courseId]="courseId">
</core-user-avatar> </core-user-avatar>
<ion-label> <ion-label>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -20,14 +20,11 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()"
(completionChanged)="onCompletionChange()"> [description]="lti && lti.showdescriptionlaunch && description" [component]="component" [componentId]="componentId"
[courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="lti && lti.showdescriptionlaunch" [description]="description" [component]="component"
[componentId]="componentId" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<div class="ion-padding"> <div class="ion-padding">
<ion-button expand="block" (click)="launch()"> <ion-button expand="block" (click)="launch()">
<ion-icon name="fas-external-link-alt" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-external-link-alt" slot="start" aria-hidden="true"></ion-icon>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" <core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)"
[iconAction]="refreshIcon" [closeOnClick]="false"> [iconAction]="refreshIcon" [closeOnClick]="false">
@ -26,14 +26,10 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="displayDescription && description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="displayDescription" [description]="description" [component]="component"
[componentId]="componentId" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<ion-card class="core-warning-card" *ngIf="warning"> <ion-card class="core-warning-card" *ngIf="warning">
<ion-item> <ion-item>
<ion-icon name="fas-exclamation-triangle" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-exclamation-triangle" slot="start" aria-hidden="true"></ion-icon>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" [iconAction]="'far-newspaper'"
[iconAction]="'far-newspaper'" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -29,19 +29,17 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Access rules description messages. --> <!-- Access rules description messages. -->
<ion-card *ngIf="gradeMethodReadable || accessRules.length || syncTime"> <ion-card *ngIf="gradeMethodReadable || accessRules.length || syncTime">
<ion-list> <ion-list>
<ion-item class="ion-text-wrap" *ngFor="let rule of accessRules"> <ion-item class="ion-text-wrap" *ngFor="let rule of accessRules">
<ion-label><p>{{ rule }}</p></ion-label> <ion-label>
<p>{{ rule }}</p>
</ion-label>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap" *ngIf="gradeMethodReadable"> <ion-item class="ion-text-wrap" *ngIf="gradeMethodReadable">
<ion-label> <ion-label>
@ -55,7 +53,7 @@
<p>{{ 'addon.mod_quiz.outof' | translate: { $a: { <p>{{ 'addon.mod_quiz.outof' | translate: { $a: {
grade: bestGrade.gradetopass, grade: bestGrade.gradetopass,
maxgrade: quiz.gradeFormatted maxgrade: quiz.gradeFormatted
} } }}</p> } } }}</p>
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap" *ngIf="syncTime"> <ion-item class="ion-text-wrap" *ngIf="syncTime">
@ -96,15 +94,9 @@
</ion-item> </ion-item>
<div role="rowgroup"> <div role="rowgroup">
<!-- List of attempts. --> <!-- List of attempts. -->
<ion-item <ion-item button detail="true" *ngFor="let attempt of attempts" class="ion-text-wrap"
button [ngClass]='{"addon-mod_quiz-highlighted": attempt.highlightGrade}' [attr.aria-label]="'core.seemoredetail' | translate"
detail="true" (click)="viewAttempt(attempt.id)">
*ngFor="let attempt of attempts"
class="ion-text-wrap"
[ngClass]='{"addon-mod_quiz-highlighted": attempt.highlightGrade}'
[attr.aria-label]="'core.seemoredetail' | translate"
(click)="viewAttempt(attempt.id)"
>
<ion-label> <ion-label>
<ion-row class="ion-align-items-center" role="row"> <ion-row class="ion-align-items-center" role="row">
<ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn && attempt.preview" role="cell"> <ion-col class="ion-text-center" *ngIf="quiz.showAttemptColumn && attempt.preview" role="cell">
@ -142,17 +134,21 @@
<ion-item class="ion-text-wrap" *ngIf="gradebookFeedback"> <ion-item class="ion-text-wrap" *ngIf="gradebookFeedback">
<ion-label> <ion-label>
<p class="item-heading">{{ 'addon.mod_quiz.comment' | translate }}</p> <p class="item-heading">{{ 'addon.mod_quiz.comment' | translate }}</p>
<p><core-format-text [component]="component" [componentId]="componentId" [text]="gradebookFeedback" <p>
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> <core-format-text [component]="component" [componentId]="componentId" [text]="gradebookFeedback"
</core-format-text></p> contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-format-text>
</p>
</ion-label> </ion-label>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap" *ngIf="quiz.showFeedbackColumn && overallFeedback"> <ion-item class="ion-text-wrap" *ngIf="quiz.showFeedbackColumn && overallFeedback">
<ion-label> <ion-label>
<p class="item-heading">{{ 'addon.mod_quiz.overallfeedback' | translate }}</p> <p class="item-heading">{{ 'addon.mod_quiz.overallfeedback' | translate }}</p>
<p><core-format-text [component]="component" [componentId]="componentId" [text]="overallFeedback" <p>
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> <core-format-text [component]="component" [componentId]="componentId" [text]="overallFeedback" contextLevel="module"
</core-format-text></p> [contextInstanceId]="module.id" [courseId]="courseId">
</core-format-text>
</p>
</ion-label> </ion-label>
</ion-item> </ion-item>
</ion-list> </ion-list>
@ -163,10 +159,14 @@
<ion-list> <ion-list>
<!-- Error messages. --> <!-- Error messages. -->
<ion-item class="ion-text-wrap core-danger-item addon-mod_quiz-prevent-messages" *ngFor="let message of preventMessages"> <ion-item class="ion-text-wrap core-danger-item addon-mod_quiz-prevent-messages" *ngFor="let message of preventMessages">
<ion-label><p>{{ message }}</p></ion-label> <ion-label>
<p>{{ message }}</p>
</ion-label>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap core-danger-item addon-mod_quiz-no-questions" *ngIf="quiz.hasquestions === 0"> <ion-item class="ion-text-wrap core-danger-item addon-mod_quiz-no-questions" *ngIf="quiz.hasquestions === 0">
<ion-label><p>{{ 'addon.mod_quiz.noquestions' | translate }}</p></ion-label> <ion-label>
<p>{{ 'addon.mod_quiz.noquestions' | translate }}</p>
</ion-label>
</ion-item> </ion-item>
<ion-item class="ion-text-wrap core-danger-item addon-mod_quiz-unsupported-questions" <ion-item class="ion-text-wrap core-danger-item addon-mod_quiz-unsupported-questions"
*ngIf="!hasSupportedQuestions && unsupportedQuestions.length"> *ngIf="!hasSupportedQuestions && unsupportedQuestions.length">
@ -226,7 +226,9 @@
<!-- Spinner shown while downloading or calculating. --> <!-- Spinner shown while downloading or calculating. -->
<ion-item class="ion-text-center" *ngIf="showStatusSpinner"> <ion-item class="ion-text-center" *ngIf="showStatusSpinner">
<ion-label><ion-spinner [attr.aria-label]="'core.loading' | translate"></ion-spinner></ion-label> <ion-label>
<ion-spinner [attr.aria-label]="'core.loading' | translate"></ion-spinner>
</ion-label>
</ion-item> </ion-item>
</ion-list> </ion-list>
</ion-card> </ion-card>

View File

@ -1,12 +1,12 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"></core-context-menu-item> iconAction="fas-external-link-alt" [showBrowserWarning]="false"></core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"></core-context-menu-item> (action)="expandDescription()" iconAction="fas-arrow-right"></core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"></core-context-menu-item> (action)="gotoBlog()"></core-context-menu-item>
<core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" <core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)"
[iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item> [iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item>
<core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="600" [content]="prefetchText" (action)="prefetch($event)" <core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="600" [content]="prefetchText" (action)="prefetch($event)"
@ -21,15 +21,11 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding core-loading-fullheight"> <core-loading [hideUntil]="loaded" class="safe-area-padding core-loading-fullheight">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" [courseId]="courseId" (completionChanged)="onCompletionChange()"
(completionChanged)="onCompletionChange()"> [description]="mode != 'iframe' && (mode != 'embedded' || displayDescription) && description" [component]="component"
[componentId]="componentId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="mode != 'iframe' && (mode != 'embedded' || displayDescription)"
[description]="description" [component]="component" [componentId]="componentId" contextLevel="module"
[contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<ion-card class="core-warning-card" *ngIf="warning"> <ion-card class="core-warning-card" *ngIf="warning">
<ion-item> <ion-item>
<ion-icon name="fas-exclamation-triangle" slot="start" aria-hidden="true"></ion-icon> <ion-icon name="fas-exclamation-triangle" slot="start" aria-hidden="true"></ion-icon>

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -29,14 +29,10 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Warning message. --> <!-- Warning message. -->
<ion-card class="core-info-card" *ngIf="scorm && scorm.warningMessage"> <ion-card class="core-info-card" *ngIf="scorm && scorm.warningMessage">
<ion-item> <ion-item>
@ -134,8 +130,8 @@
<ion-list> <ion-list>
<ion-item class="ion-text-wrap" *ngIf="organizations.length > 1"> <ion-item class="ion-text-wrap" *ngIf="organizations.length > 1">
<ion-label>{{ 'addon.mod_scorm.organizations' | translate }}</ion-label> <ion-label>{{ 'addon.mod_scorm.organizations' | translate }}</ion-label>
<ion-select [(ngModel)]="currentOrganization.identifier" (ionChange)="loadOrganization()" <ion-select [(ngModel)]="currentOrganization.identifier" (ionChange)="loadOrganization()" interface="action-sheet"
interface="action-sheet" [interfaceOptions]="{header: 'addon.mod_scorm.organizations' | translate}"> [interfaceOptions]="{header: 'addon.mod_scorm.organizations' | translate}">
<ion-select-option *ngFor="let org of organizations" [value]="org.identifier"> <ion-select-option *ngFor="let org of organizations" [value]="org.identifier">
{{ org.title }} {{ org.title }}
</ion-select-option> </ion-select-option>
@ -155,8 +151,7 @@
<p>{{ currentOrganization.title }}</p> <p>{{ currentOrganization.title }}</p>
<div *ngFor="let sco of toc" class="core-padding-{{sco.level}} addon-mod_scorm-type-{{sco.scormtype}}"> <div *ngFor="let sco of toc" class="core-padding-{{sco.level}} addon-mod_scorm-type-{{sco.scormtype}}">
<p *ngIf="sco.isvisible"> <p *ngIf="sco.isvisible">
<ion-icon *ngIf="sco.icon" [name]="sco.icon.icon" [attr.aria-label]="sco.icon.description" <ion-icon *ngIf="sco.icon" [name]="sco.icon.icon" [attr.aria-label]="sco.icon.description" slot="start">
slot="start">
</ion-icon> </ion-icon>
<button class="as-link" *ngIf="sco.prereq && sco.launch" (click)="open($event, false, sco.id)"> <button class="as-link" *ngIf="sco.prereq && sco.launch" (click)="open($event, false, sco.id)">
<core-format-text [text]="sco.title" contextLevel="module" [contextInstanceId]="module.id" <core-format-text [text]="sco.title" contextLevel="module" [contextInstanceId]="module.id"
@ -205,8 +200,7 @@
<ion-list> <ion-list>
<ng-container *ngIf="!downloading && !skip"> <ng-container *ngIf="!downloading && !skip">
<!-- Create new attempt --> <!-- Create new attempt -->
<ion-item class="ion-text-wrap" <ion-item class="ion-text-wrap" *ngIf="!scorm.forcenewattempt && numAttempts > 0 && !incomplete && attemptsLeft > 0">
*ngIf="!scorm.forcenewattempt && numAttempts > 0 && !incomplete && attemptsLeft > 0">
<ion-label>{{ 'addon.mod_scorm.newattempt' | translate }}</ion-label> <ion-label>{{ 'addon.mod_scorm.newattempt' | translate }}</ion-label>
<ion-checkbox slot="end" name="newAttempt" [(ngModel)]="startNewAttempt"> <ion-checkbox slot="end" name="newAttempt" [(ngModel)]="startNewAttempt">
</ion-checkbox> </ion-checkbox>

View File

@ -1,21 +1,21 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && hasOffline && isOnline" [priority]="600" <core-context-menu-item *ngIf="loaded && hasOffline && isOnline" [priority]="600"
[content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [iconAction]="syncIcon"
[iconAction]="syncIcon" [closeOnClick]="false"> [closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="500" [content]="prefetchText" (action)="prefetch($event)" <core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="500" [content]="prefetchText" (action)="prefetch($event)"
[iconAction]="prefetchStatusIcon" [closeOnClick]="false"> [iconAction]="prefetchStatusIcon" [closeOnClick]="false">
@ -30,15 +30,11 @@
<core-loading [hideUntil]="loaded" class="safe-area-padding"> <core-loading [hideUntil]="loaded" class="safe-area-padding">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()"
(completionChanged)="onCompletionChange()"> [description]="survey && !survey.surveydone && !hasOffline && description" [component]="component"
[componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="survey && !survey.surveydone && !hasOffline" [description]="description"
[component]="component" [componentId]="componentId" contextLevel="module" [contextInstanceId]="module.id"
[courseId]="courseId">
</core-course-module-description>
<!-- Survey already done --> <!-- Survey already done -->
<ion-card class="ion-padding" *ngIf="survey && survey.surveydone"> <ion-card class="ion-padding" *ngIf="survey && survey.surveydone">
<p class="ion-padding">{{ 'addon.mod_survey.surveycompletednograph' | translate }}</p> <p class="ion-padding">{{ 'addon.mod_survey.surveycompletednograph' | translate }}</p>
@ -63,7 +59,7 @@
<ng-container *ngFor="let question of questions; let questionIndex=index; let isEven=even;" <ng-container *ngFor="let question of questions; let questionIndex=index; let isEven=even;"
class="ion-no-padding ion-text-wrap"> class="ion-no-padding ion-text-wrap">
<!-- Parent question (Category header) --> <!-- Parent question (Category header) -->
<ng-container *ngIf="question.multiArray?.length" > <ng-container *ngIf="question.multiArray?.length">
<h3 class="ion-padding-horizontal" [class.ion-padding-top]="questionIndex == 1">{{ question.text }}</h3> <h3 class="ion-padding-horizontal" [class.ion-padding-top]="questionIndex == 1">{{ question.text }}</h3>
<ion-row class="ion-align-items-center ion-hide-md-down ion-padding"> <ion-row class="ion-align-items-center ion-hide-md-down ion-padding">
<ion-col size="7" class="ion-padding">{{ 'addon.mod_survey.responses' | translate }}</ion-col> <ion-col size="7" class="ion-padding">{{ 'addon.mod_survey.responses' | translate }}</ion-col>
@ -73,15 +69,16 @@
</ion-col> </ion-col>
</ion-row> </ion-row>
<ion-item class="ion-text-wrap addon-mod_survey-question" [class.even]="isEven" lines="full"> <ion-item class="ion-text-wrap addon-mod_survey-question" [class.even]="isEven" lines="full">
<ion-label><p>{{ question.intro }}</p></ion-label> <ion-label>
<p>{{ question.intro }}</p>
</ion-label>
</ion-item> </ion-item>
</ng-container> </ng-container>
<!-- Subquestion --> <!-- Subquestion -->
<ng-container *ngIf="question.parent !== 0"> <ng-container *ngIf="question.parent !== 0">
<ion-radio-group [(ngModel)]="answers[question.name]" [required]="question.required" [name]="question.name"> <ion-radio-group [(ngModel)]="answers[question.name]" [required]="question.required" [name]="question.name">
<ion-row *ngIf="question.parent !== 0" class="ion-align-items-center ion-padding-horizontal" <ion-row *ngIf="question.parent !== 0" class="ion-align-items-center ion-padding-horizontal" [class.even]="isEven">
[class.even]="isEven">
<ion-col size="7"> <ion-col size="7">
<ion-label id="addon-mod_survey-{{question.id}}"> <ion-label id="addon-mod_survey-{{question.id}}">
@ -93,19 +90,17 @@
<!-- Tablet view: radio buttons --> <!-- Tablet view: radio buttons -->
<ion-col class="ion-hide-md-down ion-text-center" size="1" <ion-col class="ion-hide-md-down ion-text-center" size="1"
*ngFor="let option of question.optionsArray; let value=index;" *ngFor="let option of question.optionsArray; let value=index;">
>
<!-- Empty slot to avoid errors on migration tslint checks --> <!-- Empty slot to avoid errors on migration tslint checks -->
<ion-radio [value]="value + 1" [attr.aria-label]="question.num + '. '+question.text + ': ' + option"> <ion-radio [value]="value + 1" [attr.aria-label]="question.num + '. '+question.text + ': ' + option">
</ion-radio> </ion-radio>
</ion-col> </ion-col>
<ion-col class="ion-hide-md-up" size="5"> <ion-col class="ion-hide-md-up" size="5">
<ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required" <ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required"
[attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet" [attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet" [name]="question.name"
[name]="question.name" [interfaceOptions]="{header: question.text}"> [interfaceOptions]="{header: question.text}">
<ion-select-option value="-1" selected disabled>{{ 'core.choose' | translate }}</ion-select-option> <ion-select-option value="-1" selected disabled>{{ 'core.choose' | translate }}</ion-select-option>
<ion-select-option *ngFor="let option of question.optionsArray; let value=index;" <ion-select-option *ngFor="let option of question.optionsArray; let value=index;" [value]="value +1">
[value]="value +1">
{{option}} {{option}}
</ion-select-option> </ion-select-option>
</ion-select> </ion-select>
@ -126,8 +121,8 @@
</ion-col> </ion-col>
<ion-col size="5"> <ion-col size="5">
<ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required" <ion-select class="ion-padding" [(ngModel)]="answers[question.name]" [required]="question.required"
[attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet" [attr.aria-labelledby]="'addon-mod_survey-'+question.id" interface="action-sheet" [name]="question.name"
[name]="question.name" [interfaceOptions]="{header: question.text}"> [interfaceOptions]="{header: question.text}">
<ion-select-option *ngFor="let option of question.optionsArray; let value=index;" [value]="value"> <ion-select-option *ngFor="let option of question.optionsArray; let value=index;" [value]="value">
{{option}} {{option}}
</ion-select-option> </ion-select-option>

View File

@ -1,12 +1,12 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"></core-context-menu-item> iconAction="fas-external-link-alt" [showBrowserWarning]="false"></core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"></core-context-menu-item> (action)="expandDescription()" iconAction="fas-arrow-right"></core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"></core-context-menu-item> (action)="gotoBlog()"></core-context-menu-item>
<core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" <core-context-menu-item [priority]="700" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)"
[iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item> [iconAction]="refreshIcon" [closeOnClick]="false"></core-context-menu-item>
</core-context-menu> </core-context-menu>
@ -16,14 +16,10 @@
<core-loading [hideUntil]="loaded" class="core-loading-fullheight"> <core-loading [hideUntil]="loaded" class="core-loading-fullheight">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="displayDescription && description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
</core-course-module-info> </core-course-module-info>
<core-course-module-description *ngIf="displayDescription" [description]="description" [component]="component"
[componentId]="componentId" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<div *ngIf="shouldIframe || (shouldEmbed && isOther)" class="addon-mod_url-embedded-url"> <div *ngIf="shouldIframe || (shouldEmbed && isOther)" class="addon-mod_url-embedded-url">
<core-iframe [src]="url"></core-iframe> <core-iframe [src]="url"></core-iframe>
</div> </div>

View File

@ -1,8 +1,8 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<!-- Select subwiki. --> <!-- Select subwiki. -->
<ion-button *ngIf="subwikiData.count > 1" (click)="showSubwikiPicker($event)" <ion-button *ngIf="subwikiData.count > 1" (click)="showSubwikiPicker($event)" [attr.aria-label]="'addon.mod_wiki.subwiki' | translate"
[attr.aria-label]="'addon.mod_wiki.subwiki' | translate" aria-haspopup="true"> aria-haspopup="true">
<ion-icon *ngIf="!groupWiki" name="fas-user" aria-hidden="true"></ion-icon> <ion-icon *ngIf="!groupWiki" name="fas-user" aria-hidden="true"></ion-icon>
<ion-icon *ngIf="groupWiki" name="fas-users" aria-hidden="true"></ion-icon> <ion-icon *ngIf="groupWiki" name="fas-users" aria-hidden="true"></ion-icon>
</ion-button> </ion-button>
@ -13,18 +13,17 @@
</ion-button> </ion-button>
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline && !pageIsOffline" [priority]="700" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline && !pageIsOffline" [priority]="700"
[content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [content]="'core.refresh' | translate" (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
[closeOnClick]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && isOnline && (hasOffline || pageIsOffline)" [priority]="600" <core-context-menu-item *ngIf="loaded && isOnline && (hasOffline || pageIsOffline)" [priority]="600"
[content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [iconAction]="syncIcon" [content]="'core.settings.synchronizenow' | translate" (action)="doRefresh(null, $event, true)" [iconAction]="syncIcon"
@ -33,8 +32,8 @@
<core-context-menu-item *ngIf="canEdit && (isOnline || pageIsOffline)" [priority]="590" [content]="'core.edit' | translate" <core-context-menu-item *ngIf="canEdit && (isOnline || pageIsOffline)" [priority]="590" [content]="'core.edit' | translate"
iconAction="fas-edit" (action)="goToEditPage()"> iconAction="fas-edit" (action)="goToEditPage()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="canEdit" [priority]="580" [content]="'addon.mod_wiki.createpage' | translate" <core-context-menu-item *ngIf="canEdit" [priority]="580" [content]="'addon.mod_wiki.createpage' | translate" iconAction="fas-plus"
iconAction="fas-plus" (action)="goToNewPage()"> (action)="goToNewPage()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="500" [content]="prefetchText" (action)="prefetch($event)" <core-context-menu-item *ngIf="prefetchStatusIcon" [priority]="500" [content]="prefetchText" (action)="prefetch($event)"
[iconAction]="prefetchStatusIcon" [closeOnClick]="false"> [iconAction]="prefetchStatusIcon" [closeOnClick]="false">
@ -49,15 +48,12 @@
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()" [description]="description"
(completionChanged)="onCompletionChange()"> [component]="component" [componentId]="componentId" [courseId]="courseId">
<h3 *ngIf="pageTitle" title>{{pageTitle}}</h3>
</core-course-module-info> </core-course-module-info>
<div *ngIf="description || pageIsOffline || hasOffline || pageWarning"> <div *ngIf="pageIsOffline || hasOffline || pageWarning">
<core-course-module-description [description]="description" [component]="component" [componentId]="componentId"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-course-module-description>
<!-- Wiki has something offline. --> <!-- Wiki has something offline. -->
<ion-card class="core-warning-card" *ngIf="pageIsOffline || hasOffline"> <ion-card class="core-warning-card" *ngIf="pageIsOffline || hasOffline">
<ion-item> <ion-item>
@ -82,8 +78,7 @@
<core-format-text *ngIf="pageContent" [component]="component" [componentId]="componentId" [text]="pageContent" <core-format-text *ngIf="pageContent" [component]="component" [componentId]="componentId" [text]="pageContent"
contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId"> contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
</core-format-text> </core-format-text>
<core-empty-box *ngIf="!pageContent" icon="fas-file-alt" [message]="'addon.mod_wiki.nocontent' | translate" <core-empty-box *ngIf="!pageContent" icon="fas-file-alt" [message]="'addon.mod_wiki.nocontent' | translate" inline="true">
inline="true">
</core-empty-box> </core-empty-box>
</article> </article>

View File

@ -52,9 +52,7 @@ export class AddonModWikiIndexPage extends CoreCourseModuleMainActivityPage<Addo
} }
/** /**
* Update some data based on the data received. * @inheritdoc
*
* @param data The data received.
*/ */
updateData(data: { name: string } | string): void { updateData(data: { name: string } | string): void {
if (typeof data == 'string') { if (typeof data == 'string') {

View File

@ -1,14 +1,14 @@
<!-- Buttons to add to the header. --> <!-- Buttons to add to the header. -->
<core-navbar-buttons slot="end"> <core-navbar-buttons slot="end">
<core-context-menu> <core-context-menu>
<core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" <core-context-menu-item *ngIf="externalUrl" [priority]="900" [content]="'core.openinbrowser' | translate" [href]="externalUrl"
[href]="externalUrl" iconAction="fas-external-link-alt" [showBrowserWarning]="false"> iconAction="fas-external-link-alt" [showBrowserWarning]="false">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate" <core-context-menu-item *ngIf="description" [priority]="800" [content]="'core.moduleintro' | translate"
(action)="expandDescription()" iconAction="fas-arrow-right"> (action)="expandDescription()" iconAction="fas-arrow-right">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" <core-context-menu-item *ngIf="blog" [priority]="750" content="{{'addon.blog.blog' | translate}}" iconAction="far-newspaper"
iconAction="far-newspaper" (action)="gotoBlog()"> (action)="gotoBlog()">
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate" <core-context-menu-item *ngIf="loaded && !hasOffline && isOnline" [priority]="700" [content]="'core.refresh' | translate"
(action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false"> (action)="doRefresh(null, $event)" [iconAction]="refreshIcon" [closeOnClick]="false">
@ -22,15 +22,15 @@
</core-context-menu-item> </core-context-menu-item>
<core-context-menu-item *ngIf="size" [priority]="200" [content]="'core.clearstoreddata' | translate:{$a: size}" <core-context-menu-item *ngIf="size" [priority]="200" [content]="'core.clearstoreddata' | translate:{$a: size}"
iconDescription="fas-archive" (action)="removeFiles($event)" iconAction="fas-trash" [closeOnClick]="false"> iconDescription="fas-archive" (action)="removeFiles($event)" iconAction="fas-trash" [closeOnClick]="false">
</core-context-menu-item> </core-context-menu> </core-context-menu-item>
</core-context-menu>
</core-navbar-buttons> </core-navbar-buttons>
<!-- Content. --> <!-- Content. -->
<core-loading [hideUntil]="loaded"> <core-loading [hideUntil]="loaded">
<!-- Activity info. --> <!-- Activity info. -->
<core-course-module-info *ngIf="showCompletion" [module]="module" [showManualCompletion]="true" <core-course-module-info [module]="module" (completionChanged)="onCompletionChange()">
(completionChanged)="onCompletionChange()">
</core-course-module-info> </core-course-module-info>
<ion-card *ngIf="phases"> <ion-card *ngIf="phases">
@ -87,9 +87,8 @@
<ion-item class="ion-text-wrap"> <ion-item class="ion-text-wrap">
<ion-label> <ion-label>
<h2>{{ 'addon.mod_workshop.conclusion' | translate }}</h2> <h2>{{ 'addon.mod_workshop.conclusion' | translate }}</h2>
<core-format-text fullOnClick="true" [component]="component" [componentId]="module.id" <core-format-text fullOnClick="true" [component]="component" [componentId]="module.id" [text]="workshop!.conclusion"
[text]="workshop!.conclusion" contextLevel="module" [contextInstanceId]="module.id" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
[courseId]="courseId">
</core-format-text> </core-format-text>
</ion-label> </ion-label>
</ion-item> </ion-item>
@ -97,7 +96,9 @@
<ion-card *ngIf="userGrades"> <ion-card *ngIf="userGrades">
<ion-item-divider class="ion-text-wrap"> <ion-item-divider class="ion-text-wrap">
<ion-label><h2>{{ 'addon.mod_workshop.yourgrades' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_workshop.yourgrades' | translate }}</h2>
</ion-label>
</ion-item-divider> </ion-item-divider>
<ion-item class="ion-text-wrap" *ngIf="userGrades.submissionlongstrgrade"> <ion-item class="ion-text-wrap" *ngIf="userGrades.submissionlongstrgrade">
<ion-label> <ion-label>
@ -120,8 +121,7 @@
<ion-label> <ion-label>
<h2>{{ 'addon.mod_workshop.areainstructauthors' | translate }}</h2> <h2>{{ 'addon.mod_workshop.areainstructauthors' | translate }}</h2>
<core-format-text fullOnClick="true" [component]="component" [componentId]="module.id" <core-format-text fullOnClick="true" [component]="component" [componentId]="module.id"
[text]="workshop!.instructauthors" contextLevel="module" [contextInstanceId]="module.id" [text]="workshop!.instructauthors" contextLevel="module" [contextInstanceId]="module.id" [courseId]="courseId">
[courseId]="courseId">
</core-format-text> </core-format-text>
</ion-label> </ion-label>
</ion-item> </ion-item>
@ -166,7 +166,9 @@
<ng-container *ngIf="workshop!.phase >= PHASE_CLOSED"> <ng-container *ngIf="workshop!.phase >= PHASE_CLOSED">
<ion-card *ngIf="publishedSubmissions && publishedSubmissions.length"> <ion-card *ngIf="publishedSubmissions && publishedSubmissions.length">
<ion-item-divider class="ion-text-wrap"> <ion-item-divider class="ion-text-wrap">
<ion-label><h2>{{ 'addon.mod_workshop.publishedsubmissions' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_workshop.publishedsubmissions' | translate }}</h2>
</ion-label>
</ion-item-divider> </ion-item-divider>
<ng-container *ngFor="let submission of publishedSubmissions"> <ng-container *ngFor="let submission of publishedSubmissions">
<addon-mod-workshop-submission [submission]="submission" [courseId]="workshop!.course" [module]="module" <addon-mod-workshop-submission [submission]="submission" [courseId]="workshop!.course" [module]="module"
@ -192,10 +194,14 @@
<ion-card *ngIf="canAssess"> <ion-card *ngIf="canAssess">
<ion-item-divider class="ion-text-wrap"> <ion-item-divider class="ion-text-wrap">
<ion-label><h2>{{ 'addon.mod_workshop.assignedassessments' | translate }}</h2></ion-label> <ion-label>
<h2>{{ 'addon.mod_workshop.assignedassessments' | translate }}</h2>
</ion-label>
</ion-item-divider> </ion-item-divider>
<ion-item class="ion-text-wrap" *ngIf="!assessments || !assessments.length"> <ion-item class="ion-text-wrap" *ngIf="!assessments || !assessments.length">
<ion-label><p>{{ 'addon.mod_workshop.assignedassessmentsnone' | translate }}</p></ion-label> <ion-label>
<p>{{ 'addon.mod_workshop.assignedassessmentsnone' | translate }}</p>
</ion-label>
</ion-item> </ion-item>
<ng-container *ngFor="let assessment of (assessments || [])"> <ng-container *ngFor="let assessment of (assessments || [])">
<addon-mod-workshop-submission [submission]="assessment.submission" [assessment]="assessment" <addon-mod-workshop-submission [submission]="assessment.submission" [assessment]="assessment"
@ -203,7 +209,7 @@
class="core-as-item"> class="core-as-item">
</addon-mod-workshop-submission> </addon-mod-workshop-submission>
</ng-container> </ng-container>
</ion-card > </ion-card>
</ng-container> </ng-container>
<!-- MULTIPLE PHASES SUBMISSION OR GREATER only teachers --> <!-- MULTIPLE PHASES SUBMISSION OR GREATER only teachers -->

View File

@ -70,7 +70,6 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
isDestroyed = false; // Whether the component is destroyed, used when calling fillContextMenu. isDestroyed = false; // Whether the component is destroyed, used when calling fillContextMenu.
contextMenuStatusObserver?: CoreEventObserver; // Observer of package status, used when calling fillContextMenu. contextMenuStatusObserver?: CoreEventObserver; // Observer of package status, used when calling fillContextMenu.
contextFileStatusObserver?: CoreEventObserver; // Observer of file 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 fetchContentDefaultError = 'core.course.errorgetmodule'; // Default error to show when loading contents.
protected isCurrentView = false; // Whether the component is in the current view. 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 completionObserver?: CoreEventObserver;
protected logger: CoreLogger; protected logger: CoreLogger;
protected debouncedUpdateModule?: () => void; // Update the module after a certain time. protected debouncedUpdateModule?: () => void; // Update the module after a certain time.
protected showCompletion = false; // Whether to show completion inside the activity.
constructor( constructor(
@Optional() @Inject('') loggerName: string = 'CoreCourseModuleMainResourceComponent', @Optional() @Inject('') loggerName: string = 'CoreCourseModuleMainResourceComponent',
@ -97,7 +97,7 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy,
this.componentId = this.module.id; this.componentId = this.module.id;
this.externalUrl = this.module.url; this.externalUrl = this.module.url;
this.courseId = this.courseId || this.module.course!; this.courseId = this.courseId || this.module.course!;
this.showCompletion = !!CoreSites.getCurrentSite()?.isVersionGreaterEqualThan('3.11'); this.showCompletion = !!CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11');
if (this.showCompletion) { if (this.showCompletion) {
CoreCourseHelper.calculateModuleCompletionData(this.module, this.courseId); CoreCourseHelper.calculateModuleCompletionData(this.module, this.courseId);

View File

@ -28,7 +28,9 @@ import { Component, Input } from '@angular/core';
* *
* Example usage: * Example usage:
* *
* <core-course-module-description [description]="myDescription"></core-course-module-description * <core-course-module-description [description]="myDescription"></core-course-module-description>
*
* @deprecated since 4.0 use core-course-module-info
*/ */
@Component({ @Component({
selector: 'core-course-module-description', selector: 'core-course-module-description',

View File

@ -1,18 +1,37 @@
<ion-card *ngIf="module.dates?.length || (module.completiondata && (module.completiondata.isautomatic || showManualCompletion))"> <ion-item class="ion-text-wrap" lines="none">
<ion-item class="ion-text-wrap"> <core-mod-icon slot="start" [modicon]="modicon" [modname]="module.modname" [componentId]="module.instance">
<ion-label> </core-mod-icon>
<!-- Activity dates. --> <ion-label>
<div *ngIf="module.dates && module.dates.length" class="core-module-dates"> <h2>
<p *ngFor="let date of module.dates"> <core-format-text [text]="module.name" contextLevel="module" [component]="component" [componentId]="componentId"
<strong>{{ date.label }}</strong> {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }} [contextInstanceId]="module.id" [courseId]="courseId">
</p> </core-format-text>
</div> </h2>
<ng-content select="[title]"></ng-content>
</ion-label>
</ion-item>
<ion-item class="ion-text-wrap" *ngIf="description" lines="none">
<ion-label>
<core-format-text [text]="description" [component]="component" [componentId]="componentId" contextLevel="module"
[contextInstanceId]="module.id" [courseId]="courseId" maxHeight="120">
</core-format-text>
</ion-label>
</ion-item>
<ng-content select="[description]"></ng-content>
<ion-item class="ion-text-wrap" lines="none" *ngIf="showCompletion && (module.dates?.length || module.completiondata)">
<ion-label>
<!-- Activity dates. -->
<div *ngIf="module.dates && module.dates.length" class="core-module-dates">
<p *ngFor="let date of module.dates">
<strong>{{ date.label }}</strong> {{ date.timestamp * 1000 | coreFormatDate:'strftimedatetime' }}
</p>
</div>
<!-- Module completion. --> <!-- Module completion. -->
<core-course-module-completion *ngIf="module.completiondata" [completion]="module.completiondata" <core-course-module-completion *ngIf="module.completiondata" [completion]="module.completiondata" [moduleName]="module.name"
[moduleName]="module.name" [moduleId]="module.id" [showCompletionConditions]="true" [moduleId]="module.id" [showCompletionConditions]="true" [showManualCompletion]="true"
[showManualCompletion]="showManualCompletion" (completionChanged)="completionChanged.emit($event)"> (completionChanged)="completionChanged.emit($event)">
</core-course-module-completion> </core-course-module-completion>
</ion-label> </ion-label>
</ion-item> </ion-item>
</ion-card> <ng-content></ng-content>

View File

@ -2,5 +2,9 @@
:host { :host {
display: block; 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)); @include padding-horizontal(var(--ion-safe-area-left), var(--ion-safe-area-right));
} }

View File

@ -12,21 +12,48 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // 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 { 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({ @Component({
selector: 'core-course-module-info', selector: 'core-course-module-info',
templateUrl: 'core-course-module-info.html', templateUrl: 'core-course-module-info.html',
styleUrls: ['course-module-info.scss'], styleUrls: ['course-module-info.scss'],
}) })
export class CoreCourseModuleInfoComponent { export class CoreCourseModuleInfoComponent implements OnInit {
@Input() module!: CoreCourseModule; // The module to render. @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<CoreCourseModuleCompletionData>(); // Notify when completion changes. @Output() completionChanged = new EventEmitter<CoreCourseModuleCompletionData>(); // Notify when completion changes.
modicon = '';
showCompletion = false; // Whether to show completion.
/**
* @inheritdoc
*/
async ngOnInit(): Promise<void> {
this.modicon = await CoreCourseModuleDelegate.getModuleIconSrc(this.module.modname, this.module.modicon, this.module);
this.showCompletion = CoreSites.getRequiredCurrentSite().isVersionGreaterEqualThan('3.11');
}
} }

View File

@ -1,7 +1,6 @@
<div class="ion-padding"> <div class="ion-padding">
<core-course-module-description [description]="module?.description" contextLevel="module" <core-course-module-info [description]="module?.description" [courseId]="courseId" [module]="module">
[contextInstanceId]="module?.id" [courseId]="courseId"> </core-course-module-info>
</core-course-module-description>
<h2 *ngIf="!isDisabledInSite && isSupportedByTheApp">{{ 'core.whoops' | translate }}</h2> <h2 *ngIf="!isDisabledInSite && isSupportedByTheApp">{{ 'core.whoops' | translate }}</h2>
<h2 *ngIf="isDisabledInSite || !isSupportedByTheApp">{{ 'core.uhoh' | translate }}</h2> <h2 *ngIf="isDisabledInSite || !isSupportedByTheApp">{{ 'core.uhoh' | translate }}</h2>