[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lon-capa-users
Subject:    Re: [LON-CAPA-users] Using Custom response
From:       Guy Albertelli II <guy () albertelli ! com>
Date:       2007-10-19 19:06:53
Message-ID: 20071019190653.GB29550 () mileva ! lite ! msu ! edu
[Download RAW message or body]

Hi Brew,

Sorry about the negativity of this response, as far as I can tell the
specific thing you want to do is prevented fairly throughly due to
security concerns. (We'd rather not have authors having the ability to
read random files on the filesystem or run arbitrary programs on the
lon-capa servers.) 

> It sounds like the <externalresponse> is what I am looking for. I
> found the help page that describes it. This sounds pretty
> powerful.
>
> Anyone have an example of using this?

As far as I know it has not yet been used in a real course.

> I assume the
> url that gets called could be a perl or javascript routine published
> within the course, and that routine would have the capability of
> opening the file (presumably the filename is passed into the script
> as a parameter).

It's meant for the URL to be a CGI script on a remote server. So, no.

Additionally currently external response doesn't yet support the file
submission mechanism that essay response does.

> Something like
>
> <starouttext />This is the problem text<endouttext />
> <externalresponse url="/res/monroe/brew/MyScript.js $filename"
>     answer="OK">
>  <textline readonly="yes" />
> </externalresponse>

No, because MyScript.js isn't a cgi script. And there is no way for an
author to generate a cgi script that is a publishable item in
lon-capa. (It's due to security.)

And even then there isn't a mechanism for an author to read the
contents of a student's file. (Once again security.)

And even then that is incorrect externalresponse code, the url should
be just the url of the cscript that does the grading

so url="http://brews.own.machine/cgi/MyGradingScript.cgi"

The answer field should be the correct answer (I guess "OK" could be the
correct answer, but usually there is some info you might want to send
to at least let it know what problem is was.)

The student's submission would get automatically added to the POSTed
info as the form element LONCAPA_student_response

(Hmm, I think I need to toss more words into the external response
help file...)


What you are asking to do seems reasonable but there isn't currently a
mechanism to do it.

What I propose to add is something like
<startouttext />
  Submit a file.
<endouttext />
<customresponse>
  <filesubmission />
  <answer type="loncapa/perl">
     foreach $file (@submitted_files) {
        $contents = &get_submitted_file_contents($file);
        # do something with the contents of $file
     }
  </answer>
</customresponse>


(Hmm... as an aside I think if you
1) had your own server to run the cgi scripts on and

2) and had the students
- add the file to their portfolio
- mark the file as public
- submitted an answer that was the url(s) of the portfolio file

You could use the exernalresponse mechanism as it exists right now to
do what you are looking at doing.)

-- 
guy@albertelli.com   0-7-0-6-27,137
_______________________________________________
LON-CAPA-users mailing list
LON-CAPA-users@mail.lon-capa.org
http://mail.lon-capa.org/mailman/listinfo/lon-capa-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic