Annotation Tool: Urgent update for ChinaX AB Testing

**Background:** ChinaX is launching June 12 and they would like to do some AB Testing. @singingwolfboy said it would be possible to merge in for next weeks release. Below you should not see any new files (i.e. they all already exist in master) and only changes to the functionality. There are some files (catch.js in particular) that are extremely messy and will be worked on in future PRs so I plead focus on the changes and not the overall messiness of the file. We have in our dock changes such as the template structure and separating it out into a more MVC model but are limited with timing and resources.

**AB Testing:** What will be tested is the following:
1. Group A will get an image annotation tool that does not have the annotation tool instantiated. It is merely an OpenSeaDragon viewer that you can zoom in deep.
2. Group B will get an image annotation tool that is readonly (except by the instructor) and will be able to see the instructor's annotations but not create any of their own.
3. Group C will get an image annotation tool that works as originally intended. Both instructor and students will be able to see and create annotations.

**CMS Updates:** The only changes in the backend are the introduction of 3 new variables in settings. One to set the default tab for the annotation table. One to select the "mode" in which it will be used, either read-only or read/write. One to add the email of the user that will be considered the "instructor" of the course. 

**LMS Updates:** Most of these scenarios to keep in mind are only appropriate to the image tool: 
1. the table should default to whatever tab is typed in to default_tab 
2. If you are in annotation_mode 2 (everyone can edit)
  * if you don't put in instructor then the instructor tab does not appear
  * if you put in an instructor then the instructor tab appears
3. If you are in annotation_mode 1 (only instructor can edit)
  * if you don't put in instructor then the student should not see the table at all 
  * if you do put in instructor then you should see the table and view the instructor's annotations but the "create annotation" button on the image should be gone.

**NOTE:** This is a hackish way of doing this functionality. Because I'm the only developer on this and our backend person is not currently available I couldn't use an API call to the backend server automate most of of the instructor calls. The name "instructor_username" is used because eventually we want to pass in the username instead of the email, but for now that was the only thing the code let me do in such short notice. Thank you so much for giving it your time. This PR is high priority should go in before the one that used to be #3529. I'm still working on that one but had to deviate to get this one through. 
thanks, can you please explain or point to the docs, how to make this exact code running?

--
Sincerely,  
Alexander Kryklia
Cell: +380 96 722 55 46
Отправлено при помощи Sparrow (http://www.sparrowmailapp.com/?sig)


пятница, 6 июня 2014 г. в 17:10, lduarte1991 написал:

> In common/lib/xmodule/xmodule/videoannotation_module.py:
> > @@ -106,6 +124,9 @@ def student_view(self, context): > '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,  
> Here's the branch commit:  
> lduarte1991@54974a5 (https://github.com/lduarte1991/edx-platform/commit/54974a51ca9bc7bb3482c84705e4184435abb4f4)  
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/edx/edx-platform/pull/3969/files#r13491151).
>  
>  
>