Commit 50e8ae9a by lduarte1991

Image Annotation Tool: Added Instructor Filter

parent 1dcf2dc1
......@@ -63,6 +63,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 ImageAnnotationModule(AnnotatableFields, XModule):
......@@ -104,6 +122,9 @@ class ImageAnnotationModule(AnnotatableFields, XModule):
'token': retrieve_token(self.user, self.annotation_token_secret),
'tag': self.instructor_tags,
'openseadragonjson': self.openseadragonjson,
'default_tab': self.default_tab,
'instructor_username': self.instructor_username,
'annotation_mode': self.annotation_mode,
}
fragment = Fragment(self.system.render_template('imageannotation.html', context))
......
......@@ -189,6 +189,11 @@
//Load the plugin Image/Text Annotation
var osda = new OpenSeadragonAnnotation($('#imageHolder'),options);
var userId = '${user.email}';
if('${default_tab}'.toLowerCase() == 'instructor'){
userId = '${instructor_username}';
}
//Catch
var annotator = osda.annotator,
catchOptions = {
......@@ -197,9 +202,12 @@
imageUrlRoot:imgURLRoot,
showMediaSelector: false,
showPublicPrivate: true,
userId:'${user.email}',
pagination:pagination,//Number of Annotations per load in the pagination,
flags:is_staff
userId:userId,
pagination:pagination,//Number of Annotations per load in the pagination,
flags:is_staff,
default_tab: "${default_tab}",
instructor_username: "${instructor_username}",
annotation_mode: "${annotation_mode}",
},
Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment