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

Phil Fazio lon-capa-users@mail.lon-capa.org
Sat, 20 Jan 2007 11:29:37 -0500


Hello all,

I have a couple ideas for problems mulling in my head, and I was 
wondering if you can submit an answer or a page via JavaScript and then 
use that submission in conjunction with a <customresponse>.

I tried the code "document.lonhomework.submit()" in my code, but it 
doesn't seem to pass along the value that I send it. I'm not too much of 
an expert in JavaScript, so I was wondering if doing this were even 
possible, and if currently not, whether it's worth filing a bug.

Basically my goal is to submit information (an element id, for example) 
via the onClick attribute of JavaScript, and then have the 
<customresponse> tag parse the value passed along. Possible applications 
include clicking on a certain element of an SVG image (if only IE would 
support it), or clicking on a id'ed <span> with a typo or grammar error, 
a "find the typo in this paragraph" kind of problem.

Thanks for any help,

Phil