-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adds Annotatable XBlock extracting from edx-platform repo #5
base: main
Are you sure you want to change the base?
Conversation
98a068e
to
c329afa
Compare
be2ce6a
to
f345ff3
Compare
8d1b35d
to
a6905b1
Compare
Generate initial i18n with dummy method. | ||
""" | ||
return translation.gettext_noop("Dummy") | ||
def resource_string(self, path): |
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 should use xblock.utils.resources module to load the resources
var annotationsHidden = false; | ||
var instructionsHidden = false; | ||
|
||
var el = element; |
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 are not using it
var toggleAnnotationsSelector = '.annotatable-toggle-annotations'; | ||
var toggleInstructionsSelector = '.annotatable-toggle-instructions'; | ||
var instructionsSelector = '.annotatable-instructions'; | ||
var sectionSelector = '.annotatable-section'; |
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.
Some selectors are un-used, shouldn't we remove them to keep code clean.
var $el = $(element); | ||
|
||
if (_debug) { | ||
console.log('loaded Annotatable'); |
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.
'Annotatable XBlock Loaded'
sounds better
We should put it at end of init() function
} | ||
|
||
function toggleAnnotations() { | ||
annotationsHidden = !annotationsHidden; |
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.
Extra code line
var hide = !annotationsHidden;
/* | ||
Update the position object (used by qTip2 to show the tip after the move event) | ||
*/ | ||
$.extend(position, { |
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.
Some functions are not returning value like in BuiltIn XBlock code, shouldn't we follow the same?
instructionsHidden = !instructionsHidden; | ||
var hide = instructionsHidden; |
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.
Merge the lines
@@ -1,9 +1,190 @@ | |||
/* CSS for AnnotatableBlock */ | |||
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700"); |
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.
instructions = xmltree.find("instructions") | ||
if instructions is not None: | ||
instructions.tag = "div" | ||
xmltree.remove(instructions) |
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.
|
||
|
||
class TestAnnotatableBlock(TestCase): | ||
"""Tests for AnnotatableBlock""" | ||
class MockRuntime(Runtime): |
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 should use the TestRuntimes exist in the xblock.test
api
Adds annotatable xblock extracting from edx-platform repo
Test PR
Make a test PR on
edx-platform
like this to run test cases on under development PR.File references:
xblocks_contrib/annotatable/annotatable.py
has been extracted fromxblocks_contrib/annotatable/templates/annotatable.html
has been extracted fromxblocks_contrib/annotatable/templates/annotatable_editor.html
has been extracted fromxblocks_contrib/annotatable/static/js/src/annotatable.js
has been extracted fromxblocks_contrib/annotatable/static/js/src/annotatable_editor.js
has been extracted fromxblocks_contrib/annotatable/static/css/annotatable.css
has been extracted fromxblocks_contrib/annotatable/static/css/annotatable_editor.css
has been extracted fromxblocks_contrib/annotatable/tests/test_annotatable.py
has been extracted fromAcceptance Criteria: