Moodle-BLTI tables not updating properly

38 views
Skip to first unread message

John Hsu

unread,
Jun 27, 2011, 4:09:22 PM6/27/11
to Moodle-BLTI
Hello,

Is there a database requirement such as postgresql instead of mysql
for Moodle-BLTI? Does the module's tables depend on features that the
default mysql database engine does not provide, such as foreign keys
or other cross table constraints?

I'm asking because Moodle-BLTI doesn't seem to work for me out of the
box. Configuration settings does not seem to be saved, e.g.: If you
set an option as "Delegate to Professor" and then set the default
value for that option to "Allow" and then click Save, the default
value for that option will revert back to "Do not Send". The result
being that actions such as getting roster will fail with the "Not
Permitted" error message.

Further digging showed that apparently settings are being written
properly to the table 'mdl_basiclti_types_config' but sometimes read
from 'mdl_basiclti' when actually used. It seems like whatever is
supposed to sync 'mdl_basiclti_types_config' with 'mdl_basiclti' isn't
happening.

John Hsu

unread,
Jun 27, 2011, 5:22:30 PM6/27/11
to Moodle-BLTI
Forgot to mention that I'm using Moodle 1.9.

csev

unread,
Jun 27, 2011, 7:28:23 PM6/27/11
to moodl...@googlegroups.com
John - You are using Moodle 1.9, what version of the mod are you using? Did you just download it? Did you grab it from trunk?

I myself never test with anything other than MySql and have never seen any problems.

It might be a version problem.

/Chuck

John Hsu

unread,
Jun 27, 2011, 8:31:58 PM6/27/11
to Moodle-BLTI
Hi Chuck,

Thanks for the response. It's running on Moodle 1.9.9 from the Ubuntu
repository, using the mod version found in the directory
"basiclti4moodle/IMS Basic LTI for Moodle /Moodle 1.9.6 or above".
Both the repository version and the June 3 2011 release version were
tested.

If it's supposed to work fine with MySQL, then I'm at a loss to
explain this. Maybe the Moodle install from the repository missed
something, might have to try reinstalling from scratch.

Nikolas Galanis

unread,
Jun 28, 2011, 6:29:45 AM6/28/11
to moodl...@googlegroups.com
Hi John,

I am looking into your problems right now. I had to download a new Moodle1.9 instance to make sure that we are at the same starting point. I will let you know if I am able to reproduce your problems.

Regards,
Nikolas

Nikolas Galanis

unread,
Jun 28, 2011, 9:47:25 AM6/28/11
to moodl...@googlegroups.com
Update: You were right John. I am currently fixing the tool + applying some changes already implemented for the 2.0 version. Changes should be up in a couple of hours. I will let you know.

Cheers,
Nikolas

Nikolas Galanis

unread,
Jun 28, 2011, 10:17:16 AM6/28/11
to moodl...@googlegroups.com
OK, that went better than I expected. I think it is fixed now. Both the mercurial and the zip file have been updated with the newer versions.

Please let me know if you stumble upon any more problems. I really appreciate the feedback.

Regards,

Nikolas

John Hsu

unread,
Jun 28, 2011, 4:32:30 PM6/28/11
to Moodle-BLTI
Hi Nikolas,

Thanks for the quick fix. It looks like configuration settings are now
saved properly.

Grade submission / Roster access/ Custom settings are still failing
with "Not permitted" though. It seems that settings aren't being read
properly when used, e.g.: starting around line 86 in 'service.php', we
have

if (! $basiclti = get_record("basiclti", "id", $placement))
doError("Bad sourcedid 5");

where settings are being read from the "basiclti" table. This isn't a
problem except $basiclti is later used to try to access values that no
longer exists in the table, such as 'allowroster' on line 103.

