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
7806acc7
Commit
7806acc7
authored
Mar 11, 2013
by
David Ormsbee
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1638 from MITx/feature/diana/show-correctness
Add the ability to hide correctness markers
parents
fcc3113b
421e169e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
common/lib/capa/capa/inputtypes.py
+6
-0
common/lib/capa/capa/templates/choicegroup.html
+5
-2
common/lib/capa/capa/tests/test_inputtypes.py
+2
-0
No files found.
common/lib/capa/capa/inputtypes.py
View file @
7806acc7
...
...
@@ -366,6 +366,12 @@ class ChoiceGroup(InputTypeBase):
self
.
choices
=
self
.
extract_choices
(
self
.
xml
)
@classmethod
def
get_attributes
(
cls
):
return
[
Attribute
(
"show_correctness"
,
"always"
),
Attribute
(
"submitted_message"
,
"Answer received."
)]
def
_extra_context
(
self
):
return
{
'input_type'
:
self
.
html_input_type
,
'choices'
:
self
.
choices
,
...
...
common/lib/capa/capa/templates/choicegroup.html
View file @
7806acc7
<form
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<div
class=
"indicator_container"
>
% if input_type == 'checkbox' or not value:
% if status == 'unsubmitted':
% if status == 'unsubmitted'
or show_correctness == 'never'
:
<span
class=
"unanswered"
style=
"display:inline-block;"
id=
"status_${id}"
></span>
% elif status == 'correct':
<span
class=
"correct"
id=
"status_${id}"
></span>
...
...
@@ -26,7 +26,7 @@
else:
correctness =
None
%
>
% if correctness:
% if correctness
and not show_correctness=='never'
:
class="choicegroup_${correctness}"
% endif
% endif
...
...
@@ -41,4 +41,7 @@
<span
id=
"answer_${id}"
></span>
</fieldset>
% if show_correctness == "never" and (value or status not in ['unsubmitted']):
<div
class=
"capa_alert"
>
${submitted_message}
</div>
%endif
</form>
common/lib/capa/capa/tests/test_inputtypes.py
View file @
7806acc7
...
...
@@ -102,6 +102,8 @@ class ChoiceGroupTest(unittest.TestCase):
'choices'
:
[(
'foil1'
,
'<text>This is foil One.</text>'
),
(
'foil2'
,
'<text>This is foil Two.</text>'
),
(
'foil3'
,
'This is foil Three.'
),
],
'show_correctness'
:
'always'
,
'submitted_message'
:
'Answer received.'
,
'name_array_suffix'
:
expected_suffix
,
# what is this for??
}
...
...
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