catalyst / moodle-mod_scormremote Goto Github PK
View Code? Open in Web Editor NEWA Moodle activity for serving SCORM packages remotely to another LMS across domains
Home Page: https://moodle.org/plugins/mod_scormremote
License: Other
A Moodle activity for serving SCORM packages remotely to another LMS across domains
Home Page: https://moodle.org/plugins/mod_scormremote
License: Other
In some testing I got an upgrade error, didn't grab the stack trace but it was barfing because the primarydomain column can't be null and it was I believe temporarily null during the upgrade. I had to fix it manually:
ALTER TABLE mdl_scormremote_clients ALTER COLUMN primarydomain DROP NOT NULL;
scormremote_clients
Unexpected index 'mdl_scorclie_pri_ix'.
Mostly consider the security downsides of doing this
Alternative add a runtime check if it isn't set
ie if someone puts in a full url with https then just strip this out and accept the domain gracefully
The MOODLE_39_STABLE is not actually compatible with Moodle 3.9 as it depends on core_files\archive_writer
I've pushed a version that works to https://github.com/andrewhancox/moodle-mod_scormremote/tree/39_compatible
https://adlnet.gov/projects/scorm/#scorm-versions-and-resources
https://wiki.creativecommons.org/wiki/ShareAlike_compatibility:_GPLv3
Should just be docs and third party xml
This is as a result of the refactoring to meet type-safe equality operators
Not exactly sure what this means, might just be docs. Might be a new option
Scorm 1.2 has limit of 4096
Scorm 2004 has limit of 64000
Many scorms hit this limit
Most LMS's don't care about the limit
scorm again has it hard coded
We should make scorm again just emit a warning to the console but still accept it
This should actually log the user in via complete_user_login() and leave them logged in for this request (same as web services and token logins)
lib.php:scormremote_pluginfile()
calls exit($OUTPUT->render_from_template(...)) to render output which results in a warning if debugging is enabled for the site: Debugging: Coding problem: $PAGE->context was not set...
.
Using Moodle 4.1.4+ (Build: 20230623) and mod_scormremote 2023070600 (44d5d9d).
No warning in PHP error log on the server hosting Moodle.
Warning in PHP error log on the server hosting Moodle:
[31-Aug-2023 16:13:22 Europe/London] Debugging: Coding problem: $PAGE->context was not set. You may have forgotten to call require_login() or $PAGE->set_context(). The page may not display correctly as a result in
* line 567 of /lib/pagelib.php: call to debugging()
* line 1696 of /lib/pagelib.php: call to moodle_page->magic_get_context()
* line 1972 of /lib/setuplib.php: call to moodle_page->initialise_theme_and_output()
* line 250 of /mod/scormremote/lib.php: call to bootstrap_renderer->__call()
* line 5212 of /lib/filelib.php: call to scormremote_pluginfile()
* line 44 of /pluginfile.php: call to file_pluginfile()
Does a scorm which has 10 resources really need to have a wrapper which contains 10 stub SCO's? This means the wrapper has a lot more information encoded into it which ideally isn't present at all. This would limit the ability to swap out a scorm which has 10 sco's to one which has 11 seamlessly.
Before this issue kicks off lets be guided by real world scorms that this client will actually use. If all of their scorms use a single SCO then this issue will be back burner.
If a remote student completes the SCORM, on the Moodle site their completion status is not set to "Completed".
This appears to be because submit_completion.php
has require_login(0, false)
so the POST /mod/scormremote/submit_completion.php gets 303 See Other: /login/index.php.
mod_scormremote 2023070600 with Moodle 4.1.5+ (Build: 20230929).
The js at the top is a blocking load, so nothing under it will load until it has executed. Which means we could:
OR
If we want something genuine to show if the js itself fails then
line 134 of /mod/scormremote/classes/client.php: ArgumentCountError thrown
line 39 of /mod/scormremote/submit_completion.php: call to mod_scormremote\client::get_record_by_domain
This does record data from it doesn't send it anywhere, it is import only from the other site. So I think technically this doesn't store user data even though it does.
I think the best next option is to implement it in a way that allows an admin to login as to this person and make data requests on behalf of that person. Or if the psuedo users ever get turned into real accounts then it will magically just work.
Tasks:
Scorm Again is loaded here.
https://github.com/catalyst/moodle-mod_scormremote/blob/MOODLE_39_STABLE/lib.php#L242
eslint reports no-undef
https://github.com/catalyst/moodle-mod_scormremote/blob/MOODLE_39_STABLE/amd/src/layer3.js#L36
Skipping this test from WR #398963.
Check if this test is still needed. The class \mod_scormremote\client no longer has the 'domain' param.
https://github.com/catalyst/moodle-mod_scormremote/blame/1346fa3e6d304d9a6cff6c88b0df5c633eaac9d3/classes/client.php#L46
When loading in some envs the js is served as html and so won't load:
console message ' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled
The third layer loads Javascript from jssource, which is liked as a .js file. When attempting to load this file errors end up loading init.mustache instead, which is returning the MIME type (“text/html”).
This can potentially cause the error page to not load based on how the browser handles this. A few examples:
ie we could redact the incoming data from the remote site so we have enough to identify and link records but do not record any personal identifying information PII
https://github.com/catalyst/moodle-mod_scormremote/blob/MOODLE_39_STABLE/classes/utils.php#L174-L201
If a user has already been created for one tier they can access other tiers even if the seat limit has been reached.
mod/scormremote/clients.php
) with course subscriptions to Scormremote1 and Scormremote2.Error 402 | Subscription limit reached because there is only one seat for tier Scormremote2 and that is in use by student2.
The SCORM is displayed. The Moodle site admin sees ( 2 / 1) for the seats in use for tier Scormremote2 under Manage clients (mod/scormremote/clients.php
)
If I'm not wrong, the plugging fails -cannot read the database- when the tables prefix is different from mdl_ -the moodle default prefix. It occurs when downloading the wrapper
Added generic privacy provider. This needs to be reviewed.
The README says As learners on the remote site use the scorm, you will see accounts created in your Moodle and enrolments and completion status for those accounts. I want to make sure I understand the plugin's functionality and I don't think that's correct. Is there completion tracking of remote learners on the hosting Moodle?
Or is this an error in the README?
(Also asked this question on the plugin comments page).
Version information says mod_scormremote supports Moodle 3.9 to 4.0. But mod_scormremote\packagefile->download_wrapper()
uses core_files\archive_writer
which was introduced in Moodle 3.11 (MDL-68533).
Consequently clicking the Download button on mod/scormremote/wrapper.php?cmid=<ID>
with Moodle 3.9 results in:
Exception - Class 'core_files\archive_writer' not found
More information about this error
Debug info:
Error code: generalexceptionmessage
Stack trace:
line 139 of /mod/scormremote/classes/packagefile.php: Error thrown
line 92 of /mod/scormremote/wrapper.php: call to mod_scormremote\packagefile::download_wrapper()
Maybe the lms admins of the N other embedding LMS's could have accounts in the host lms and could directly access the latest versions of all of the packages. Even better we could have a report which show all of the packages which have been used by a certain domain, AND which version they are on and what version is available and prompt them to download any which are newer, or which are not yet in use.
mod/scormremote/error.php
sets the HTTP status with a corresponding message, for example, 402 | Subscription limit reached. But error.php
has require_login()
at the top (line 30) so the student never sees the error, just the login page of the Moodle site hosting the SCORM.
If I remove the require_login()
students see any error messages (401, 402, etc.) as expected.
We know the sha1hash for each package and can use that in the pluginfile url so that all real scorm files can be served as immutable and public
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.