Code Monkey home page Code Monkey logo

o365-moodle's Introduction

Microsoft 365 and Azure Active Directory Plugins for Moodle

includes support for Microsoft 365 Education, Microsoft 365 Enterprise, Azure Active Directory and Microsoft School Data Sync

This repo is where development on all Microsoft 365 and Azure Active Directory plugins for Moodle takes place. After every release, updated versions of these plugins are pushed to the Microsoft 365 plugin set available in the Moodle plugins directory.

The following plugins are actively maintained and required for new installations and provide the core functionality of the integration:

The plugins below are optional for new installations:

Supported Moodle versions

The plugins currently support Moodle 3.9 and 3.10. Support for newer releases of Moodle typically comes a few weeks after the release.

How this repository is structured

The master branch of this repository contains the most up-to-date code. As issues are completed and new features are added, they are immediately added to master. Master should be fairly stable, however it is the absolute newest code and not intended for production systems. Periodically completed issues are packaged into releases and added to the STABLE branches. You'll find a stable branch for each version of Moodle supported - MOODLE_310_STABLE would be for Moodle 3.10, for example. These branches contain production-ready, stable code.

Installation of the plugins

You can find information on how to install Moodle plugins here. The simplest option is to install directly from the Moodle plugins directory. You can find all the plugins required for the installation in the Microsoft 365 plugin set.

Alternatively you might choose to manually install the plugins from Github. If doing so please note the following:

  1. The file structure of this repository mimics that of a Moodle install, so the /auth/oidc folder in this repository would go in the /auth/oidc folder of your Moodle install, for example. Place each folder of this repository in your Moodle installation according to the folder structure of this repository.
  2. From the Moodle Administration block, expand Site Administration and click "Notifications".
  3. Follow the on-screen instructions to install each plugin.

Don't have a Moodle site already? You might want to check out our Moodle on Azure repo (https://github.com/azure/moodle) where you can quickly deploy a Moodle instance on Azure and customize it to your needs.

Documentation

The documentation for installing, configuring, and using these plugins is available on Moodle.org here.

Support

We do not provide any SLA on the use of these plugins. If you are experiencing problems, have a feature request, or have a question, please open an issue on Github on our issue tracker.

Reporting Issues

To help the community triage and debug problems, please include the following in all issues:

  • Detailed instructions of what went wrong and how to reproduce the problem. (Screenshots are always helpful!)
  • Any error messages encountered and recorded debug messages
  • Relevant version numbers (i.e. Microsoft 365 Plugins, Moodle, PHP, Database etc.)

Please note that without this information it is often impossible for us to fully investigate your issue. We will often add a "need more info" tag to the issue to indicate missing or incomplete information for an issue.

Contributing

We're looking for community contributions! Feel free to submit pull requests, but please do so against the development repository at https://github.com/Microsoft/o365-moodle. Pull requests submitted to individual plugin repositories cannot be accepted.

Please be sure to submit an issue via the Github Issue Tracker before working on any pull requests. Pull requests adding new features are much appreciated but note that they may be rejected (even if technically sound) if they do not match the direction of the project. If you want to add a new feature, it's best to open an issue outlining your idea first, and get feedback from the the maintainers and the community at large. Issues that we have no plan address will be labeled with "Help Wanted" in our issue tracker. These tend to be features that are requested but are beyond the scope of the initial project.

Code Review

All pull requests go through a thorough examination from maintainers before they are merged. Please esure your code adheres to the Moodle coding standard before submitting. A maintainer may respond with changes that are needed before a pull request can be accepted, and it is up to the submitter to make those changes. If accepted, your commit will remain as-is to ensure you get credit, but maintainers may modify solutions slightly in subsequent commits.

CLA

Finally, before we can accept your pull request, you'll need to electronically complete Microsoft's Contributor License Agreement. If you've done this for other Microsoft projects, then you're already covered.

Why a CLA? (from the FSF)

Frequently Asked Questions

  1. Moodle already offers some Microsoft 365 and Azure Active Directory functionality out-of-the-box. Are these plugins different? Yes. These plugins provide a different set of Microsoft 365 and Azure Active Directory functionality that is not provided by Moodle today. This includes features such as user matching between Azure Active Directory and Moodle, as well as the ability to create Microsoft 365 Groups from existing Moodle courses and have Microsoft 365 Group Files accessible through the Moodle file picker. The plugins also provide preview support for Microsoft School Data Sync. In short, there is a lot more functionality available through these plugins, and we highly encourage you to install them to find out what they are.

  2. Are the current plugins stable? Can they be used in-production? Yes. The plugins are stable and there are many customers using them today in-production.

  3. What additional functionality do you plan on adding to the plugins? At this stage we are not looking to make any significant changes to the core functionality of the plugins.

  4. Newer releases of the plugins lack features present in older versions of the plugins. Why is that? This is true. The plugins have evolved as functionality and direction of Microsoft 365 have evolved (for example the introduction of Microsoft 365 Groups). Moreover, with the deprecation of our Microsoft 365 legacy plugins, we have tended to focus on features that are supported by the Microsoft Graph.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Copyright

