[LON-CAPA-users] Using Custom response
lon-capa-users@mail.lon-capa.org
lon-capa-users@mail.lon-capa.org
Fri, 19 Oct 2007 11:44:24 -0400
<div>It sounds like the <externalresponse> is what I am looking for. =
I found the help page that describes it. This sounds pretty powerful.<br><b=
r>Anyone have an example of using this? I assume the url that gets called c=
ould be a perl or javascript routine published within the course, and that =
routine would have the capability of opening the file (presumably the filen=
ame is passed into the script as a parameter).<br><br>Something like<br><=
;starouttext />This is the problem text<endouttext /><br><exter=
nalresponse url=3D"/res/monroe/brew/MyScript.js $filename" answer=3D"OK">=
;<br> <textline readonly=3D"yes" /><br></externalrespo=
nse><br><br>Thanks,<br>brew<br></div><font color=3D"#990099">-----lon-ca=
pa-users-admin@mail.lon-capa.org wrote: -----<br><br></font><blockquote sty=
le=3D"border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left=
: 5px; margin-left: 5px; margin-right: 0px;">To: lon-capa-users@mail.lon-ca=
pa.org<br>From: Guy Albertelli II <guy@albertelli.com><br>Sent by: lo=
n-capa-users-admin@mail.lon-capa.org<br>Date: 10/17/2007 09:13PM<br>Subject=
: Re: [LON-CAPA-users] Using Custom response<br><br><font face=3D"monospace=
" size=3D"3">Hi Brew,<br><br>> I would like to do the following: Have th=
e student upload a file, then use<br>> a customresponse tag to use code =
(perl, javascript, java, C++, standalone<br>> Visual Basic program)<br><=
br>Currently <customresponse> can only be a perl script.<br><br>There=
is <externalresponse> which can be used to submit the students<br>re=
sponse and associated information to a remote server which can then<br>do w=
hatever it wants however it wants.<br><br><br>> to analyze the file and =
return the appropriate return<br>> code. Typically I would expect to ret=
urn something like EXACT=5FANS or<br>> INCORRECT. The student would then=
fix the file and resubmit it until it is<br>> correct.<br>> <br>>=
In the sample code for customresponse, the <customresponse> tag incl=
udes a<br>> <textline />; the contents of the textline show up as =
the variable<br>> $submission in the <answer> code.<br>> <br>&g=
t; I want to (in essence) replace the <textline> with an <essayres=
ponse>,<br><br>You can use <textfield> to get the larger type inpu=
t area<br>(<textarea>), but there isn't a way currently to get the fi=
le<br>submission style entry in anything but an essayresponse.<br><br>> =
where I get the functionality of the file upload process. Is customresponse=
<br>> limited to textlines, or can I use other types of responses? Does =
anyone<br>> have sample code that does non-textline uses of <customre=
sponse>? I notice<br>> that one of the available return codes from &l=
t;customresponse> is<br>> INVALID=5FFILETYPE, which leads me to hope =
the <answer> code should be able<br>> to find the uploaded file:)<=
br>> <br>> <br>> Hmmm, another potential problem: when the file is=
uploaded, I can retrieve<br>> the url for the file on the LonCapa serve=
r. I assume the code would be able<br>> to read the file from this url? =
For security, LonCapa perl has been<br>> restricted to remove the file a=
ccess functions - can javascript or other<br>> languages access the file=
somehow?<br><br>If the file type input was exteneded to work with <cust=
omresponse> the<br>file contents would be made available automagically t=
o the authoring<br>of the problem.<br><br>-- <br>guy@albertelli.com =
0-7-0-6-27,137<br>=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=5F=
=5F=5F=5F<br>LON-CAPA-users mailing list<br>LON-CAPA-users@mail.lon-capa.or=
g<br><a href=3D"http://mail.lon-capa.org/mailman/listinfo/lon-capa-users">h=
ttp://mail.lon-capa.org/mailman/listinfo/lon-capa-users</a><br></font></blo=
ckquote><br><BR>