Forums | Mahara Community
Mahara/Moodle integration
/
Confused by Moodle/Mahara LTI
24 September 2021, 23:47
I may be missing the point of it all... however...
I seem to have LTI "working" but I've all sorts of odd/surprising problems. My primary authentication is LDAP and I definitely don't want multiple accounts created so I haven't enabled LTI creating accounts.
I have set up LTI and added Mahara as an external tool in Moodle. When I click that, if the user doesn't exist I was hoping/expecting a login page or, at worst, a sensible error message. I don't - I get a nasty XML web service error. Is this intentional?
<EXCEPTION class="AccessDeniedException">
<ERRORCODE>403</ERRORCODE>
<MESSAGE>Auto-creation of accounts is not enabled</MESSAGE>
</EXCEPTION>
When the person does exist, it works. But I get dumped into some strange page in Mahara..
https://my.mahara.site/module/lti/submission.php
....which, in my case, just throws up an error
"Currently, this activity does not allow submissions. Please check back later. "
Again... is this intentional? I was expecting an external tool link to send me to the Mahara front page (but logged in). This seems to be getting muddled up with the Assignment submission stuff.
Also, (not a big deal for most users) it's chucking me out of a different Mahara account in a completely different browser when I access using LTI - which is very strange. Some sort of IP address enforcement I'm guessing?
27 September 2021, 8:54
Hi Howard,
These are all expected things. Let me explain.
1. XML error message
This is shown because you didn't allow the account creation. Yes, the page could probably be styled a bit nicer. It does say that account creation is not enabled. Since you are using LDAP, you could turn on the account sync there so that accounts are created automatically. Otherwise, you'd need to let your students know that they'll need to log in via Mahara first before they can use the link in Moodle.
Redirecting them from the LTI login to another login method would be a new feature.
2. You get this message because you set up your link in Moodle for students to submit an assignment. The teacher hasn't yet set the assignment submission criteria and that's why the message is displayed. Once you confirmed the assignment settings, students will be able to submit a portfolio. Since the activity is set up as an assignment, we point directly to the submission screen rather than the dashboard as students are expected to submit a portfolio. If you just want to take them to Mahara, make sure not to tick 'Accept grades from the tool' in the Moodle activity 'Privacy' settings.
Thank you
Kristina
27 September 2021, 21:15
Thanks - that's really useful. If I may, can I follow up on some of this.
We have a considerable existing user base authenticating with LDAP and MNET from Moodle. This works smoothly. I'd like to emulate the same thing with LTI. It doesn't appear that this is currently possible. Is this correct? What we need to avoid is duplicate accounts. I think the blocker is probably that error message. If it linked to the normal login or even could be persuaded to say "please login directly to Mahara first" it might be workable.
Thanks for the update on the way the linking works. The grades selection makes sense although I think that could be made clearer in the documentation as I expect many people will be using the Moodle Assignment plugin and will not want/need the submission functionality here.
Some things to think about... :)
28 September 2021, 0:57
We are using Mahara with LTI and Moodle an faced the same "Problem". I realized that this was intended, but I didn't like the idea that some XML error message would be displayed to users. Of course, the teachers should just tell their students to login once in Mahara first, but still, a teacher or a student might forget and then they would be presented some cryptic message.
So we ended up patching a single line for a more - as we think - user friendly behavior. Rather than throwing an exception, we redirect to the main page where users also find the login form. That was good enough for us. If you like that too, the file to patch is:
htdocs/module/lti/webservice/functions/module_lti_launch.php
There, I patched line 208 (might vary a little, depending on your version) from
throw new AccessDeniedException(get_string('autocreationnotenabled', 'module.lti'));
to
redirect(get_config('wwwroot'));
Hope that will help.
28 September 2021, 2:00
Thanks - that's very useful.
What I'm struggling to understand is why this is not the default behaviour. I'm probably missing something but it sounds like a logical use-case. Well, there's at least two of us ;-)
28 September 2021, 11:06
Hi Alexej
I like the idea of redirecting to the homepage and have created a bug/patch for this change
https://reviews.mahara.org/#/c/12040
In my patch it will check that the LTI auth method has a parent auth method and if so redirect to homepage allowing one to login that way.
Cheers
Robert
30 September 2021, 8:31
Hi Howard,
For institutions using Moodle, the Mahara assignment functionality is definitely more comfortable, but other LMS do not have that custom integration ;-) (it relies on LTI for authentication but on web services for the pulling of portfolios so that grades can be entered directly in Moodle and the normal workflow done rather than just sending the grade via LTI).
Cheers
Kristina