Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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
edx-platform
Commits
cc7f7910
Commit
cc7f7910
authored
Feb 20, 2013
by
Arthur Barrett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse xml for annotationinput
parent
07f64abb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
8 deletions
+21
-8
common/lib/capa/capa/inputtypes.py
+19
-5
common/lib/capa/capa/templates/annotationinput.html
+2
-2
lms/templates/annotatable_problem.html
+0
-1
No files found.
common/lib/capa/capa/inputtypes.py
View file @
cc7f7910
...
...
@@ -968,11 +968,25 @@ class AnnotationInput(InputTypeBase):
tags
=
[
'annotationinput'
]
def
setup
(
self
):
# Pull out all the things from the xml
self
.
text
=
'text'
self
.
comment_prompt
=
'comment_prompt'
self
.
tag_prompt
=
'tag_prompt'
self
.
options
=
[(
0
,
'blue'
),
(
1
,
'green'
),
(
2
,
'red'
)]
xml
=
self
.
xml
self
.
text
=
xml
.
findtext
(
'./text'
)
self
.
comment_prompt
=
xml
.
findtext
(
'./comment_prompt'
)
self
.
tag_prompt
=
xml
.
findtext
(
'./tag_prompt'
)
self
.
options
=
self
.
_find_options
()
def
_find_options
(
self
):
options
=
[]
index
=
0
for
option
in
self
.
xml
.
findall
(
'./options/option'
):
options
.
append
({
'id'
:
index
,
'tag'
:
option
.
text
,
'description'
:
option
.
get
(
'description'
,
''
),
'score'
:
option
.
get
(
'score'
,
0
)
})
index
+=
1
return
options
def
_extra_context
(
self
):
return
{
'text'
:
self
.
text
,
...
...
common/lib/capa/capa/templates/annotationinput.html
View file @
cc7f7910
...
...
@@ -14,8 +14,8 @@ TODO: make the textline hidden once it all works
Value: ${value}
% for option
_id, option_description
in options:
<p>
${option
_id}, ${option_description
}
</p>
% for option in options:
<p>
${option
['id']}, ${option['tag']}, ${option['description']}, ${option['score']
}
</p>
% endfor
<span
id=
"answer_${id}"
></span>
...
...
lms/templates/annotatable_problem.html
View file @
cc7f7910
...
...
@@ -15,7 +15,6 @@
<div
class=
"annotatable-problem-controls"
>
<button
class=
"button annotatable-problem-save"
>
Save
</button>
<button
class=
"button annotatable-problem-submit"
>
Submit
</button>
<a
class=
"annotatable-problem-return"
href=
"javascript:void(0);"
data-discussion-id=
"${problem['discussion_id']}"
>
Return to annotation
</a>
</div>
</div>
<div
class=
"annotatable-problem-footer"
>
...
...
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