Forums | Mahara Community

Mahara/Moodle integration /
Can't get Moodle Mahara LTI integration & assign submissions working


Dan Marsden's profile picture
Posts: 13

14 August 2023, 19:42

yes - Moodle 4.3(master branch) is what I've been testing with today and I can see the successful webservice call on the Mahara logs as well as the result on the Moodle side.

There are some other reported issues like this one related to "teacher" accounts not being able to enable the Mahara WS - but from what I understand you're logging in as Admin:
https://github.com/catalyst/moodle-assignsubmission_maharaws/issues/50

I think there's also room for some improved validation in the setup forms so I'll see if I can improve that along with the error output it provides, and see if I can find a way to reproduce the issue you're having along the way.

will let you know how I go! :-)

Dan Marsden's profile picture
Posts: 13

15 August 2023, 13:06

Hi Richard - I've just pushed a new version of the maharaws plugin code into the github repository which includes some fixes for some of the known issues reported in the github issues tracker, along with some improvements to the way settings are obtained when dealing with existing assignments.

In my test the other day I set the url/secret/key at the site level and then created a "new" assignment in the site - There did appear to be some potential issues with the code when using a pre-existing assignment rather than creating a new one after making changes at the site level config so I wonder if you were hitting those too.

In any case - if you could please update your version of the code with the latest one I've uploaded to the github repo and let me know if it helps? - It may still show the same error as I haven't been able to completely reproduce the scenario you describe, but fingers crossed!

let us know how you go!

thanks,

15 August 2023, 19:21

Hi Dan,

I updated, but it doesn't make a difference:

LfuPNrO.png

Yes, I'm logged in as admin.

Also, I tried it both with new and with existing assignments. No difference.

I have now set everything up for a second time on the production site. Same error as the test site. It doesn't make a difference.

How you guys are getting this to work puzzels me. Once again: could you please post relevant screenshots? I know there are a lot of people reading here as they are running in the exact same problems.

I've also replied to the Email, but in this threat so far 5 people are reporting this problem and no where is there a solution to be found. Just people from Catalyst telling that it works at their sites/setups.

Dan Marsden's profile picture
Posts: 13

18 August 2023, 14:10

Good news for anyone else following along here! 

The main issue Richard was experiencing ended up being some default Apache settings which were stripping out the authorization header passed from Moodle to Mahara. Adjusting the Apache settings to prevent them from being removed fixed this up - I've also added some detail to the readme of the Moodle maharaws assignment plugin about this scenario in case it bites someone else!

Thanks for the help Richard! - I believe you're also having some issues submitting the assignment that the Mahara team are helping you with, but hopefully that can be resolved now the oauth connection is working correctly.

 

18 August 2023, 18:29

Yes, specifically this needs to be added to .htaccess on the Mahara site:

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Prevents default apache installs from stripping of tokens in OAuth sessions.

 

Thanks to Dan and Robert for looking into this.

Gurvan Giboire's profile picture
Posts: 4

15 September 2023, 9:41

Hello,

I'm facing some issues with the plugin Mahara submissions (Assignment submissions ::: assignsubmission_maharaws).

I followed all the instructions from the github repository for the configuration and it seems like the connection is correct but I still have an issue when I submit a page.

This is the error I got:

Attempt to send Mahara request resulted in error: A required parameter is missing or malformed View with id 221007 has not been submitted

Debug info:
Error code: errorwsrequest

Stack trace:

  • line 645 of /mod/assign/submission/maharaws/locallib.php: moodle_exception thrown
  • line 744 of /mod/assign/submission/maharaws/locallib.php: call to assign_submission_maharaws->release_submitted_view()
  • line 7656 of /mod/assign/locallib.php: call to assign_submission_maharaws->save()
  • line 7741 of /mod/assign/locallib.php: call to assign->save_submission()
  • line 509 of /mod/assign/locallib.php: call to assign->process_save_submission()
  • line 55 of /mod/assign/view.php: call to assign->view()

 

I have the same error into the logs of Mahara:
REST OAUTH mahara_submission_release_submitted_view 0.00000 14 September 2023, 17:22 exception: ParameterException message: View with id 221007 has not been submitted debuginfo:
 
