Code Monkey home page Code Monkey logo

o365-moodle's Issues

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!

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

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

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.

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

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.

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

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.

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

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.

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.

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.

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?

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

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]

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.

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.

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"

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

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)

Non-submission assigmnet

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

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

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

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.

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

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?

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.

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.

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?

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.

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.