From 9f7e2cafdaab7397e66bb20c702526373da9eb46 Mon Sep 17 00:00:00 2001 From: Jake Dallimore Date: Tue, 25 Jul 2023 10:43:43 +0800 Subject: [PATCH] MDL-78713 mod_lti: update lang strings --- .../course_external_tools_list.php | 4 ++-- mod/lti/coursetooledit.php | 12 ++++++------ mod/lti/lang/en/lti.php | 19 +++++++++---------- mod/lti/tests/behat/managecoursetools.feature | 10 +++++----- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/mod/lti/classes/reportbuilder/local/systemreports/course_external_tools_list.php b/mod/lti/classes/reportbuilder/local/systemreports/course_external_tools_list.php index 7e8b46970c8..abc4cbf8be6 100644 --- a/mod/lti/classes/reportbuilder/local/systemreports/course_external_tools_list.php +++ b/mod/lti/classes/reportbuilder/local/systemreports/course_external_tools_list.php @@ -126,7 +126,7 @@ class course_external_tools_list extends system_report { if (get_site()->id == $row->course) { return \html_writer::div( \html_writer::div( - $OUTPUT->pix_icon('t/locked', get_string('sitetoolnocourseediting', 'mod_lti') + $OUTPUT->pix_icon('t/locked', get_string('courseexternaltoolsnoeditpermissions', 'mod_lti') ), 'tool-action-icon-container'), 'd-flex justify-content-end' ); } @@ -135,7 +135,7 @@ class course_external_tools_list extends system_report { if (!has_capability('mod/lti:addcoursetool', \context_course::instance($row->course))) { return \html_writer::div( \html_writer::div( - $OUTPUT->pix_icon('t/locked', get_string('courseexternaltoolsnoaddpermissions', 'mod_lti') + $OUTPUT->pix_icon('t/locked', get_string('courseexternaltoolsnoeditpermissions', 'mod_lti') ), 'tool-action-icon-container'), 'd-flex justify-content-end' ); } diff --git a/mod/lti/coursetooledit.php b/mod/lti/coursetooledit.php index d90f7456686..c99809baa8e 100644 --- a/mod/lti/coursetooledit.php +++ b/mod/lti/coursetooledit.php @@ -43,17 +43,17 @@ if (!empty($typeid)) { // Page setup. $url = new moodle_url('/mod/lti/coursetooledit.php', ['courseid' => $courseid]); +$type = !empty($typeid) ? lti_get_type_type_config($typeid) : (object) ['lti_clientid' => null]; +$pageheading = !empty($typeid) ? get_string('courseexternaltooledit', 'mod_lti', $type->lti_typename) : + get_string('courseexternaltooladd', 'mod_lti'); + $PAGE->set_url($url); $PAGE->set_pagelayout('incourse'); -$PAGE->set_title(get_string('edittype', 'mod_lti')); // TODO confirm with UX about use of 'edit preconfigured tool' for the title. +$PAGE->set_title($pageheading); $PAGE->set_secondary_active_tab('coursetools'); $PAGE->add_body_class('limitedwidth'); -$type = !empty($typeid) ? lti_get_type_type_config($typeid) : (object) ['lti_clientid' => null]; -$pageheading = !empty($typeid) ? get_string('courseexternaltooleditheading', 'mod_lti') : - get_string('courseexternaltooladdheading', 'mod_lti'); $form = new mod_lti_edit_types_form($url, (object)array('id' => $typeid, 'clientid' => $type->lti_clientid)); - if ($form->is_cancelled()) { redirect(new moodle_url('/mod/lti/coursetools.php', ['id' => $courseid])); @@ -66,7 +66,7 @@ if ($form->is_cancelled()) { lti_load_type_if_cartridge($data); lti_update_type($type, $data); $redirecturl = new moodle_url('/mod/lti/coursetools.php', ['id' => $courseid]); - $notice = get_string('courseexternaltooleditsuccess', 'mod_lti', $type->name); + $notice = get_string('courseexternaltooleditsuccess', 'mod_lti'); } else { $type = (object) ['state' => LTI_TOOL_STATE_CONFIGURED, 'course' => $data->course]; lti_load_type_if_cartridge($data); diff --git a/mod/lti/lang/en/lti.php b/mod/lti/lang/en/lti.php index 7278d957821..4231326123d 100644 --- a/mod/lti/lang/en/lti.php +++ b/mod/lti/lang/en/lti.php @@ -117,14 +117,14 @@ $string['contentitem_multiple_description'] = 'The following items will be added $string['contentitem_multiple_graded'] = 'Graded activity (Maximum grade: {$a})'; $string['course_tool_types'] = 'Course tools'; $string['courseactivitiesorresources'] = 'Course activities or resources'; -$string['courseexternaltooladdheading'] = 'Add new LTI External tool'; // TODO confirm wording with UX. -$string['courseexternaltooladdsuccess'] = 'Successfully added course tool \'{$a}\'.'; // TODO confirm wording with UX. -$string['courseexternaltooleditheading'] = 'Edit LTI External tool'; // TODO confirm wording with UX. -$string['courseexternaltooleditsuccess'] = 'The changes to the course tool \'{$a}\' were saved.'; // TODO confirm wording with UX. -$string['courseexternaltooliconalt'] = 'Icon for the \'{$a}\' LTI External tool'; // TODO: confirm wording with UX. -$string['courseexternaltools'] = 'LTI External tools'; // TODO: confirm wording with UX. -$string['courseexternaltoolsinfo'] = 'LTI External tools are add-on apps you can integrate into your course, such as interactive content or assessments. Your students can access and use them without leaving your course.'; // TODO: confirm wording with UX. -$string['courseexternaltoolsnoaddpermissions'] = 'You don\'t have permission to add or edit course tools.'; // TODO: confirm wording with UX. +$string['courseexternaltooladd'] = 'Add new LTI External tool'; +$string['courseexternaltooladdsuccess'] = '{$a} added.'; +$string['courseexternaltooledit'] = 'Edit {$a}'; +$string['courseexternaltooleditsuccess'] = 'Changes saved.'; +$string['courseexternaltooliconalt'] = 'Icon for {$a}'; +$string['courseexternaltools'] = 'LTI External tools'; +$string['courseexternaltoolsinfo'] = 'LTI External tools are add-on apps you can integrate into your course, such as interactive content or assessments. Your students can access and use them without leaving your course.'; +$string['courseexternaltoolsnoeditpermissions'] = 'You don\'t have permission to edit this tool'; $string['courseexternaltoolsnoviewpermissions'] = 'View course external tools'; $string['courseid'] = 'Course ID number'; $string['courseinformation'] = 'Course information'; @@ -353,7 +353,7 @@ $string['no_tp_configured'] = 'There are no unregistered external tool registrat $string['no_tp_pending'] = 'There are no pending external tool registrations.'; $string['no_tp_rejected'] = 'There are no rejected external tool registrations.'; $string['noattempts'] = 'No attempts have been made on this tool instance'; -$string['nocourseexternaltoolsnotice'] = 'There are no LTI external tools yet'; // TODO confirm wording with UX. +$string['nocourseexternaltoolsnotice'] = 'There are no LTI external tools yet'; $string['noltis'] = 'There are no external tool instances'; $string['noprofileservice'] = 'Profile service not found'; $string['noservers'] = 'No servers found'; @@ -522,7 +522,6 @@ $string['show_in_course_lti2_help'] = 'This tool can be shown in the activity ch $string['show_in_course_no'] = 'Do not show; use only when a matching tool URL is entered'; $string['show_in_course_preconfigured'] = 'Show as preconfigured tool when adding an external tool'; $string['size'] = 'Size parameters'; -$string['sitetoolnocourseediting'] = 'This is a site level tool which cannot be edited.'; // TODO: confirm wording with UX. $string['opensslconfiginvalid'] = 'LTI 1.3 requires a valid openssl.cnf to be configured and available to your web server. Please contact the site administrator to configure and enable openssl for this site.'; $string['submission'] = 'Submission'; $string['submissions'] = 'Submissions'; diff --git a/mod/lti/tests/behat/managecoursetools.feature b/mod/lti/tests/behat/managecoursetools.feature index fd7791ae51d..78492e9eb64 100644 --- a/mod/lti/tests/behat/managecoursetools.feature +++ b/mod/lti/tests/behat/managecoursetools.feature @@ -30,7 +30,7 @@ Feature: Manage course tools | Tool URL | http://example.com | | Tool description | A short description of the tool | And I press "Save changes" - And I should see "Successfully added course tool" + And I should see "Teaching Tool 1 added" And I should see "A short description of the tool" in the "Teaching Tool 1" "table_row" Scenario: Viewing a site level tool in the course tools table @@ -42,9 +42,9 @@ Feature: Manage course tools And I am on the "Course 1" course page logged in as teacher1 When I navigate to "LTI External tools" in current page administration Then I should see "Test tool 2" in the "reportbuilder-table" "table" - And "This is a site level tool which cannot be edited" "icon" should exist in the "Test tool 2" "table_row" + And "You don't have permission to edit this tool" "icon" should exist in the "Test tool 2" "table_row" And I should see "Test tool 3" in the "reportbuilder-table" "table" - And "This is a site level tool which cannot be edited" "icon" should exist in the "Test tool 3" "table_row" + And "You don't have permission to edit this tool" "icon" should exist in the "Test tool 3" "table_row" And I should not see "Example tool" in the "reportbuilder-table" "table" Scenario: Viewing course tools without the capability to add/edit but having the capability to use @@ -57,7 +57,7 @@ Feature: Manage course tools | Test tool | Example description | https://example.com/tool | C1 | And I am on the "Course 1" course page logged in as teacher1 When I navigate to "LTI External tools" in current page administration - Then "You don't have permission to add or edit course tools" "icon" should exist in the "Test tool" "table_row" + Then "You don't have permission to edit this tool" "icon" should exist in the "Test tool" "table_row" @javascript Scenario: Edit a course tool @@ -79,7 +79,7 @@ Feature: Manage course tools | Tool URL | http://example.com | | Tool description | A short description of the tool (edited) | And I press "Save changes" - And I should see "The changes to the course tool 'Test tool (edited)' were saved" + And I should see "Changes saved" And I should see "A short description of the tool (edited)" in the "Test tool (edited)" "table_row" @javascript