Repository: apluslms/a-plus

Issue:
LTI: enable branding for instance name
Enable branding name for  `tool_consumer_instance_name`.


Discussion:
In the source code, LTI parameters are set here: https://github.com/apluslms/a-plus/blob/master/external_services/lti.py

LTI 1.1 specification that describes tool_consumer_instance_name etc.
https://www.imsglobal.org/specs/ltiv1p1/implementation-guide
@Mankro Thanks for the links! It's still not very clear for me what "enable branding name" means, is this explained somewhere?
@HenrikSundell in the LTI specification, they use the school name as an example. So, the LTI Tool Provider could display the school name in the tool if it receives this parameter (tool_consumer_instance_name) or something similar that counts as the brand of the site.

A+ does not support branding inside A+ either, so we should decide how to do it for LTI. Branding in A+ would allow site maintainers to easily modify the logo and name of the site visible in the web pages. A+ is used in Tampere and Aalto, and currently Tampere has modified some CSS code manually in order to brand the Tampere Plussa site differently from the Aalto plus.cs site.

So, how should we enable branding for LTI? One alternative is to have a setting for the brand name in a-plus/settings.py. That value could be used in the LTI parameter (tool_consumer_instance_name) and at some point, it could be used inside A+ too in order to support branding. @raphendyr comments?
There is a setting `BRAND_NAME`, which should be used here. If I remember right.that is also used to render the text on top left of the web page.

Another variable interesting variable would be `tool_consumer_instance_description`, but I don't think we have content for that yet. Maybe `WELCOME_TEXT` could be used for that.
How I see it, is that we should provide fields

* tool_consumer_instance_name=SchoolU
* tool_consumer_instance_description=University of School (LMSng)
* tool_consumer_instance_url=http://lmsng.school.edu

Then the tool provider (e.g. koodisäilö), could tell

```
Login is required, please click the button to be forwarded to SchoolU.

<button>Login via SchoolU</button>

University of School (LMSng)
http://lmsng.school.edu
```

Sadly, there isn't good content for tool_consumer_instance_description :(

In addition, I don't think there is translation support for these strings. Maybe in v1.3?

Resolving patch:
diff --git a/aplus/local_settings.example.py b/aplus/local_settings.example.py
--- a/aplus/local_settings.example.py
+++ b/aplus/local_settings.example.py
@@ -5,6 +5,9 @@
 #ADMINS = (
 #    ('Your Name', 'your_email@domain.com'),
 #)
+## Branding
+#BRAND_NAME = 'Your brand name (default is A+)'
+#BRAND_DESCRIPTION = 'Description of your service (default is Virtual Learning Environment)'
 # Show red alert on top of all pages
 #SITEWIDE_ALERT_TEXT = "Maintenance on Monday"
 #SITEWIDE_ALERT_TEXT = {'en': "Maintenance on Monday", 'fi': "Maanantaina on palvelukatko"}
diff --git a/aplus/settings.py b/aplus/settings.py
--- a/aplus/settings.py
+++ b/aplus/settings.py
@@ -29,6 +29,7 @@
 SITEWIDE_ALERT_TEXT = None
 SITEWIDE_ADVERT = None
 BRAND_NAME = 'A+'
+BRAND_DESCRIPTION = 'Virtual Learning Environment'
 
 WELCOME_TEXT = 'Welcome to A+ <small>modern learning environment</small>'
 SHIBBOLETH_TITLE_TEXT = 'Aalto University users'
diff --git a/external_services/lti.py b/external_services/lti.py
--- a/external_services/lti.py
+++ b/external_services/lti.py
@@ -66,7 +66,9 @@ def __init__(self, service, user, instance, request, title, context_id=None, lin
             "launch_presentation_return_url": urljoin(settings.BASE_URL, instance.get_absolute_url()),
 
             "tool_consumer_instance_guid": base_url_parts.netloc + "/aplus",
-            "tool_consumer_instance_name": "A+ LMS",
+            "tool_consumer_instance_name": settings.BRAND_NAME,
+            "tool_consumer_instance_description": settings.BRAND_DESCRIPTION,
+            "tool_consumer_instance_url": settings.BASE_URL,
         })
 
         if service.api_access:


Test patch: