Commit graph

1031 commits

Author SHA1 Message Date
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
Jake Dallimore
e555984880
MDL-78576 mod_lti: move count subselect into report base fields
This gets around a limitation of the RB; its inability to use a column
subselect value in another column. This change permits the use of the
count in more than just the 'usage' column, as the row_callback is able
to set an instance var, usable by other column callbacks.
2023-08-16 23:51:31 +08:00
Jake Dallimore
1e886c375c
MDL-78753 mod_lti: fix access control for LTI External tools page
To view this page, the user must be able to use preconfigred tools in
the course. This is controlled by the 'mod/lti:addpreconfiguredinstance'
capability. The capability 'mod/lti:addcoursetool' isn't required to
view the page but does add extra functionality to the page.
2023-08-15 18:03:43 +07:00
Jake Dallimore
f645d21da1
MDL-78753 mod_lti: use course visibility named constant in report params 2023-08-15 09:20:44 +08:00
Jake Dallimore
9f7e2cafda
MDL-78713 mod_lti: update lang strings 2023-08-08 13:33:01 +08:00
Angelia Dela Cruz
6385949078 MDL-78684 Behat: Replace gradebook navigation to use page resolvers
This commit also does other things such as:
- Replace manual steps to setup gradebook by data generators
- Added support for outcomes and scales page resolvers
- Behat clean up
2023-08-08 11:53:45 +08:00
Paul Holden
3b6fcd1f5b
MDL-78575 mod_lti: remove column alias from inner sub-select.
The `usage` alias is a reserved word in MySQL/MariaDB.
2023-08-01 12:46:18 +01:00
Jake Dallimore
a99e8fbdac
MDL-78575 mod_lti: use activity icon styling for course tool icons 2023-07-17 09:22:18 +08:00
Jake Dallimore
51cc455525
MDL-78575 mod_lti: Add deletion support to course tools page 2023-07-17 09:22:18 +08:00
Jake Dallimore
5e077e1e46
MDL-78575 mod_lti: add behat coverage of course tools list page 2023-07-17 09:22:18 +08:00
Jake Dallimore
8d455f5adb
MDL-78575 mod_lti: add course tool editing form as standalone page
This handles create/edit of course tools. Deletion will be supported via
an action and modal confirm on the coursetools listing page.
2023-07-17 09:22:17 +08:00
Jake Dallimore
a8f496e48e
MDL-78575 mod_lti: add course tools page to course
Uses a reportbuilder report to display course tools.
2023-07-14 11:00:29 +08:00
Paul Holden
436a279dec
MDL-76953 mod: deprecate libxml library method wrappers.
The `libxml_disable_entity_loader` method is deprecated since PHP8.0,
which is our minimum required version so we no longer need to support
calls to it using the current wrappers.
2023-06-16 19:15:24 +01:00
Helen Foster
06c5a6c883 MDL-78415 lang: Import fixed English strings (en_fix) 2023-06-08 09:59:04 +01:00
Simey Lameze
d9cccadcf2 MDL-76065 behat: Review and enhance mod_lti Behat tests
In this commit, the following improvements were made to the mod_lti Behat tests:

* Replaced manual steps with data generators to set completion.
* Eliminated unnecessary user and course enrolments data generation as some tests can be performed as an admin.
* Removed the @javascript tag from non-JS tests.
* Updated the LTI data generator to generate an internal Moodle URL in the toolurl field, enabling the use of XML files.
2023-05-23 12:11:48 +08:00
Angelia Dela Cruz
dca69e002a MDL-76065 behat: LTI behat generators use UI
Replace steps that manually add LTI instances via the UI and use
Behat generators. This improves the speed of the Behat test runs.
2023-05-23 12:11:48 +08:00
Ilya Tregubov
38230b57e4
Merge branch 'MDL-77840-master' of https://github.com/davewoloszyn/moodle 2023-05-16 09:46:05 +08:00
David Woloszyn
80203e3be1 MDL-77840 lti: Avoid passing nulls to base64_encode 2023-05-02 13:46:41 +10:00
Jun Pataleta
9095bb0ef9 MDL-78000 upgrade: add the 4.2.0 separation line to all upgrade scripts 2023-04-22 23:17:50 +08:00
Eloy Lafuente (stronk7)
061c9d7ba0 MDL-77940 versions: bump all versions and requires near release
version = 2023042400 release version
requires= 2023041800 current rc1 version
2023-04-18 18:08:09 +02:00
Sara Arjona
9ce4fb65fd Merge branch 'MDL-77164-master' of https://github.com/marinaglancy/moodle 2023-04-13 14:00:18 +02:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Meirza
67e583783c MDL-77348 mod_lti: Added missing class properties
In PHP 8.2 and later, setting a value to an undeclared class property is
deprecated and emits a deprecation notice.
So we need to add missing class properties that still need to be declared.

While working on this issue, even though it's not related to the deprecation issue,
I added 'use core_external\external_api' to avoid the 'Undefined type external_api' warning at
mod_lti_testcase::generate_tool_proxy().
2023-04-12 13:56:21 +07:00
Ilya Tregubov
90fa3f3390 Merge branch 'MDL-69976' of https://github.com/paulholden/moodle 2023-04-04 12:20:52 +08:00
Jun Pataleta
f10d132bdc MDL-77105 mod_lti: Add 'nofilter' class for custom tool icons
Add a '.nofilter' class when rendering custom tool icons in order
to render them as is and without CSS filter on the activity chooser.
2023-03-27 13:57:07 +08:00
Paul Holden
060e47e58e
MDL-69976 mod_lti: final removal of deprecated 310 method. 2023-03-20 09:41:15 +00:00
Jun Pataleta
8441270181 Merge branch 'MDL-77559-master-2' of https://github.com/andrewnicols/moodle 2023-03-09 16:02:01 +08:00
Andrew Nicols
511401f4f6 MDL-77559 js: Rebuild all JS with Node 16 2023-03-09 09:53:19 +08:00
Mathew May
e5ca7766e7 MDL-52805 core: Remove legacy log calls 2023-03-07 13:08:46 +08:00
Andrew Nicols
33b1e41f13 MDL-75012 js: Full build of all grunt things 2023-03-02 11:55:32 +08:00
Paul Holden
ffb123b6e8 MDL-76602 mod_lti: array syntax/whitespace cleanup. 2023-02-21 17:04:29 +00:00
Paul Holden
87912b7929 Merge branch 'MDL-76602-master-lti13claims' of https://github.com/cengage/moodle 2023-02-21 16:46:25 +00:00
Paul Holden
a309d643ab Merge branch 'MDL-77140-master' of https://github.com/snake/moodle 2023-02-14 15:51:32 +00:00
Jake Dallimore
7e6f706717 MDL-77140 mod_lti: fix content item return for new TinyMCE versions 2023-02-10 10:11:34 +08:00