[LON-CAPA-dev] Suggestion of new author tool: upload of .ZIP files and unzip it in the current work directory in the Construction Space area

Ricardo Luis Kulzer lon-capa-dev@mail.lon-capa.org
Thu, 11 Sep 2003 22:58:34 -0300


--------------040803000704020100060608
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

    Hello.  
    I'm a new user of LON-CAPA, and I don't know many thinks about its 
code, but I'm investigating it. now.  
    In our laboratory, we used another e-learning software called 
TELEDUC (http://teleduc.nied.unicamp.br/teleduc/), very good, but it 
doesn't bring all the advantages offered by the LON-CAPA.  
    However, an important feature that is missing in LON-CAPA, and it 
exists TELEDUC, is a tool that allows to do upload of several files 
compacted in one only .ZIP file, and allow to unzip the .ZIP file in the 
server later.   
    So, when developing a page using some HTML editor like Netscape 
Composer, we used compact the file .HTML and << many >> images files 
(.GIF, .JPG) in only one .ZIP file. Soon after, through the WEB 
interface of TELEDUC, we transfer (upload) the .ZIP file in to the 
TELEDUC server. Then, the WEB interface provides a new button that 
allows unzip that file in the server and to publish them as a new 
Content Page, with the .HTML and images files totally decompressed.
    I tried to do the same task in LON-CAPA, but it doesn't present this 
resource. So I needed to do upload of file by file, using the tool 
Construction Space, and that is a annoying task (upload file by file...).
    I know that I can use SSH file transfer or Samba, but It's difficult 
to teach all this thinks to a Geography teacher, for example, that 
usually don't know and don't like computer a lot. And another advantage 
is that we don't need to open smb and ssh ports to every author. He can 
do all this thinks through http server, in a much more secure way, using 
the simple and easy Construction Space tool of LON-CAPA.
    Then I would like to propose to the LON-CAPA development, to create 
a new tool in the Construction Space area of LON-CAPA, that allows to 
upload a .ZIP file, and automatically unzip it into the server. Or 
alternatively, a tool that allows to upload of a whole paste with many 
files at the same time (like select many files in Windows Explorer using 
Shift key), without the need of currently file by file upload tool 
available today in LON-CAPA.  
    I saw in the TELEDUC code 
<http://teleduc.nied.unicamp.br/teleduc/download.php?download=sim&usuario=2147483648> 
that the function responsible for unzip the .ZIP file in the server 
after the upload is implemented in PHP. The PHP code is more or less 
like this:  
 
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 
* * *  
   DescompactarArquivoZip function - Unzip compressed cribs.  
   Input: $zip - path and name of the zip cribs  
             $destination - destination path to unzip   
   Output: true i all ok  
* /  
function DescompactarArquivoZip ($zip,$destination)  
{  
  $command = " unzip -q -o \"". $zip ". \ " -d \"". $destination ". \"";  
  system($command,$status);  
  CreateIndexFile ($destination);  
  SetPermissions($destination);  
  return (! $status);  
}  
 
    So, I think it's not difficult to insert an equivalent function in 
LON-CAPA code, not in PHP, but in perl, the main LON-CAPA language. It 
would be enough to add a button in the Construction Space area to allow 
the upload of .ZIP files. After the upload, the system of the LON- CAPA 
will be able to automatically unzip the file in the current work 
directory of Construction Space area, or to show a new option for the 
.ZIP file that allows unzip it into the server, to be published later.  
    I await suggestions to implement this new tool. And sorry for my 
poor English.

    Thanks,
    Ricardo Luis Kulzer.
    http://www.decom.fee.unicamp.br/~ricardol/www/
 
 


--------------040803000704020100060608
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
&nbsp;&nbsp;&nbsp; Hello. &nbsp;<br>
&nbsp;&nbsp;&nbsp; I&#8217;m a new user of LON-CAPA, and I don&#8217;t know many thinks about its code,
but I&#8217;m investigating it. now. &nbsp;<br>
&nbsp;&nbsp;&nbsp; In our laboratory, we used another e-learning software called TELEDUC
(<a class="moz-txt-link-freetext" href="http://teleduc.nied.unicamp.br/teleduc/">http://teleduc.nied.unicamp.br/teleduc/</a>), very good, but it doesn't bring
all the advantages offered by the LON-CAPA. &nbsp;<br>
&nbsp;&nbsp;&nbsp; However, an important feature that is missing in LON-CAPA, and it exists
TELEDUC, is a tool that allows to do upload of several files compacted in
one only .ZIP file, and allow to unzip the .ZIP file in the server later.&nbsp;
&nbsp;<br>
&nbsp;&nbsp;&nbsp; So, when developing a page using some HTML editor like Netscape Composer,
we used compact the file .HTML and &lt;&lt; <b><big>many </big></b>&gt;&gt;
images files (.GIF, .JPG) in only one .ZIP file. Soon after, through the
WEB interface of TELEDUC, we transfer (upload) the .ZIP file in to the TELEDUC
server. Then, the WEB interface provides a new button that allows unzip that
file in the server and to publish them as a new Content Page, with the .HTML
and images files totally decompressed.<br>
&nbsp;&nbsp;&nbsp; I tried to do the same task in LON-CAPA, but it doesn't present this
resource. So I needed to do upload of file by file, using the tool Construction
Space, and that is a annoying task (upload file by file&#8230;). <br>
&nbsp;&nbsp;&nbsp; I know that I can use SSH file transfer or Samba, but It&#8217;s difficult
to teach all this thinks to a Geography teacher, for example, that usually
don&#8217;t know and don&#8217;t like computer a lot. And another advantage is that we
don&#8217;t need to open smb and ssh ports to every author. He can do all this
thinks through http server, in a much more secure way, using the simple and
easy Construction Space tool of LON-CAPA. <br>
&nbsp;&nbsp;&nbsp; Then I would like to propose to the LON-CAPA development, to create a
new tool in the Construction Space area of LON-CAPA, that allows to upload
a .ZIP file, and automatically unzip it into the server. Or alternatively,
a tool that allows to upload of a whole paste with many files at the same
time (like select many files in Windows Explorer using Shift key), without
the need of currently file by file upload tool available today in LON-CAPA.
&nbsp;<br>
&nbsp;&nbsp;&nbsp; I saw in the <a
 href="http://teleduc.nied.unicamp.br/teleduc/download.php?download=sim&amp;usuario=2147483648">TELEDUC
code</a> that the function responsible for unzip the .ZIP file in the server
after the upload is implemented in PHP. The PHP code is more or less like
this: &nbsp;<br>
&nbsp; <br>
/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * &nbsp;<br>
&nbsp;&nbsp; DescompactarArquivoZip function - Unzip compressed cribs. &nbsp;<br>
&nbsp;&nbsp; Input: $zip - path and name of the zip cribs &nbsp;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;$destination - destination path to unzip&nbsp; &nbsp;<br>
&nbsp;&nbsp; Output: true i all ok &nbsp;<br>
* / &nbsp;<br>
function DescompactarArquivoZip ($zip,$destination) &nbsp;<br>
{ &nbsp;<br>
&nbsp; $command = " unzip -q -o \"". $zip ". \ " -d \"". $destination ". \"";
&nbsp;<br>
&nbsp; system($command,$status); &nbsp;<br>
&nbsp; CreateIndexFile ($destination); &nbsp;<br>
&nbsp; SetPermissions($destination); &nbsp;<br>
&nbsp; return (! $status); &nbsp;<br>
} &nbsp;<br>
&nbsp; <br>
&nbsp;&nbsp;&nbsp; So, I think it&#8217;s not difficult to insert an equivalent function in LON-CAPA
code, not in PHP, but in perl, the main LON-CAPA language. It would be enough
to add a button in the Construction Space area to allow the upload of .ZIP
files. After the upload, the system of the LON- CAPA will be able to automatically
unzip the file in the current work directory of Construction Space area,
or to show a new option for the .ZIP file that allows unzip it into the server,
to be published later. &nbsp;<br>
&nbsp;&nbsp;&nbsp; I await suggestions to implement this new tool. And sorry for my poor
English.<br>
<br>
&nbsp;&nbsp;&nbsp; Thanks,<br>
&nbsp;&nbsp;&nbsp; Ricardo Luis Kulzer.<br>
&nbsp;&nbsp; &nbsp;<a class="moz-txt-link-freetext" href="http://www.decom.fee.unicamp.br/~ricardol/www/">http://www.decom.fee.unicamp.br/~ricardol/www/</a><br>
&nbsp; <br>
&nbsp; <br>
<br>
</body>
</html>

--------------040803000704020100060608--