© Microsoft, Inc. Code for this plugin is licensed under the GPLv3 license.

Any Microsoft trademarks and logos included in these plugins are property of Microsoft and should not be reused, redistributed, modified, repurposed, or otherwise altered or used outside of this plugin.

o365-moodle's People

Contributors

avegys-enovation avatar brentboghosian avatar brum1975 avatar chrisoconnor avatar christianabila avatar danmarsden avatar darius-m avatar facorread avatar golenkovm avatar gopikap avatar gormster avatar grigory-catalyst avatar henhell avatar jamesmcq avatar m1guelpf avatar mwehr avatar nageshtembhurnikar avatar nimojg-microsoft avatar patmr7 avatar pdmc78 avatar phager-at avatar rimas-kudelis avatar roopalik avatar schjan avatar scottverbeek avatar sumaiyamannan avatar sushantgawali avatar tchekda avatar vinhub avatar weilai-irl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

o365-moodle's Issues

Non-submission assigmnet

On save changes of grade page, error comes with
error/Could not download the feedback from OneNote. Please try again.

Little fix in jwt.php

I got the error.

PHP 5.4.24 Default exception handler: Could not read JWT payload.
Debug:
Error code: errorjwtbadpayload

  • line 71 of \auth\oidc\classes\jwt.php: moodle_exception thrown
  • line 98 of \auth\oidc\classes\jwt.php: call to auth_oidc\jwt::decode()
  • line 159 of \auth\oidc\auth.php: call to auth_oidc\jwt::instance_from_encoded()
  • line 33 of \auth\oidc\index.php: call to auth_plugin_oidc->handleauthresponse()

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] , '-_,', '+/='));

The multi-part payload was malformed

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:

  • Create an assignment which allows onenote submissions.
  • Log in as a student, go to the assignment and click add submission.
  • Log in to Onenote,
  • Refresh page, click "Work on this"
  • See error.

Settings page produces debugging output

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:

  1. Login is admin
  2. Access a users profile
  3. Login as that user
  4. See the debugging output displayed

Redirect to error page when clicked on 'View Submission' link

Steps to reproduce:

  1. Login as teacher two
  2. Go to Aquaponics 2 assignment
  3. Go to submission listing
  4. Click on first "View Submission" link
  5. It will redirect to error page

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.

Plugins do not contain installation instructions

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!

Office 365 Account | OneDrive Business

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.

On save changes of grade page error

Steps to repo

  1. Login as teacher and create an assignment with no onenote submission
  2. Teacher comes and click on save changes on grade page

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.

Fatal error after saving the assignment.

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 :

  1. Go Add new assignment form.
  2. Add title and description.
  3. Click on save and display.

Demo server url : http://moodle-o365.cloudapp.net/

Admin user - admin, password - Pwd&0011
Teacher user - te1, password - Pwd&0011

Moodle is setting up this SharePoint site

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?

Please separate these plugins into separate repos

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.

repository/onenote can produce debugging output during install

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.

local/o365 admin setting doesn't support default value

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 '';
     }

Setting system API returns error

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?

Logging in as a Guest

When I log in using my office365 account to moodle it is logging me in as a guest and can not access anything

Multi Tenant Support

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.

request for jquery too late in settings

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()

Same user submitting and grading a OneNote assignment causes error

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.

Notices while trying to create an assignment

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]

On submit assignment error

Steps to repo

  1. login as student
  2. Submit the assignment

It shows the below error

"Error calling message processor email"

Notice on a non-submission assignment

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( )

SharePoint site not created

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

Warning on student "work on this" link

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

After adding feedback and saving assignment shows error

Steps for Repo

  1. Login as teacher and click on grading of assigmnet
  2. Add feedback to the assignment and then click on save changes, gives this page as error.

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

Localization

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?

Cannot make connection to office365 without updating userprofile

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)

Saving of submission silently fails if larger than configured submission limit

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.

When student access assignment getting - Error code: get_onenote_page_failed

Getting "get_onenote_page_failed" when student access the assignment.

Steps to repo

  1. Login as Teacher, create an assignment with Submission Yes (teacher had logged in Microsoft OneNote.)
  2. Login as Student, access the assignment.
  3. Click on Edit submission, Login in to Microsoft sign in
  4. Click on "Work on this" , we get the error page

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.

msa_refresh_tokens table not created.

  1. Teacher creates an assignment in the course
  2. Student logs in, click on add submission
  3. Student clicks on login to Onenote
  4. Error reading database is shown in the popup page

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.

Improve the processing of text styles in the HTML being posted to and downloaded from OneNote

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.

Error when creating user groups in Office 365

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.