Skip to content

Commit ce7243b

Browse files
authored
Merge pull request #4209 from crazyserver/MOBILE-4616
MOBILE-4616 scorm: Update sco status icons to match LMS
2 parents f663b86 + c6f73af commit ce7243b

File tree

8 files changed

+31
-24
lines changed

8 files changed

+31
-24
lines changed

src/addons/mod/scorm/components/index/addon-mod-scorm-index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ <h3 class="item-heading">{{'core.grades.grades' | translate}}</h3>
140140
<p>{{ currentOrganization.title }}</p>
141141
<div *ngFor="let sco of toc" class="core-padding-{{sco.level}} addon-mod_scorm-type-{{sco.scormtype}}">
142142
<p *ngIf="sco.isvisible">
143-
<ion-icon *ngIf="sco.icon" [name]="sco.icon.icon" [attr.aria-label]="sco.icon.description" slot="start" />
143+
<ion-icon *ngIf="sco.icon" [name]="sco.icon.icon" [attr.aria-label]="sco.icon.description" />
144144
<button class="as-link" *ngIf="sco.prereq && sco.launch" (click)="open($event, false, sco.id)">
145145
<core-format-text [text]="sco.title" contextLevel="module" [contextInstanceId]="module.id"
146146
[courseId]="courseId" />

src/addons/mod/scorm/components/index/index.scss

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@
55
font-size: var(--text-size);
66
}
77

8-
.addon-mod_scorm-toc {
9-
// Hide all non sco icons using css to maintain padding.
10-
ion-icon {
11-
opacity: 0;
12-
@include margin(5px, 8px, null, null);
13-
}
14-
15-
.addon-mod_scorm-type-sco ion-icon {
16-
opacity: 1
17-
}
8+
.addon-mod_scorm-toc ion-icon {
9+
@include margin(4px, 8px, null, null);
1810
}
1911
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@use "theme/globals" as *;
2+
3+
.addon-mod_scorm-toc ion-icon {
4+
@include margin(4px, 8px, null, null);
5+
}

src/addons/mod/scorm/components/toc/toc.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { CoreSharedModule } from '@/core/shared.module';
2525
@Component({
2626
selector: 'addon-mod-scorm-toc',
2727
templateUrl: 'toc.html',
28+
styleUrl: 'toc.scss',
2829
standalone: true,
2930
imports: [
3031
CoreSharedModule,

src/addons/mod/scorm/services/scorm.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,14 @@ const STATUSES = {
6363
'n': 'notattempted',
6464
};
6565
const STATUS_TO_ICON = {
66-
assetc: 'far-file-zipper',
67-
asset: 'far-file-zipper',
66+
asset: '', // Empty to show an space.
6867
browsed: 'fas-book',
69-
completed: 'far-square-check',
68+
completed: 'fas-check',
7069
failed: 'fas-xmark',
71-
incomplete: 'far-pen-to-square',
72-
minus: 'fas-minus',
70+
incomplete: 'fas-pen-to-square',
7371
notattempted: 'far-square',
74-
passed: 'fas-check',
75-
plus: 'fas-plus',
76-
popdown: 'far-rectangle-xmark',
77-
popup: 'fas-window-restore',
72+
passed: 'fas-check-double',
7873
suspend: 'fas-pause',
79-
wait: 'far-clock',
8074
};
8175

8276
/**
@@ -1022,7 +1016,7 @@ export class AddonModScormProvider {
10221016

10231017
if (sco.isvisible) {
10241018
if (VALID_STATUSES.indexOf(status) >= 0) {
1025-
if (sco.scormtype == 'sco') {
1019+
if (sco.scormtype === 'sco') {
10261020
imageName = status;
10271021
descName = status;
10281022
} else {
@@ -1042,7 +1036,7 @@ export class AddonModScormProvider {
10421036
} else {
10431037
incomplete = true;
10441038

1045-
if (sco.scormtype == 'sco') {
1039+
if (sco.scormtype === 'sco') {
10461040
// Status empty or not valid, use 'notattempted'.
10471041
imageName = 'notattempted';
10481042
} else {

src/core/features/reportbuilder/services/handlers/reportbuilder.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
CoreUserProfileHandlerType,
1818
CoreUserProfileHandler,
1919
CoreUserProfileHandlerData,
20+
CoreUserDelegateContext,
2021
} from '@features/user/services/user-delegate';
2122
import { CoreNavigator } from '@services/navigator';
2223
import { makeSingleton } from '@singletons';
@@ -42,6 +43,18 @@ export class CoreReportBuilderHandlerService implements CoreUserProfileHandler {
4243
return await CoreReportBuilder.isEnabled();
4344
}
4445

46+
/**
47+
* @inheritdoc
48+
*/
49+
async isEnabledForContext(context: CoreUserDelegateContext): Promise<boolean> {
50+
// Custom reports only available in user menu.
51+
if (context !== CoreUserDelegateContext.USER_MENU) {
52+
return false;
53+
}
54+
55+
return this.isEnabled();
56+
}
57+
4558
/**
4659
* @inheritdoc
4760
*/
-92 Bytes
Loading

src/theme/theme.base.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ core-split-view.menu-and-content {
180180
[aria-current="page"],
181181
.item.item-current {
182182
@include safe-area-border-start(var(--selected-item-border-width), solid, var(--selected-item-color));
183+
--padding-start: calc(16px - var(--selected-item-border-width));
184+
183185
> * {
184186
--ion-safe-area-left: 0px;
185187
}
@@ -278,7 +280,7 @@ mark, .matchtext {
278280
// Different levels of padding.
279281
@for $i from 0 through 15 {
280282
.core-padding-#{$i} {
281-
@include padding(null, null, null, 15px * $i + 16px);
283+
@include padding(null, null, null, 16px * $i);
282284
}
283285
}
284286

0 commit comments

Comments
 (0)