OneDrive - using Access controlled links for assignment submissions

OneDrive - using Access controlled links for assignment submissions

by Ian MacKinnon -
Number of replies: 19

Hi,

Referring to this from the docs for OneDrive:

Students may submit files from OneDrive as 'access controlled links' in assignments. Once submitted, the student may no longer change them, but the teacher is allowed to edit them

Can anyone shed some light on how this works? Through my testing I have found no way to allow this, in fact I have found the complete opposite. 

When logged in as a student, I have submitted my assignment as an access controlled link, but the Teacher has no way to edit the submission (in the OneDrive window that opens, the Teacher is assigned as "Guest contributor" and can't change anything). The student however can switch the edit mode on and make changes to the document (which get updated to the assignment submission, even after the submission is closed).

I have found the same in Google Drive, with the exception that the Teacher can request edit access from the "owner" (which looks like is the system account assigned in Site Admin>Server>OAuth2 services.

The settings for OneDrive repository are as they should be from the docs page:

  • "Supported files" is set to "Internal and External"
  • "Default return type" is set to "External (only links stored in Moodle)"


Ian

Average of ratings: -
In reply to Ian MacKinnon

Re: OneDrive - using Access controlled links for assignment submissions

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hello Ian. Have you connected a system account in the OAuth 2 screen as in the screencast here  -watch from around 30 seconds onwards. I'm just going to update the documentation.


What will happen once a system account is connected, is that this account then owns the files submitted by students (as assignments) or by teachers as files in their course. When students submit a file as an access controlled link the file is copied into the Drive of the system account and the student is no longer allowed to change it. Teachers are allowed to edit the files however. There should be no need for any "sharing" settings. (And, speaking from personal experience, if you are testing this out, it is essential that you log out of all Google/Office accounts before logging in again when you are testing with the system account/teacher and student account.)

Average of ratings: Useful (2)
In reply to Mary Cooch

Re: OneDrive - using Access controlled links for assignment submissions

by Ian MacKinnon -

Hi Mary,

Yes I have connected a system account (although it isn't made that clear in the documentation what this system account is for, your explanation would be useful to add to it), but even with my system account connected I get the same issues as above. Is there any guidance on what kind of account to set as the system account? Does it need to be an existing Moodle user, or just an existing Microsoft user?

I will start again from scratch to see if I can get it working and let you know.


Thanks.

In reply to Ian MacKinnon

Re: OneDrive - using Access controlled links for assignment submissions

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

I tried with a regular Gmail account (not an institutional one) that I created uniquely/specifically to be the system account. I'd imagine it would be the same with a MS account- regular Outlook.


In reply to Mary Cooch

Re: OneDrive - using Access controlled links for assignment submissions

by Tue Korsgaard -
Picture of Plugin developers Picture of Translators

think the use Ian was refering to, that he expects that when a student upload an assignment as a access controlled link, then the teacher should get read access to the file uploaded as a acces controlled link. 


As per your reply - Mary - it seems that the functionality which creates a read-write version of a file for teacher, happens only when a teacher uploades a file to a course (or as a resource inside an acitivity) . 

Can you clearify whether Ian's use case is indeed supporteed ?

In reply to Tue Korsgaard

Re: OneDrive - using Access controlled links for assignment submissions

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Ian's case should be supported - a student should be able to upload a One Drive assignment as an access controlled link. It is then copied into the system OneDrive account and the teacher is given access to it to read and, if needed, to comment on it. The student retains a copy in their personal OneDrive and cannot change the uploaded assignment once it has been set as access controlled.

In reply to Mary Cooch

Re: OneDrive - using Access controlled links for assignment submissions

by Gil Brandt -

Hi,


I am an admin of a course. I have followed all the steps above to allow access controlled links. When students submit they get the following error message:


Exception - notAllowed: The feature has been disabled. Please contact your admin to get it enabled.


Please can you help?


Thanks

In reply to Mary Cooch

Re: OneDrive - using Access controlled links for assignment submissions

by Paul Lindgreen -
re: submit files from OneDrive as 'access controlled links' in assignments

Are submitted student assignments copied form the students onedrive account into a Moodle System onedrive account and linked to there?

Can teachers embed file resources as links to their onedrive or must they be copied into the Moodle System onedrive account and linked to there? I was hoping the teacher could link directly to their own files so they would only need to update the file in 1 location, their own drive.
In reply to Paul Lindgreen

Re: OneDrive - using Access controlled links for assignment submissions

by Augusto Luiz da Costa Schnorr -

Hi, Paul!


As discussed above, yes, students assignments are copied from the students' OneDrive account into a Moodle System' OneDrive account.


And yes, a teacher may post only a link to a file in his/her OneDrive (as well as from any other Cloud Storage). For this, a teacher must turn edition on and add a URL resource where the link is the sharing link to the file he/she wants to share.

In reply to Mary Cooch

Re: OneDrive - using Access controlled links for assignment submissions

by Sarah Ricketts -

Hi Mary,

I'm testing this on a dev 3.5.3 installation.  I've connected a system account (i.e. a dedicated google account on our google for edu domain) in the 'Server > OAuth 2 Services' section.  The teacher can use the google repository to "Make a copy of the file" and this works.  However if they choose "Create and Access Controlled Link", although in the connected google account's GDrive I can see an associated folder structure and a copy of the GDoc is generated, from the teacher POV in Moodle they get an error:

"Exception - 403: The user does not have sufficient permissions for this file."

Please can you advise if you can think what steps I have missed?

Kind regards,
Sarah

In reply to Sarah Ricketts

Re: OneDrive - using Access controlled links for assignment submissions

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Have you checked the Supported files  and Default return type settings here Google drive repository , and confirmed that the teacher is logging in with their own personal google account? (ie not the system one)?

In reply to Mary Cooch

Re: OneDrive - using Access controlled links for assignment submissions

by Sarah Ricketts -

Hi Mary,

Yes, the settings are this as advised in the docs?



I've tried with the logged in using being a Teacher on the course, i've also tried a learner adding content to an assignment submission.  Both get the "Exception - 403: The user does not have sufficient permissions for this file." error.  Do I need to manually change any permissions on the top level google drive 'system' folder that has been generated?  I can see the shared files being added in there but then I check the sharing permissions on the individual files they are owned by the system account, but not shared with anyone (private only).

Kind regards,
Sarah

In reply to Ian MacKinnon

Re: OneDrive - using Access controlled links for assignment submissions

by António Godinho -

I did everything, but when I choose a file with controlled link, it fails with an exception...


Anyone else with this problem?



Exception - invalidRequest: One of the provided arguments is not acceptable.

More information about this error

Debug info: 
Error code: generalexceptionmessage
Stack trace:
  • line 123 of /lib/classes/oauth2/rest.php: core\oauth2\rest_exception thrown
  • line 674 of /repository/onedrive/lib.php: call to core\oauth2\rest->call()
  • line 943 of /repository/onedrive/lib.php: call to repository_onedrive->create_folder_in_folder()
  • line 1204 of /lib/filelib.php: call to repository_onedrive->reference_file_selected()
  • line 328 of /lib/filelib.php: call to file_save_draft_area_files()
  • line 227 of /mod/assign/submission/file/locallib.php: call to file_postupdate_standard_filemanager()
  • line 7105 of /mod/assign/locallib.php: call to assign_submission_file->save()
  • line 7185 of /mod/assign/locallib.php: call to assign->save_submission()
  • line 455 of /mod/assign/locallib.php: call to assign->process_save_submission()
  • line 55 of /mod/assign/view.php: call to assign->view()

In reply to António Godinho

Re: OneDrive - using Access controlled links for assignment submissions

by Florian Plainer -

Hi António!

Have you already been able to solve this problem? If so, please let me know your solution, as I am currently encountering the exact same issue.

Kind regards,
Florian

In reply to Florian Plainer

Re: OneDrive - using Access controlled links for assignment submissions

by António Godinho -
Sorry so...
Had to open the flood gates for one class... each submission around 500GB...

I'm running moodle 3.64+, and you?
In reply to António Godinho

Re: OneDrive - using Access controlled links for assignment submissions

by Florian Plainer -

Thanks for responding!

We are on the same version and could not get it to work, so we had to declare our test of the plugin as failed. Please reach out if you make any progress..

In reply to Florian Plainer

Re: OneDrive - using Access controlled links for assignment submissions

by ED ED -

Hello,

I have similar problem with Nextcloud plugin.

Files copied from Nextcloud to Moodle are ok but I get an error when I want to use a link to a Nextcloud file !

I use Moodle 3.7.1 and last Nextcloud version.

In reply to ED ED

Re: OneDrive - using Access controlled links for assignment submissions

by kucas Luga -
At times OneDrive for business backup isn’t an option and you will encounter this error where it isn’t working for that user. When you check the OneDrive settings for this user, it shows an error saying OneDrive is not provisioned for this user. To fix this issue, you have to allocate the SharePoint Online license to the pretentious user in the Office 365 admin center and trail the following steps to allocate a SharePoint Online license. To learn a lot more about OneDrive errors browse https://appuals.com/onedrive-is-not-provisioned-for-this-user-error/ . Now go to Office 365 admin center, choose Users, and go to Active Users. As second last step have a look at the user’s name in the list of Active users, before you tap the option of Edit in the Product licenses portion. At the end you will see that you can continue to the steps that fix the error of redirection to the Delve user profile page.
In reply to Ian MacKinnon

Re: OneDrive - using Access controlled links for assignment submissions

by Paul Lindgreen -
I have similar issue, moodle 3.5.12 and OneDrive. For Assignments I can upload a copy of the file but the ACL throws the error below.

Strangely, I can overwrite the uploaded file with an ACL, so the ACL almost works as expected ?!

Is this a moodle or microsoft issue? is it possible OneDrive requires additional parameters for the oauth2 service, the documentation indicates none are required?

====================

Exception - nameAlreadyExists: The specified item name already exists.

More information about this error

×Debug info:
Error code: generalexceptionmessage
×Stack trace:
line 123 of \lib\classes\oauth2\rest.php: core\oauth2\rest_exception thrown
line 674 of \repository\onedrive\lib.php: call to core\oauth2\rest->call()
line 943 of \repository\onedrive\lib.php: call to repository_onedrive->create_folder_in_folder()
line 1063 of \lib\filelib.php: call to repository_onedrive->reference_file_selected()
line 328 of \lib\filelib.php: call to file_save_draft_area_files()
line 229 of \mod\assign\submission\file\locallib.php: call to file_postupdate_standard_filemanager()
line 7096 of \mod\assign\locallib.php: call to assign_submission_file->save()
line 7176 of \mod\assign\locallib.php: call to assign->save_submission()
line 456 of \mod\assign\locallib.php: call to assign->process_save_submission()
line 55 of \mod\assign\view.php: call to assign->view()