-
Notifications
You must be signed in to change notification settings - Fork 4.1k
annotation tools #2188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
annotation tools #2188
Conversation
@@ -41,6 +41,7 @@ class InheritanceMixin(XBlockMixin): | |||
scope=Scope.settings, | |||
) | |||
xqa_key = String(help="DO NOT USE", scope=Scope.settings) | |||
annotation_storage_url = String(help="Location of Annotation backend", scope=Scope.settings, default="http://your_annotation_storage.com", display_name="annotation_storage_url") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain a little of what we were hoping to do: We want there to be an field in the Advanced Tools section where we can change the address to the server that will hold annotations and not build one into the code for obvious security issues.
When we added this line of code it allowed for this to occur and in videoannotation_module.py we are able to call it using self.annotation_storage_url during live testing, but not while running the unit test.
I have created test files and I have already rebased the code to the last edx version in order to be merged |
@@ -65,7 +65,7 @@ | |||
|
|||
# If set to True, Studio won't restrict the set of advanced components | |||
# to just those pre-approved by edX | |||
'ALLOW_ALL_ADVANCED_COMPONENTS': False, | |||
'ALLOW_ALL_ADVANCED_COMPONENTS': True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want this set to True. It would appear from the comment that the process is to get this new component approved by edx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should definitely stay False. Instead, this block should be added to the list of ADVANCED_COMPONENTS
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, we are making the change right now and the block is already part of the ADVANCED_COMPONENTS list.
@danielcebrian Can you add a description of this feature or a link to a specification of it? Someone from the Studio team will review the Studio impact of this PR in the next sprint. Please also follow up on the failing tests. |
@cahrens I had a question above about the annotation_storage_url and inheritance.py issue. Is there any way you can help me or lead me to someone who can? Thank you! |
@@ -48,6 +48,9 @@ | |||
# ajax view that actually does the work | |||
url(r'^login_post$', 'student.views.login_user', name='login_post'), | |||
url(r'^logout$', 'student.views.logout_user', name='logout'), | |||
|
|||
#added token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this comment supposed to mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to give information of a new permission to generate a token for the catch (annotation backend)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, with a few changes we've made as of late this comment and the line below will be deleted momentarily.
@nedbat or @cpennington would be good folks for the annotation_storage_url question. Keep in mind that display_name is actually shown to users in the Studio UI. So it should title case and not just a variable name. |
@mhoeber - Tagging you for doc implications. |
We're working on the silly mistakes pointed out in the jenkins test. In the meantime does anyone have any idea about these two: https://jenkins.testeng.edx.org/job/edx-all-tests-manual-pr/543/SHARD=1,TEST_SUITE=unit/testReport/junit/xmodule.tests.test_textannotation/TextAnnotationModuleTestCase/test_get_html/ |
'element_id': self.element_id, | ||
'instructions_html': self.instructions, | ||
'content_html': self._render_content(), | ||
'annotation_storage':self.annotation_storage_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The annotation_storage_url
field is used by this block, so it should be defined on this block as well. The definition in inheritance.py
is only used to allow the attribute to be set on other parent blocks as well. This will also probably fix your failing xmodule tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so is it enough to do something along the lines of:
self.annotation_storage_url = self.annotation_storage_url if typeof(self.annotation_storage_url) != undefined else ""
We don't want to define the url directly here as that might change. For academic purposes, my question is still why inheritance.py doesn't define it here when running rake test, but it does define it when you have the VM running.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant was, you need the field definition in AnnotatableFields
. (annotation_storage_url = String(...)
). Without it, the AnnotationModule
isn't usuable unless the InheritanceMixin
is applied (which is not the case in tests, for instance). You want to be able to test the module in isolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, and will fix it with daniel as soon as possible. Thank you all so much for helping us through this ordeal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cpennington So my question then would be when the code is changed and we define it in AnnotationModule
does the InheritanceMixin
then apply the url used in advanced settings for the course? or will the instructor have to input the link every time they create a module instead of once per course? i.e. does adding the code above override the variable in inheritance and thus make it useless?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Defining the Field
in the AnnotationModule
is what allows you to use the module in any runtime. Adding the definition in InheritanceMixin
is what allows Studio/LMS to use the value defined at the course level in Studio to set the value on all of the modules anywhere in the course.
A user would be able to override the course-level value on a particular module by setting an explicit value on the module, but if they don't do that, then it'll just default to the course level value.
We've done another push and we think the errors are fixed and if the coverage rule could be lenient because of time issues |
To clarify-- someone from Studio will review this by next Friday (January 31st). We have it as a story in our current sprint. A description of the feature (spec) would be most helpful in the review process. |
@danielcebrian Please take a look at the quality and coverage reports. https://jenkins.testeng.edx.org/job/edx-platform-report-manual/248/Diff_Coverage_Report/? |
Are 99 and 92% not good enough? What is the ideal target? |
For quality, no pep8 violations. I think pylint is less strict, but you should still fix everything that can be fixed. We don't want our pep8 and pylint violations growing. For coverage, make sure that everything that is not covered is not covered for a good reason. A lot of our PRs have 100% coverage, but that is not a requirement (I don't know what the official number is, but I would guess 90%). In particular, "exceptional" code paths often aren't covered by our tests. And unfortunately our integration (Selenium) tests currently do not count towards code coverage for technical reasons. |
@@ -304,6 +314,25 @@ | |||
'output_filename': 'js/cms-modules.js', | |||
'test_order': 1 | |||
}, | |||
'main_vendor': { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of putting these dependencies here, it would be better to update CMS' RequireJS configuration. See /cms/templates/base.html.
FYI, LMS does not use RequireJS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files aren't really used in CMS. You should not be able to create annotations in Studio mode, only do the set up and actually annotate in the LMS. Where would they go if not in this file if we only needed them for the LMS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is specifically for CMS. It does not impact LMS at all.
LMS has a similar file, and I believe it already has the libraries listed there (in this PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I'm sorry, you are correct. We'll remove it from here and the line in cms/urls.py that is associated with it as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are right. At the beginning, we thought to use annotator in the CMS and finally we decided to put in the LMS. But we are going to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please look over the rest of the PR and make sure the files are what you want in the final version? When you have addressed all the outstanding issues and feel that the PR is good shape for review, add a comment and I will start reviewing again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I am working on this.
@danielcebrian is there a URL for annotation_storage_url that we can use for testing? I'm starting to manually test the branch. |
@danielcebrian When I add "textannotation" and "videoannotation" to the advanced_modules in Studio, they still don't show up in the advanced components on the unit page. I think you need to add them to ADVANCED_COMPONENT_TYPES in edx-platform/cms/djangoapps/contentstore/views/component.py (and update unit test). |
Stop using JavaScript to set the body's CSS class
This does not include some of the testing files. The textannotation and videoannotation test files are not ready. waiting for an answer on the issue.
It seems like feedback.js is only for CMS…so I’m not sure what to do in this case. I’ve removed commented out code and left alert and confirm as it appears in LMS. i.e. confirming delete of a discussion thread post.
Conflicts: common/lib/xmodule/xmodule/tests/test_textannotation.py common/lib/xmodule/xmodule/tests/test_videoannotation.py lms/templates/textannotation.html lms/templates/videoannotation.html
@nedbat Hi there, so we ran into some serious rebasing issues. Every time I try to rebase it gives me dozens of conflicts that start out from various previous commits. Once I go through and manually address each conflict and continue the rebase, it says it's fine, but when I try to rebase again it gives me all the same conflicts once more...can you point us in the right direction? or can @danielcebrian delete his fork and have him fork a new version or will that mess up this PR? |
@lduarte1991 it'll be easier to rebase if you squash your commits. |
@jzoldak I get the same issue. As per the "How to Rebase a Pull Request" on here I tried to squash my commits but I still have to do git rebase --interactive. At the end it performs the same merge with conflicts that I spent hours trying to resolve before. It keeps telling me error: could not apply 5c8b9cd... annotation tools which is the patch that contains the squashed commits from the other PR. |
If I may venture an explanation as to what the issue might be, i'd say it has to do with the fact that I forked from this version of daniel's code. Squashed all the commits he'd made since the beginning of this PR #2188 so now Daniel's code is trying to merge and squash the commits that have already been squashed as well as rebase with the squashed commits it is trying to commit...if that made no sense, I can see why git is also confused. |
Conflicts: lms/templates/textannotation.html lms/templates/videoannotation.html
Please, let continue the pull request here https://github.com/edx/edx-platform/pull/2515 |
* fix add note to Zendesk help openedx#2194 (openedx#2202) * fix add library option, and library links to the course. openedx#2181 (openedx#2205) * second fix. add library option, and library links to the course. openedx#2210 (openedx#2211) * third fix. add library option, and library links to the course. openedx#2213 (openedx#2214) * Add the validation of the due date before 1900 openedx#2188 (openedx#2208) * Fix bug for biz playback page title openedx#2195 (openedx#2203) * fix test case. add library option, and library links to the course. openedx#2213 (openedx#2220) * Add note to page of Password reset confirm. openedx#2216 (openedx#2217) * Add login code to Playback Status page when the contract using login code openedx#2193 (openedx#2209)
To add these components to your course in Studio:
Installing Modules:
Add "notes", "textannotation" and "videoannotation" to advanced_modules in Studio's Advanced Settings. Now on the unit page you can see the Advanced components.
In the same advanced settings. It is necessary to add the annotation backend url and the annotation consumer key.
2.1.) Type a url with the annotation external storage under “annotation_storage_url”
2.2.) Type a consumer key for the annotation external storage under “annotation_token_secret”
Using Modules:
Will also need to specify an annotation_storage_url and token_secret in Advanced Settings. @danielcebrian @lduarte1991 can provide this information.