diff --git a/common/lib/xmodule/xmodule/textannotation_module.py b/common/lib/xmodule/xmodule/textannotation_module.py index 9a561b9411..4a673eb33e 100644 --- a/common/lib/xmodule/xmodule/textannotation_module.py +++ b/common/lib/xmodule/xmodule/textannotation_module.py @@ -61,9 +61,9 @@ class TextAnnotationModule(AnnotatableFields, XModule): self.instructions = self._extract_instructions(xmltree) self.content = etree.tostring(xmltree, encoding='unicode') - self.user = "" + self.user_email = "" if self.runtime.get_real_user is not None: - self.user = self.runtime.get_real_user(self.runtime.anonymous_student_id).email + self.user_email = self.runtime.get_real_user(self.runtime.anonymous_student_id).email def _extract_instructions(self, xmltree): """ Removes from the xmltree and returns them as a string, otherwise None. """ @@ -83,7 +83,7 @@ class TextAnnotationModule(AnnotatableFields, XModule): 'instructions_html': self.instructions, 'content_html': self.content, 'annotation_storage': self.annotation_storage_url, - 'token':retrieve_token(self.user, self.annotation_token_secret), + 'token': retrieve_token(self.user_email, self.annotation_token_secret), } return self.system.render_template('textannotation.html', context) diff --git a/common/lib/xmodule/xmodule/videoannotation_module.py b/common/lib/xmodule/xmodule/videoannotation_module.py index c5d47b5c32..68e5b40413 100644 --- a/common/lib/xmodule/xmodule/videoannotation_module.py +++ b/common/lib/xmodule/xmodule/videoannotation_module.py @@ -56,9 +56,9 @@ class VideoAnnotationModule(AnnotatableFields, XModule): self.instructions = self._extract_instructions(xmltree) self.content = etree.tostring(xmltree, encoding='unicode') - self.user = "" + self.user_email = "" if self.runtime.get_real_user is not None: - self.user = self.runtime.get_real_user(self.runtime.anonymous_student_id).email + self.user_email = self.runtime.get_real_user(self.runtime.anonymous_student_id).email def _extract_instructions(self, xmltree): """ Removes from the xmltree and returns them as a string, otherwise None. """ @@ -93,7 +93,7 @@ class VideoAnnotationModule(AnnotatableFields, XModule): 'poster': self.poster_url, 'content_html': self.content, 'annotation_storage': self.annotation_storage_url, - 'token': retrieve_token(self.user, self.annotation_token_secret), + 'token': retrieve_token(self.user_email, self.annotation_token_secret), } return self.system.render_template('videoannotation.html', context) diff --git a/common/static/js/vendor/ova/annotator-full-firebase-auth.js b/common/static/js/vendor/ova/annotator-full-firebase-auth.js index d915f05bf0..defc25fc95 100644 --- a/common/static/js/vendor/ova/annotator-full-firebase-auth.js +++ b/common/static/js/vendor/ova/annotator-full-firebase-auth.js @@ -1,11 +1,11 @@ Annotator.Plugin.Auth.prototype.haveValidToken = function() { - var allFields; - allFields = this._unsafeToken && this._unsafeToken.d.issuedAt && this._unsafeToken.d.ttl && this._unsafeToken.d.consumerKey; - if (allFields && this.timeToExpiry() > 0) { - return true; - } else { - return false; - } + return ( + this._unsafeToken && + this._unsafeToken.d.issuedAt && + this._unsafeToken.d.ttl && + this._unsafeToken.d.consumerKey && + this.timeToExpiry() > 0 + ); }; Annotator.Plugin.Auth.prototype.timeToExpiry = function() { diff --git a/lms/templates/textannotation.html b/lms/templates/textannotation.html index 01d94bf054..f69cb7b68c 100644 --- a/lms/templates/textannotation.html +++ b/lms/templates/textannotation.html @@ -1,63 +1,63 @@ <%! from django.utils.translation import ugettext as _ %>
-
- % if display_name is not UNDEFINED and display_name is not None: -
${display_name}
- % endif -
- % if instructions_html is not UNDEFINED and instructions_html is not None: -
-
- ${_('Instructions')} - ${_('Collapse Instructions')} -
-
- ${instructions_html} -
-
- % endif -
-
-
${content_html}
-
${_('Source:')} ${source}
-
-
${_('You do not have any notes.')}
-
-
-
+
+ % if display_name is not UNDEFINED and display_name is not None: +
${display_name}
+ % endif +
+ % if instructions_html is not UNDEFINED and instructions_html is not None: +
+
+ ${_('Instructions')} + ${_('Collapse Instructions')} +
+
+ ${instructions_html} +
+
+ % endif +
+
+
${content_html}
+
${_('Source:')} ${source}
+
+
${_('You do not have any notes.')}
+
+
+