WeBWorK Problems

LTI connection with Canvas has a single error statement

LTI connection with Canvas has a single error statement

by tim Payer -
Number of replies: 5

Greetings all,

We at HSU are having trouble establishing the LTI connection between Canvas and webwork.

We came very close to making the connection work, but regrettably have had to resort to downloading csv files each weekend in order to update the Canvas grade sheet.

Could I give you a brief summary of our problems in hopes that you might be able to determine where our error is located?

We are using Homework assignment specific grade pass-back.

The LTI connection worked fine for me as an instructor. I was brought to a specific homework assignment without any error statements. However other instructors and our test student kept getting the same error statement below:

 

Unable to update LMS grade. Error: failure at /opt/webwork/webwork2/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm line 273.

The course.conf that we are using to establish the LTI connection is shown below.

Any feedback would be most appreciated.

Sincerley, Tim Payer

 

#!perl

################################################################################

# WeBWorK Online Homework Delivery System

# Copyright © 2000-2007 The WeBWorK Project, http://openwebwork.sf.net/

#

# This program is free software; you can redistribute it and/or modify it under

# the terms of either: (a) the GNU General Public License as published by the

# Free Software Foundation; either version 2, or (at your option) any later

# version, or (b) the "Artistic License" which comes with this package.

#

# This program is distributed in the hope that it will be useful, but WITHOUT

# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

# FOR A PARTICULAR PURPOSE.  See either the GNU General Public License or the

# Artistic License for more details.

################################################################################

 

# This file is used to override the global WeBWorK course environment for

# requests to this course. All package variables set in this file are added to

# the course environment. If you wish to set a variable here but omit it from

# the course environment,  use the "my" keyword. Commonly changed configuration

# options are noted below.

 

# Database Layout (global value typically defined in defaults.config)

#

# Several database are defined in the file conf/database.conf and stored in the

# hash %dbLayouts.

#

# The database layout is always set here, since one should be able to change the

# default value in localOverrides.conf without disrupting existing courses.

#

# defaults.config values:

#       $dbLayoutName = 'sql_single';

#       *dbLayout = $dbLayouts{$dbLayoutName};

 

$dbLayoutName = 'sql_single';

*dbLayout = $dbLayouts{$dbLayoutName};

 

# Allowed Mail Recipients (global value typically not defined)

#

# Defines addresses to which the PG system is allowed to send mail. This should

# probably be set to the addresses of professors of this course. Sending mail

# from the PG system (i.e. questionaires, essay questions) will fail if this is

# not set.

#

# defaults.config values:

#       $mail{allowedRecipients} = [];

 

 

 

 

# By default, feedback is sent to all users who have permission to

# receive_feedback. If this list is non-empty, feedback is also sent to the

# addresses specified here.

#

# * If you want to disable feedback altogether, leave this empty and set

#   $permissionLevels{submit_feeback} = undef;

#   This will cause the

#   feedback button to go away as well.

#

# * If you want to send email ONLY to addresses in this list, set

#   $permissionLevels{receive_feedback} = undef;

#

# It's often useful to set this in the course.conf to change the behavior of

# feedback for a specific course.

# defaults.config values:

#       $mail{feedbackRecipients} = [];

 

 

 

 

# Users for whom to label problems with the PG file name (global value typically "professor")

#

# For users in this list, PG will display the source file name when rendering a problem.

#

# defaults.config values:

#       $pg{specialPGEnvironmentVars}{PRINT_FILE_NAMES_FOR} = ['professor'];

 

 

#!perl

 

# wouldn't we uncomment the line above for an execution in perl?

 

#############################################################################

# authen_LTI.conf

# Configuration for using LTI authentication.

# To enable this file, uncomment the appropriate lines in localOverrides.conf

#############################################################################

 

# set this to 1 to have LTI calling parameters printed to HTML page for

# debugging.  This is useful when setting things up for the first time because

# different LMS systems have different parameters

$debug_lti_parameters = 0; # Changed from 0 for our first time...

 

# This first section enables LTI authentication.

# Failover to Basic_TheLastOption is necessary to authenticate with

# cookie keys. 

 

###################

$authen{user_module} = [

{  "*" => "WeBWorK::Authen::LTIAdvanced", }, #preferred authorization method

{  "*" => "WeBWorK::Authen::Basic_TheLastOption",}  #fallback authorization method

];

 

# If the preferred module is an external authentication

# module but the sequence includes an internal authentication

# system, e.g., Basic_TheLastOption, then the following line

# must be commented out.

# If it is uncommented and the value = 1,

# then, if the authentication sequence reaches

# Basic_TheLastOption, then WeBWorK::Login

# will display a screen directing the user

# back to an external authentication system.

 

$external_auth=0;

 

# NOTE:  If external authentication is disabled

# then you should probably also prevent students

# from changing their passwords (because they cant use them).

# To do this ucomment the following

 

#  $permissionLevels{change_password} = "ta";

 

################################################################################

# LTI Basic parameters

################################################################################

 

################################################################################

# LTI Preferred Source of Username

################################################################################

 

# If both lis_person_sourcedid (or one of its variants)

# and lis_person_contact_email_primary are present,

# then one needs to state which one is preferred

# as the WeBWorK username.

# The considerations are (1) ensuring that usernames

# are unique and (2) being as compatible as possible with the practices

# of the institutions that are being served in a site.

# If a site is only being used be students from a single

# institution and the value  lis_person_sourcedid  is

# unique across the population and matches the  logon username

# at that institution, then lis_person_sourcedid is

# probably the better choice.

# On the other hand, if a site is serving a population

# from several institutions and  lis_person_sourcedid  is not

# necessarily unique across the population, then

# lis_person_contact_email_primary is the better choice.

# Because the WeBWorK username must be unique across

# the population served by a site, the default if

# neither line is uncommented will be the value of

# lis_person_contact_email_primary.

 

# NOTE: Even if a course management system sends

# one of the common misspellings of "lis_person_sourcedid", i.e.,

# lis_person_sourced_id, lis_person_source_id, and

# lis_person_sourceid, one must nevertheless use

# the correct spelling here, i.e. "lis_person_sourcedid".

 

#$preferred_source_of_username = "lis_person_sourcedid";

$preferred_source_of_username = "lis_person_contact_email_primary";

In reply to tim Payer

Re: LTI connection with Canvas has a single error statement

by Danny Glin -
A couple of suggestions:

Did you check the apache error logs? They might give you more detail on the error than just "failure".

Is the student that you are testing with a real student account? When you use the LTI grade pass-back, the LMS sends information to the tool (in this case WeBWorK) about how to pass grades back. Some LMSs do not send this info if the user clicking on the link wouldn't show up in the grade book (e.g. instructors, TAs, etc.).
In reply to tim Payer

Re: LTI connection with Canvas has a single error statement

by Sara Nagreen -
Did anyone get this fixed?

I'm experiencing the same issues in trying to get Grade Passback to work in Canvas.

Same error.
In reply to Sara Nagreen

Re: LTI connection with Canvas has a single error statement

by Michael Gage -
The relevant code is at https://github.com/openwebwork/webwork2/blob/master/lib/WeBWorK/Authen/LTIAdvanced/SubmitGrade.pm
lines 247 through 276. The WeBWorK request calling back to canvas is unable to connect. I suspect that the problem might be the $consumer_key defined at 251. Is this defined correctly in the webwork configuration files and does it match the key defined in canvas? I think the LTIBasicConsumerSecret is probably ok since this is needed just to display the problem. I believe the $consumer_key is needed when reporting the grades.

Two debugging tips:

You may be able to see the actual call back by using the Developer/Developer View tool on your browser to observe the HTTP request back to the browser.

Setting $debug_lti_parameters=1;
in authen_LTI.conf or in course.conf may give you more information.

Hope this helps.

-- Mike
In reply to Michael Gage

Re: LTI connection with Canvas has a single error statement

by Sara Nagreen -
the consumer key is only marked in Canvas. Where does it go in Webwork? I cannot see in Authen_LTI.conf where it would go. I tried grepping the conf files without a noticable place.

I have tried to add it to either Authen_LTI.conf and sneak it into SubmitGrades.pm to see if that helps, without success.

Turning on debugging gives me an additional warning message.

* Submitting grade using sourcedid: <numbers> and score <score> at /opt/webwork/webwork2/lib/WebWork/Authen/LTIAdvanced/SubmitGrade.pm line 221.
* Unable to update LMS grade. Error: failure at /opt/webwork/webwork2/lib/WebWork/Authen/LTIAdvanced/SubmitGrade.pm line 273.

Now, if it's trying to deliver using Sourcedid, that may be the issue. Per our developers, neither email address or PVI (aka lis_person_sourceid) is a good method for source of username. They instead made a change to lib/WebWork/Authen/LTIAdvanced.pm to use a param from custom_canvas_user_login_id. ($eppn) I'd have to go back and review why this change was exactly needed, but it seems like while the change they made doesn't impact login but DOES impact grade passback.

Well, at least this gives me a direction to go in.




In reply to Sara Nagreen

Re: LTI connection with Canvas has a single error statement

by Michael Gage -
Good luck. It might be the sourcedid that is incorrect. Can you access the error/access logs on the canvas side to see why it is refusing the connection?

It's been a while since I worked on the LTI stuff and the LTI interface itself has changed over the last 2 or 3 years. Originally I thought consumer key was an important key for passing stuff back to the LMS but perhaps not. It appears to be set in WeBWorK when WW receives the authorization from the oauth packet along with the request from the LMS.
It is set to the oauth_consumer_key parameter in the request. It is then returned in the grade packet along with the consumer_secret.

Let us know what you find out.