diff --git a/src/core/features/grades/pages/course/course.html b/src/core/features/grades/pages/course/course.html index 3cbbfc4af..70cc02b61 100644 --- a/src/core/features/grades/pages/course/course.html +++ b/src/core/features/grades/pages/course/course.html @@ -13,9 +13,9 @@ - + -
+
@@ -26,7 +26,7 @@ - + @@ -55,7 +55,7 @@ - +
-

{{ 'core.grades.weight' | translate}}

+

{{ 'core.grades.weight' | translate}}

-

{{ 'core.grades.grade' | translate}}

+

{{ 'core.grades.grade' | translate}}

-

{{ 'core.grades.range' | translate}}

+

{{ 'core.grades.range' | translate}}

-

{{ 'core.grades.percentage' | translate}}

+

{{ 'core.grades.percentage' | translate}}

-

{{ 'core.grades.lettergrade' | translate}}

+

{{ 'core.grades.lettergrade' | translate}}

-

{{ 'core.grades.rank' | translate}}

+

{{ 'core.grades.rank' | translate}}

-

{{ 'core.grades.average' | translate}}

+

{{ 'core.grades.average' | translate}}

-

{{ 'core.grades.feedback' | translate}}

+

{{ 'core.grades.feedback' | translate}}

@@ -139,7 +139,7 @@ -

{{ 'core.grades.contributiontocoursetotal' | translate}}

+

{{ 'core.grades.contributiontocoursetotal' | translate}}

@@ -149,6 +149,7 @@
+
diff --git a/src/core/features/grades/pages/course/course.page.ts b/src/core/features/grades/pages/course/course.page.ts index 4c0bc4880..9b1608047 100644 --- a/src/core/features/grades/pages/course/course.page.ts +++ b/src/core/features/grades/pages/course/course.page.ts @@ -50,8 +50,9 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { collapseLabel!: string; title?: string; courses?: CoreSwipeNavigationItemsManager; - columns?: CoreGradesFormattedTableColumn[]; - rows?: CoreGradesFormattedTableRow[]; + columns: CoreGradesFormattedTableColumn[] = []; + rows: CoreGradesFormattedTableRow[] = []; + rowsOnView = 0; totalColumnsSpan?: number; withinSplitView?: boolean; @@ -196,6 +197,7 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { this.columns = []; this.rows = []; + this.rowsOnView = 0; } } @@ -209,6 +211,7 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { this.title = formattedTable.rows[0]?.gradeitem ?? Translate.instant('core.grades.grades'); this.columns = formattedTable.columns; this.rows = formattedTable.rows; + this.rowsOnView = this.getRowsOnHeight(); this.totalColumnsSpan = formattedTable.columns.reduce((total, column) => total + column.colspan, 0); if (!this.fetchSuccess) { @@ -217,4 +220,23 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { } } + /** + * Function to get the number of rows that can be shown on the screen. + * + * @returns The number of rows. + */ + protected getRowsOnHeight(): number { + return Math.floor(window.innerHeight / 44); + } + + /** + * Function to load more rows. + * + * @param infiniteComplete Infinite scroll complete function. Only used from core-infinite-loading. + */ + loadMore(infiniteComplete?: () => void): void { + this.rowsOnView += this.getRowsOnHeight(); + infiniteComplete && infiniteComplete(); + } + }