[LON-CAPA-dev] upload url
Guy Albertelli II
lon-capa-dev@mail.lon-capa.org
Mon, 26 Feb 2007 01:59:32 -0500 (EST)
Hi Mark,
> Looking for some advice. I have a $symb and a username.
>
> What is the best call to get the uploadfile url for a problem?
>
> I'm trying to gather a group of essay response uploads for download as a
> zip file.
This would be BUG#5179
You'll need to do a Apache::lonnet::restore() to get the current problem
state information for a particular student/symb.
Then (looking at the document loncapa/doc/datastorage)
resource.partid.responseid.uploadedurl
# url to use to grab the file that was used for
# the submission
resource.partid.responseid.uploadedfile
# filename of the upload file that is to be used
# for the submission
resource.partid.responseid.portfiles
# comma sepearted list of student portfolio files
# for the submission
Are the fields in the hash from restore() that have the info that you
need.
lonnet::filelocation() will take a
/uploaded/domain/username/portfolio/.... url spec and turn it into a
local filesystem location.
lonnet::repcopy() can be used to make a local copy for the file come
into existance (it fetchs it properly from the library server). So
if (!-e $filelocation) { &Apache::lonnet::repcopy($filelocation); }
should bring it around.
Need anything else?
--
guy@albertelli.com 0-7-0-9-27,137