From 94f57fb5b15923e6c76a2a214a47a13e4228a6df Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Tue, 25 Jun 2024 08:56:50 -0600 Subject: [PATCH] Add more configurable LTI variables to config page. Adds LTIGradeOnSubmit, LTIMassUpdateInterval, LTI{v1p1}{BasicConsumerSecret} to the list of variables that can be configured by a course instructor. --- conf/authen_LTI.conf.dist | 3 +++ lib/WeBWorK/ConfigValues.pm | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/conf/authen_LTI.conf.dist b/conf/authen_LTI.conf.dist index 5018e39249..25145c9d01 100644 --- a/conf/authen_LTI.conf.dist +++ b/conf/authen_LTI.conf.dist @@ -177,7 +177,10 @@ $LTIMassUpdateInterval = 86400; #in seconds #'LTI{v1p3}{LMS_url}', #'external_auth', #'LTIGradeMode', + #'LTIGradeOnSubmit', + #'LTIMassUpdateInterval', #'LMSManageUserData', + #'LTI{v1p1}{BasicConsumerSecret}', #'debug_lti_parameters', #'lms_context_id' ); diff --git a/lib/WeBWorK/ConfigValues.pm b/lib/WeBWorK/ConfigValues.pm index b7d837005c..795e2c2289 100644 --- a/lib/WeBWorK/ConfigValues.pm +++ b/lib/WeBWorK/ConfigValues.pm @@ -890,6 +890,25 @@ sub getConfigValues ($ce) { labels => { '' => 'None', 'course' => 'Course', 'homework' => 'Homework' }, type => 'popuplist' }, + LTIGradeOnSubmit => { + var => 'LTIGradeOnSubmit', + doc => x('Update LMS Grade Each Submit'), + doc2 => x( + 'Sets if webwork sends grades back to the LMS every time a user submits an answer. ' + . 'This keeps students grades up to date, but can cause additional server load.' + ), + type => 'boolean' + }, + LTIMassUpdateInterval => { + var => 'LTIMassUpdateInterval', + doc => x('Time in seconds to periodically update LMS grades (-1 to disable)'), + doc2 => x( + 'Sets the time in seconds to periodically update the LMS grades. WeBWorK will update all grades on ' + . 'the LMS if it has been longer than this time since the completion of the last update. This is ' + . 'only an approximate time. 86400 seconds is one day. -1 disables periodic updates.' + ), + type => 'number' + }, LMSManageUserData => { var => 'LMSManageUserData', doc => x('Allow the LMS to update user account data'), @@ -902,6 +921,15 @@ sub getConfigValues ($ce) { ), type => 'boolean' }, + 'LTI{v1p1}{BasicConsumerSecret}' => { + var => 'LTI{v1p1}{BasicConsumerSecret}', + doc => x('Set the shared secret used for the LMS'), + doc2 => x( + 'This is a secret word that is used to validate information between WeBWorK and the LMS.' + . 'This secret word must match the word you configure in the LMS.' + ), + type => 'text' + }, debug_lti_parameters => { var => 'debug_lti_parameters', doc => x('Show LTI parameters (for debugging)'), @@ -988,6 +1016,7 @@ sub getConfigValues ($ce) { { %{ delete $LTIConfigValues->{'LTI{v1p1}{LMS_name}'} }, var => 'LTI{v1p3}{LMS_name}' }; $LTIConfigValues->{'LTI{v1p3}{LMS_url}'} = { %{ delete $LTIConfigValues->{'LTI{v1p1}{LMS_url}'} }, var => 'LTI{v1p3}{LMS_url}' }; + delete $LTIConfigValues->{'LTI{v1p1}{BasicConsumerSecret}'}; } push(