Diff for /loncom/publisher/lonupload.pm between versions 1.29 and 1.32

version 1.29, 2005/04/07 06:56:27 version 1.32, 2006/04/10 22:30:31
Line 37  use File::Basename; Line 37  use File::Basename;
 use Apache::Constants qw(:common :http :methods);  use Apache::Constants qw(:common :http :methods);
 use Apache::loncacc;  use Apache::loncacc;
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::Log();  
 use Apache::lonnet;  use Apache::lonnet;
 use HTML::Entities();  use HTML::Entities();
 use Apache::lonlocal;  use Apache::lonlocal;
Line 46  use Apache::lonnet; Line 45  use Apache::lonnet;
 my $DEBUG=0;  my $DEBUG=0;
   
 sub Debug {  sub Debug {
         # Put out the indicated message but only if DEBUG is true.
     # Marshall the parameters.  
     
     my $r       = shift;  
     my $log     = $r->log;  
     my $message = shift;  
     
     # Put out the indicated message butonly if DEBUG is false.  
     
     if ($DEBUG) {      if ($DEBUG) {
  $log->debug($message);   my ($r,$message) = @_;
    $r->log_reason($message);
     }      }
 }  }
   
Line 257  sub handler { Line 249  sub handler {
     }      }
   
     unless ($env{'form.phase'} eq 'two') {      unless ($env{'form.phase'} eq 'two') {
    my %body_layout = ('rightmargin'  => "0",
      'leftmargin'   => "0",
      'marginwidth'  => "0",
      'topmargin'    => "0",
      'marginheight' => "0");
    my $start_page = 
       &Apache::loncommon::start_page('Importing a Testbank file into LON-CAPA',
      undef,
      {'only_body'   => 1,
       'add_entries' => \%body_layout,
       'js_ready'    => 1,});
    my $end_page = 
       &Apache::loncommon::end_page({'js_ready' => 1,});
   
         $javascript = qq|          $javascript = qq|
 function verifyForm() {  function verifyForm() {
     var mode = document.fileupload.filetype.options[document.fileupload.filetype.selectedIndex].value      var mode = document.fileupload.filetype.options[document.fileupload.filetype.selectedIndex].value
Line 275  function verifyForm() { Line 281  function verifyForm() {
 function testbankWin() {  function testbankWin() {
   newWindow = window.open("","testbankinfo","HEIGHT=400,WIDTH=750,scrollbars=yes")    newWindow = window.open("","testbankinfo","HEIGHT=400,WIDTH=750,scrollbars=yes")
   newWindow.document.open()    newWindow.document.open()
   newWindow.document.write("<html><head><title>'Importing a Testbank file into LON-CAPA</title><meta http-equiv='pragma' content='no-cache'>\\n")    newWindow.document.write('$start_page')
   newWindow.document.write("</head><body bgcolor='#CCFFDD' topmargin='0' leftmargin='0' marginheight='0'marginwidth='0' rightmargin='0'>\\n")  
   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("<table border='0' cellspacing='0' cellpadding='0' width='95%' bgcolor='#CCFFDD'>\\n")    newWindow.document.write("<table border='0' cellspacing='0' cellpadding='0' width='95%' bgcolor='#CCFFDD'>\\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")
Line 288  function testbankWin() { Line 293  function testbankWin() {
     newWindow.document.write("<li><i>Multiple choice</i> and <i>multiple answer correct</i> questions should consist of (i) the question number followed by (ii) a question stem beginning on the same line and (iii) two or more foils, with each foil beginning on a new line and prefixed by a unique letter, or Roman numeral, listed in alphabetic or numeric order, beginning at a (alphabetic) or i (Roman numeral), followed by a period, or enclosed in parentheses, i.e., a., (a), i., or (i) .</li>")      newWindow.document.write("<li><i>Multiple choice</i> and <i>multiple answer correct</i> questions should consist of (i) the question number followed by (ii) a question stem beginning on the same line and (iii) two or more foils, with each foil beginning on a new line and prefixed by a unique letter, or Roman numeral, listed in alphabetic or numeric order, beginning at a (alphabetic) or i (Roman numeral), followed by a period, or enclosed in parentheses, i.e., a., (a), i., or (i) .</li>")
      newWindow.document.write("<li>If <i>fill-in-the-blank</i> or <i>multiple answer</i> questions have more than one correct answer, each answer should appear in a comma-, tab-, space-, or new line-delimited list. </li></ol>")       newWindow.document.write("<li>If <i>fill-in-the-blank</i> or <i>multiple answer</i> questions have more than one correct answer, each answer should appear in a comma-, tab-, space-, or new line-delimited list. </li></ol>")
   newWindow.document.write("</td></tr>\\n")    newWindow.document.write("</td></tr>\\n")
   newWindow.document.write("</table></body></html>")    newWindow.document.write("</table>")
     newWindow.document.write('$end_page')
   newWindow.document.close()    newWindow.document.close()
   newWindow.focus()    newWindow.focus()
 }  }
Line 324  function testbankWin() { Line 330  function testbankWin() {
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
   
     $r->print("<html><head><title>LON-CAPA Construction Space</title><script type=\"text/javascript\">\n//<!--\n$javascript\n// --></script>\n</head>");     $javascript = "<script type=\"text/javascript\">\n//<!--\n".
    $javascript."\n// --></script>\n";
   
     $r->print(&Apache::loncommon::bodytag('Upload file to Construction Space'));      $r->print(&Apache::loncommon::start_page('Upload file to Construction Space',
        $javascript));
       
     if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {      if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) {
  $r->print('<h3><font color=red>'.&mt('Co-Author').': '.$uname.   $r->print('<h3><font color=red>'.&mt('Co-Author').': '.$uname.
Line 339  function testbankWin() { Line 347  function testbankWin() {
  &phaseone($r,$fn,$uname,$udom);   &phaseone($r,$fn,$uname,$udom);
     }      }
   
     $r->print('</body></html>');      $r->print(&Apache::loncommon::end_page());
     return OK;        return OK;  
 }  }
   

Removed from v.1.29  
changed lines
  Added in v.1.32


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