if ( $basiclti->allowroster == 1 ||
( $basiclti->allowroster == 2 && $basiclti-
>instructorchoiceallowroster == 1 ) ) {

- John


On Jun 28, 7:17 am, Nikolas Galanis <ngala...@gmail.com> wrote:
> OK, that went better than I expected. I think it is fixed now. Both the
> mercurial and the zip file have been updated with the newer versions.
>
> Please let me know if you stumble upon any more problems. I really
> appreciate the feedback.
>
> Regards,
>
> Nikolas
>
>
>
>
>
>
>
> On Tue, Jun 28, 2011 at 3:47 PM, Nikolas Galanis <ngala...@gmail.com> wrote:
> > Update: You were right John. I am currently fixing the tool + applying some
> > changes already implemented for the 2.0 version. Changes should be up in a
> > couple of hours. I will let you know.
>
> > Cheers,
> > Nikolas
>
> > On Tue, Jun 28, 2011 at 12:29 PM, Nikolas Galanis <ngala...@gmail.com>wrote:
>
> >> Hi John,
>
> >> I am looking into your problems right now. I had to download a new
> >> Moodle1.9 instance to make sure that we are at the same starting point. I
> >> will let you know if I am able to reproduce your problems.
>
> >> Regards,
> >> Nikolas
>

John Hsu

unread,
Jun 28, 2011, 8:10:23 PM6/28/11
to Moodle-BLTI
Hi Nikolas,

I tried patching it myself, here's the diff: http://pastebin.com/M2b461h3

Grades, rosters, custom settings, all seem to work with that.

I'm wondering why service.php and setting.php seems to be identical?
Is it a requirement of the Moodle plugin architecture?

- John

Nikolas Galanis

unread,
Jun 29, 2011, 9:42:57 AM6/29/11
to moodl...@googlegroups.com
On Wed, Jun 29, 2011 at 2:10 AM, John Hsu <ionpa...@gmail.com> wrote:
Hi Nikolas,

I tried patching it myself, here's the diff: http://pastebin.com/M2b461h3


Thanks for the patch. I am looking to incorporate the changes right now.
 
Grades, rosters, custom settings, all seem to work with that.

I'm wondering why service.php and setting.php seems to be identical?
Is it a requirement of the Moodle plugin architecture?


Actually it is a bit more stupid than that. At some point we renamed setting.php to service.php and we must have forgotten to tell mercurial to delete the original file... I am going to fix that as well.


 Nikolas

Nikolas Galanis

unread,
Jun 29, 2011, 10:36:16 AM6/29/11
to moodl...@googlegroups.com
Mercurial and zip file updated.

Nikolas

John Hsu

unread,
Jun 29, 2011, 5:31:14 PM6/29/11
to Moodle-BLTI
Hi Nikolas,

Thanks for the quick responses. These should be the last issues. :)

When checking if $typeconfig is set, there is a typo in the error
case, instead of do_error(), it should be doError().

$typeconfig is an array, but most accesses to $typeconfig are still
treating it as an object returned by get_record(). e.g.: using the ->
operator instead of the [] to access data, $typeconfig->allowroster
would return null, $typeconfig['allowroster'] returns an actual value.

When checking for permission to send email info as part of the roster,
it checks for the non-existent 'sendemail' field in the
basiclti_types_config table. It looks like the field it should check
is 'sendemailaddr'.

When including email as part of the roster, it sends the user's last
name instead of the user's email address.

My fixes here as a diff: http://pastebin.com/bnHiHfYr

- John

On Jun 29, 7:36 am, Nikolas Galanis <ngala...@gmail.com> wrote:
> Mercurial and zip file updated.
>
> Nikolas
>
>
>
>
>
>
>
> On Wed, Jun 29, 2011 at 3:42 PM, Nikolas Galanis <ngala...@gmail.com> wrote:

Nikolas Galanis

unread,
Jun 30, 2011, 6:01:37 AM6/30/11
to moodl...@googlegroups.com
You know what the worst thing is? I already had it all correct in the 2.0 version but not in the 1.9, :).

Anyway, it is fixed once more.

Regards,

Nikolas

csev

unread,
Jun 30, 2011, 11:26:51 AM6/30/11
to moodl...@googlegroups.com
On Jun 30, 2011, at 6:01 AM, Nikolas Galanis wrote:

> You know what the worst thing is? I already had it all correct in the 2.0 version but not in the 1.9, :).
>
> Anyway, it is fixed once more.
>
> Regards,
>
> Nikolas

You know what the best thing is? The fact that now both are fixed :)

Thanks John and Nik.

/Chuck

John Hsu

unread,
Jul 14, 2011, 5:22:50 PM7/14/11
to Moodle-BLTI
Hi Nikolas,

Sorry to bring this back up, just noticed that one fix was missed:

> When including email as part of the roster, it sends the user's last
name instead of the user's email address.

- John

Nikolas Galanis

unread,
Jul 15, 2011, 11:10:40 AM7/15/11
to moodl...@googlegroups.com
Thanks, corrected :)

Nikolas
Reply all
Reply to author
Forward
0 new messages