Diff for /loncom/publisher/testbankimport.pm between versions 1.10 and 1.12

version 1.10, 2006/04/10 22:30:31 version 1.12, 2007/05/02 01:34:23
Line 35  use HTML::Entities(); Line 35  use HTML::Entities();
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonupload;  use Apache::lonupload;
 use File::Basename();  use File::Basename();
   use LONCAPA();
   
 # ---------------------------------------------------------------- Display Control  # ---------------------------------------------------------------- Display Control
 sub display_control {  sub display_control {
Line 392  function createWin() { Line 393  function createWin() {
     newWindow.document.write("<td><h3>Location: <tt>$fullpath</tt></h3><h3>New Directory</h3></td></tr>\\n")      newWindow.document.write("<td><h3>Location: <tt>$fullpath</tt></h3><h3>New Directory</h3></td></tr>\\n")
     newWindow.document.write("<tr><td width='2'>&nbsp;</td><td width='3'>&nbsp;</td>\\n")      newWindow.document.write("<tr><td width='2'>&nbsp;</td><td width='3'>&nbsp;</td>\\n")
     newWindow.document.write("<td><form name='fileaction' action='/adm/cfile' method='post'>\\n")      newWindow.document.write("<td><form name='fileaction' action='/adm/cfile' method='post'>\\n")
     newWindow.document.write("<font face='arial,helvetica,sans-serif'>Enter the name of the new directory where you will store the converted testbank questions<br /><br />")      newWindow.document.write("<font face='arial,helvetica,sans-serif'>Enter the name of the new directory where you will save the converted testbank questions<br /><br />")
     newWindow.document.write("<input type='hidden' name='filename' value='$fullpath'>")         newWindow.document.write("<input type='hidden' name='filename' value='$fullpath'>")   
     newWindow.document.write("<input type='hidden' name='action' value='newdir'>")      newWindow.document.write("<input type='hidden' name='action' value='newdir'>")
     newWindow.document.write("<input type='hidden' name='callingmode' value='testbank'>")      newWindow.document.write("<input type='hidden' name='callingmode' value='testbank'>")
Line 469  Five steps are involved in the import pr Line 470  Five steps are involved in the import pr
     $r->print(qq|</li>      $r->print(qq|</li>
          <li>Provide information about the question format - i.e.,  question numbering style, and the number of blocks of questions of each question type.</li>           <li>Provide information about the question format - i.e.,  question numbering style, and the number of blocks of questions of each question type.</li>
          <li>Provide information about the questions in each block, including question type, start and end question numbers for each block, and foil labelling style and answer format where required.</li>           <li>Provide information about the questions in each block, including question type, start and end question numbers for each block, and foil labelling style and answer format where required.</li>
          <li>Create a new directory where you will store the converted testbank questions.</li>            <li>Create a new directory where you will save the converted testbank questions.</li> 
          <li>Complete the import of questions to the selected pool.</li>           <li>Complete the import of questions to the selected pool.</li>
         </ol>          </ol>
         </font>          </font>
Line 1029  END_OF_ONE Line 1030  END_OF_ONE
        <td width='30' align='top'><img src='/res/adm/pages/bl_step4.gif'>         <td width='30' align='top'><img src='/res/adm/pages/bl_step4.gif'>
        </td>         </td>
        <td width='100%' align='left'>&nbsp;&nbsp;         <td width='100%' align='left'>&nbsp;&nbsp;
         <font size='+1' face='arial,helvetica,sans-serif'><b>Create a directory to store your testbank questions.</b></font>          <font size='+1' face='arial,helvetica,sans-serif'><b>Create a directory to save your testbank questions.</b></font>
        </td>         </td>
       </tr>        </tr>
       <tr>        <tr>
Line 1039  END_OF_ONE Line 1040  END_OF_ONE
        <td>&nbsp;</td>         <td>&nbsp;</td>
        <td>         <td>
         <font face='Arial,Helvetica,sans-serif'>          <font face='Arial,Helvetica,sans-serif'>
 Please choose a destination LON-CAPA directory in which to store your uploaded questions.&nbsp;&nbsp;  Please choose a destination LON-CAPA directory in which to save your uploaded questions.&nbsp;&nbsp;
        <input type="button" name="createdir" value="Create Directory" onClick="javascript:createWin()"><input type="hidden" name="newdir" value=""></font></td>         <input type="button" name="createdir" value="Create Directory" onClick="javascript:createWin()"><input type="hidden" name="newdir" value=""></font></td>
       </tr>        </tr>
       <tr>        <tr>
Line 1736  sub handler { Line 1737  sub handler {
         $fn=$env{'form.filename'};          $fn=$env{'form.filename'};
         $fn=~s/^http\:\/\/[^\/]+\///;          $fn=~s/^http\:\/\/[^\/]+\///;
         $fn=~s/^\///;          $fn=~s/^\///;
         $fn=~s/(\~|priv\/)(\w+)//;          $fn=~s{(~|priv/)($LONCAPA::username_re)}{};
         $fn=~s/\/+/\//g;          $fn=~s/\/+/\//g;
     } else {      } else {
         $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.          $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.

Removed from v.1.10  
changed lines
  Added in v.1.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>