arlosoftware / moodle-enrol_arlo Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Commit vendor directory to project
PATCH https://lwarlo.arlo.co/api/2012-02-01/auth/resources/registrations/31/
<?xml version="1.0" encoding="utf-8"?>
<diff>
<replace sel="Registration/LastActivityDateTime/text()[1]">2017-07-11T02:55:08+0000</replace>
<replace sel="Registration/ProgressStatus/text()[1]">In progress</replace>
<replace sel="Registration/ProgressPercent/text()[1]">33</replace>
</diff>
Response
<?xml version="1.0" encoding="utf-8"?>
<ApiException>
<Code>BadRequest</Code>
<Message>Path Registration/LastActivityDateTime/text()[1] did not match a node (line = 2, position = 8)</Message>
</ApiException>
I have been using patch example from: https://developer.arlo.co/doc/api/2012-02-01/auth/resources/registrations there is nothing obvious to me in request and I don't really have time to read throught rfc5261.
Is this because fields have no data yet. Should I be using add?
https://lwarlo.arlo.co/api/2012-02-01/auth/resources/registrations/31/?expand=Registration
<?xml version="1.0" encoding="utf-8"?>
<Registration>
<RegistrationID>31</RegistrationID>
<UniqueIdentifier>d0d1c8c0-94db-4d00-8706-c3a5e28f8a65</UniqueIdentifier>
<Attendance>Unknown</Attendance>
<Status>Approved</Status>
<CreatedDateTime>2017-07-10T02:56:06.045Z</CreatedDateTime>
<Link rel="self" type="application/xml" href="https://lwarlo.arlo.co/api/2012-02-01/auth/resources/registrations/31/"/>
<Link rel="http://schemas.arlo.co/api/2012/02/auth/related/CustomFields" type="application/xml" title="CustomFields" href="https://lwarlo.arlo.co/api/2012-02-01/auth/resources/registrations/31/customfields/"/>
<Link rel="http://schemas.arlo.co/api/2012/02/auth/related/Event" type="application/xml" title="Event" href="https://lwarlo.arlo.co/api/2012-02-01/auth/resources/events/1/"/>
<Link rel="http://schemas.arlo.co/api/2012/02/auth/related/Contact" type="application/xml" title="Contact" href="https://lwarlo.arlo.co/api/2012-02-01/auth/resources/contacts/33/"/>
<Link rel="http://schemas.arlo.co/api/2012/02/auth/related/SourceInfo" type="application/xml" title="SourceInfo" href="https://lwarlo.arlo.co/api/2012-02-01/auth/resources/registrations/31/sourceinfo/"/>
</Registration>
Steps:
Results:
What is the max length of a platform name?
When the plugin attempts to match Arlo contacts against a Moodle user there is the possibility that Moodle could find more than one match.
In Moodle there is a setting "allowaccountssameemail" by default it is set to false. And still, this may be enforced by the Moodle UI but not by other plugins that create Moodle user accounts.
In some organisations, they have integrations to SMS, HR systems etc. Users can have multiple Moodle accounts that have same information attached such as first name, last name and email.
The two options are:
Thoughts?
Development code that can parse XML responses from Arlo AuthAPI and serialize to Collection and Resource objects.
Steps:
EXPECTED:
Registrations should sync
ACTUAL:
Registrations are not synced
Moodle course:
https://dev-arlo.elearning.ac.nz/course/view.php?id=19
Arlo template:
https://arlomoodleqa.builds.arlosoftware.net/management/Console/#/templates/1015
Add course group creation for new enrol instances.
Clean up lang/en/enrol_arlo.php
The changes below have been suggested to help make the Arlo connection process as simple as possible.
Feedback welcomed. Submitted by Tim
Setup plugin skeleton. Migrate usable code from the moodle-local_arlo plugin.
Navigate to Site Administration > Plugins > Enrolements > Manage Arlo > Email log
Results:
Moodle Administration menu > Site administration > Plugins > Enrolments > Manage Arlo > Configuration
Under 'Resulting'
Should 'Push Event results' be enabled by default? Currently, this is disabled by default. This will cause issues for our support team as almost all users expect results for events to flow back into Arlo.
When integration encounters following HTTP status codes how should they be handled?
401 Unauthorized - Alert, disable plugin?
403 Forbidden - Alert, disable plugin?
500 Internal Server Error - Alert, retry?
503 Service Unavailable - Alert, retry?
Steps:
Results:
Remove user from entol_arlo_contact table
Upgrade instructions.
Steps:
Results:
Under existing code when a new user needs to be created. A username is generated by using:
first 3 letters of firstname + first 3 letters of lastname + random 3 digit number
Testing against Arlo QA instance I found matching taking more time that expected and became a real problem with 5000 contacts. This was due to Contacts having first Arlo (1..n) and lastname REGS.
I also have issues generating usernames for people using special characters first, last names. Like Chinese UTF-8 characters.
Moodle does accept .@_a-z0-9 by default. Moodle does have a setting $CFG->extendedusernamechars not enabled by default that allows other characters.
Any thoughts on an alternative username scheme. Email address maybe?
Relay important alerts like sync errors through MessageAPI
// Provider
$messageproviders = array (
// Error alerts.
'alerts' => array(
),
);
// Example of sender
$message = new \core\message\message();
$message->component = 'enrol_arlo';
$message->name = 'alert';
$message->notification = 1;
$message->userfrom = core_user::get_noreply_user();
$message->subject = get_string('usercommentedonaplansubject', 'core_competency', $fullname);
$message->fullmessage = $fullmessage;
$message->fullmessageformat = $format;
$message->fullmessagehtml = $fullmessagehtml;
$message->smallmessage = get_string('usercommentedonaplansmall', 'core_competency', array(
'fullname' => $fullname,
'plan' => $planname,
));
$message->contexturl = $url->out(false);
$message->contexturlname = $urlname;
// Message each recipient.
foreach ($recipients as $recipient) {
$msgcopy = clone($message);
$msgcopy->userto = $recipient;
message_send($msgcopy);
}
Sometimes it's not clear what all admin settings do.
Steps:
EXPECTED:
Arlo-to-Moodle connection on both courses should be retained after upgrade
New arlo registration is synced to Moodle
ACTUAL:
New Arlo registration has not synced to Moodle after a couple of hours
New Arlo Registration: Philip Woo
Moodle: https://dev-arlo.elearning.ac.nz/enrol/users.php?id=39
Arlo: https://arlomoodledemo.arlo.co/management/Console/#/onlineactivities/1015/registrations
When making a call to API I am receiving a resource when I don't expect any be returned.
Review attached file:
The last modified date is
<LastModifiedDateTime>2017-05-11T01:27:13.858Z</LastModifiedDateTime>
This occurs when using either 2017-05-11T01:27:13+0000 or 2017-05-11T01:27:13.858Z in datetime filter.
Call with 2017-05-11T01:27:13+0000
https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/eventtemplates/?expand=EventTemplate&filter=LastModifiedDateTime gt datetime('2017-05-11T01:27:13+0000')&orderby=LastModifiedDateTime ASC
Encoded
https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/eventtemplates/?expand=EventTemplate&filter=LastModifiedDateTime%20gt%20datetime%28%272017-05-11T01%3A27%3A13%2B0000%27%29&orderby=LastModifiedDateTime%20ASC
Call with 2017-05-11T01:27:13.858Z
https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/eventtemplates/?expand=EventTemplate&filter=LastModifiedDateTime gt datetime('2017-05-11T01:27:13.858Z')&orderby=LastModifiedDateTime ASC
Encoded
https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/eventtemplates/?expand=EventTemplate&filter=LastModifiedDateTime%20gt%20datetime%28%272017-05-11T01:27:13.858Z%27%29&orderby=LastModifiedDateTime%20ASC
Thoughts?
User story: a person fails the course, and wants to retake the course with a clean record (grade, progress, etc)
Steps:
EXPECTED:
User gets another instance on the Moodle course
ACTUAL:
The user is only synced once
This a rare use case. Just confirming behaviour if a Moodle admin decides to change platform FQDN.
When a user changes the platform in Moodle, what is the expected behaviour?
All enrolment instances will be broken as reference previous platform. As well as template, event, online activity, contact syncing.
Do we drop data or rename?
I expect a new platform, so all previous associated data would be dropped?
Mat is working on a new Moodle admin setting that locks the text field and requires another action from admin to unlock and change platform.
Thoughts?
Getting a 'Client connection error!' on the Arlo Connection page which blocks QA from Syncing Arlo-Moodle
Please see error logs below
Thursday, 27 July 2017, 4:41 PM | arlomoodleqa.builds.arlosoftware.net | https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/eventtemplates/?expand=EventTemplate&filter=CreatedDateTime%20gt%20datetime%28%271970-01-01T00%3A00%3A00%2B0000%27%29%20or%20LastModifiedDateTime%20gt%20datetime%28%271970-01-01T00%3A00%3A00%2B0000%27%29&orderby=LastModifiedDateTime%20ASC | 0 | cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html) |
---|
Thursday, 27 July 2017, 4:41 PM | arlomoodleqa.builds.arlosoftware.net | https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/events/?expand=Event%2CEvent%2FEventTemplate&filter=CreatedDateTime%20gt%20datetime%28%271970-01-01T00%3A00%3A00%2B0000%27%29%20or%20LastModifiedDateTime%20gt%20datetime%28%271970-01-01T00%3A00%3A00%2B0000%27%29&orderby=LastModifiedDateTime%20ASC | 0 | cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Thursday, 27 July 2017, 4:41 PM | arlomoodleqa.builds.arlosoftware.net | https://arlomoodleqa.builds.arlosoftware.net/api/2012-02-01/auth/resources/onlineactivities/?expand=OnlineActivity%2COnlineActivity%2FEventTemplate&filter=CreatedDateTime%20gt%20datetime%28%271970-01-01T00%3A00%3A00%2B0000%27%29%20or%20LastModifiedDateTime%20gt%20datetime%28%271970-01-01T00%3A00%3A00%2B0000%27%29&orderby=LastModifiedDateTime%20ASC | 0 | cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Steps:
EXPECTED:
Moodle grades sync to the Arlo event
ACTUAL:
Grades still have not synced after a couple of hours
Moodle: https://dev-arlo.elearning.ac.nz/enrol/users.php?id=36
Arlo: https://arlomoodledemo.arlo.co/management/Console/#/onlineactivities/1014
Steps:
EXPECTED:
Name/Email change on existing registrants update on Moodle
ACTUAL:
Changes via merging do not update on moodle
Arlo Course (MergedReg MergedReg2):
https://arlomoodleqa.builds.arlosoftware.net/management/Console/#/onlineactivities/11/registrations
Moodle Course (MergedReg MergedReg):
https://dev-arlo.elearning.ac.nz/enrol/users.php?id=32
Add code to migrate existing clients from old integration to new integration.
IMPORTANT: Ensure any records that have old platform name convention are migrated to use new FQDN platform name convention. #11
Track each call to Arlo AuthAPI.
Create table:
Create admin page to view, needs to provide ordering by timelogged, status.
Video link:
https://drive.google.com/file/d/0B1JMDYWZxC6oZDBrVjNZS1hYSmM/view
Steps:
Results:
Added additional related issues on the comments below
Platform OA with the issue: https://arlomoodleqa.builds.arlosoftware.net/management/Console/#/onlineactivities/4
Moodle course
https://dev-arlo.elearning.ac.nz/grade/report/grader/index.php?id=18
Steps:
Results:
Also note: Progress status is incorrect
https://dev-arlo.elearning.ac.nz/admin/settings.php?section=enrolsettingsarlo
I noticed that the messages below have showed up and the Green status disappeared on the Connection page after the registrants of this event have synced and I have taken the quizzes as the registrants.
I also get an Error 400 when I look at the logs:
https://arlomoodledemo.arlo.co/api/2012-02-01/auth/resources/registrations/166/
BadRequestString was not recognized as a valid DateTime. at line 14
Arlo Course with Error 400:
https://arlomoodledemo.arlo.co/management/Console/#/onlineactivities/1014/registrations
Set and pass options on Guzzle Request:
I encountered this the first time I created 1 order in arlo with 3 registrants. I tried to replicate twice now but was not successful. Can we try to look at it?
Steps:
EXPECTED:
All registrants are synced to Moodle
ACTUAL RESULT:
Only 2 out of 3 registrants were synced. The third one synced the same time i created another registration on another online activity (25 mins after the first 2 were synced)
*Could be a bug where it does not sync until there's a new registration
Arlo event (3 Registrants in 1 order):
XmlDeserializer currently using standard PHP Exception class. Could add extended Exceptions for:
Add indexes on DB where appropriate.
Steps:
Results:
Arlo Course:
https://arlomoodledemo.arlo.co/management/Console/#/events/50
Moodle Course:
https://dev-arlo.elearning.ac.nz/enrol/users.php?id=16
Add template information to Online Activity table:
Refactor schema.
Tables used across existing enrol and local plugins.
config_plugins
enrol_arlo_templatelink
local_arlo_api
local_arlo_contacts
local_arlo_events
local_arlo_mergerequests
local_arlo_onlineactivities
local_arlo_registrations
local_arlo_templates
local_arlo_userduplicates
Hi Adam,
Looking for more information on the ordering of results on collections, I can't find any at https://developer.arlo.co/doc/api/2012-02-01/auth/collectionresources can you please direct to where this can be found?
Cheers
No more local plugin, so associate template page can only be injected into navigation via enrol_arlo_extend_navigation_course().
Create Moodle events for:
Moodle events called in the manager class after DB writes:
update_event
update_onlineactivity
Wire up the observer to handle those events.
User creates a template association
Create DB record in enrol_arlo_templatelink table
Handling create/update events
Get Arlo enrol instance using type, sourceguid
When event_created example:
$type = \enrol_arlo_plugin::ARLO_TYPE_EVENT;
$sourcestatus = $event->sourcestatus;
$sourceguid = $event->sourceguid;
$arloinstance = $DB->get_record('enrol_arlo_instance', array('type'=>$type, 'sourceguid'=>$sourceguid));
$instance = $DB->get_record('enrol', array('id'=>$arloinstance->enrolid));
Get enrol plugin
use classes\Arlo\AuthAPI\Enum\EventStatus;
If EventStatus::Active or EventStatus::Completed
$plugin = enrol_get_plugin('arlo');
$instance = $plugin->get_instance_defaults();
$instance->arlotype = $type;
$instance->arloevent = $sourceguid;
$plugin->add_instance($instance);
Else do nothing.
User deletes a template association
Steps:
EXPECTED:
All grade details are reflected correctly
ACTUAL:
The Progress status is still 'Not started' after grades have synced
Arlo Course:
https://arlomoodledemo.arlo.co/management/Console/#/onlineactivities/1015/registrations
Moodle Course:
https://dev-arlo.elearning.ac.nz/enrol/users.php?id=39
While testing I noticed that when importing registrations for event LastModifiedDateTime is not set.
This causes the problem of high watermark "LatestRegistrationModifiedDateTime" not being set. This causes the whole collection to be fetched and processed again. Should collection fetch be order by be "LastModifiedDateTime ASC, CreatedDateTime ASC " I guess this would keep processing until record modified, is there a chance LastModifiedDateTime never set for collection. Is this issue? Thoughts?
Add reload image to pix for manual enrolment instance sync.
In enrol/db/install.php
Do something like:
set_config('matchuseraccountsby', 3,'enrol_arlo');
set_config('authplugin', 'manual','enrol_arlo');
set_config('onlineactivityresults', 1,'enrol_arlo');
set_config('eventresults', 0,'enrol_arlo');
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.