From 1455882b4f6676bf8e86dd59b65080ae0d04425c Mon Sep 17 00:00:00 2001 From: lduarte1991 Date: Thu, 10 Sep 2015 10:53:36 -0400 Subject: [PATCH] Allows username and user email to be sent to an LTI. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, there is a way to do so via opening the LTI tool in a new page, this removes the one line of code that specifies that it is the only way to do it. It allows the iframe’d version of the tool to be able to receive such information if necessary. --- common/lib/xmodule/xmodule/lti_module.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/common/lib/xmodule/xmodule/lti_module.py b/common/lib/xmodule/xmodule/lti_module.py index c559e1d985..7d3a895eb3 100644 --- a/common/lib/xmodule/xmodule/lti_module.py +++ b/common/lib/xmodule/xmodule/lti_module.py @@ -206,9 +206,8 @@ class LTIFields(object): ask_to_send_username = Boolean( display_name=_("Request user's username"), # Translators: This is used to request the user's username for a third party service. - # Usernames can only be requested if "Open in New Page" is set to True. help=_( - "Select True to request the user's username. You must also set Open in New Page to True to get the user's information." + "Select True to request the user's username." ), default=False, scope=Scope.settings @@ -216,9 +215,8 @@ class LTIFields(object): ask_to_send_email = Boolean( display_name=_("Request user's email"), # Translators: This is used to request the user's email for a third party service. - # Emails can only be requested if "Open in New Page" is set to True. help=_( - "Select True to request the user's email address. You must also set Open in New Page to True to get the user's information." + "Select True to request the user's email address." ), default=False, scope=Scope.settings @@ -603,11 +601,10 @@ class LTIModule(LTIFields, LTI20ModuleMixin, XModule): except AttributeError: self.user_username = "" - if self.open_in_a_new_page: - if self.ask_to_send_username and self.user_username: - body["lis_person_sourcedid"] = self.user_username - if self.ask_to_send_email and self.user_email: - body["lis_person_contact_email_primary"] = self.user_email + if self.ask_to_send_username and self.user_username: + body["lis_person_sourcedid"] = self.user_username + if self.ask_to_send_email and self.user_email: + body["lis_person_contact_email_primary"] = self.user_email # Appending custom parameter for signing. body.update(custom_parameters)