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
5134c99d
Commit
5134c99d
authored
Feb 14, 2013
by
Victor Shnayder
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1500 from MITx/700x-sandbox
700x sandbox
parents
f80181be
e352226d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
common/lib/capa/capa/responsetypes.py
+3
-1
common/lib/capa/capa/templates/designprotein2dinput.html
+1
-1
common/static/js/capa/design-protein-2d.js
+17
-5
No files found.
common/lib/capa/capa/responsetypes.py
View file @
5134c99d
...
...
@@ -633,9 +633,11 @@ class MultipleChoiceResponse(LoncapaResponse):
# define correct choices (after calling secondary setup)
xml
=
self
.
xml
cxml
=
xml
.
xpath
(
'//*[@id=$id]//choice'
,
id
=
xml
.
get
(
'id'
))
# contextualize correct attribute and then select ones for which
# correct = "true"
self
.
correct_choices
=
[
contextualize_text
(
choice
.
get
(
'name'
),
self
.
context
)
self
.
correct_choices
=
[
contextualize_text
(
choice
.
get
(
'name'
),
self
.
context
)
for
choice
in
cxml
if
contextualize_text
(
choice
.
get
(
'correct'
),
self
.
context
)
==
"true"
]
...
...
common/lib/capa/capa/templates/designprotein2dinput.html
View file @
5134c99d
<section
id=
"designprotein2dinput_${id}"
class=
"designprotein2dinput"
>
<div
class=
"script_placeholder"
data-src=
"/static/js/capa/protex/protex.nocache.js"
/>
<div
class=
"script_placeholder"
data-src=
"/static/js/capa/protex/protex.nocache.js
?raw
"
/>
<div
class=
"script_placeholder"
data-src=
"${applet_loader}"
/>
% if status == 'unsubmitted':
...
...
common/static/js/capa/design-protein-2d.js
View file @
5134c99d
...
...
@@ -22,6 +22,15 @@
// It calls protexIsReady with a deferred command when it has finished
// initialization and has drawn itself
function
updateProtexField
()
{
var
problem
=
$
(
'#protex_container'
).
parents
(
'.problem'
);
var
input_field
=
problem
.
find
(
'input[type=hidden]'
);
var
protex_answer
=
protexCheckAnswer
();
var
value
=
{
protex_answer
:
protex_answer
};
//console.log(JSON.stringify(value));
input_field
.
val
(
JSON
.
stringify
(
value
));
}
protexIsReady
=
function
()
{
//Load target shape
var
target_shape
=
$
(
'#target_shape'
).
val
();
...
...
@@ -29,15 +38,18 @@
//Get answer from protex and store it into the hidden input field
//when Check button is clicked
var
problem
=
$
(
'#protex_container'
).
parents
(
'.problem'
);
var
check_button
=
problem
.
find
(
'input.check'
);
var
input_field
=
problem
.
find
(
'input[type=hidden]
'
);
check_button
.
on
(
'click'
,
function
()
{
var
fold_button
=
$
(
"#fold-button"
);
fold_button
.
on
(
'click'
,
function
(){
var
problem
=
$
(
'#protex_container'
).
parents
(
'.problem
'
);
var
input_field
=
problem
.
find
(
'input[type=hidden]'
);
var
protex_answer
=
protexCheckAnswer
();
var
value
=
{
protex_answer
:
protex_answer
};
//console.log(JSON.stringify(value));
input_field
.
val
(
JSON
.
stringify
(
value
));
});
});
updateProtexField
();
};
/*function initializeProtex() {
//Check to see if the two exported GWT functions protexSetTargetShape
...
...
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