Skip to content

Commit d5fb315

Browse files
committed
Added result of LMS return. See: #3
1 parent d136fbb commit d5fb315

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

LTIPlugin.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ public function afterSurveyComplete()
304304
$resource_link->setConsumer($consumer);
305305
$user = new LTIUser($token->attribute_6,$token->attribute_5);
306306
$res = $resource_link->doOutcomesService(ToolProvider\ResourceLink::EXT_WRITE, $lti_outcome, $user);
307+
$token->attribute_7 = print_r($res,TRUE);
308+
$token->save();
307309
}
308310
}
309311
}
@@ -333,9 +335,10 @@ public function beforeSurveySettings()
333335
isset($survey->tokenAttributes['attribute_4']))
334336
|| ((!empty($rr)) &&
335337
!(isset($survey->tokenAttributes['attribute_5']) &&
336-
isset($survey->tokenAttributes['attribute_6'])))
338+
isset($survey->tokenAttributes['attribute_6']) &&
339+
isset($survey->tokenAttributes['attribute_7'])))
337340
) {
338-
$info = 'Please ensure the survey participant function has been enabled, and that there at least ' . (empty($rr) ? "4" : "6") . ' attributes created';
341+
$info = 'Please ensure the survey participant function has been enabled, and that there at least ' . (empty($rr) ? "4" : "7") . ' attributes created';
339342
}
340343

341344
$apiKey = $this->get('sAuthKey', 'Survey', $event->get('survey'));

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@ git clone --recursive https://github.com/adamzammit/LTIPlugin.git LTIPlugin
1212
## Requirements
1313

1414
- LimeSurvey version 3.x, 4.x, 5.x
15-
- 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)
15+
- 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)
1616
- If your LTI Provider is running on HTTPS, then LimeSurvey must run over HTTPS also
1717

18+
## LimeSurvey Particpant Attributes
19+
20+
Required:
21+
- attribute_1: LTI return URL
22+
- attribute_2: LMS Course Title
23+
- attribute_3: LMS Resource ID (course ID)
24+
- attribute_4: LMS User ID
25+
26+
Optional (if using LimeSurvey to return a grade/result)
27+
- attribute_5: LMS result source did
28+
- attribute_6: LMS outcome source URL
29+
- attribute_7: Storing the result of the attempt to set a grade in the LMS
30+
31+
1832
## Configuration (LimeSurvey)
1933

2034
1. Visit the "Plugin manager" section in your LimeSurvey installation under "Configuration"

config.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<name>LTIPlugin</name>
55
<type>plugin</type>
66
<creationDate>2020-08-27</creationDate>
7-
<lastUpdate>2021-10-14</lastUpdate>
7+
<lastUpdate>2022-12-14</lastUpdate>
88
<author>Adam Zammit</author>
99
<authorUrl>https://acspri.org.au/</authorUrl>
1010
<authorEmail>[email protected]</authorEmail>
1111
<supportUrl>https://acspri.org.au/</supportUrl>
12-
<version>1.0.8</version>
12+
<version>1.1.0</version>
1313
<license>GNU General Public License v3.0</license>
1414
<description><![CDATA[Make LimeSurvey an LTI provider for tools that support the LTI API such as Canvas and OpenEdX]]></description>
1515
</metadata>

0 commit comments

Comments
 (0)