Diff for /loncom/publisher/testbankimport.pm between versions 1.20 and 1.24

version 1.20, 2009/03/26 16:50:12 version 1.24, 2009/05/14 14:24:18
Line 81  function createWin() { Line 81  function createWin() {
     newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes")      newWindow = window.open("","CreateDir","HEIGHT=400,WIDTH=750,scrollbars=yes")
     newWindow.document.open()      newWindow.document.open()
     newWindow.document.write('$start_page')      newWindow.document.write('$start_page')
     newWindow.document.write("<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]'>\\n")      newWindow.document.write("<img border='0' src='/adm/lonInterFace/author.jpg' alt='[Author Header]' />\\n")
     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 522  sub display_one { Line 522  sub display_one {
     my %topics;      my %topics;
     $topics{2} = &mt('Select the format of the question number - e.g., 1,  1., 1), (1 or (1) - ').'&nbsp;      $topics{2} = &mt('Select the format of the question number - e.g., 1,  1., 1), (1 or (1) - ').'&nbsp;
                <select name="qnumformat">                 <select name="qnumformat">
                   <option value = "-1" selected>'.&mt('Select').'</option>                    <option value="-1" selected="selected">'.&mt('Select').'</option>
                   <option value="number">1</option>                    <option value="number">1</option>
                   <option value="period">1.</option>                    <option value="period">1.</option>
                   <option value="paren">(1)</option>                    <option value="paren">(1)</option>
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="selected">'.&mt('Select').'</option>'."\n");
         foreach my $qtype (@types) {          foreach my $qtype (@types) {
             $r->print('<option value="'.$qtype.'">'.$typenames{$qtype}.'</option>'."\n");              $r->print('<option value="'.$qtype.'">'.$typenames{$qtype}.'</option>'."\n");
         }          }
Line 768  sub display_three { Line 768  sub display_three {
                                 }                                  }
                                 $r->print(&Apache::loncommon::start_data_table_row().                                  $r->print(&Apache::loncommon::start_data_table_row().
                                           '<td valign="top">'.$qnum.'.</td>'."\n".                                            '<td valign="top">'.$qnum.'.</td>'."\n".
                                           '<td valign="top"><input name="createprob" type="checkbox" "checked="checked" value="'.$j.'" /></td>'."\n".                                            '<td valign="top"><input name="createprob" type="checkbox" checked="checked" value="'.$j.'" /></td>'."\n".
                                           '<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n".                                            '<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n".
                                           '<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'.                                            '<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'.
                                           '<td valign="top">'.$showqn.'<br /><br />'."\n");                                            '<td valign="top">'.$showqn.'<br /><br />'."\n");
Line 829  sub display_three { Line 829  sub display_three {
                         }                          }
                         $r->print(&Apache::loncommon::start_data_table_row().                          $r->print(&Apache::loncommon::start_data_table_row().
                                   '<td valign="top">'.$qnum.'</td>'."\n".                                    '<td valign="top">'.$qnum.'</td>'."\n".
                                   '<td valign="top"><input name="createprob" type="checkbox" "checked="checked" value="'.$j.'" /></td>'."\n".                                    '<td valign="top"><input name="createprob" type="checkbox" checked="checked" value="'.$j.'" /></td>'."\n".
                                   '<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n".                                    '<td valign="top"><b>'.$qtype[$i].'</b></td>'."\n".
                                   '<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'."\n".                                    '<td valign="top"><input type="textbox" name="probfile_'.$j.'" value="'.$libfile.'" size="20" /></td>'."\n".
                                   '<td valign="top">'.$items->[$j].'</td>'."\n".                                    '<td valign="top">'.$items->[$j].'</td>'."\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 1774  sub print_header { Line 1774  sub print_header {
                                              {'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 .= '<p class="LC_warning">'          $output .= '<p class="LC_warning">'
                  .&mt('Co-Author [_1]:[_2]',$uname,$udom)                   .&mt('Co-Author [_1]',$uname.':'.$udom)
                  .'</p>';                   .'</p>';
     }      }
     return $output;      return $output;

Removed from v.1.20  
changed lines
  Added in v.1.24


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