Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-drag-and-drop-v2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
xblock-drag-and-drop-v2
Commits
7dd4efba
Commit
7dd4efba
authored
Dec 04, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address review comments.
parent
1626ec0b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
drag_and_drop_v2/drag_and_drop_v2.py
+10
-1
drag_and_drop_v2/templates/html/drag_and_drop_edit.html
+2
-2
drag_and_drop_v2/templates/html/js_templates.html
+4
-4
No files found.
drag_and_drop_v2/drag_and_drop_v2.py
View file @
7dd4efba
...
@@ -26,7 +26,7 @@ class DragAndDropBlock(XBlock):
...
@@ -26,7 +26,7 @@ class DragAndDropBlock(XBlock):
display_name
=
_
(
"Title"
),
display_name
=
_
(
"Title"
),
help
=
_
(
"The title of the Drag and Drop that is displayed to the user"
),
help
=
_
(
"The title of the Drag and Drop that is displayed to the user"
),
scope
=
Scope
.
settings
,
scope
=
Scope
.
settings
,
default
=
"Drag and Drop"
,
default
=
_
(
"Drag and Drop"
)
,
)
)
show_title
=
Boolean
(
show_title
=
Boolean
(
...
@@ -91,6 +91,10 @@ class DragAndDropBlock(XBlock):
...
@@ -91,6 +91,10 @@ class DragAndDropBlock(XBlock):
has_score
=
True
has_score
=
True
def
_
(
self
,
text
):
""" Translate text """
return
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
(
text
)
def
student_view
(
self
,
context
):
def
student_view
(
self
,
context
):
"""
"""
Player view, displayed to the student
Player view, displayed to the student
...
@@ -124,8 +128,13 @@ class DragAndDropBlock(XBlock):
...
@@ -124,8 +128,13 @@ class DragAndDropBlock(XBlock):
"""
"""
js_templates
=
load_resource
(
'/templates/html/js_templates.html'
)
js_templates
=
load_resource
(
'/templates/html/js_templates.html'
)
help_texts
=
{
'item_background_color'
:
self
.
_
(
self
.
fields
[
'item_background_color'
]
.
help
),
'item_text_color'
:
self
.
_
(
self
.
fields
[
'item_text_color'
]
.
help
)
}
context
=
{
context
=
{
'js_templates'
:
js_templates
,
'js_templates'
:
js_templates
,
'help_texts'
:
help_texts
,
'self'
:
self
,
'self'
:
self
,
'data'
:
urllib
.
quote
(
json
.
dumps
(
self
.
data
)),
'data'
:
urllib
.
quote
(
json
.
dumps
(
self
.
data
)),
}
}
...
...
drag_and_drop_v2/templates/html/drag_and_drop_edit.html
View file @
7dd4efba
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
aria-labelledby=
"item-background-color-label"
aria-labelledby=
"item-background-color-label"
aria-describedby=
"item-background-color-description"
>
aria-describedby=
"item-background-color-description"
>
<div
id=
"item-background-color-description"
class=
"item-styles-form-help"
>
<div
id=
"item-background-color-description"
class=
"item-styles-form-help"
>
{{
self.fields.item_background_color.help
}}
{{
help_texts.item_background_color
}}
</div>
</div>
<h3
id=
"item-text-color-label"
>
<h3
id=
"item-text-color-label"
>
{% trans "Text color" %}
{% trans "Text color" %}
...
@@ -85,7 +85,7 @@
...
@@ -85,7 +85,7 @@
aria-labelledby=
"item-text-color-label"
aria-labelledby=
"item-text-color-label"
aria-describedby=
"item-text-color-description"
>
aria-describedby=
"item-text-color-description"
>
<div
id=
"item-text-color-description"
class=
"item-styles-form-help"
>
<div
id=
"item-text-color-description"
class=
"item-styles-form-help"
>
{{
self.fields.item_text_color.help
}}
{{
help_texts.item_text_color
}}
</div>
</div>
</form>
</form>
</section>
</section>
...
...
drag_and_drop_v2/templates/html/js_templates.html
View file @
7dd4efba
...
@@ -21,9 +21,9 @@
...
@@ -21,9 +21,9 @@
<
label
>
{{
i18n
"height"
}}
<
/label
>
<
label
>
{{
i18n
"height"
}}
<
/label
>
<
input
type
=
"text"
class
=
"size height"
value
=
"{{ height }}"
/>
<
input
type
=
"text"
class
=
"size height"
value
=
"{{ height }}"
/>
<
br
/>
<
br
/>
<
label
>
{{
i18n
"x"
}}
<
/label
>
<
label
>
x
<
/label
>
<
input
type
=
"text"
class
=
"coord x"
value
=
"{{ x }}"
/>
<
input
type
=
"text"
class
=
"coord x"
value
=
"{{ x }}"
/>
<
label
>
{{
i18n
"y"
}}
<
/label
>
<
label
>
y
<
/label
>
<
input
type
=
"text"
class
=
"coord y"
value
=
"{{ y }}"
/>
<
input
type
=
"text"
class
=
"coord y"
value
=
"{{ y }}"
/>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
...
@@ -57,9 +57,9 @@
...
@@ -57,9 +57,9 @@
<
textarea
class
=
"error-feedback"
>
{{
feedback
.
incorrect
}}
<
/textarea
>
<
textarea
class
=
"error-feedback"
>
{{
feedback
.
incorrect
}}
<
/textarea
>
<
/div
>
<
/div
>
<
div
class
=
"row"
>
<
div
class
=
"row"
>
<
label
>
{{
i18n
"Width
(px -
0 for auto)"
}}
<
/label
>
<
label
>
{{
i18n
"Width
in pixels (
0 for auto)"
}}
<
/label
>
<
input
type
=
"text"
class
=
"item-width"
value
=
"{{ width }}"
><
/input
>
<
input
type
=
"text"
class
=
"item-width"
value
=
"{{ width }}"
><
/input
>
<
label
>
{{
i18n
"Height
(px -
0 for auto)"
}}
<
/label
>
<
label
>
{{
i18n
"Height
in pixels (
0 for auto)"
}}
<
/label
>
<
input
type
=
"text"
class
=
"item-height"
value
=
"{{ height }}"
><
/input
>
<
input
type
=
"text"
class
=
"item-height"
value
=
"{{ height }}"
><
/input
>
<
/div
>
<
/div
>
<
div
class
=
"row"
>
<
div
class
=
"row"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment