Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-vectordraw
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
edx
xblock-vectordraw
Commits
dd06d817
Commit
dd06d817
authored
Oct 30, 2015
by
Tim Krones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for exercise descriptions.
parent
9a9a3241
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
vectordraw/static/css/vectordraw.css
+4
-0
vectordraw/static/html/vectordraw.html
+8
-0
vectordraw/vectordraw.py
+11
-0
No files found.
vectordraw/static/css/vectordraw.css
View file @
dd06d817
...
@@ -4,6 +4,10 @@
...
@@ -4,6 +4,10 @@
display
:
inline-block
;
display
:
inline-block
;
}
}
.vectordraw_block
.vectordraw-description
{
margin-bottom
:
1.5em
;
}
.vectordraw_block
.jxgboard
{
.vectordraw_block
.jxgboard
{
float
:
left
;
float
:
left
;
border
:
2px
solid
#1f628d
;
border
:
2px
solid
#1f628d
;
...
...
vectordraw/static/html/vectordraw.html
View file @
dd06d817
<div
class=
"vectordraw_block"
>
<div
class=
"vectordraw_block"
>
<h2>
{{ self.display_name }}
</h2>
{% if self.description %}
<div
class=
"vectordraw-description"
>
{{ self.description|safe }}
</div>
{% endif %}
<div
id=
"vectordraw"
/>
<div
id=
"vectordraw"
/>
</div>
</div>
vectordraw/vectordraw.py
View file @
dd06d817
...
@@ -35,6 +35,15 @@ class VectorDrawXBlock(StudioEditableXBlockMixin, XBlock):
...
@@ -35,6 +35,15 @@ class VectorDrawXBlock(StudioEditableXBlockMixin, XBlock):
scope
=
Scope
.
content
scope
=
Scope
.
content
)
)
description
=
String
(
display_name
=
"Description"
,
help
=
"Exercise description displayed above vector drawing box"
,
default
=
""
,
multiline_editor
=
"html"
,
resettable_editor
=
False
,
scope
=
Scope
.
content
)
width
=
Integer
(
width
=
Integer
(
display_name
=
"Width"
,
display_name
=
"Width"
,
help
=
"The width of the board in pixels"
,
help
=
"The width of the board in pixels"
,
...
@@ -172,6 +181,7 @@ class VectorDrawXBlock(StudioEditableXBlockMixin, XBlock):
...
@@ -172,6 +181,7 @@ class VectorDrawXBlock(StudioEditableXBlockMixin, XBlock):
editable_fields
=
(
editable_fields
=
(
'display_name'
,
'display_name'
,
'description'
,
'width'
,
'width'
,
'height'
,
'height'
,
'bounding_box_size'
,
'bounding_box_size'
,
...
@@ -217,6 +227,7 @@ class VectorDrawXBlock(StudioEditableXBlockMixin, XBlock):
...
@@ -217,6 +227,7 @@ class VectorDrawXBlock(StudioEditableXBlockMixin, XBlock):
The primary view of the VectorDrawXBlock, shown to students
The primary view of the VectorDrawXBlock, shown to students
when viewing courses.
when viewing courses.
"""
"""
context
[
'self'
]
=
self
fragment
=
Fragment
()
fragment
=
Fragment
()
fragment
.
add_content
(
loader
.
render_template
(
'static/html/vectordraw.html'
,
context
))
fragment
.
add_content
(
loader
.
render_template
(
'static/html/vectordraw.html'
,
context
))
fragment
.
add_css
(
self
.
resource_string
(
'static/css/vectordraw.css'
))
fragment
.
add_css
(
self
.
resource_string
(
'static/css/vectordraw.css'
))
...
...
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