[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 &lt;externalresponse&gt; 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>&lt=
;starouttext /&gt;This is the problem text&lt;endouttext /&gt;<br>&lt;exter=
nalresponse url=3D"/res/monroe/brew/MyScript.js $filename" answer=3D"OK"&gt=
;<br>&nbsp;&nbsp; &lt;textline readonly=3D"yes" /&gt;<br>&lt;/externalrespo=
nse&gt;<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 &lt;guy@albertelli.com&gt;<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>&gt; I would like to do the following: Have th=
e student upload a file, then use<br>&gt; a customresponse tag to use code =
(perl, javascript, java, C++, standalone<br>&gt; Visual Basic program)<br><=
br>Currently &lt;customresponse&gt; can only be a perl script.<br><br>There=
 is &lt;externalresponse&gt; 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>&gt; to analyze the file and =
return the appropriate return<br>&gt; code. Typically I would expect to ret=
urn something like EXACT=5FANS or<br>&gt; INCORRECT. The student would then=
 fix the file and resubmit it until it is<br>&gt; correct.<br>&gt; <br>&gt;=
 In the sample code for customresponse, the &lt;customresponse&gt; tag incl=
udes a<br>&gt; &lt;textline /&gt;; the contents of the textline show up as =
the variable<br>&gt; $submission in the &lt;answer&gt; code.<br>&gt; <br>&g=
t; I want to (in essence) replace the &lt;textline&gt; with an &lt;essayres=
ponse&gt;,<br><br>You can use &lt;textfield&gt; to get the larger type inpu=
t area<br>(&lt;textarea&gt;), but there isn't a way currently to get the fi=
le<br>submission style entry in anything but an essayresponse.<br><br>&gt; =
where I get the functionality of the file upload process. Is customresponse=
<br>&gt; limited to textlines, or can I use other types of responses? Does =
anyone<br>&gt; have sample code that does non-textline uses of &lt;customre=
sponse&gt;? I notice<br>&gt; that one of the available return codes from &l=
t;customresponse&gt; is<br>&gt; INVALID=5FFILETYPE, which leads me to hope =
the &lt;answer&gt; code should be able<br>&gt; to find the uploaded file:)<=
br>&gt; <br>&gt; <br>&gt; Hmmm, another potential problem: when the file is=
 uploaded, I can retrieve<br>&gt; the url for the file on the LonCapa serve=
r. I assume the code would be able<br>&gt; to read the file from this url? =
For security, LonCapa perl has been<br>&gt; restricted to remove the file a=
ccess functions - can javascript or other<br>&gt; languages access the file=
 somehow?<br><br>If the file type input was exteneded to work with &lt;cust=
omresponse&gt; the<br>file contents would be made available automagically t=
o the authoring<br>of the problem.<br><br>-- <br>guy@albertelli.com &nbsp; =
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>