Skip to content

Commit

Permalink
Merge branch 'MDL-78713-master' of https://github.com/snake/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta authored and HuongNV13 committed Aug 10, 2023
2 parents ec200c0 + 9f7e2ca commit b8a93b9
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected function add_columns(tool_types $tooltypesentity): void {
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'
);
}
Expand All @@ -135,7 +135,7 @@ protected function add_columns(tool_types $tooltypesentity): void {
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'
);
}
Expand Down
12 changes: 6 additions & 6 deletions mod/lti/coursetooledit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@

// 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]));
Expand All @@ -66,7 +66,7 @@
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);
Expand Down
19 changes: 9 additions & 10 deletions mod/lti/lang/en/lti.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@
$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';
Expand Down Expand Up @@ -353,7 +353,7 @@
$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';
Expand Down Expand Up @@ -522,7 +522,6 @@
$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';
Expand Down
10 changes: 5 additions & 5 deletions mod/lti/tests/behat/managecoursetools.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b8a93b9

Please sign in to comment.