diff --git a/LTIPlugin.php b/LTIPlugin.php index 0faabed..5604ff7 100644 --- a/LTIPlugin.php +++ b/LTIPlugin.php @@ -304,6 +304,8 @@ public function afterSurveyComplete() $resource_link->setConsumer($consumer); $user = new LTIUser($token->attribute_6,$token->attribute_5); $res = $resource_link->doOutcomesService(ToolProvider\ResourceLink::EXT_WRITE, $lti_outcome, $user); + $token->attribute_7 = print_r($res,TRUE); + $token->save(); } } } @@ -333,9 +335,10 @@ public function beforeSurveySettings() isset($survey->tokenAttributes['attribute_4'])) || ((!empty($rr)) && !(isset($survey->tokenAttributes['attribute_5']) && - isset($survey->tokenAttributes['attribute_6']))) + isset($survey->tokenAttributes['attribute_6']) && + isset($survey->tokenAttributes['attribute_7']))) ) { - $info = 'Please ensure the survey participant function has been enabled, and that there at least ' . (empty($rr) ? "4" : "6") . ' attributes created'; + $info = 'Please ensure the survey participant function has been enabled, and that there at least ' . (empty($rr) ? "4" : "7") . ' attributes created'; } $apiKey = $this->get('sAuthKey', 'Survey', $event->get('survey')); diff --git a/README.md b/README.md index 7727040..3d1f617 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,23 @@ git clone --recursive https://github.com/adamzammit/LTIPlugin.git LTIPlugin ## Requirements - LimeSurvey version 3.x, 4.x, 5.x -- Surveys need to be activated, with a participant table set up with at least 4 attributes avaiable, 6 attributes if you want to return a grade/result (the plugin will use the first 4 or 6 attributes for LTI related data) +- Surveys need to be activated, with a participant table set up with at least 4 attributes avaiable, 7 attributes if you want to return a grade/result (the plugin will use the first 4 or 7 attributes for LTI related data) - If your LTI Provider is running on HTTPS, then LimeSurvey must run over HTTPS also +## LimeSurvey Particpant Attributes + +Required: +- attribute_1: LTI return URL +- attribute_2: LMS Course Title +- attribute_3: LMS Resource ID (course ID) +- attribute_4: LMS User ID + +Optional (if using LimeSurvey to return a grade/result) +- attribute_5: LMS result source did +- attribute_6: LMS outcome source URL +- attribute_7: Storing the result of the attempt to set a grade in the LMS + + ## Configuration (LimeSurvey) 1. Visit the "Plugin manager" section in your LimeSurvey installation under "Configuration" diff --git a/config.xml b/config.xml index d978a0c..071bf10 100644 --- a/config.xml +++ b/config.xml @@ -4,12 +4,12 @@ LTIPlugin plugin 2020-08-27 - 2021-10-14 + 2022-12-14 Adam Zammit https://acspri.org.au/ software@acspri.org.au https://acspri.org.au/ - 1.0.8 + 1.1.0 GNU General Public License v3.0