Diff for /loncom/homework/lonhomework.pm between versions 1.265 and 1.266

version 1.265, 2007/03/06 19:05:58 version 1.266, 2007/04/06 21:21:34
Line 662  sub handle_save_or_undo { Line 662  sub handle_save_or_undo {
  if ((!$error) && (!copy($filebak,$file))) { $error=1; }   if ((!$error) && (!copy($filebak,$file))) { $error=1; }
  if ((!$error) && (!move($filetmp,$filebak))) { $error=1; }   if ((!$error) && (!move($filetmp,$filebak))) { $error=1; }
  if (!$error) {   if (!$error) {
     &Apache::lonxml::info("<p><b>".&mt("Undid changes, Switched")." $filebak ".&mt("and")." $file</b></p>");      &Apache::lonxml::info("<p><b>".
     &mt("Undid changes, Switched [_1] and [_2]",
         '<span class="LC_filename">'.$filebak.
         '</span>',
         '<span class="LC_filename">'.$file.
         '</span>')."</b></p>");
  } else {   } else {
     &Apache::lonxml::info("<p><font color=\"red\" size=\"+1\"><b>".&mt("Unable to undo, unable to switch")." $filebak ".&mt("and")." $file</b></font></p>");      &Apache::lonxml::info("<p><span class=\"LC_error\">".
     &mt("Unable to undo, unable to switch [_1] and [_2]",
         '<span class="LC_filename">'.
         $filebak.'</span>',
         '<span class="LC_filename">'.
         $file.'</span>')."</span></p>");
     $error=1;      $error=1;
  }   }
     } else {      } else {
Line 672  sub handle_save_or_undo { Line 682  sub handle_save_or_undo {
  my $fs=Apache::File->new(">$filebak");   my $fs=Apache::File->new(">$filebak");
  if (defined($fs)) {   if (defined($fs)) {
     print $fs $$problem;      print $fs $$problem;
     &Apache::lonxml::info("<b>".&mt("Making Backup to").      &Apache::lonxml::info("<b>".&mt("Making Backup to [_1]",
   " $filebak</b>");      '<span class="LC_filename">'.
       $filebak.'</span>').
     "</b>");
  } else {   } else {
     &Apache::lonxml::info("<font color=\"red\" size=\"+1\"><b>".&mt("Unable to make backup")." $filebak</b></font>");      &Apache::lonxml::info("<span class=\"LC_error\">".
     &mt("Unable to make backup [_1]",
         '<span class="LC_filename">'.
         $filebak.'</span>')."</span>");
     $error=2;      $error=2;
  }   }
  my $fh=Apache::File->new(">$file");   my $fh=Apache::File->new(">$file");
  if (defined($fh)) {   if (defined($fh)) {
     print $fh $$result;      print $fh $$result;
     &Apache::lonxml::info("<b>".&mt("Saving Modifications to").      &Apache::lonxml::info("<b>".&mt("Saving Modifications to [_1]",
   " $file</b>");     '<span class="LC_filename">'.
       $file.'</span>' )."</b>");
  } else {   } else {
     &Apache::lonxml::info("<font color=\"red\" size=\"+1\"><b>".      &Apache::lonxml::info('<span class="LC_error">'.
   &mt("Unable to write to")." $file</b></font>");    &mt("Unable to write to [_1]",
         '<span class="LC_filename">'.
         $file.'</span>').
     '</span>');
     $error|=4;      $error|=4;
  }   }
     }      }
Line 759  sub analyze { Line 778  sub analyze {
       $answer_part);        $answer_part);
  my $concatanswer= join("\0",@{ $answer_part });   my $concatanswer= join("\0",@{ $answer_part });
  if (($concatanswer eq '') || ($concatanswer=~/^\@/)) {   if (($concatanswer eq '') || ($concatanswer=~/^\@/)) {
     $answer_part = ['<font color="red">'.&mt('Error').'</font>'];      $answer_part = ['<span class="LC_error">'.&mt('Error').'</span>'];
  }   }
  $seedexample{join("\0",$part,$i,@{$answer_part})}=   $seedexample{join("\0",$part,$i,@{$answer_part})}=
     $thisseed;      $thisseed;
Line 999  sub newproblem { Line 1018  sub newproblem {
  my $dest = &Apache::lonnet::filelocation("",$request->uri);   my $dest = &Apache::lonnet::filelocation("",$request->uri);
  my $errormsg;   my $errormsg;
  if ($env{'form.newfile'}) {   if ($env{'form.newfile'}) {
     $errormsg='<p><font color="red">'.&mt('You did not select a template.').'</font></p>'."\n";      $errormsg='<p><span class="LC_error">'.&mt('You did not select a template.').'</span></p>'."\n";
  }   }
  my $instructions;   my $instructions;
  my $start_page =    my $start_page = 

Removed from v.1.265  
changed lines
  Added in v.1.266


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