[LON-CAPA-users] Submission of Answer via combination of JavaScript and customresponse

James M Sullivan/FS/VCU lon-capa-users@mail.lon-capa.org
Mon, 22 Jan 2007 06:59:13 -0500


<font size=3D"2">Phil,<br><br>I think maybe Guy was referring to some of th=
e free body diagram applets (FBD) we developed at VCU. We have several prob=
lems that interact with a popup window using java/javascript. Students draw=
 a FBD in the popup child window and then send that information back to the=
 parent page for grading. The drawing feature is handled by java and javasc=
ript and the info from the popup child window is sent back to the parent wi=
th a setfield. <br><br>In our particular case we are =5Fnot=5F using a cust=
om response grading since loncapa need only grade a vector (which is, after=
 all, just two numbers). Okay, so that's not completely true since we do so=
me "grading" using the javascript too; basically we don't let the students =
send their answer from the popup window to the loncapa problem page unless =
their answer passes some basic criteria. We haven't explored using a bona f=
ide custom response tag yet.<br><br>You can find an example at /res/vcu/jms=
ullivan/physics/freebodydiagram/FBD=5Fdraw=5Fbox1ontable.problem, which is =
published as open source. You're also gonna need to look at two javascript =
libraries which handle the behind-the-scenes machinations for our problems,=
 and a perl library for defaulting the popup window with information from p=
revious student submissions. </font><font size=3D"2">All the java that make=
s up the backbone of the drawing
routines is handled by "physlets" located at
/res/vcu/jmsullivan/physics/applets.<br><br></font><font size=3D"2">You can=
 find the three support javascript and perl libraries at:<br><br>/res/vcu/j=
msullivan/tools/fbd0=5Ftools.js<br>/res/vcu/jmsullivan/tools/fbd=5Ftools.js=
<br>/res/vcu/jmsullivan/tools/fbd=5Fsubmissions.library<br><br>In particula=
r you are probably gonna be interested in the function "send=5Fanswers" in =
the "fbd=5Ftools.js" library as this handles the sending of the information=
 to the appropriate field on the loncapa problem page.<br><br>Hope this hel=
ps,<br>Jay<br><br><br></font>=