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
e3b8ce70
Commit
e3b8ce70
authored
Nov 18, 2013
by
RobertMarks
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes to allow multiple choicetextresponses in one problem
parent
69ef7531
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
common/lib/capa/capa/templates/choicetext.html
+1
-1
common/static/js/capa/choicetextinput.js
+3
-3
No files found.
common/lib/capa/capa/templates/choicetext.html
View file @
e3b8ce70
...
...
@@ -55,7 +55,7 @@
% else:
<
%
my_id =
content_node.get('contents','')
%
>
<
%
my_val =
value.get(my_id,'')
%
>
<input
class=
"ctinput"
type=
"text"
name=
"${content_node['contents']}"
id=
"${content_node['contents']}"
value=
"${my_val|h}
"
/>
<input
class=
"ctinput"
type=
"text"
name=
"${content_node['contents']}"
id=
"${content_node['contents']}"
value=
"${my_val|h}"
/>
%endif
<span
class=
"mock_label"
>
${content_node['tail_text']}
...
...
common/static/js/capa/choicetextinput.js
View file @
e3b8ce70
(
function
()
{
var
update
=
function
()
{
// Whenever a value changes create a new serialized version of this
// problem's inputs and set the hidden input fields value to equal it.
var
parent
=
$
(
this
).
closest
(
'
.problems-wrapper
'
);
// problem's inputs and set the hidden input field
'
s value to equal it.
var
parent
=
$
(
this
).
closest
(
'
section.choicetextinput
'
);
// find the closest parent problems-wrapper and use that as the problem
// grab the input id from the input
// real_input is the hidden input field
var
real_input
=
$
(
'input.choicetextvalue'
,
parent
);
var
all_inputs
=
$
(
'
.choicetextinput
.ctinput'
,
parent
);
var
all_inputs
=
$
(
'
input
.ctinput'
,
parent
);
var
user_inputs
=
{};
$
(
all_inputs
).
each
(
function
(
index
,
elt
)
{
var
node
=
$
(
elt
);
...
...
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