Diff for /loncom/homework/grades.pm between versions 1.49 and 1.53

version 1.49, 2002/09/20 23:35:30 version 1.53, 2002/10/02 21:24:35
Line 265  sub verifyreceipt { Line 265  sub verifyreceipt {
     my ($string,$contents,$matches) = ('','',0);      my ($string,$contents,$matches) = ('','',0);
     my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist('all','0');      my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist('all','0');
           
     foreach (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) {      foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
  my ($uname,$udom)=split(/\:/);   my ($uname,$udom)=split(/\:/);
  if ($receipt eq    if ($receipt eq 
     &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb)) {      &Apache::lonnet::ireceipt($uname,$udom,$courseid,$symb)) {
Line 292  sub verifyreceipt { Line 292  sub verifyreceipt {
     $contents.      $contents.
     '</table></td></tr></table>'."\n";      '</table></td></tr></table>'."\n";
     }      }
     return $string.&show_grading_menu_form ($symb,$url);      return $string.&show_grading_menu_form($symb,$url);
 }  }
   
 #--- This is called by a number of programs.  #--- This is called by a number of programs.
Line 401  LISTJAVASCRIPT Line 401  LISTJAVASCRIPT
     $gradeTable.='</tr>'."\n";      $gradeTable.='</tr>'."\n";
   
     my $ctr = 0;      my $ctr = 0;
     foreach my $student (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) {      foreach my $student (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
  my ($uname,$udom) = split(/:/,$student);   my ($uname,$udom) = split(/:/,$student);
  my (%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);   my (%status) =&student_gradeStatus($url,$symb,$udom,$uname,$partlist);
  my $statusflg = '';   my $statusflg = '';
Line 436  LISTJAVASCRIPT Line 436  LISTJAVASCRIPT
     $gradeTable.='</table></td></tr></table>'.      $gradeTable.='</table></td></tr></table>'.
  '<input type="button" '.   '<input type="button" '.
  'onClick="javascript:checkSelect(this.form.stuinfo);" '.   'onClick="javascript:checkSelect(this.form.stuinfo);" '.
  'value="'.$viewgrade.'" /><form />'."\n";   'value="'.$viewgrade.'" /></form>'."\n";
     if ($ctr == 0) {      if ($ctr == 0) {
  $gradeTable='<br />&nbsp;<font color="red">'.   $gradeTable='<br />&nbsp;<font color="red">'.
     'No submission found for this resource.</font><br />';      'No submission found for this resource.</font><br />';
  $gradeTable.=&show_grading_menu_form($symb,$url);  
     } elsif ($ctr == 1) {      } elsif ($ctr == 1) {
  $gradeTable =~ s/type=checkbox/type=checkbox checked/;   $gradeTable =~ s/type=checkbox/type=checkbox checked/;
     }      }
       $gradeTable.=&show_grading_menu_form($symb,$url);
     $request->print($gradeTable);      $request->print($gradeTable);
     return '';      return '';
 }  }
Line 1145  KEYWORDS Line 1145  KEYWORDS
  $endform.='(Next and Previous do not save the scores.)'."\n"    $endform.='(Next and Previous do not save the scores.)'."\n" 
     if ($ENV{'form.handgrade'} eq 'yes');      if ($ENV{'form.handgrade'} eq 'yes');
  $endform.='</td><tr></table></form>';   $endform.='</td><tr></table></form>';
    $endform.=&show_grading_menu_form($symb,$url);
  $request->print($endform);   $request->print($endform);
     }      }
     return '';      return '';
Line 1299  sub processHandGrade { Line 1300  sub processHandGrade {
     my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($ENV{'form.section'},'0');      my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($ENV{'form.section'},'0');
     my (@parsedlist,@nextlist);      my (@parsedlist,@nextlist);
     my ($nextflg) = 0;      my ($nextflg) = 0;
     foreach (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) {      foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
  if ($nextflg == 1 && $button =~ /Next$/) {   if ($nextflg == 1 && $button =~ /Next$/) {
     push @parsedlist,$_;      push @parsedlist,$_;
  }   }
Line 1583  sub viewgrades { Line 1584  sub viewgrades {
  '<input type="hidden" name="url"     value="'.$url.'" />'."\n".   '<input type="hidden" name="url"     value="'.$url.'" />'."\n".
  '<input type="hidden" name="command" value="editgrades" />'."\n".   '<input type="hidden" name="command" value="editgrades" />'."\n".
  '<input type="hidden" name="section" value="'.$ENV{'form.section'}.'" />'."\n";   '<input type="hidden" name="section" value="'.$ENV{'form.section'}.'" />'."\n";
     $result.='To assign the same score for all the students use the radio buttons or '.      $result.='<h3>Assign Common Grade To ';
  'text box below. To assign scores individually fill in the score boxes for '.      if ($ENV{'form.section'} eq 'all') {
  'each student in the table below. <font color="red">A part that has already '.   $result.='Class </h3>';
  'been graded does not get changed using the radio buttons or text box. '.      } elsif ($ENV{'form.section'} eq 'no') {
  'If needed, it has to be changed individually.</font>';   $result.='Students in no Section </h3>';
       } else {
    $result.='Students in Section '.$ENV{'form.section'}.'</h3>';
       }
       $result.= '<table border=0><tr><td bgcolor="#777777">'."\n".
    '<table border=0><tr bgcolor="#ffffdd"><td>';
   #    $result.='To assign the same score for all the students use the radio buttons or '.
   # 'text box below. To assign scores individually fill in the score boxes for '.
   # 'each student in the table below. <font color="red">A part that has already '.
   # 'been graded does not get changed using the radio buttons or text box. '.
   # 'If needed, it has to be changed individually.</font>';
   #    $result.='</td></tr><tr><td>';
     #radio buttons/text box for assigning points for a section or class.      #radio buttons/text box for assigning points for a section or class.
     #handles different parts of a problem      #handles different parts of a problem
     my ($partlist,$handgrade) = &response_type($ENV{'form.url'});      my ($partlist,$handgrade) = &response_type($ENV{'form.url'});
Line 1630  sub viewgrades { Line 1641  sub viewgrades {
     '<option>excused</option></select></td></tr>'."\n";      '<option>excused</option></select></td></tr>'."\n";
  $ctsparts++;   $ctsparts++;
     }      }
     $result.='</table><input type="hidden" name="totalparts" value="'.$ctsparts.'" />';      $result.='</table>'.'</td></tr></table>'.'</td></tr></table>'."\n".
    '<input type="hidden" name="totalparts" value="'.$ctsparts.'" />';
     $result.='<input type="button" value="Reset" '.      $result.='<input type="button" value="Reset" '.
  'onClick="javascript:resetEntry('.$ctsparts.');" TARGET=_self> &nbsp; &nbsp;';   'onClick="javascript:resetEntry('.$ctsparts.');" TARGET=_self> &nbsp; &nbsp;';
     $result.='<input type="button" value="Submit Changes" '.      $result.='<input type="button" value="Submit Changes" '.
Line 1638  sub viewgrades { Line 1650  sub viewgrades {
   
     #table listing all the students in a section/class      #table listing all the students in a section/class
     #header of table      #header of table
       $result.= '<h3>Assign Grade to Specific Students in ';
       if ($ENV{'form.section'} eq 'all') {
    $result.='the Class </h3>';
       } elsif ($ENV{'form.section'} eq 'no') {
    $result.='no Section </h3>';
       } else {
    $result.='Section '.$ENV{'form.section'}.'</h3>';
       }
     $result.= '<table border=0><tr><td bgcolor="#777777">'."\n".      $result.= '<table border=0><tr><td bgcolor="#777777">'."\n".
  '<table border=0><tr bgcolor="#deffff">'.   '<table border=0><tr bgcolor="#deffff">'.
  '<td><b>Fullname</b></td><td><b>Username</b></td><td><b>Domain</b></td>'."\n";   '<td><b>Fullname</b></td><td><b>Username</b></td><td><b>Domain</b></td>'."\n";
Line 1649  sub viewgrades { Line 1669  sub viewgrades {
  if ($display =~ /^Partial Credit Factor/) {   if ($display =~ /^Partial Credit Factor/) {
     $_ = $display;      $_ = $display;
     my ($partid) = /.*?(\d+).*/;      my ($partid) = /.*?(\d+).*/;
     $result.='<td><b>Score Part '.$partid.'<br>(weight = '.      $result.='<td><b>Score Part '.$partid.'<br />(weight = '.
  $weight{$partid}.')</b></td>'."\n";   $weight{$partid}.')</b></td>'."\n";
     next;      next;
  }   }
  $display =~ s/Problem Status/Grade Status<br>/;   $display =~ s|Problem Status|Grade Status<br />|;
  $result.='<td><b>'.$display.'</b></td>'."\n";   $result.='<td><b>'.$display.'</b></td>'."\n";
     }      }
     $result.='</tr>';      $result.='</tr>';
Line 1662  sub viewgrades { Line 1682  sub viewgrades {
     #list all the students - with points and grade status      #list all the students - with points and grade status
     my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($ENV{'form.section'},'0');      my ($classlist,$seclist,$ids,$stusec,$fullname) = &getclasslist($ENV{'form.section'},'0');
     my $ctr = 0;      my $ctr = 0;
     foreach (sort {$$fullname{$a} cmp $$fullname{$b} } keys %$fullname) {      foreach (sort {lc($$fullname{$a}) cmp lc($$fullname{$b}) } keys %$fullname) {
  my ($uname,$udom) = split(/:/);   my ($uname,$udom) = split(/:/);
  $result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$uname.'" />'."\n";   $result.='<input type="hidden" name="ctr'.$ctr.'" value="'.$uname.'" />'."\n";
  $result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},   $result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},
Line 2115  sub view_edit_entire_class_form { Line 2135  sub view_edit_entire_class_form {
     my ($classlist,$sections) = &getclasslist('all','0');      my ($classlist,$sections) = &getclasslist('all','0');
     my $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n";      my $result.='<table width=100% border=0><tr><td bgcolor=#777777>'."\n";
     $result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n";      $result.='<table width=100% border=0><tr bgcolor="#e6ffff"><td>'."\n";
     $result.='&nbsp;<b>View/Grade Entire Section/Class</b></td></tr>'."\n";      $result.='&nbsp;<b>Grade Entire Section or Class</b></td></tr>'."\n";
     $result.='<tr bgcolor=#ffffe6><td>'."\n";      $result.='<tr bgcolor=#ffffe6><td>'."\n";
     $result.='<form action="/adm/grades" method="post">'."\n".      $result.='<form action="/adm/grades" method="post">'."\n".
  '<input type="hidden" name="symb" value="'.$symb.'" />'."\n".   '<input type="hidden" name="symb" value="'.$symb.'" />'."\n".
Line 2128  sub view_edit_entire_class_form { Line 2148  sub view_edit_entire_class_form {
  }   }
     }      }
     $result.='<option selected="on">all</select>'."<br />\n";      $result.='<option selected="on">all</select>'."<br />\n";
     $result.='&nbsp;<input type="button" onClick="submit();" value="View/Grade" /></form>'."\n";      $result.='&nbsp;<input type="button" onClick="submit();" value="Grade" /></form>'."\n";
     $result.='</td></tr></table>'."\n";      $result.='</td></tr></table>'."\n";
     $result.='</td></tr></table>'."\n";      $result.='</td></tr></table>'."\n";
     return $result;      return $result;

Removed from v.1.49  
changed lines
  Added in v.1.53


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