Diff for /loncom/homework/grades.pm between versions 1.119 and 1.120

version 1.119, 2003/07/18 20:14:35 version 1.120, 2003/07/19 15:11:27
Line 707  sub sub_page_js { Line 707  sub sub_page_js {
     }      }
   
     function checkSolved(formname,id) {      function checkSolved(formname,id) {
  if (eval("formname.solved"+id+".value") == "correct_by_student") {   if (eval("formname.solved"+id+".value") == "correct_by_student" && formname.overRideScore.value == 'no') {
     var reply = confirm("This problem has been graded correct by the computer. Do you want to change the score?");      var reply = confirm("This problem has been graded correct by the computer. Do you want to change the score?");
     if (!reply) {return "noupdate";}      if (!reply) {return "noupdate";}
       formname.overRideScore.value = 'yes';
  }   }
  return "update";   return "update";
     }      }
Line 747  sub sub_page_js { Line 748  sub sub_page_js {
  formname.submit();   formname.submit();
     }      }
   
   //======= Process request to show the grading page from SUBM, CHART buttons
       function gradeStudent(formname,ptr) {
    formname.gradeOpt.value = 'Grade Student';
    formname.showgrading.value = "yes";
    formname.studentNo.value = ptr;
    formname.submit();
       }
   
 //======= Check that a score is assigned for all the problems (page/sequence grading only) =========  //======= Check that a score is assigned for all the problems (page/sequence grading only) =========
     function checkSubmitPage(formname,total) {      function checkSubmitPage(formname,total) {
  noscore = new Array(100);   noscore = new Array(100);
Line 1160  sub submission { Line 1169  sub submission {
   
     (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;      (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
     my ($uname,$udom)     = ($ENV{'form.student'},$ENV{'form.userdom'});      my ($uname,$udom)     = ($ENV{'form.student'},$ENV{'form.userdom'});
       $udom = ($udom eq '' ? $ENV{'user.domain'} : $udom); #has form.userdom changed for a student?
     my $usec = &Apache::lonnet::getsection($udom,$uname,$ENV{'request.course.id'});      my $usec = &Apache::lonnet::getsection($udom,$uname,$ENV{'request.course.id'});
     $ENV{'form.fullname'} = &get_fullname ($uname,$udom) if $ENV{'form.fullname'} eq '';      $ENV{'form.fullname'} = &get_fullname ($uname,$udom) if $ENV{'form.fullname'} eq '';
   
Line 1173  sub submission { Line 1183  sub submission {
  return;   return;
     }      }
   
       $ENV{'form.lastSub'} = ($ENV{'form.lastSub'} eq '' ? 'all' : $ENV{'form.lastSub'});
     my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');      my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
   
     # header info      # header info
Line 1217  sub submission { Line 1228  sub submission {
     $ENV{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0';      $ENV{'form.savemsgN'} = $keyhash{$symb.'_savemsgN'} ne '' ? $keyhash{$symb.'_savemsgN'} : '0';
   
  }   }
    my $overRideScore = $ENV{'form.overRideScore'} eq '' ? 'no' : $ENV{'form.overRideScore'};
   
  $request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n".   $request->print('<form action="/adm/grades" method="post" name="SCORE">'."\n".
  '<input type="hidden" name="command"    value="handgrade" />'."\n".   '<input type="hidden" name="command"    value="handgrade" />'."\n".
  '<input type="hidden" name="saveState"  value="'.$ENV{'form.saveState'}.'" />'."\n".   '<input type="hidden" name="saveState"  value="'.$ENV{'form.saveState'}.'" />'."\n".
  '<input type="hidden" name="Status"     value="'.$ENV{'form.Status'}.'" />'."\n".   '<input type="hidden" name="Status"     value="'.$ENV{'form.Status'}.'" />'."\n".
    '<input type="hidden" name="overRideScore" value="'.$overRideScore.'" />'."\n".
  '<input type="hidden" name="probTitle"  value="'.$ENV{'form.probTitle'}.'" />'."\n".   '<input type="hidden" name="probTitle"  value="'.$ENV{'form.probTitle'}.'" />'."\n".
  '<input type="hidden" name="refresh"    value="off" />'."\n".   '<input type="hidden" name="refresh"    value="off" />'."\n".
    '<input type="hidden" name="studentNo"  value="" />'."\n".
    '<input type="hidden" name="gradeOpt"   value="" />'."\n".
  '<input type="hidden" name="symb"       value="'.$symb.'" />'."\n".   '<input type="hidden" name="symb"       value="'.$symb.'" />'."\n".
  '<input type="hidden" name="url"        value="'.$url.'" />'."\n".   '<input type="hidden" name="url"        value="'.$url.'" />'."\n".
  '<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" />'."\n".   '<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" />'."\n".
Line 1279  KEYWORDS Line 1294  KEYWORDS
  $request->print('<br /><br /><br />') if ($counter > 0);   $request->print('<br /><br /><br />') if ($counter > 0);
  $request->print(&show_problem($request,$symb,$uname,$udom,1,1));   $request->print(&show_problem($request,$symb,$uname,$udom,1,1));
     }      }
   
     my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname);      my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname);
     my ($partlist,$handgrade) = &response_type($url);      my ($partlist,$handgrade) = &response_type($url);
   
Line 1426  KEYWORDS Line 1440  KEYWORDS
  $last,'.submission',   $last,'.submission',
  'Apache::grades::keywords_highlight'));   'Apache::grades::keywords_highlight'));
     }      }
   
       $result='<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n".
    '<input type="hidden" name="includemsg'.$counter.'" value="" />'."\n".
    '<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':'
    .$udom.'" />'."\n";
       $request->print($result);
           
     # return if view submission with no grading option      # return if view submission with no grading option
     if ($ENV{'form.showgrading'} eq '' || (!&canmodify($usec))) {      if ($ENV{'form.showgrading'} eq '' || (!&canmodify($usec))) {
  $request->print('</td></tr></table></td></tr></table></form>'."\n");   my $toGrade.='<input type="button" value="Grade Student" '.
  $request->print(&show_grading_menu_form($symb,$url))       'onClick="javascript:gradeStudent(this.form,\''.$counter.'\');" TARGET=_self> &nbsp;'."\n";
    $toGrade.='</td></tr></table></td></tr></table></form>'."\n";
    $toGrade.=&show_grading_menu_form($symb,$url) 
     if (($ENV{'form.command'} eq 'submission') ||       if (($ENV{'form.command'} eq 'submission') || 
  ($ENV{'form.command'} eq 'processGroup' && $counter == $total));   ($ENV{'form.command'} eq 'processGroup' && $counter == $total));
    $request = print($toGrade);
  return;   return;
     }      }
   
     $result='<input type="hidden" name="newmsg'.$counter.'" value="" />'."\n".  
  '<input type="hidden" name="includemsg'.$counter.'" value="" />'."\n".  
  '<input type="hidden" name="unamedom'.$counter.'" value="'.$uname.':'  
  .$udom.'" />'."\n";  
     # essay grading options      # essay grading options
     if ($ENV{'form.handgrade'} eq 'yes') {      if ($ENV{'form.handgrade'} eq 'yes') {
  my ($lastname,$givenn) = split(/,/,$ENV{'form.fullname'});   my ($lastname,$givenn) = split(/,/,$ENV{'form.fullname'});
Line 1450  KEYWORDS Line 1469  KEYWORDS
  }   }
  $msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript   $msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript
 # $result.='<tr><td bgcolor="#ffffff">'."\n".  # $result.='<tr><td bgcolor="#ffffff">'."\n".
  $result.='&nbsp;<a href="javascript:msgCenter(document.SCORE,'.$counter.   $result='&nbsp;<a href="javascript:msgCenter(document.SCORE,'.$counter.
     ',\''.$msgfor.'\')"; TARGET=_self>'.      ',\''.$msgfor.'\')"; TARGET=_self>'.
     'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'</a> &nbsp;'.      'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'</a> &nbsp;'.
     '<img src="'.$request->dir_config('lonIconsURL').      '<img src="'.$request->dir_config('lonIconsURL').