I have the following config:
  • Moodle 4.1.3
  • Mahara 22.10_stable
  • assignsubmission_maharaws main branch
 

I've looked through all the current bugs you have but haven't found anything similar.

Has anyone had the same problem ?

Robert Lyon's profile picture
Posts: 773

15 September 2023, 12:46

Hi Gurvan,

The error you pasted mentions that the failure happens when the portfolio is trying to be set as not being submitted and it looks like this happens as part of the "Unlock the previously selected page." code in maharaws plugin.

Can you let me know more of how you get this error? Is it when you first try to set a portfolio to be submitted? Or is when you are trying to change the submission to be a different portfolio?

Cheers

Robert

Gurvan Giboire's profile picture
Posts: 4

16 September 2023, 3:56

Hi Robert,

Thank you for the quick answer.

When I was reading your message, it makes me think about possible conflict between the old plugin (assignsubmission_mahara) and the new one. And indeed it was the case.

So I had this error because at first the old plugin was set for the submission and I tested some submissions with it and after that I change for the new plugin. So when I was testing I had this error.

So I created a new assignment with the new plugin and now there is no conflict. I'm able to submit a submission  and also to edit it.

But then the link to go from moodle to mahara is broken (it was working before).

For instance when I already submitted a submission and I want to follow the link to see the submission on Mahara I got an error.

uri of the callback: «moodle-domain»/webservice/rest/server.php

<EXCEPTION class="moodle_exception">
    <ERRORCODE>invalidtoken</ERRORCODE>
    <MESSAGE>Jeton invalide (introuvable)</MESSAGE>
</EXCEPTION>

  • mahara.org/artefact/file/download.php?file=439663
  • mahara.org/artefact/file/download.php?file=439664

I have the same behavior when I want to create a new one from moodle:

  • mahara.org/artefact/file/download.php?file=439665

I already added the configuration of apache2 like describe in the previous comments.

Gurvan Giboire's profile picture
Posts: 4

16 September 2023, 9:47

Hi Robert,

Following my last message, I found why I it was not working and I think it is a bug in the plugin.

Let me explain.

I've set the config assignsubmission_maharaws | force_global_credentials to true.


So when I create a new assignment, the following message appears in the plugin configuration:

«Mahara url and credentials have been set globally »

Which it sounds correct!

But after that when I want to follow an url from moodle to mahara, it is unable to find the url, the key and the secret of mahara.

So it simply tries to connect to the webservice of moodle (that the reason why I have the error because it should connect to the webservice of Mahara).

So when the configuration are set globally it did'nt take it into account the config.


This is the debug value of the link /mod/assign/submission/maharaws/launch.php?url=%2Fview%2Fview.php%3Fid%3D224626&id=4480609&sesskey=KCeD4iTcfb :


LTI launch endpoint
/webservice/rest/server.php


LTI launch parameters
...
oauth_consumer_key =

...


If I set the config assignsubmission_maharaws | force_global_credentials to false and then I save the
assignment again with the possibility to change the config.


Then it is able to find the url, the key and the secret of mahara.


This is the debug value of the link /mod/assign/submission/maharaws/launch.php?url=%2Fview%2Fview.php%3Fid%3D224626&id=4480609&sesskey=KCeD4iTcfb :

LTI launch endpoint
«domain-of-mahara»/webservice/rest/server.php
 
LTI launch parameters
...
oauth_consumer_key = 3688794a*****************************

...

I hope I'm clear enough, if not let me know.

I wanted to add some screenshot but I'm blocked when I try to add some.

 

 

Dan Marsden's profile picture
Posts: 13

18 September 2023, 13:22

when you turned "force global credentials" on - did you make sure you had the mahara url and secret saved on the same page? - or did you leave them blank?

the "force global credentials" option allows you to put the mahara url and secret into the site-level configuration instead of needing the teacher to enter it within the assignment itself (if you only have a single Mahara site that you integrate with, this will simplify the setup for your teachers.)

I think what is missing in the form settings is a check to make sure that you have entered a url and secret into the site-level settings, so if you enable "force global credentials" but forget to add a valid mahara url/secret it should throw a more useful error - I'll see if I can add something in along these lines shortly.