Skip to content

Commit

Permalink
Merge branch 'MDL-40531_24' of https://github.com/stronk7/moodle into…
Browse files Browse the repository at this point in the history
… MOODLE_24_STABLE
  • Loading branch information
danpoltawski committed Oct 23, 2013
2 parents 8a3894d + 4673a6a commit 7a2db63
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mod/lti/service.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
$grade = lti_read_grade($ltiinstance, $parsed->userid);

$responsexml = lti_get_response_xml(
isset($grade) ? 'success' : 'failure',
'success', // Empty grade is also 'success'
'Result read',
$parsed->messageid,
'readResultResponse'
Expand Down
4 changes: 3 additions & 1 deletion mod/lti/servicelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

function lti_get_response_xml($codemajor, $description, $messageref, $messagetype) {
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><imsx_POXEnvelopeResponse />');
$xml->addAttribute('xmlns', 'http://www.imsglobal.org/lis/oms1p0/pox');
$xml->addAttribute('xmlns', 'http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0');

$headerinfo = $xml->addChild('imsx_POXHeader')->addChild('imsx_POXResponseHeaderInfo');

Expand All @@ -49,6 +49,8 @@ function lti_get_response_xml($codemajor, $description, $messageref, $messagetyp
$statusinfo->addChild('imsx_severity', 'status');
$statusinfo->addChild('imsx_description', $description);
$statusinfo->addChild('imsx_messageRefIdentifier', $messageref);
$incomingtype = str_replace('Response','Request', $messagetype);
$statusinfo->addChild('imsx_operationRefIdentifier', $incomingtype);

$xml->addChild('imsx_POXBody')->addChild($messagetype);

Expand Down
2 changes: 1 addition & 1 deletion mod/lti/tests/locallib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function disabled_test_sign_parameters() {
*/
public function disabled_test_parse_grade_replace_message() {
$message = '
<imsx_POXEnvelopeRequest xmlns = "http://www.imsglobal.org/lis/oms1p0/pox">
<imsx_POXEnvelopeRequest xmlns = "http://www.imsglobal.org/services/ltiv1p1/xsd/imsoms_v1p0">
<imsx_POXHeader>
<imsx_POXRequestHeaderInfo>
<imsx_version>V1.0</imsx_version>
Expand Down

0 comments on commit 7a2db63

Please sign in to comment.