964 Commits

Author SHA1 Message Date
Jake Dallimore
26d0ac156e
MDL-79442 mod_lti: launch container should inherit from tool config
Specifically in the case where multiple content items are returned, and
when we hit the content_item_to_form() method, ensure that content-item-
specific values do not influence the final value of launchcontainer,
which must use the value set in tool configuration.
2023-09-22 10:13:56 +08:00
Sara Arjona
3079511dc7
NOBUG: Fixed SVG browser compatibility 2023-09-15 17:33:23 +02:00
Jun Pataleta
4370887449
Merge branch 'MDL-78916-master' of https://github.com/junpataleta/moodle 2023-09-15 16:19:06 +08:00
Jake Dallimore
4464e46336
MDL-78916 mod_lti: deprecate and remove unused strings and files
These strings and files supported the old way of creating course-level
tools, which has now been fully replaced.
2023-09-15 10:47:10 +08:00
Jake Dallimore
f41a0dcacf
MDL-78916 mod_lti: remove delegate option for name and email sharing
These settings are no longer configurable on a per-instance basis, so
'delegate to teacher' needs to be removed from the options list for the
relevant fields in the tool type edit form. For existing tool types,
allow 'delegate to teacher' to continue to be used only if it's the
currently set value of these fields. If changed, it cannot be set again.
2023-09-15 10:47:10 +08:00
Jake Dallimore
3cabbfd00f
MDL-78916 mod_lti: update behat tests to test new instance form 2023-09-15 10:47:10 +08:00
Jake Dallimore
630066c4f5
MDL-78916 mod_lti: update add/edit instance form to new design
This form layout applies when adding or editing any instance which is
based on a preconfigured tool (course or site). That is now the only
supported way of configuring a mod_lti instance.
2023-09-15 10:47:10 +08:00
Jake Dallimore
bf3f13fea6
MDL-78916 mod_lti: refactor mod_form, separating legacy definition
Move all the logic dealing with display of the legacy instance form,
(which displays those frozen, manually-configured instances) into a
method of its own for clarity.
2023-09-13 17:37:06 +08:00
Huong Nguyen
50a74f6a2d
Merge branch 'MDL-67271-master' of https://github.com/sarjona/moodle 2023-09-13 11:15:22 +07:00
Jun Pataleta
6c6a655b0b
Merge branch 'MDL-78527-master' of https://github.com/aanabit/moodle 2023-09-13 11:17:20 +08:00
Ilya Tregubov
94c9ce0595
Merge branch 'MDL-78806-master' of https://github.com/junpataleta/moodle 2023-09-13 10:54:54 +08:00
Amaia Anabitarte
b87b72195c MDL-78527 core_completion: Fixing tests 2023-09-12 15:43:49 +02:00
Sara Arjona
87589e07fc
MDL-67271 pix: Add missing SVG files
The absence of SVG files has been addressed by including them,
sourced from the respective FontAwesome versions available for
download at https://fontawesome.com/icons
2023-09-12 10:54:15 +02:00
Jun Pataleta
1c892fb6d9
Merge branch 'MDL-78324-master-7' of https://github.com/andrewnicols/moodle 2023-09-11 16:29:56 +08:00
Ilya Tregubov
787455198b
MDL-78909 mod_lti: Add indexes in upgrade.php 2023-09-11 16:03:53 +08:00
Ilya Tregubov
faa491fe3b
MDL-78909 mod_lti: Fix upgrade.php for lti. 2023-09-11 13:17:08 +08:00
Ilya Tregubov
ba32de5281
MDL-78909 mod_lti: Show category restriction only for site tools 2023-09-11 10:14:58 +08:00
Ilya Tregubov
3eceb14342
MDL-78909 mod_lti: Fix for restrict to category. 2023-09-11 10:14:58 +08:00
Ilya Tregubov
f9b1bac756
MDL-78909 mod_lti: Support coursevisibility override for courses 2023-09-11 10:14:58 +08:00
Jun Pataleta
1eb8ee32bb
MDL-78806 core: Remove redundant site name
MDL-78806 core: Remove redundant site name on page titles

