File tree Expand file tree Collapse file tree 6 files changed +17
-8
lines changed Expand file tree Collapse file tree 6 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 1515export const GRADES_PAGE_NAME = 'grades' ;
1616export const GRADES_PARTICIPANTS_PAGE_NAME = 'participant-grades' ;
1717
18+ export const CORE_GRADES_COURSE_OPTION_NAME = 'CoreGrades' ; // Tabname.
19+
1820export const enum CoreGradeType {
1921 NONE = 0 , // Moodle's GRADE_TYPE_NONE.
2022 VALUE = 1 , // Moodle's GRADE_TYPE_VALUE.
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ import { CoreCourseAccessDataType } from '@features/course/constants';
4949import { CorePromiseUtils } from '@singletons/promise-utils' ;
5050import { CoreArray } from '@singletons/array' ;
5151import { CoreCourseModuleHelper } from '@features/course/services/course-module-helper' ;
52- import { GRADES_PAGE_NAME } from '../constants' ;
52+ import { CORE_GRADES_COURSE_OPTION_NAME , GRADES_PAGE_NAME } from '../constants' ;
5353
5454/**
5555 * Service that provides some features regarding grades information.
@@ -505,13 +505,13 @@ export class CoreGradesHelperProvider {
505505 // View own grades. Check if we already are in the course index page.
506506 if ( CoreCourse . currentViewIsCourse ( courseId ) ) {
507507 // Current view is this course, just select the grades tab.
508- CoreCourse . selectCourseTab ( 'CoreGrades' ) ;
508+ CoreCourse . selectCourseTab ( CORE_GRADES_COURSE_OPTION_NAME ) ;
509509
510510 return ;
511511 }
512512
513513 // Open the course with the grades tab selected.
514- await CoreCourseHelper . getAndOpenCourse ( courseId , { selectedTab : 'CoreGrades' } , siteId ) ;
514+ await CoreCourseHelper . getAndOpenCourse ( courseId , { selectedTab : CORE_GRADES_COURSE_OPTION_NAME } , siteId ) ;
515515 } catch {
516516 // Cannot get course for some reason, just open the grades page.
517517 await CoreNavigator . navigateToSitePath ( `/${ GRADES_PAGE_NAME } /${ courseId } ` , { siteId } ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
1919 CoreCourseOptionsHandlerData ,
2020} from '@features/course/services/course-options-delegate' ;
2121import { CoreCourseAnyCourseData , CoreCourses , CoreCourseUserAdminOrNavOptionIndexed } from '@features/courses/services/courses' ;
22- import { GRADES_PAGE_NAME } from '../../constants' ;
22+ import { CORE_GRADES_COURSE_OPTION_NAME , GRADES_PAGE_NAME } from '../../constants' ;
2323import { makeSingleton } from '@singletons' ;
2424import { CoreGrades } from '../grades' ;
2525import { CoreGradesHelper } from '../grades-helper' ;
@@ -30,7 +30,7 @@ import { CoreGradesHelper } from '../grades-helper';
3030@Injectable ( { providedIn : 'root' } )
3131export class CoreGradesCourseOptionHandlerService implements CoreCourseOptionsHandler {
3232
33- name = 'CoreGrades' ;
33+ name = CORE_GRADES_COURSE_OPTION_NAME ;
3434 priority = 400 ;
3535
3636 /**
Original file line number Diff line number Diff line change 1414
1515export const PARTICIPANTS_PAGE_NAME = 'participants' ;
1616
17+ export const CORE_PARTICIPANTS_COURSE_OPTION_NAME = 'CoreUserParticipants' ; // Tabname.
18+
1719// Events.
1820export const CORE_USER_AUTO_SYNCED = 'core_user_autom_synced' ;
1921
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
2020 CoreCourseOptionsHandlerData ,
2121} from '@features/course/services/course-options-delegate' ;
2222import { CoreCourseAnyCourseData , CoreCourseUserAdminOrNavOptionIndexed } from '@features/courses/services/courses' ;
23- import { PARTICIPANTS_PAGE_NAME } from '@features/user/constants' ;
23+ import { CORE_PARTICIPANTS_COURSE_OPTION_NAME , PARTICIPANTS_PAGE_NAME } from '@features/user/constants' ;
2424import { makeSingleton } from '@singletons' ;
2525import { CoreUser } from '../user' ;
2626
@@ -30,7 +30,7 @@ import { CoreUser } from '../user';
3030@Injectable ( { providedIn : 'root' } )
3131export class CoreUserCourseOptionHandlerService implements CoreCourseOptionsHandler {
3232
33- name = 'CoreUserParticipants' ;
33+ name = CORE_PARTICIPANTS_COURSE_OPTION_NAME ;
3434 priority = 600 ;
3535
3636 /**
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import { Injectable } from '@angular/core';
1717import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler' ;
1818import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate' ;
1919import { CoreCourseHelper } from '@features/course/services/course-helper' ;
20+ import { CORE_PARTICIPANTS_COURSE_OPTION_NAME } from '@features/user/constants' ;
2021import { makeSingleton } from '@singletons' ;
2122
2223/**
@@ -41,7 +42,11 @@ export class CoreUserParticipantsLinkHandlerService extends CoreContentLinksHand
4142
4243 return [ {
4344 action : async ( siteId ) : Promise < void > => {
44- await CoreCourseHelper . getAndOpenCourse ( courseIdentifier , { selectedTab : 'CoreUserParticipants' } , siteId ) ;
45+ await CoreCourseHelper . getAndOpenCourse (
46+ courseIdentifier ,
47+ { selectedTab : CORE_PARTICIPANTS_COURSE_OPTION_NAME } ,
48+ siteId ,
49+ ) ;
4550 } ,
4651 } ] ;
4752 }
You can’t perform that action at this time.
0 commit comments