[LON-CAPA-users] Using Custom response
Guy Albertelli II
Wed, 17 Oct 2007 21:13:17 -0400
> I would like to do the following: Have the student upload a file, then use
> Visual Basic program)
Currently <customresponse> can only be a perl script.
There is <externalresponse> which can be used to submit the students
response and associated information to a remote server which can then
do whatever it wants however it wants.
> to analyze the file and return the appropriate return
> code. Typically I would expect to return something like EXACT_ANS or
> INCORRECT. The student would then fix the file and resubmit it until it is
> In the sample code for customresponse, the <customresponse> tag includes a
> <textline />; the contents of the textline show up as the variable
> $submission in the <answer> code.
> I want to (in essence) replace the <textline> with an <essayresponse>,
You can use <textfield> to get the larger type input area
(<textarea>), but there isn't a way currently to get the file
submission style entry in anything but an essayresponse.
> where I get the functionality of the file upload process. Is customresponse
> limited to textlines, or can I use other types of responses? Does anyone
> have sample code that does non-textline uses of <customresponse>? I notice
> that one of the available return codes from <customresponse> is
> INVALID_FILETYPE, which leads me to hope the <answer> code should be able
> to find the uploaded file:)
> Hmmm, another potential problem: when the file is uploaded, I can retrieve
> the url for the file on the LonCapa server. I assume the code would be able
> to read the file from this url? For security, LonCapa perl has been
> languages access the file somehow?
If the file type input was exteneded to work with <customresponse> the
file contents would be made available automagically to the authoring
of the problem.