Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-activetable
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-activetable
Commits
bbc750c9
Commit
bbc750c9
authored
Oct 26, 2015
by
Sven Marnach
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename table_definition field to content for nicer XML representation.
parent
28d5a460
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
activetable/activetable.py
+5
-5
No files found.
activetable/activetable.py
View file @
bbc750c9
...
...
@@ -26,7 +26,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
scope
=
Scope
.
settings
,
default
=
'ActiveTable problem'
)
table_definition
=
String
(
content
=
String
(
display_name
=
'Table definition'
,
help
=
'The definition of the table in Python-like syntax.'
,
scope
=
Scope
.
content
,
...
...
@@ -89,7 +89,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
editable_fields
=
[
'display_name'
,
'
table_definition
'
,
'
content
'
,
'help_text'
,
'column_widths'
,
'row_heights'
,
...
...
@@ -126,8 +126,8 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
def
parse_fields
(
self
):
"""Parse the user-provided fields into more processing-friendly structured data."""
if
self
.
table_definition
:
self
.
thead
,
self
.
tbody
=
parse_table
(
self
.
table_definition
)
if
self
.
content
:
self
.
thead
,
self
.
tbody
=
parse_table
(
self
.
content
)
else
:
self
.
thead
=
self
.
tbody
=
None
return
...
...
@@ -250,7 +250,7 @@ class ActiveTableXBlock(StudioEditableXBlockMixin, XBlock):
"""Add a validation error."""
validation
.
add
(
ValidationMessage
(
ValidationMessage
.
ERROR
,
msg
))
try
:
thead
,
tbody
=
parse_table
(
data
.
table_definition
)
thead
,
tbody
=
parse_table
(
data
.
content
)
except
ParseError
as
exc
:
add_error
(
'Problem with table definition: '
+
exc
.
message
)
thead
=
tbody
=
None
...
...
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