* With the site name now being appended to the page titles, there
is no need to manually append the page titles.
2023-09-09 08:58:54 +08:00
Andrew Nicols
48bc688ccd
MDL-78324 core: Convert modals to use new static methods
This commit takes all modals which were not using the legacy
ModalFactory.create triggers and migrates them to the new Modal.create
method.
2023-09-09 00:04:11 +08:00
Ilya Tregubov
d302f0dc01
Merge branch 'MDL-78597-master' of https://github.com/snake/moodle 2023-08-31 08:23:03 +08:00
Jake Dallimore
a23abb0538
MDL-78597 mod_lti: fix those tests not using lti generators
The following were added in MDL-69489 and had a few issues, which are
fixed in this patch:
Unit tests:
- were not using the existing generator.
- were making assertions inside a foreach, which doesn't test anything
if the result set returned is empty (error prone).
- were calling setAdminUser() unnecessarily.
Behat tests:
- the restricttocategory.feature file used manual steps to setup site
tools.
2023-08-29 16:14:55 +08:00
Jake Dallimore
c497672778
MDL-78597 mod_lti: add category restriction support to course tools list 2023-08-29 16:14:37 +08:00
Jake Dallimore
7cb2a78626
MDL-78597 mod_lti: add category restriction support to lti generator
This is already supported in lti_add_type, via the lti_coursecategories
config value, so all that's needed is to match the categories by
idnumber and pass through the resulting ids.
2023-08-29 16:14:37 +08:00
Jake Dallimore
5c737525d8
MDL-78597 mod_lti: Add test for manually configured instance editing
This adds a single scenario covering all the expected behavior for those
existing, manually configured tools. It also removes any tests dealing
with creation of manually configured instances, which is not supported
any more.
2023-08-29 16:14:11 +08:00
Jake Dallimore
9914870b7d
MDL-78597 mod_lti: cover creation of course tools using cartridge URLs
This replaces the legacy scenario, which used the '+' on the activity
instance edit form, with a scenario covering the cartridge use on the
new course tools (LTI External tools) edit form.
2023-08-29 16:14:11 +08:00
Jake Dallimore
dfd215cad2
MDL-78597 mod_lti: add cartridge support to course tool generator
Allow the generator to create course tools based on cartridge URLs.
2023-08-29 16:14:11 +08:00
Jake Dallimore
93707d8cf5
MDL-78597 mod_lti: deprecate mod/lti:addmanualinstance and lock config
This change:
- removes all uses of mod/lti:addmanualinstance and deprecates it.
- updates the activity instance edit form, specifically the way it deals
with existing manually-configured instances, removing the ability to
edit tool configuration and adding a notice to the user.
2023-08-29 16:14:11 +08:00
Jake Dallimore
d8e2067b66
MDL-78597 mod_lti: deprecate lti_get_lti_types_by_course()
This method includes broken legacy behaviour in which the inclusion of
course and site tools could be controlled independently, based on the
capabilities 'mod/lti:addmanualinstance' (to include course tools) and
'mod/lti:addpreconfiguredinstance' (to include site tools). This
behaviour is deprecated in 4.3, so this method is also deprecated. See
the replacement method types_helper::get_lti_types_by_course.
2023-08-29 13:14:15 +08:00
Jake Dallimore
7ca26f1460
MDL-78597 mod_lti: add \mod_lti\local\types_helper class
This will serve as a location to put new tool-type-centric methods.
2023-08-29 13:11:49 +08:00
Jake Dallimore
85679c47da
MDL-78597 mod_lti: let content item callbacks obey preconfigured cap
Users without the 'mod/lti:addpreconfiguredinstance' capability won't be
able to see any mod_lti content items in the activity chooser.
Note: this patch doesn't address the underlying locallib method,
lti_get_lti_types_by_course(), which will be addressed elsewhere.
2023-08-29 13:06:48 +08:00
Jake Dallimore
5b01727107
MDL-78597 mod_lti: retain selected option when arranging into optgroups
Fixes a bug with YUI, resulting in the selected option not being set
properly again after the options have been reorganised into optgroups.
2023-08-29 13:06:48 +08:00
Jake Dallimore
6ed29fc35b
MDL-78597 mod_lti: prevent manual instance use in edit form
This change ensures tool instances which are currently using
preconfigured tools (site or course level) are not able to be switched
back to use the manual 'Automatic, based on tool URL' option. That
option is reserved for legacy tool support of manual instances and
domain-matched site tools, but must not be selectable otherwise.
2023-08-29 13:06:48 +08:00
Jake Dallimore
ca10084639
MDL-78597 mod_lti: remove the ability to add manual instances of tools
In summary:
- Remove the 'External tool' item from get_course_content_items()
hook, which results in its removal from the activity chooser.
- Remove the 'External tool' item from get_all_content_items() hook,
which results in its removal from the admin activity chooser
recommendations page.
- Prevent use of the edit_form for creation of new manual instances.
- Retain the ability to edit existing manual instances.
- Fix tests expecting external tool.
2023-08-29 13:06:48 +08:00
Jake Dallimore
36900136a8
MDL-78597 mod_lti: add instance creation to behat creatable entities
This allows behat tests which have already created either a site or
course tool type, to then link it to an activity instance using a
generator. This depends on the ability to name match a type.
2023-08-29 13:06:48 +08:00
Jake Dallimore
5862fe2607
MDL-78597 mod_lti: add full field support to course_tool_types generator
This method is used by behat only, where only a single arg is received.
The method lti_add_type() expects two params: type and config, but will
only ever receive one. This means not all the fields can be set when
creating an lti type. This change:
- Removes the superfluous param which the method won't receive
- Improves the logic for handling type and type config data, making it
match what happens when creating types via mforms.
- Adds relative URL support to the baseurl field, allowing behat
features to create types using local tool fixtures.
- Sets sensible default for missing config data, allowing the created
tool type to be used in launches in places like behat.
2023-08-29 13:06:48 +08:00
Jake Dallimore
7d1cd36e89
MDL-78597 mod_lti: add full field support to tool_types generator
This method is used by behat only, where only a single arg is received.
The method lti_add_type() expects two params: type and config, but will
only ever receive one. This means not all the fields can be set when
creating an lti type. This change:
- Removes the superfluous param which the method won't receive
- Improves the logic for handling type and type config data, making it
match what happens when creating types via mforms.
- Adds relative URL support to the baseurl field, allowing behat
features to create types using local tool fixtures.
- Sets sensible default for missing config data, allowing the created
tool type to be used in launches in places like behat.
2023-08-29 13:06:47 +08:00
Jake Dallimore
b3ef113509
MDL-78597 mod_lti: set instance vars in mod_edit form
This introduces a form constructor and sets up instance vars for the
object there, allowing removal of the optional_param() calls in other
methods.
2023-08-29 13:06:47 +08:00
Jake Dallimore
8825c0a0fe
MDL-78597 mod_lti: remove tool configuration usage for course tools
This change removes the 'Tool configuration usage' control for course
tools being edited via site admin. All course tools are, at a minimum,
considered to be preconfigured tools and are visible in the course.
The visibility of course tools in the activity chooser will be
controlled via the LTI External tools course page in future.
2023-08-29 13:06:46 +08:00
Jake Dallimore
8ed8b6e9b9
MDL-78597 mod_lti: make new course tools show in activity chooser
This will only impact newly created course tools, not existing tools.
Existing tools will be listed in the LTI External tools page and
teachers will be able to add them to the activity chooser from there.
2023-08-29 13:05:55 +08:00
Jake Dallimore
6f4555d31d
MDL-78597 mod_lti: improve DB reads on coursetooledit page
This was hitting the lti_types table twice, via both lti_get_type and
lti_get_type_type_config. This change adds course to the stdClass
returned by the latter, so we can just make a single call to that.
This also permits the use of that course property in other places
where we'd like to have access to it, such as when editing a pre-
configured tool at site level.
2023-08-29 13:05:55 +08:00
Andrew Nicols
af7719682d
MDL-79064 core: Update all get_strings as uses 2023-08-29 10:57:54 +08:00
Jun Pataleta
d6f6443993
NOBUG: Fixed file access permissions 2023-08-26 11:04:43 +08:00
Ilya Tregubov
fac3395464
MDL-69489 mod_lti: Fix query condition
Missing parenthesis added
2023-08-23 10:53:31 +08:00
Jackson D'souza
480114fc96 MDL-69489 mod_lti: Make LTI only available to specific course categories
* Add new table for LTI types course categories
* Update LTI add / update form to restrict tool availablily in selected course categories
* Bumped version
2023-08-22 12:53:07 +01:00
Andrew Nicols
edf29562cc
Merge branch 'MDL-78576-master' of https://github.com/snake/moodle 2023-08-17 09:12:36 +02:00
Andrew Nicols
b71bec8475
Merge branch 'MDL-78684-master' of https://github.com/andelacruz/moodle 2023-08-17 09:12:36 +02:00
Jake Dallimore
42c24a3223
MDL-78576 mod_lti: fail launch early when preconfigured tool not found
In the case where the instance is associated with a preconfigured tool
and where that tool type has since been removed, throw an exception
early.
2023-08-16 23:51:31 +08:00
Jake Dallimore
3a1db3cc47
MDL-78576 mod_lti: improve course tool deletion with contextual messages
Present different deletion messages depending on whether the tool has
usages or not.
2023-08-16 23:51:31 +08:00