Skip to content

Commit 670c75f

Browse files
committed
MOBILE-3890 course: Use course name in single activity
1 parent 9215753 commit 670c75f

File tree

7 files changed

+12
-12
lines changed

7 files changed

+12
-12
lines changed

src/addons/mod/assign/tests/behat/single_activity.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Feature: Test single activity of assign type in app
99
| username | firstname | lastname |
1010
| student1 | First | Student |
1111
And the following "courses" exist:
12-
| fullname | shortname | category | format | activitytype |
13-
| Course 1 | C1 | 0 | singleactivity | assign |
12+
| fullname | shortname | category | format | activitytype |
13+
| Single activity assign course | C1 | 0 | singleactivity | assign |
1414
And the following "course enrolments" exist:
1515
| user | course | role |
1616
| student1 | C1 | student |
@@ -19,7 +19,7 @@ Feature: Test single activity of assign type in app
1919
| assign | Single activity assign | Test assign description | C1 | 1 | 1 | 1 | ## 20 August 2002 12:00 PM ## | manual | -1 |
2020

2121
Scenario: Single activity assign
22-
Given I entered the course "Course 1" as "student1" in the app
22+
Given I entered the course "Single activity assign course" as "student1" in the app
2323
Then I should find "Attempt 1" in the app
2424

2525
When I set "page-core-course-index core-course-image" styles to "background" "lightblue"
691 Bytes
Loading

src/addons/mod/book/tests/behat/single_activity.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Feature: Test single activity of book type in app
99
| username | firstname | lastname |
1010
| student1 | First | Student |
1111
And the following "courses" exist:
12-
| fullname | shortname | category | format | activitytype |
13-
| Course 1 | C1 | 0 | singleactivity | book |
12+
| fullname | shortname | category | format | activitytype |
13+
| Single activity book course | C1 | 0 | singleactivity | book |
1414
And the following "course enrolments" exist:
1515
| user | course | role |
1616
| student1 | C1 | student |
@@ -24,7 +24,7 @@ Feature: Test single activity of book type in app
2424
| Single activity book | Chapt 3 | This is the third chapter | 0 | 0 | 1 |
2525

2626
Scenario: Single activity book
27-
Given I entered the course "Course 1" as "student1" in the app
27+
Given I entered the course "Single activity book course" as "student1" in the app
2828
Then I should find "Chapt 1" in the app
2929
And I should find "Chapt 2" in the app
3030

998 Bytes
Loading

src/addons/mod/scorm/tests/behat/single_activity.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Feature: Test single activity of scorm type in app
99
| username | firstname | lastname | email |
1010
| student1 | Student | One | student1@example.com |
1111
And the following "courses" exist:
12-
| fullname | shortname | format | activitytype |
13-
| Course 1 | C1 | singleactivity | scorm |
12+
| fullname | shortname | format | activitytype |
13+
| Single activity SCORM course | C1 | singleactivity | scorm |
1414
And the following "course enrolments" exist:
1515
| user | course | role |
1616
| student1 | C1 | student |
@@ -19,7 +19,7 @@ Feature: Test single activity of scorm type in app
1919
| scorm | C1 | C1 Scorm 1 | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12.zip | 0 |
2020

2121
Scenario: Single activity scorm
22-
Given I entered the course "Course 1" as "student1" in the app
22+
Given I entered the course "Single activity SCORM course" as "student1" in the app
2323
And I replace "/.*/" within ".addon-scorm-last-sync-date" with "[Date]"
2424

2525
When I set "page-core-course-index core-course-image" styles to "background" "lightblue"
3.26 KB
Loading

src/core/features/course/format/singleactivity/services/handlers/singleactivity-format.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ export class CoreCourseFormatSingleActivityHandlerService implements CoreCourseF
5656
* @inheritdoc
5757
*/
5858
getCourseTitle(course: CoreCourseAnyCourseData, sections?: CoreCourseWSSection[]): string {
59-
if (sections?.[0]?.contents?.[0]) {
60-
return sections[0].contents[0].name;
59+
if (course.fullname) {
60+
return course.fullname;
6161
}
6262

63-
return course.fullname || '';
63+
return sections?.[0]?.contents?.[0].name || '';
6464
}
6565

6666
/**

0 commit comments

Comments
 (0)