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
0c949d20
Commit
0c949d20
authored
Mar 11, 2013
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add the ability to hide correctness markers
with a custom message for when they submit something.
parent
fb407e3c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
common/lib/capa/capa/inputtypes.py
+6
-0
common/lib/capa/capa/templates/choicegroup.html
+5
-2
No files found.
common/lib/capa/capa/inputtypes.py
View file @
0c949d20
...
@@ -366,6 +366,12 @@ class ChoiceGroup(InputTypeBase):
...
@@ -366,6 +366,12 @@ class ChoiceGroup(InputTypeBase):
self
.
choices
=
self
.
extract_choices
(
self
.
xml
)
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
):
def
_extra_context
(
self
):
return
{
'input_type'
:
self
.
html_input_type
,
return
{
'input_type'
:
self
.
html_input_type
,
'choices'
:
self
.
choices
,
'choices'
:
self
.
choices
,
...
...
common/lib/capa/capa/templates/choicegroup.html
View file @
0c949d20
<form
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<form
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<div
class=
"indicator_container"
>
<div
class=
"indicator_container"
>
% if input_type == 'checkbox' or not value:
% 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>
<span
class=
"unanswered"
style=
"display:inline-block;"
id=
"status_${id}"
></span>
% elif status == 'correct':
% elif status == 'correct':
<span
class=
"correct"
id=
"status_${id}"
></span>
<span
class=
"correct"
id=
"status_${id}"
></span>
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
else:
else:
correctness =
None
correctness =
None
%
>
%
>
% if correctness:
% if correctness
and not show_correctness=='never'
:
class="choicegroup_${correctness}"
class="choicegroup_${correctness}"
% endif
% endif
% endif
% endif
...
@@ -41,4 +41,7 @@
...
@@ -41,4 +41,7 @@
<span
id=
"answer_${id}"
></span>
<span
id=
"answer_${id}"
></span>
</fieldset>
</fieldset>
% if show_correctness == "never" and (value or status not in ['unsubmitted']):
<div
class=
"capa_alert"
>
${submitted_message}
</div>
%endif
</form>
</form>
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