Line 1483  KEYWORDS Line 1502  KEYWORDS
   
     # print end of form      # print end of form
     if ($counter == $total) {      if ($counter == $total) {
  my $endform='<table border="0"><tr><td>'.   my $endform='<table border="0"><tr><td>'."\n";
     '<input type="hidden" name="gradeOpt" value="" />'."\n";  #    '<input type="hidden" name="gradeOpt" value="" />'."\n";
  $endform.='<input type="button" value="Save & Next" '.   $endform.='<input type="button" value="Save & Next" '.
     'onClick="javascript:checksubmit(this.form,\'Save & Next\','.      'onClick="javascript:checksubmit(this.form,\'Save & Next\','.
     $total.','.scalar(@partlist).');" TARGET=_self> &nbsp;'."\n";      $total.','.scalar(@partlist).');" TARGET=_self> &nbsp;'."\n";
Line 1554  sub processHandGrade { Line 1573  sub processHandGrade {
     my $button = $ENV{'form.gradeOpt'};      my $button = $ENV{'form.gradeOpt'};
     my $ngrade = $ENV{'form.NCT'};      my $ngrade = $ENV{'form.NCT'};
     my $ntstu  = $ENV{'form.NTSTU'};      my $ntstu  = $ENV{'form.NTSTU'};
   
     if ($button eq 'Save & Next') {      if ($button eq 'Save & Next') {
  my $ctr = 0;   my $ctr = 0;
  while ($ctr < $ngrade) {   while ($ctr < $ngrade) {
Line 1668  sub processHandGrade { Line 1686  sub processHandGrade {
  return '';   return '';
     }      }
   
   # Go directly to grade student - from submission page
       if ($button eq 'Grade Student') {
    my $processUser = $ENV{'form.unamedom'.$ENV{'form.studentNo'}};
    ($ENV{'form.student'},$ENV{'form.userdom'}) = split(/:/,$processUser);
    $ENV{'form.fullname'} = $$fullname{$processUser};
    &submission($request,0,0);
    return '';
       }
   
     # Get the next/previous one or group of students      # Get the next/previous one or group of students
     my $firststu = $ENV{'form.unamedom0'};      my $firststu = $ENV{'form.unamedom0'};
     my $laststu = $ENV{'form.unamedom'.($ngrade-1)};      my $laststu = $ENV{'form.unamedom'.($ngrade-1)};
Line 2779  sub displayPage { Line 2806  sub displayPage {
         if($curRes == $iterator->BEGIN_MAP) { $depth++; }          if($curRes == $iterator->BEGIN_MAP) { $depth++; }
         if($curRes == $iterator->END_MAP) { $depth--; }          if($curRes == $iterator->END_MAP) { $depth--; }
   
         if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {  #        if (ref($curRes) && $curRes->is_problem() && !$curRes->randomout) {
           if (ref($curRes) && $curRes->is_problem()) {
     my $parts = $curRes->parts();      my $parts = $curRes->parts();
             my $title = $curRes->compTitle();              my $title = $curRes->compTitle();
     my $symbx = $curRes->symb();      my $symbx = $curRes->symb();

Removed from v.1.119  
changed lines
  Added in v.1.120


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