Diff for /loncom/homework/lonhomework.pm between versions 1.298.2.1 and 1.299

version 1.298.2.1, 2009/03/20 20:36:41 version 1.299, 2008/11/19 18:34:56
Line 85  sub set_bubble_lines { Line 85  sub set_bubble_lines {
     }      }
 }  }
   
 #  =pod
 # Decides what targets to render for.  
 # Implicit inputs:  =item get_target()
 #   Various session environment variables:  
 #      request.state -  published  - is a /res/ resource  Decides what targets to render for.
 #                       uploaded   - is a /uploaded/ resource  Implicit inputs:
 #                       contruct   - is a /priv/ resource    Various session environment variables:
 #      form.grade_target - a form parameter requesting a specific target       request.state -  published  - is a /res/ resource
                         uploaded   - is a /uploaded/ resource
                         contruct   - is a /priv/ resource
        form.grade_target - a form parameter requesting a specific target
   
   =cut
   
 sub get_target {  sub get_target {
     &Apache::lonxml::debug("request.state = $env{'request.state'}");      &Apache::lonxml::debug("request.state = $env{'request.state'}");
     if( defined($env{'form.grade_target'})) {      if( defined($env{'form.grade_target'})) {
Line 173  sub setup_vars { Line 179  sub setup_vars {
 sub createmenu {  sub createmenu {
     my ($which,$request)=@_;      my ($which,$request)=@_;
     if ($which eq 'grade') {      if ($which eq 'grade') {
  $request->print('<script type="text/javascript" language="JavaScript">    $request->print('<script language="JavaScript"> 
           hwkmenu=window.open("/res/adm/pages/homeworkmenu.html","homeworkremote",            hwkmenu=window.open("/res/adm/pages/homeworkmenu.html","homeworkremote",
                  "height=350,width=150,menubar=no");                   "height=350,width=150,menubar=no");
           </script>');            </script>');
Line 331  sub check_slot_access { Line 337  sub check_slot_access {
     return ($slotstatus,$datemsg,$slot_name,$returned_slot);      return ($slotstatus,$datemsg,$slot_name,$returned_slot);
 }  }
   
 # JB, 9/24/2002: Any changes in this function may require a change  
 # in lonnavmaps::resource::getDateStatus.  =pod
   
   =item check_access()
   
   JB, 9/24/2002: Any changes in this function may require a change
   in lonnavmaps::resource::getDateStatus.
   
   =cut
   
 sub check_access {  sub check_access {
     my ($id) = @_;      my ($id) = @_;
     my $date ='';      my $date ='';
Line 480  sub check_access { Line 494  sub check_access {
   
     return ($status,$datemsg);      return ($status,$datemsg);
 }  }
 # this should work exactly like the copy in lonnavmaps.pm  
   
   =pod 
   
   =item due_date()
   
       this should work exactly like the copy in lonnavmaps.pm
   
   =cut
   
 sub due_date {  sub due_date {
     my ($part_id,$symb,$udom,$uname)=@_;      my ($part_id,$symb,$udom,$uname)=@_;
     my $date;      my $date;
Line 855  sub editxmlmode { Line 878  sub editxmlmode {
     my $result;      my $result;
     my $problem=&Apache::lonnet::getfile($file);      my $problem=&Apache::lonnet::getfile($file);
     if ($problem eq -1) {      if ($problem eq -1) {
         &Apache::lonxml::error(   &Apache::lonxml::error("<b> ".&mt('Unable to find').
             '<b> '         " <i>$file</i></b>");
            .&mt('Unable to find [_1]',  
                 '<span class="LC_filename">'.$file.'</span>')  
            .'</b>');  
  $problem='';   $problem='';
     }      }
     if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) {      if (defined($env{'form.editxmltext'}) || defined($env{'form.Undo'})) {
Line 874  sub editxmlmode { Line 894  sub editxmlmode {
  &renderpage($request,$file);   &renderpage($request,$file);
     } else {      } else {
  my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem);   my ($rows,$cols) = &Apache::edit::textarea_sizes(\$problem);
    my $xml_help = '<table><tr><td>'.
       &Apache::loncommon::helpLatexCheatsheet("Problem_Editor_XML_Index",
       "Problem Editing Help").
       '</td><td>'.
          &Apache::loncommon::help_open_menu(undef,undef,5,'Authoring').
                   '</td></tr></table>';
  if ($cols > 80) { $cols = 80; }   if ($cols > 80) { $cols = 80; }
  if ($cols < 70) { $cols = 70; }   if ($cols < 70) { $cols = 70; }
  if ($rows < 20) { $rows = 20; }   if ($rows < 20) { $rows = 20; }
Line 902  sub editxmlmode { Line 928  sub editxmlmode {
               <table class="LC_edit_problem_header_title"><tr><td>                <table class="LC_edit_problem_header_title"><tr><td>
                '.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').'                 '.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').'
                 </td><td align="right">                  </td><td align="right">
                   '.&Apache::loncommon::helpLatexCheatsheet('Problem_LON-CAPA_Functions','Script Functions').'                    '.&Apache::loncommon::helpLatexCheatsheet().'
                 </td></tr>                  </td></tr>
               </table>                </table>
               <div class="LC_edit_problem_discards">                <div class="LC_edit_problem_discards">
Line 935  sub editxmlmode { Line 961  sub editxmlmode {
     return '';      return '';
 }  }
   
 #  =pod
 #    Render the page in whatever target desired.  
 #  =item renderpage()
   
       Render the page in whatever target desired.
   
   =cut
   
 sub renderpage {  sub renderpage {
     my ($request,$file,$targets,$return_string) = @_;      my ($request,$file,$targets,$return_string) = @_;
   
Line 966  sub renderpage { Line 997  sub renderpage {
     my $filename=(split('/',$file))[-1];      my $filename=(split('/',$file))[-1];
     my $error =      my $error =
  "<b> ".&mt('Unable to find [_1]',   "<b> ".&mt('Unable to find [_1]',
                            '<span class="LC_filename">'.$filename.'</span>')     ' <span class="LC_filename">'.$filename.'</span>')
  ."</b>";   ."</b>";
     $result.=      $result.=
  &Apache::loncommon::simple_error_page($request,'Not available',   &Apache::loncommon::simple_error_page($request,'Not available',
Line 1137  sub update_construct_style { Line 1168  sub update_construct_style {
  && !defined($env{'form.newrandomization'})) {   && !defined($env{'form.newrandomization'})) {
  if ((!$env{'form.style_file'} && $env{'construct.style'})   if ((!$env{'form.style_file'} && $env{'construct.style'})
     ||$env{'form.clear_style_file'}) {      ||$env{'form.clear_style_file'}) {
     &Apache::lonnet::delenv('construct.style');      &Apache::lonnet::delenv('construct\\.style');
  } elsif ($env{'form.style_file'}    } elsif ($env{'form.style_file'} 
     && $env{'construct.style'} ne $env{'form.style_file'}) {      && $env{'construct.style'} ne $env{'form.style_file'}) {
     &Apache::lonnet::appenv({'construct.style' =>       &Apache::lonnet::appenv({'construct.style' => 

Removed from v.1.298.2.1  
changed lines
  Added in v.1.299


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