From be17040f9dbc2d7632e0252e8e8f8a065c68fa2d Mon Sep 17 00:00:00 2001 From: Ivica Ceraj Date: Tue, 12 Aug 2014 08:30:33 -0400 Subject: [PATCH] Fix for empty imsx_messageIdentifier --- AUTHORS | 1 + common/lib/xmodule/xmodule/lti_module.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index 3e96b5759c..96bca29d4a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -168,3 +168,4 @@ Juanan Pereira Clinton Blackburn Dennis Jen Filippo Valsorda +Ivica Ceraj diff --git a/common/lib/xmodule/xmodule/lti_module.py b/common/lib/xmodule/xmodule/lti_module.py index 297cfae2ca..c5e8458f0f 100644 --- a/common/lib/xmodule/xmodule/lti_module.py +++ b/common/lib/xmodule/xmodule/lti_module.py @@ -694,7 +694,7 @@ oauth_consumer_key="", oauth_signature="frVp4JuvT1mVXlxktiAUjQ7%2F1cw%3D"'} parser = etree.XMLParser(ns_clean=True, recover=True, encoding='utf-8') root = etree.fromstring(data, parser=parser) - imsx_messageIdentifier = root.xpath("//def:imsx_messageIdentifier", namespaces=namespaces)[0].text + imsx_messageIdentifier = root.xpath("//def:imsx_messageIdentifier", namespaces=namespaces)[0].text or '' sourcedId = root.xpath("//def:sourcedId", namespaces=namespaces)[0].text score = root.xpath("//def:textString", namespaces=namespaces)[0].text action = root.xpath("//def:imsx_POXBody", namespaces=namespaces)[0].getchildren()[0].tag.replace('{'+lti_spec_namespace+'}', '')