Skip to content

Commit

Permalink
Added result of LMS return. See: #3
Browse files Browse the repository at this point in the history
  • Loading branch information
adamzammit committed Dec 14, 2022
1 parent d136fbb commit d5fb315
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
7 changes: 5 additions & 2 deletions LTIPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
Expand Down Expand Up @@ -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'));
Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<name>LTIPlugin</name>
<type>plugin</type>
<creationDate>2020-08-27</creationDate>
<lastUpdate>2021-10-14</lastUpdate>
<lastUpdate>2022-12-14</lastUpdate>
<author>Adam Zammit</author>
<authorUrl>https://acspri.org.au/</authorUrl>
<authorEmail>[email protected]</authorEmail>
<supportUrl>https://acspri.org.au/</supportUrl>
<version>1.0.8</version>
<version>1.1.0</version>
<license>GNU General Public License v3.0</license>
<description><![CDATA[Make LimeSurvey an LTI provider for tools that support the LTI API such as Canvas and OpenEdX]]></description>
</metadata>
Expand Down

0 comments on commit d5fb315

Please sign in to comment.