microsoft / o365-moodle Goto Github PK
View Code? Open in Web Editor NEWOffice 365 and Azure Active Directory plugins for Moodle
License: GNU General Public License v3.0
Office 365 and Azure Active Directory plugins for Moodle
License: GNU General Public License v3.0
I have followed the steps you have given for setting up Office 365 Integration plugin. After setup I am not able to see the Office365 Connection and Azure AD items in the user's profile. So not able to setup calendar sync.
Normally, Moodle plugins contain a text file stating where in the Moodle file system the plugin should be installed. This information is usually either in README.txt or INSTALL.TXT (or .md).
I have no idea which folders to put where, and I have never come across a plugin before that does not contain instructions for where it should go!
I have updated local/o365 plugin code from master branch on demo server. After updating, I am not able to save the assignments. I am getting the following error :
Fatal error: Call to a member function create_event() on a non-object in C:\MoodleWindowsInstaller-latest-27\server\moodle\local\o365\classes\observers.php on line 322
Steps to reproduce :
Demo server url : http://moodle-o365.cloudapp.net/
Admin user - admin, password - Pwd&0011
Teacher user - te1, password - Pwd&0011
When a feedback is added or a submission is added for first time and then saved the view feedback and submission links are not seen. It comes after saving the assigment once again
Steps for Repo
Notice: Trying to get property of non-object in /opt/bitnami/apps/moodle/htdocs/local/onenote/onenote_api.php on line 117
Warning: Creating default object from empty value in /opt/bitnami/apps/moodle/htdocs/local/onenote/onenote_api.php on line 121
We cannot manage these plugins using git submodules in our Moodle build because they are all in the same repo. It would be far better to have them separate so that we can import the ones we need and update them easily.
Getting "error/get_onenote_page_failed" when trying to create a onenote submission.
Did some investigating and create_page_from_postdata is failing as it's getting back
{ "error":{ "code":"20011","message":"The multi-part payload was malformed.","@api.url":"http://go.microsoft.com/fwlink/?LinkID=401441" } }
The postdata looks okay to me, tried a couple things (double-checking newlines, added a newline at the end), can't figure out why it's malformed.. The postdata being sent is:
--044a0f50392e1d92125c21f675fde4e9f9f2531e6148348bf36423cf89f77c59 Content-Disposition: form-data; name="Presentation" Content-Type: application/xhtml+xml <?xml version="1.0" encoding="utf-8" ?> <html xmlns="http://www.w3.org/1999/xhtml" lang="en-us"> <head> <title>Submission: OneNote assignment test [James McQuillan]</title> <meta name="created" value="2014-11-28 14:00:36"/> </head> <body style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:12px; color:rgb(51,51,51);"><p>OneNote assignment test<p></p></p> </body> </html> --044a0f50392e1d92125c21f675fde4e9f9f2531e6148348bf36423cf89f77c59--
To reproduce:
Hi,
The local/o365/settings.php
file can produce debugging output due to the way that it requires the jQuery library.
For example:
$PAGE->requires->jquery();
Should really be:
if (!$PAGE->requires->is_head_done()) {
$PAGE->requires->jquery();
}
This ensures that the jQuery library is only included / loaded when it is safe to do so.
Steps to replicate:
O365 is a separate instance from rest of world. It's API endpoints are different. Please see: https://msdn.microsoft.com/en-us/office/office365/api/o365-china-endpoints
Forking the code to create a China version of the plug-ins seems unnecessary. Can we include a switch which toggles the specific set of API endpoints in plug-in configuration?
Go to user profiles > manage o365 connection > calendar sync.
Nothing is selected.
Yet calendars from my courses sync.
Since OneNote supports a subset of HTML, assignment text created in moodle looks different when posted to OneNote during "Work on this". Also, when user saves the submission or feedback back into moodle, the saved HTML looks different from the way it did in OneNote. Perform the low hanging fruit type processing on the HTML being posted to and downloaded from OneNote to make them look close to the original.
Is there any support for the Azure AAD B2C and B2B in Moodle?
Warning: Invalid callback onenote_api::__wakeup, cannot access private method onenote_api::__wakeup()
This issue comes when teacher/admin tries to create an activity
When I log in using my office365 account to moodle it is logging me in as a guest and can not access anything
Ignore this issue if that is the behaviour
The readme should contain the high level design of the plugin, info about settings for the plugin, and user stories if any.
Hi,
The local/onenote/classes/api/base.php
file can produce debugging output during installation of the plugin.
The suggested fix is to change:
$iso365user = ($USER->auth === 'oidc' && class_exists('\local_o365\rest\onenote')) ? true : false;
to:
$iso365user = (isset($USER->auth) && $USER->auth === 'oidc' && class_exists('\local_o365\rest\onenote')) ? true : false;
Debugging output can cause unit tests to fail, which can be problematic.
When teacher clicks on View submission, it creates a new submission in OneNote and second image added in the content is missing. Same while clicking on view feedback, the second image is missing.
I've got a pretty vanilla Moodle 2.8.5, and I get this error when navigating to Site administration -> Plugins -> Blocks -> Manage blocks
Can not add jQuery plugins after starting page output!
line 463 of /lib/outputrequirementslib.php: call to debugging()
line 407 of /lib/outputrequirementslib.php: call to page_requirements_manager->jquery_plugin()
line 26 of /local/o365/settings.php: call to page_requirements_manager->jquery()
line 67 of /lib/classes/plugininfo/local.php: call to include()
line 489 of /admin/settings/plugins.php: call to core\plugininfo\local->load_settings()
line 6660 of /lib/adminlib.php: call to require()
line 151 of /admin/blocks.php: call to admin_get_root()
If the OneNote submission / feedback system would work directly with the Office 365 moodle-auth_oidc Plugin and OneDrive Business, the user wouldn't need to have a Microsoft account but only the Office 365 account which is automatically connected because of SSO and the notebooks would directly be synced with the users business OneDrive Account.
Two ways to demonstrate this:
Assignment too big to start with
Create an assignment
Set submission size limit
In the Description textbox insert picture (or pictures) that exceed the size limit.
Save
In the student open assignment and modify
submit the assignment.
The assignment is saved without the modifications.
The second scenario
Create the assignment
set size limit
Enter a few lines of text in the Description (well under size limit)
Student opens assignment
Opens the onenote page
Opts to work on page in desktop version of onenote
attaches file, such as zip or word doc, that is larger than limit to page
Submits assignment
The assignment is saved without the attached files.
I both cases there is no indication that the modifications were not saved properly and if the student views their submission they can see the items they added.
Steps to repo
Error comes error/Could not download the feedback from OneNote. Please try again.
But if we click on add feedback link and then click on save the error is not there.
When setting the system API user in the settings our moodle site is returning the error:
OIDC id_token not received after user login at login.micosoftonline.com.
I've looked around to see if anyone else is having this error, but cant find the same problem, issue 43 seems to have similar resemblances to the issue maybe?
Any ideas as to what may be causing this?
When student tries to work on assigment, below warning is shown at times.
Warning: DOMDocument::loadHTML(): Tag wbr invalid in Entity, line: 1 in /opt/bitnami/apps/moodle/htdocs/local/onenote/onenote_api.php on line 626
Steps to reproduce:
It will show errors for both the fields. I have updated latest code from master branch on server.
Link : http://mofficewin1.cloudapp.net
Login : admin / Pwd&0011
Error comes while trying to create a activity and saving the activity.
If the token request in OIDC fails, error is "id_token not received" as in this line: https://github.com/MSOpenTech/o365-moodle/blob/master/auth/oidc/auth.php#L150
This happened to me due to the client secret not yet being valid (validity started next day). A JSON error response is received instead, which doesn't have the id_token parameter.
Would be nice to have better error checking.
While saving an assignment by teacher (moodle user and not azure user), gets notice
Notice: Trying to get property of non-object in
C:\wamp\www\moodleapp\local\oevents\lib.php on line 216
Notice: Undefined property: stdClass::$accesstoken in C:\wamp\www\moodleapp\local\oevents\lib.php on line 250
and also language string does not exist error
Help contents string does not exist: [enabled_help, assignfeedback_onenote]
Repro:
Create a file with spaces in name.
Upload to OneDrive for Biz.
Add to assignment as link or copy.
Download file from assignment.
Open in plaintext editor - you'll see an error.
If you change the spaces to dashes it works fine.
Same happens when teacher also tries to login to Microsoft Log in
The table called in refresh token function "msa_refresh_tokens" is not present in the database. This table create is not seen in upgrade/install php files in msaccount plugin and so in install it is not getting created.
In my case, no User Groups are being created in Office 365. I have captured the following output from the cron job which seems to indicate an error but I do not how to interpret it nor how to remedy.
Execute scheduled task: Create user groups in Office365
... started 19:45:06. Current memory use 74.5MB.
Could not create group for course #4
array(1) {
["odata.error"]=>
array(3) {
["code"]=>
string(18) "Request_BadRequest"
["message"]=>
array(2) {
["lang"]=>
string(2) "en"
["value"]=>
string(72) "Invalid value specified for property 'mailNickname' of resource 'Group'."
}
["values"]=>
array(2) {
[0]=>
array(2) {
["item"]=>
string(12) "PropertyName"
["value"]=>
string(12) "mailNickname"
}
[1]=>
array(2) {
["item"]=>
string(17) "PropertyErrorCode"
["value"]=>
string(12) "InvalidValue"
}
}
}
}
Created group 5facffc9-990a-43d2-8e3b-16e4ab819254 for course #6
Recorded group object (5facffc9-990a-43d2-8e3b-16e4ab819254) into object table with record id 4
Waiting 10 seconds for group to register...
Adding users to group (5facffc9-990a-43d2-8e3b-16e4ab819254)
Added user #9 (77d36274-2d34-4620-b1d7-7b5e441e1701)
Added user #10 (6fa12531-7e70-4c24-8457-9924c3d81f2d)
Added user #8 (36c1301a-6ae1-4752-b850-7ce99cfa3381)
... used 12 dbqueries
... used 19.472978830338 seconds
Scheduled task complete: Create user groups in Office365
Execute scheduled task: Sync o365 events in to Moodle
... started 19:45:25. Current memory use 75MB.
Bad response received when fetching events.
... used 5 dbqueries
... used 1.9638118743896 seconds
Scheduled task complete: Sync o365 events in to Moodle
Please advise.
Steps to repo
It shows the below error
"Error calling message processor email"
I got the error.
PHP 5.4.24 Default exception handler: Could not read JWT payload.
Debug:
Error code: errorjwtbadpayload
The error is caused by incorrect working function base64_decode() in file o365-moodle/blob/master/auth/oidc/classes/jwt.php
when the user has Cyrillic characters in the name or in the surname.
In my case all works fine with change line 84: $body = base64_decode($jwtparts[1]);
to line 84: $body = base64_decode(strtr($jwtparts[1] , '-_,', '+/='));
When trying to connect to office365 without changing the "Choose an authentication method" to OpenID Connect, it fails.
It seems like its forcing update of the user profile, even name, lastname and email is updated as well as "Choose an authentication method"
If i click on the link - connect to office365, and provide the user infor in the login, it sets the office365 login as Enabled and its office365 connection is still Not connected.
(see this image http://screencast.com/t/GfhmJRgmdYTU )
Following is installed:
OpenID Connect (auth_oidc)
OpenIDConnect Management (profilefield_oidc)
Office365 Connection (profilefield_o365)
Microsoft Office 365 Integration (local_o365)
On save changes of grade page, error comes with
error/Could not download the feedback from OneNote. Please try again.
If I type in a SharePoint site URL, Moodle successfully detects whether the site exists or not (blue or green message). After typing in a new SharePoint site URL and saving changes, I receive a message "Moodle is setting up this SharePoint site". The cron job runs successfully, too:
Server Time: Tue, 02 Jun 2015 12:12:08 +0300
Execute adhoc task: local_o365\task\sharepointinit
... started 12:12:12. Current memory use 4.5MB.
Created parent site
... used 6 dbqueries
... used 7.1267318725586 seconds
Adhoc task complete: local_o365\task\sharepointinit
Cron script completed correctly
Cron completed at 12:12:19. Memory used 5.6MB.
Execution took 10.851464 seconds
When I return to Microsoft Office 365 Integration plugin settings page, "SharePoint Link" section informs that "Moodle is connected to this SharePoint site."
Unfortunately this is not true because the SharePoint site has not been created.
local_o365 plugin version and release:
2015012716, 28.0.0.9
Will this plugin set support the 'Shared with Me' folders as shown on the OneDrive for Business UI?
In the assignment where there is no submission, when teacher tries to grade, Notice shows up
Notice: Trying to get property of non-object in C:\wamp\www\moodleapp\mod\assign\feedback\onenote\locallib.php on line 136
assign_feedback_onenote->get_form_elements_for_user( )
Note : This happens when student haven't submitted any submission still teacher grade it and give feedback. And Empty "View Submission" link is shown on submission listing page.
.
Reported by Sushant.
Hi,
The sharepointlink
admin setting located in local/o365/classes/adminsetting/sharepointlink.php
doesn't support its own default setting.
This causes Moodle to prompt for a setting once the plugin is installed. This can cause automated tests, such as Behat tests, to fail as the Behat test does not see the admin page that it expects.
One proposed solution is as follows:
--- a/local/o365/classes/adminsetting/sharepointlink.php
+++ b/local/o365/classes/adminsetting/sharepointlink.php
@@ -65,7 +65,7 @@ class sharepointlink extends \admin_setting {
*/
public function write_setting($data) {
$oldvalue = get_config($this->plugin, $this->name);
- if ($oldvalue == $data) {
+ if ($oldvalue == $data && !empty($data)) {
return '';
}
if (!empty($data)) {
@@ -73,6 +73,9 @@ class sharepointlink extends \admin_setting {
$this->config_write('sharepoint_initialized', '0');
$sharepointinit = new \local_o365\task\sharepointinit();
\core\task\manager::queue_adhoc_task($sharepointinit);
+ } else {
+ // Support default value so it doesn't prompt for setting on install.
+ $this->config_write($this->name, '');
}
return '';
}
If I were to submit localization strings for Chinese support, is this the right repo to use? Or should I submit to each individual plug-in's repo?
All the onenote plugins and the msaccount plugin.
FIrst time when we try to login from Work on this, from the assignment content, it was showing "Notice: Trying to get property of non-object" in get page function. But it goes after trying to access it again.
Can you please check if that is happening at your end.
Would be great if the plugin supported multiple tenants. We need to separate our students from faculty for security reasons, so they will be on two tenants.
Getting "get_onenote_page_failed" when student access the assignment.
Steps to repo
Debug info:
Error code: get_onenote_page_failed
Output buffer:
Notice: Trying to get property of non-object in /opt/bitnami/apps/moodle/htdocs/local/onenote/onenote_api.php on line 472
Only you click on "Save changes",, We get error
Could not download your submission from OneNote. Please try again.
Notice: Trying to get property of non-object in /opt/bitnami/apps/moodle/htdocs/mod/assign/submission/onenote/locallib.php on line 204
After that if we click on "Work on this", it shows the OneNote page.
When I enter the sharepoint url, the message "Moodle is setting up this SharePoint site" is there and it is loading. When I refresh, it doesn't change. I have waited a day. Anyone know what's going on?
When the same user submits a OneNote assignment and then clicks the "Add feedback" button to grade it, they get an error - 'get_onenote_page_failed'.
This seems to be because isteacher
is set to false in the created URL, which looks like this:
https://moodle-282.cloudapp.net/local/onenote/onenote_actions.php?action=openpage&cmid=2&wantfeedback=1&isteacher&submissionuserid=3&submissionid=1&gradeid
If changed to isteacher=1
, the button works.
When course short name has a space in it, "Initialize" doesn't create a subsite for it.
"error":{
"code":"","message":"The request entity's media type 'application/x-www-form-urlencoded' is not supported for this resource
}
Steps to reproduce
Create a new course and try to sync it to the oneNote api. When we debug, we will be able to see this error while the code tries to post the new course to the oneNote using api.
This error comes due to not properly set the header
While assesing edit grades, Add feedback link gets moodle exception error on non-submission assignment
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.