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
53a6edd0
Commit
53a6edd0
authored
Oct 06, 2016
by
cahrens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "single form element per capa problem"
This reverts commit
943a3a5e
.
parent
6073ea2e
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
18 additions
and
27 deletions
+18
-27
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
+5
-4
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 @
53a6edd0
<
%!
from
openedx
.
core
.
djangolib
.
markup
import
HTML
%
>
<
%!
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=
"script_placeholder"
data-src=
"${STATIC_URL}js/capa/annotationinput.js"
/>
<div
class=
"annotation-header"
>
<div
class=
"annotation-header"
>
...
@@ -57,7 +57,7 @@
...
@@ -57,7 +57,7 @@
<p
id=
"answer_${id}"
class=
"answer answer-annotation"
></p>
<p
id=
"answer_${id}"
class=
"answer answer-annotation"
></p>
</div>
</div>
</
div
>
</
form
>
% if msg:
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
<span
class=
"message"
>
${HTML(msg)}
</span>
...
...
common/lib/capa/capa/templates/choicegroup.html
View file @
53a6edd0
...
@@ -6,8 +6,7 @@
...
@@ -6,8 +6,7 @@
not
isinstance
(
value
,
basestring
)
and
choice_id
in
value
not
isinstance
(
value
,
basestring
)
and
choice_id
in
value
))
))
%
>
%
>
<form
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<div
class=
"choicegroup capa_inputtype"
id=
"inputtype_${id}"
>
<fieldset
${
HTML
(
describedby_html
)}
>
<fieldset
${
HTML
(
describedby_html
)}
>
% if response_data['label']:
% if response_data['label']:
<legend
id=
"${id}-legend"
class=
"response-fieldset-legend field-group-hd"
>
${response_data['label']}
</legend>
<legend
id=
"${id}-legend"
class=
"response-fieldset-legend field-group-hd"
>
${response_data['label']}
</legend>
...
@@ -72,4 +71,4 @@
...
@@ -72,4 +71,4 @@
% if msg:
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
<span
class=
"message"
>
${HTML(msg)}
</span>
% endif
% endif
</
div
>
</
form
>
common/lib/capa/capa/templates/choicetext.html
View file @
53a6edd0
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
%endif
%endif
% endfor
% endfor
<section
id=
"choicetextinput_${id}"
class=
"choicetextinput"
>
<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"
/>
<div
class=
"script_placeholder"
data-src=
"${STATIC_URL}js/capa/choicetextinput.js"
/>
<fieldset
aria-label=
"${remove_markup(response_data['label'])}"
>
<fieldset
aria-label=
"${remove_markup(response_data['label'])}"
>
...
@@ -73,5 +73,5 @@
...
@@ -73,5 +73,5 @@
% if msg:
% if msg:
<span
class=
"message"
>
${msg|n}
</span>
<span
class=
"message"
>
${msg|n}
</span>
% endif
% endif
</
div
>
</
form
>
</section>
</section>
common/lib/capa/capa/templates/javascriptinput.html
View file @
53a6edd0
<
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"
/>
<input
type=
"hidden"
name=
"input_${id}"
id=
"input_${id}"
class=
"javascriptinput_input"
/>
<div
class=
"javascriptinput_data"
data-display_class=
"${display_class}"
<div
class=
"javascriptinput_data"
data-display_class=
"${display_class}"
data-problem_state=
"${problem_state}"
data-params=
"${params}"
data-problem_state=
"${problem_state}"
data-params=
"${params}"
data-submission=
"${value|h}"
data-evaluation=
"${msg|h}"
>
data-submission=
"${value|h}"
data-evaluation=
"${msg|h}"
>
</div>
</div>
<div
class=
"script_placeholder"
data-src=
"/static/js/${display_file}"
></div>
<div
class=
"script_placeholder"
data-src=
"/static/js/${display_file}"
></div>
<div
class=
"javascriptinput_container"
></div>
<div
class=
"javascriptinput_container"
></div>
</div>
</form>
common/lib/capa/capa/templates/optioninput.html
View file @
53a6edd0
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<
%!
from
openedx
.
core
.
djangolib
.
markup
import
HTML
%
>
<
%!
from
openedx
.
core
.
djangolib
.
markup
import
HTML
%
>
<
%
doinline =
"inline"
if
inline
else
""
%
>
<
%
doinline =
"inline"
if
inline
else
""
%
>
<
div
class=
"inputtype option-input ${doinline}"
>
<
form
class=
"inputtype option-input ${doinline}"
>
% if response_data['label']:
% if response_data['label']:
<label
class=
"problem-group-label"
for=
"input_${id}"
>
${response_data['label']}
</label>
<label
class=
"problem-group-label"
for=
"input_${id}"
>
${response_data['label']}
</label>
% endif
% endif
...
@@ -31,4 +31,4 @@
...
@@ -31,4 +31,4 @@
% if msg:
% if msg:
<span
class=
"message"
>
${HTML(msg)}
</span>
<span
class=
"message"
>
${HTML(msg)}
</span>
% endif
% endif
</
div
>
</
form
>
common/lib/xmodule/xmodule/capa_base.py
View file @
53a6edd0
...
@@ -1288,16 +1288,17 @@ class CapaMixin(CapaFields):
...
@@ -1288,16 +1288,17 @@ class CapaMixin(CapaFields):
if
is_correct
is
None
:
if
is_correct
is
None
:
is_correct
=
''
is_correct
=
''
response_data
=
getattr
(
answer_input
,
'response_data'
,
{})
input_metadata
[
input_id
]
=
{
input_metadata
[
input_id
]
=
{
'question'
:
response_data
.
get
(
'label'
,
''
),
'question'
:
answer_input
.
response_data
.
get
(
'label'
,
''
),
'answer'
:
user_visible_answer
,
'answer'
:
user_visible_answer
,
'response_type'
:
getattr
(
getattr
(
answer_response
,
'xml'
,
None
),
'tag'
,
''
),
'response_type'
:
getattr
(
getattr
(
answer_response
,
'xml'
,
None
),
'tag'
,
''
),
'input_type'
:
getattr
(
answer_input
,
'tag'
,
''
),
'input_type'
:
getattr
(
answer_input
,
'tag'
,
''
),
'correct'
:
is_correct
,
'correct'
:
is_correct
,
'variant'
:
variant
,
'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
return
input_metadata
...
...
common/lib/xmodule/xmodule/tests/test_capa_module.py
View file @
53a6edd0
...
@@ -2600,7 +2600,6 @@ class TestProblemCheckTracking(unittest.TestCase):
...
@@ -2600,7 +2600,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'optionresponse'
,
'response_type'
:
'optionresponse'
,
'input_type'
:
'optioninput'
,
'input_type'
:
'optioninput'
,
'correct'
:
True
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
''
,
'variant'
:
''
,
},
},
factory
.
answer_key
(
3
):
{
factory
.
answer_key
(
3
):
{
...
@@ -2609,7 +2608,6 @@ class TestProblemCheckTracking(unittest.TestCase):
...
@@ -2609,7 +2608,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'multiplechoiceresponse'
,
'response_type'
:
'multiplechoiceresponse'
,
'input_type'
:
'choicegroup'
,
'input_type'
:
'choicegroup'
,
'correct'
:
False
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
'variant'
:
''
,
},
},
factory
.
answer_key
(
4
):
{
factory
.
answer_key
(
4
):
{
...
@@ -2618,7 +2616,6 @@ class TestProblemCheckTracking(unittest.TestCase):
...
@@ -2618,7 +2616,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'choiceresponse'
,
'response_type'
:
'choiceresponse'
,
'input_type'
:
'checkboxgroup'
,
'input_type'
:
'checkboxgroup'
,
'correct'
:
False
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
'variant'
:
''
,
},
},
})
})
...
@@ -2659,7 +2656,6 @@ class TestProblemCheckTracking(unittest.TestCase):
...
@@ -2659,7 +2656,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'numericalresponse'
,
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
'input_type'
:
'textline'
,
'correct'
:
True
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
''
,
'variant'
:
''
,
}
}
})
})
...
@@ -2791,7 +2787,6 @@ class TestProblemCheckTracking(unittest.TestCase):
...
@@ -2791,7 +2787,6 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'numericalresponse'
,
'response_type'
:
'numericalresponse'
,
'input_type'
:
'textline'
,
'input_type'
:
'textline'
,
'correct'
:
True
,
'correct'
:
True
,
'group_label'
:
''
,
'variant'
:
module
.
seed
,
'variant'
:
module
.
seed
,
}
}
})
})
...
@@ -2824,13 +2819,11 @@ class TestProblemCheckTracking(unittest.TestCase):
...
@@ -2824,13 +2819,11 @@ class TestProblemCheckTracking(unittest.TestCase):
'response_type'
:
'coderesponse'
,
'response_type'
:
'coderesponse'
,
'input_type'
:
'filesubmission'
,
'input_type'
:
'filesubmission'
,
'correct'
:
False
,
'correct'
:
False
,
'group_label'
:
''
,
'variant'
:
''
,
'variant'
:
''
,
},
},
factory
.
answer_key
(
3
):
{
factory
.
answer_key
(
3
):
{
'answer'
:
'None'
,
'answer'
:
'None'
,
'correct'
:
True
,
'correct'
:
True
,
'group_label'
:
''
,
'question'
:
''
,
'question'
:
''
,
'response_type'
:
'customresponse'
,
'response_type'
:
'customresponse'
,
'input_type'
:
'textline'
,
'input_type'
:
'textline'
,
...
...
lms/djangoapps/courseware/features/problems_setup.py
View file @
53a6edd0
...
@@ -216,7 +216,7 @@ def answer_problem(course, problem_type, correctness):
...
@@ -216,7 +216,7 @@ def answer_problem(course, problem_type, correctness):
world
.
css_fill
(
inputfield
(
course
,
'string'
),
textvalue
)
world
.
css_fill
(
inputfield
(
course
,
'string'
),
textvalue
)
elif
problem_type
==
'numerical'
:
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
)
world
.
css_fill
(
inputfield
(
course
,
'numerical'
),
textvalue
)
elif
problem_type
==
'formula'
:
elif
problem_type
==
'formula'
:
...
...
lms/templates/problem.html
View file @
53a6edd0
...
@@ -12,8 +12,6 @@ from openedx.core.djangolib.markup import HTML
...
@@ -12,8 +12,6 @@ from openedx.core.djangolib.markup import HTML
<div
class=
"problem-progress"
></div>
<div
class=
"problem-progress"
></div>
<div
class=
"problem"
>
<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']) }
${ HTML(problem['html']) }
<div
class=
"action"
>
<div
class=
"action"
>
<input
type=
"hidden"
name=
"problem_id"
value=
"${ problem['name'] }"
/>
<input
type=
"hidden"
name=
"problem_id"
value=
"${ problem['name'] }"
/>
...
@@ -41,5 +39,4 @@ from openedx.core.djangolib.markup import HTML
...
@@ -41,5 +39,4 @@ from openedx.core.djangolib.markup import HTML
</div>
</div>
% endif
% endif
</div>
</div>
</form>
</div>
</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