Commit b22643ad by lduarte1991

Image Annotation Tool: Annotation Mode for AB Testing

Annotation Tools PR Fixes

- forgot to overwrite the previous line
parent 50e8ae9a
...@@ -380,19 +380,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ...@@ -380,19 +380,20 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
clickTimeThreshold: viewer.clickTimeThreshold, clickTimeThreshold: viewer.clickTimeThreshold,
clickDistThreshold: viewer.clickDistThreshold clickDistThreshold: viewer.clickDistThreshold
}); });
if(this.options.viewer.annotation_mode == "2" || this.options.viewer.flags){
/* Set elements to the control menu */ /* Set elements to the control menu */
viewer.annotatorControl = viewer.wrapperAnnotation.element; viewer.annotatorControl = viewer.wrapperAnnotation.element;
if( viewer.toolbar ){ if( viewer.toolbar ){
viewer.toolbar.addControl( viewer.toolbar.addControl(
viewer.annotatorControl, viewer.annotatorControl,
{anchor: $.ControlAnchor.BOTTOM_RIGHT} {anchor: $.ControlAnchor.BOTTOM_RIGHT}
); );
}else{ }else{
viewer.addControl( viewer.addControl(
viewer.annotatorControl, viewer.annotatorControl,
{anchor: $.ControlAnchor.TOP_LEFT} {anchor: $.ControlAnchor.TOP_LEFT}
); );
}
} }
}, },
_reset: function(){ _reset: function(){
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
</div> </div>
<div id="catchDIV"> <div id="catchDIV">
## Translators: Notes below refer to annotations. They wil later be put under a "Notes" section. ## Translators: Notes below refer to annotations. They wil later be put under a "Notes" section.
<div class="annotationListContainer">${_('You do not have any notes.')}</div> <div class="annotationListContainer">${_('Note: only instructors may annotate.')}</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
var unit_id = $('#sequence-list').find('.active').attr("data-element"); var unit_id = $('#sequence-list').find('.active').attr("data-element");
uri += unit_id; uri += unit_id;
var pagination = 100, var pagination = 100,
is_staff = !('${user.is_staff}'=='False'), is_staff = ('${user.email}'=='${instructor_username}'),
options = { options = {
optionsAnnotator: { optionsAnnotator: {
permissions:{ permissions:{
...@@ -172,6 +172,8 @@ ...@@ -172,6 +172,8 @@
}, },
optionsOpenSeadragon:{ optionsOpenSeadragon:{
id: "imageHolder", id: "imageHolder",
annotation_mode: "${annotation_mode}",
flags: is_staff,
prefixUrl: "${settings.STATIC_URL}" + "js/vendor/ova/images/", prefixUrl: "${settings.STATIC_URL}" + "js/vendor/ova/images/",
${openseadragonjson} ${openseadragonjson}
}, },
...@@ -195,8 +197,8 @@ ...@@ -195,8 +197,8 @@
} }
//Catch //Catch
var annotator = osda.annotator, var annotator = osda.annotator;
catchOptions = { var catchOptions = {
media:'image', media:'image',
externalLink:false, externalLink:false,
imageUrlRoot:imgURLRoot, imageUrlRoot:imgURLRoot,
...@@ -208,8 +210,10 @@ ...@@ -208,8 +210,10 @@
default_tab: "${default_tab}", default_tab: "${default_tab}",
instructor_username: "${instructor_username}", instructor_username: "${instructor_username}",
annotation_mode: "${annotation_mode}", annotation_mode: "${annotation_mode}",
}, };
Catch = new CatchAnnotation($('#catchDIV'),catchOptions); if ("${annotation_mode}" == "2" || ("${annotation_mode}" == 1 && "${instructor_username}" != ""))
var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
if ("${annotation_mode}" == 1 && "${instructor_username}" == "" && !is_staff)
osda.annotator.destroy();
} }
</script> </script>
\ No newline at end of file
...@@ -183,8 +183,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} ...@@ -183,8 +183,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
} }
//Catch //Catch
var annotator = ova.annotator, var annotator = ova.annotator;
catchOptions = { var catchOptions = {
media:'text', media:'text',
externalLink:false, externalLink:false,
imageUrlRoot:imgURLRoot, imageUrlRoot:imgURLRoot,
...@@ -196,6 +196,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} ...@@ -196,6 +196,6 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
default_tab: "${default_tab}", default_tab: "${default_tab}",
instructor_username: "${instructor_username}", instructor_username: "${instructor_username}",
annotation_mode: "${annotation_mode}", annotation_mode: "${annotation_mode}",
}, };
Catch = new CatchAnnotation($('#catchDIV'),catchOptions); var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
</script> </script>
...@@ -181,8 +181,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} ...@@ -181,8 +181,8 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
} }
//Catch //Catch
var annotator = ova.annotator, var annotator = ova.annotator;
catchOptions = { var catchOptions = {
media:'video', media:'video',
externalLink:false, externalLink:false,
imageUrlRoot:imgURLRoot, imageUrlRoot:imgURLRoot,
...@@ -190,11 +190,10 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)} ...@@ -190,11 +190,10 @@ ${static.css(group='style-vendor-tinymce-skin', raw=True)}
showPublicPrivate: true, showPublicPrivate: true,
userId:userId, userId:userId,
pagination:pagination,//Number of Annotations per load in the pagination, pagination:pagination,//Number of Annotations per load in the pagination,
flags:is_staff
flags:is_staff, flags:is_staff,
default_tab: "${default_tab}", default_tab: "${default_tab}",
instructor_username: "${instructor_username}", instructor_username: "${instructor_username}",
annotation_mode: "${annotation_mode}", annotation_mode: "${annotation_mode}",
}, };
Catch = new CatchAnnotation($('#catchDIV'),catchOptions); var Catch = new CatchAnnotation($('#catchDIV'),catchOptions);
</script> </script>
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