Diff for /loncom/publisher/testbankimport.pm between versions 1.18 and 1.21

version 1.18, 2008/09/24 19:48:29 version 1.21, 2009/04/04 21:45:57
Line 85  function createWin() { Line 85  function createWin() {
     newWindow.document.write("<h3>$lt{'loca'}: <tt>$webpath</tt></h3><h3>$lt{'newd'}</h3>\\n")      newWindow.document.write("<h3>$lt{'loca'}: <tt>$webpath</tt></h3><h3>$lt{'newd'}</h3>\\n")
     newWindow.document.write("<form name='fileaction' action='/adm/cfile' method='post'>\\n")      newWindow.document.write("<form name='fileaction' action='/adm/cfile' method='post'>\\n")
     newWindow.document.write("$lt{'ente'}.<br /><br />")      newWindow.document.write("$lt{'ente'}.<br /><br />")
     newWindow.document.write("<input type='hidden' name='filename' value='$webpath'>")      newWindow.document.write("<input type='hidden' name='filename' value='$webpath' />")
     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' />")
     newWindow.document.write("$webpath<input type='text' name='newfilename' value=''/>")      newWindow.document.write("$webpath<input type='text' name='newfilename' value='' />")
     newWindow.document.write("<input type='button' value='$lt{'go'}' onClick='document.fileaction.submit();' /></form>")      newWindow.document.write("<input type='button' value='$lt{'go'}' onClick='document.fileaction.submit();' /></form>")
     newWindow.document.write('$end_page')      newWindow.document.write('$end_page')
     newWindow.document.close()      newWindow.document.close()
Line 510  sub display_zero { Line 510  sub display_zero {
         </ol><form name="info" method="post" action="/adm/testbank">'.          </ol><form name="info" method="post" action="/adm/testbank">'.
         &topic_bar(1,&mt('Optional: create a sub-directory in which the testbank questions will be saved')).          &topic_bar(1,&mt('Optional: create a sub-directory in which the testbank questions will be saved')).
         &mt('By default, LON-CAPA problems generated from the testbank file will be stored in the current directory.').' '.&mt('To store them in a new sub-directory:').           &mt('By default, LON-CAPA problems generated from the testbank file will be stored in the current directory.').' '.&mt('To store them in a new sub-directory:'). 
        ' <input type="button" name="createdir" value="'.&mt('Create sub-directory').'" onClick="javascript:createWin()">'.         ' <input type="button" name="createdir" value="'.&mt('Create sub-directory').'" onClick="javascript:createWin()" />'.
        &page_footer($env{'form.newdir'},$uname,$fn,$page,$webpath).'         &page_footer($env{'form.newdir'},$uname,$fn,$page,$webpath).'
        </form>');         </form>');
 }  }
Line 625  sub display_two { Line 625  sub display_two {
         $r->print(&Apache::loncommon::start_data_table_row().          $r->print(&Apache::loncommon::start_data_table_row().
                  '<td valign="top">&nbsp;'.$iter.'&nbsp;</td>'."\n".                   '<td valign="top">&nbsp;'.$iter.'&nbsp;</td>'."\n".
                  '<td valign="top">&nbsp;<input type="text" name="start_'.$i.'" value="'.$bl1st.'" size="5" />&nbsp;</td>'."\n".                   '<td valign="top">&nbsp;<input type="text" name="start_'.$i.'" value="'.$bl1st.'" size="5" />&nbsp;</td>'."\n".
                  '<td valign="top">&nbsp;<input type="text" name="end_'.$i.'" value="'.$bl1end.'" size="5">&nbsp;</td>'."\n".                   '<td valign="top">&nbsp;<input type="text" name="end_'.$i.'" value="'.$bl1end.'" size="5" />&nbsp;</td>'."\n".
                  '<td valign="top">                   '<td valign="top">
    <select name="qtype_'.$i.'" onChange="colSet('.$i.')">     <select name="qtype_'.$i.'" onChange="colSet('.$i.')">
     <option value= "-1" selected>'.&mt('Select').'</option>'."\n");      <option value= "-1" selected>'.&mt('Select').'</option>'."\n");
Line 1200  sub page_footer { Line 1200  sub page_footer {
             $output .= '              $output .= '
          <td>&nbsp;</td>           <td>&nbsp;</td>
          <td>           <td>
           <input type="button" name="nextpage" value="'.$nextval.'" onclick="'.$nextclick.'">            <input type="button" name="nextpage" value="'.$nextval.'" onclick="'.$nextclick.'" />
          </td>';           </td>';
         }          }
         $output .= '    </tr>          $output .= '    </tr>
Line 1773  sub print_header { Line 1773  sub print_header {
     my $output = &Apache::loncommon::start_page($title,$javascript,      my $output = &Apache::loncommon::start_page($title,$javascript,
                                              {'add_entries' => $loadentries});                                               {'add_entries' => $loadentries});
     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {      if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
         $output .= '<h3><span class="LC_error">'.&mt('Co-Author').': '.$uname.          $output .= '<p class="LC_warning">'
                    &mt(' at ').$udom.'</span></h3>';                   .&mt('Co-Author [_1]:[_2]',$uname,$udom)
                    .'</p>';
     }      }
     return $output;      return $output;
 }  }
Line 1817  sub handler { Line 1818  sub handler {
     my ($fn,$filename);      my ($fn,$filename);
     if ($env{'form.filename'}) {      if ($env{'form.filename'}) {
         $fn=$env{'form.filename'};          $fn=$env{'form.filename'};
         $fn=~s/^http\:\/\/[^\/]+\///;          $fn=~s/^https?\:\/\/[^\/]+\///;
         $fn=~s/^\///;          $fn=~s/^\///;
         $fn=~s{(~|priv/)($LONCAPA::username_re)}{};          $fn=~s{(~|priv/)($LONCAPA::username_re)}{};
         $fn=~s/\/+/\//g;          $fn=~s/\/+/\//g;

Removed from v.1.18  
changed lines
  Added in v.1.21


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