-
Bug
-
Resolution: Fixed
-
Minor
-
3.1
-
MOODLE_31_STABLE
-
MOODLE_31_STABLE
-
MDL-53977_master -
This happens because of MDL-21782 where the user is not returned by get_enrolled_sql because of the round(time(), -2) hack to utilise DB caching. The user is instantly enrolled in the course when accessing the LTI activity but the round(time(), -2) hack means the it's possible that the time used in the query is less than the current time, meaning they are not returned until X seconds has passed.
Steps to replicate
Requirements
- Two sites.
- One for your LTI consumer.
- One for your LTI provider.
On your LTI provider site.
- Visit 'Site administration' > 'Plugins' > 'Authentication' > 'Manage authentication'.
- Enable 'LTI'.
- Visit 'Site administration' > 'Plugins' > 'Enrolments' > 'Manage enrol plugins'.
- Enable 'Shared external tool'.
- Visit a course and create an assignment.
- Visit 'Course administration' > 'Users' > 'Enrolment methods'.
- Add a shared external tool with 'Tool to be provided' selected to your assignment.
- Visit 'Course administration' > 'Shared external tools'.
- Make note of the URL and secret.
On your LTI consumer site.
- Visit a course.
- Add a LTI activity and use the URL and secret from your LTI provider site.
- Log in as a student.
- Visit the course and click on the LTI activity.
- Notice the assignment header is only shown.
- Wait for 2 minutes and refresh the page.
- Note the assignment displays as expected.
- Discovered while testing
-
MDL-52035 Integrate LTI Provider support in Moodle
-
- Closed
-
- has been marked as being related by
-
MDL-54009 Prettify consuming an LTI provider from a Moodle site
-
- Closed
-
- is a regression caused by
-
MDL-21782 Major 2.0 enrolments rewrite META
-
- Closed
-
- will be (partly) resolved by
-
MDL-51443 Improve/remove get_enrolled_sql db caching trick
-
- Closed
-