From 1dcf2dc10ab1916647664469a237ed0909595447 Mon Sep 17 00:00:00 2001 From: lduarte1991 Date: Mon, 2 Jun 2014 23:27:23 -0400 Subject: [PATCH] Video Annotation Tool: Added Instructor Filter --- .../xmodule/xmodule/videoannotation_module.py | 21 +++++++++++++++++++ lms/templates/textannotation.html | 2 -- lms/templates/videoannotation.html | 10 ++++++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/videoannotation_module.py b/common/lib/xmodule/xmodule/videoannotation_module.py index 857ec5fcd9..e3fbde9944 100644 --- a/common/lib/xmodule/xmodule/videoannotation_module.py +++ b/common/lib/xmodule/xmodule/videoannotation_module.py @@ -57,6 +57,24 @@ class AnnotatableFields(object): default="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", display_name=_("Secret Token String for Annotation") ) + default_tab = String( + display_name=_("Default Annotations Tab"), + help=_("Select which tab will be the default in the annotations table: myNotes, Instructor, or Public."), + scope=Scope.settings, + default="myNotes", + ) + instructor_username = String( + display_name=_("Username for 'Instructor' Annotations"), + help=_("Username that will be attached to all annotations that will be found in 'Instructor' tab."), + scope=Scope.settings, + default="", + ) + annotation_mode = String( + display_name=_("Mode for Annotation Tool"), + help=_("Type in number corresponding to following modes: 1 = only instructor can annotate , 2 = Everyone can annotate"), + scope=Scope.settings, + default="2", + ) class VideoAnnotationModule(AnnotatableFields, XModule): '''Video Annotation Module''' @@ -106,6 +124,9 @@ class VideoAnnotationModule(AnnotatableFields, XModule): 'content_html': self.content, 'annotation_storage': self.annotation_storage_url, 'token': retrieve_token(self.user_email, self.annotation_token_secret), + 'default_tab': self.default_tab, + 'instructor_username': self.instructor_username, + 'annotation_mode': self.annotation_mode, } fragment = Fragment(self.system.render_template('videoannotation.html', context)) fragment.add_javascript_url("/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js") diff --git a/lms/templates/textannotation.html b/lms/templates/textannotation.html index ba27390b62..4a817cafd8 100644 --- a/lms/templates/textannotation.html +++ b/lms/templates/textannotation.html @@ -182,8 +182,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} userId = '${instructor_username}'; } - console.log("${user.is_staff}"); - //Catch var annotator = ova.annotator, catchOptions = { diff --git a/lms/templates/videoannotation.html b/lms/templates/videoannotation.html index 539e86909a..2259257d68 100644 --- a/lms/templates/videoannotation.html +++ b/lms/templates/videoannotation.html @@ -175,6 +175,10 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} var ova = new OpenVideoAnnotation.Annotator($('#videoHolder'),options); ova.annotator.addPlugin('Tags'); + var userId = '${user.email}'; + if('${default_tab}'.toLowerCase() == 'instructor'){ + userId = '${instructor_username}'; + } //Catch var annotator = ova.annotator, @@ -184,9 +188,13 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} imageUrlRoot:imgURLRoot, showMediaSelector: false, showPublicPrivate: true, - userId:'${user.email}', + userId:userId, pagination:pagination,//Number of Annotations per load in the pagination, flags:is_staff + flags:is_staff, + default_tab: "${default_tab}", + instructor_username: "${instructor_username}", + annotation_mode: "${annotation_mode}", }, Catch = new CatchAnnotation($('#catchDIV'),catchOptions);