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
752a4552
Commit
752a4552
authored
Jan 09, 2013
by
Carlos Andrés Rocha
Committed by
Victor Shnayder
Feb 05, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed design-a-protein input type to save the value of output
parent
bc3f373e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
common/static/js/capa/design-protein-2d.js
+15
-8
No files found.
common/static/js/capa/design-protein-2d.js
View file @
752a4552
...
...
@@ -9,19 +9,26 @@
function
waitForApplet
(
applet
)
{
if
(
applet
.
isActive
&&
applet
.
isActive
())
{
console
.
log
(
"Applet is ready."
);
var
answerStr
=
applet
.
checkAnswer
();
console
.
log
(
answerStr
);
var
input
=
$
(
'.designprotein2dinput input'
);
console
.
log
(
input
);
input
.
val
(
answerStr
);
}
else
if
(
timeout
>
30
*
1000
)
{
console
.
error
(
"Applet did not load on time."
);
// FIXME: [rocha] This is a hack to capture the click on the check
// button and update the hidden field with the applet values
var
input_field
=
$
(
'.designprotein2dinput input'
);
var
problem
=
$
(
applet
).
parents
(
'.problem'
);
var
check_button
=
problem
.
find
(
'input.check'
);
check_button
.
on
(
'click'
,
function
()
{
var
answerStr
=
applet
.
checkAnswer
();
console
.
log
(
answerStr
);
input_field
.
val
(
answerStr
);
});
}
else
{
console
.
log
(
"Waiting for applet..."
);
setTimeout
(
function
()
{
waitForApplet
(
applet
);
},
timeout
);
}
}
var
applets
=
$
(
'.designprotein2dinput object'
);
applets
.
each
(
function
(
i
,
el
)
{
initializeApplet
(
el
);
});
}).
call
(
this
);
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