diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php
index fd71da8ca07..eedda8b6161 100644
--- a/mod/lesson/locallib.php
+++ b/mod/lesson/locallib.php
@@ -2330,8 +2330,10 @@ class lesson extends lesson_base {
$instancename = $DB->get_field($modname, 'name', array('id' => $module->instance));
if ($instancename) {
return html_writer::link(new moodle_url('/mod/'.$modname.'/view.php',
- array('id' => $this->properties->activitylink)), get_string('activitylinkname',
- 'lesson', $instancename), array('class' => 'centerpadded lessonbutton standardbutton pr-3'));
+ ['id' => $this->properties->activitylink]),
+ get_string('activitylinkname', 'lesson',
+ format_string($instancename, true, ['context' => $this->get_context()])),
+ ['class' => 'centerpadded lessonbutton standardbutton pr-3']);
}
}
}
diff --git a/mod/lesson/mod_form.php b/mod/lesson/mod_form.php
index eb421e75d0e..d48047e57dd 100644
--- a/mod/lesson/mod_form.php
+++ b/mod/lesson/mod_form.php
@@ -163,7 +163,8 @@ class mod_lesson_mod_form extends moodleform_mod {
if ($module = get_coursemodule_from_instance($mod->modname, $mod->instance, $COURSE->id)) {
// Exclude this lesson, if it's already been saved.
if (!isset($this->_cm->id) || $this->_cm->id != $mod->id) {
- $modinstances[$mod->id] = $mod->modname.' - '.$module->name;
+ $modinstances[$mod->id] = get_string('pluginname', $mod->modname).' - '.
+ format_string($module->name, true, ['context' => $this->context]);
}
}
}
diff --git a/mod/lesson/tests/behat/lesson_navigation.feature b/mod/lesson/tests/behat/lesson_navigation.feature
index d329ba753d4..0cf3b9c398e 100644
--- a/mod/lesson/tests/behat/lesson_navigation.feature
+++ b/mod/lesson/tests/behat/lesson_navigation.feature
@@ -17,10 +17,13 @@ Feature: In a lesson activity, students can navigate through a series of pages i
| teacher1 | C1 | editingteacher |
| student1 | C1 | student |
And the following "activities" exist:
- | activity | name | course | idnumber |
- | lesson | Test lesson name | C1 | lesson1 |
+ | activity | name | course | idnumber |
+ | lesson | Test lesson name | C1 | lesson1 |
+ | page | A page (EN)Orri bat (EU) | C1 | PAGE1 |
Scenario: Student navigation with pages and questions
+ Given the "multilang" filter is "on"
+ And the "multilang" filter applies to "content and headings"
Given the following "mod_lesson > pages" exist:
| lesson | qtype | title | content |
| Test lesson name | content | First page name | First page contents |
@@ -33,7 +36,11 @@ Feature: In a lesson activity, students can navigate through a series of pages i
| Second page name | Next page | | Next page | 0 |
| Hardest question ever | 2 | Correct answer | End of lesson | 1 |
| Hardest question ever | 1 | Incorrect answer | Second page name | 0 |
- When I am on the "Test lesson name" "lesson activity" page logged in as student1
+ When I am on the "Test lesson name" "lesson activity editing" page logged in as teacher1
+ And I expand all fieldsets
+ And I set the field "Link to next activity" to "Page - A page (EN)"
+ And I press "Save and display"
+ And I am on the "Test lesson name" "lesson activity" page logged in as student1
Then I should see "First page contents"
And I press "Next page"
And I should see "Second page contents"
@@ -60,6 +67,8 @@ Feature: In a lesson activity, students can navigate through a series of pages i
And I press "Continue"
And I should see "Congratulations - end of lesson reached"
And I should see "Your score is 0 (out of 1)."
+ And I should see "Go to A page (EN)"
+ And I should not see "Orri bat (EU)"
Scenario: Student reattempts a question until out of attempts
Given the following "mod_lesson > page" exist: