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
432f6cdf
Commit
432f6cdf
authored
Oct 06, 2016
by
Christina Roberts
Committed by
GitHub
Oct 06, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13680 from edx/christina/revert-capa-form
Revert "single form element per capa problem"
parents
b27f8a29
53a6edd0
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
25 deletions
+16
-25
common/lib/capa/capa/templates/annotationinput.html
+2
-2
common/lib/capa/capa/templates/choicegroup.html
+2
-3
common/lib/capa/capa/templates/choicetext.html
+2
-2
common/lib/capa/capa/templates/javascriptinput.html
+3
-2
common/lib/capa/capa/templates/optioninput.html
+2
-2
common/lib/xmodule/xmodule/capa_base.py
+4
-3
common/lib/xmodule/xmodule/tests/test_capa_module.py
+0
-7
lms/djangoapps/courseware/features/problems_setup.py
+1
-1
lms/templates/problem.html
+0
-3
No files found.
common/lib/capa/capa/templates/annotationinput.html
View file @
432f6cdf
<
%!
from
openedx
.
core
.
djangolib
.
markup
import
HTML
%
>
<
div
class=
"annotation-input"
>
<
form
class=
"annotation-input"
>
<div
class=
"script_placeholder"
data-src=
"${STATIC_URL}js/capa/annotationinput.js"
/>
<div
class=
"annotation-header"
>
...
...
@@ -57,7 +57,7 @@
<p
id=
"answer_${id}"
class=
"answer answer-annotation"
></p>
</div>
</
div
>
</
form
>
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
...
...
common/lib/capa/capa/templates/choicegroup.html
View file @
432f6cdf
...
...
@@ -6,8 +6,7 @@
not
isinstance
(
value
,
basestring
)
and
choice_id
in
value
))
%
>
<div
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<form
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<fieldset
${
HTML
(
describedby_html
)}
>
% if response_data['label']:
<legend
id=
"${id}-legend"
class=
"response-fieldset-legend field-group-hd"
>
${response_data['label']}
</legend>
...
...
@@ -72,4 +71,4 @@
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
% endif
</
div
>
</
form
>
common/lib/capa/capa/templates/choicetext.html
View file @
432f6cdf
...
...
@@ -8,7 +8,7 @@
%endif
% endfor
<section
id=
"choicetextinput_${id}"
class=
"choicetextinput"
>
<
div
class=
"choicetextgroup capa_inputtype"
id=
"inputtype_${id}"
>
<
form
class=
"choicetextgroup capa_inputtype"
id=
"inputtype_${id}"
>
<div
class=
"script_placeholder"
data-src=
"${STATIC_URL}js/capa/choicetextinput.js"
/>
<fieldset
aria-label=
"${remove_markup(response_data['label'])}"
>
...
...
@@ -73,5 +73,5 @@
% if msg:
<span
class=
"message"
>
${msg|n}
</span>
% endif
</
div
>
</
form
>
</section>
common/lib/capa/capa/templates/javascriptinput.html
View file @
432f6cdf
<
div
class=
"javascriptinput capa_inputtype"
id=
"inputtype_${id}"
>
<
form
class=
"javascriptinput capa_inputtype"
id=
"inputtype_${id}"
>
<input
type=
"hidden"
name=
"input_${id}"
id=
"input_${id}"
class=
"javascriptinput_input"
/>
<div
class=
"javascriptinput_data"
data-display_class=
"${display_class}"
data-problem_state=
"${problem_state}"
data-params=
"${params}"
...
...
@@ -6,4 +6,5 @@
</div>
<div
class=
"script_placeholder"
data-src=
"/static/js/${display_file}"
></div>
<div
class=
"javascriptinput_container"
></div>
</div>
</form>
common/lib/capa/capa/templates/optioninput.html
View file @
432f6cdf
...
...
@@ -2,7 +2,7 @@
<
%!
from
openedx
.
core
.
djangolib
.
markup
import
HTML
%
>
<
%
doinline =
"inline"
if
inline
else
""
%
>
<
div
class=
"inputtype option-input ${doinline}"
>
<
form
class=
"inputtype option-input ${doinline}"
>
% if response_data['label']:
<label
class=
"problem-group-label"
for=
"input_${id}"
>
${response_data['label']}
</label>
% endif
...
...
@@ -31,4 +31,4 @@
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
% endif
</
div
>
</
form
>
common/lib/xmodule/xmodule/capa_base.py
View file @
432f6cdf
...
...
@@ -1288,16 +1288,17 @@ class CapaMixin(CapaFields):
if
is_correct
is
None
:
is_correct
=
''
response_data
=
getattr
(
answer_input
,
'response_data'
,
{})
input_metadata
[
input_id
]
=
{
'question'
:
response_data
.
get
(
'label'
,
''
),
'question'
:
answer_input
.
response_data
.
get
(
'label'
,
''
),
'answer'
:
user_visible_answer
,
'response_type'
:
getattr
(
getattr
(
answer_response
,
'xml'
,
None
),
'tag'
,
''
),
'input_type'
:
getattr
(
answer_input
,
'tag'
,
''
),
'correct'
:
is_correct
,
'variant'
:
variant
,
'group_label'
:
response_data
.
get
(
'group_label'
,
''
),
}
# Add group_label in event data only if the responsetype contains multiple inputtypes
if
answer_input
.
response_data
.
get
(
'group_label'
):
input_metadata
[
input_id
][
'group_label'
]
=
answer_input
.
response_data
.
get
(
'group_label'
)
return
input_metadata
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
432f6cdf
...
...
@@ -2600,7 +2600,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'optionresponse'
,
'input_type'
:
'optioninput'
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
''
,
},
factory
.
answer_key
(
3
):
{
...
...
@@ -2609,7 +2608,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'multiplechoiceresponse'
,
'input_type'
:
'choicegroup'
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
},
factory
.
answer_key
(
4
):
{
...
...
@@ -2618,7 +2616,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'choiceresponse'
,
'input_type'
:
'checkboxgroup'
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
},
})
...
...
@@ -2659,7 +2656,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
''
,
}
})
...
...
@@ -2791,7 +2787,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
module
.
seed
,
}
})
...
...
@@ -2824,13 +2819,11 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'coderesponse'
,
'input_type'
:
'filesubmission'
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
},
factory
.
answer_key
(
3
):
{
'answer'
:
'None'
,
'correct'
:
True
,
'group_label'
:
''
,
'question'
:
''
,
'response_type'
:
'customresponse'
,
'input_type'
:
'textline'
,
...
...
lms/djangoapps/courseware/features/problems_setup.py
View file @
432f6cdf
...
...
@@ -216,7 +216,7 @@ def answer_problem(course, problem_type, correctness):
world
.
css_fill
(
inputfield
(
course
,
'string'
),
textvalue
)
elif
problem_type
==
'numerical'
:
textvalue
=
"pi
+
1"
if
correctness
==
'correct'
else
str
(
random
.
randint
(
-
2
,
2
))
textvalue
=
"pi
+
1"
if
correctness
==
'correct'
else
str
(
random
.
randint
(
-
2
,
2
))
world
.
css_fill
(
inputfield
(
course
,
'numerical'
),
textvalue
)
elif
problem_type
==
'formula'
:
...
...
lms/templates/problem.html
View file @
432f6cdf
...
...
@@ -12,8 +12,6 @@ from openedx.core.djangolib.markup import HTML
<div
class=
"problem-progress"
></div>
<div
class=
"problem"
>
## onsubmit is required because click on any button inside form will submit it and reload page which we don't want
<form
class=
'capa-problem-form'
onsubmit=
'return false;'
>
${ HTML(problem['html']) }
<div
class=
"action"
>
<input
type=
"hidden"
name=
"problem_id"
value=
"${ problem['name'] }"
/>
...
...
@@ -41,5 +39,4 @@ from openedx.core.djangolib.markup import HTML
</div>
% endif
</div>
</form>
</div>
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