--- loncom/homework/grades.pm 2003/03/11 19:32:02 1.71 +++ loncom/homework/grades.pm 2003/03/27 21:26:07 1.78 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.71 2003/03/11 19:32:02 ng Exp $ +# $Id: grades.pm,v 1.78 2003/03/27 21:26:07 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -113,7 +113,7 @@ sub response_type { #--- Dumps the class list with usernames,list of sections, #--- section, ids and fullnames for each user. sub getclasslist { - my ($getsec,$hideexpired) = @_; + my ($getsec,$filterlist) = @_; my $classlist=&Apache::loncoursedata::get_classlist(); # Bail out if we were unable to get the classlist return if (! defined($classlist)); @@ -124,11 +124,13 @@ sub getclasslist { # the following undefs are for 'domain', and 'username' respectively. my (undef,undef,$end,$start,$id,$section,$fullname,$status)= @{$classlist->{$_}}; - # still a student? - if (($hideexpired) && ($status ne 'Active')) { - delete ($classlist->{$_}); - next; - } + # filter students according to status selected + if ($filterlist && $ENV{'form.status'} ne 'Any') { + if ($ENV{'form.status'} ne $status) { + delete ($classlist->{$_}); + next; + } + } $section = ($section ne '' ? $section : 'no'); if ($getsec eq 'all' || $getsec eq $section) { $sections{$section}++; @@ -209,6 +211,8 @@ sub jscriptNform { $jscript.= '
'."\n"); + $request->print(&show_grading_menu_form($symb,$url)) + if (($ENV{'form.command'} eq 'submission') || + ($ENV{'form.command'} eq 'processGroup' && $counter == $total)); return; } @@ -1227,8 +1244,6 @@ KEYWORDS push @partlist,$partid; $request->print(&gradeBox($request,$symb,$uname,$udom,$counter,$partid,\%record)); - -# $request->print($result); } $result=''."\n"; @@ -1281,9 +1296,7 @@ sub get_last_submission { for ($version=1;$version<=$returnhash{'version'};$version++) { foreach (sort(split(/\:/,$returnhash{$version.':keys'}))) { $lasthash{$_}=$returnhash{$version.':'.$_}; -# if ($returnhash{$version.':'.$_} =~ /(SUBMITTED|DRAFT)$/) { $timestamp = scalar(localtime($returnhash{$version.':timestamp'})); -# } } } foreach ((keys %lasthash)) { @@ -1330,7 +1343,7 @@ sub processHandGrade { my $ctr = 0; while ($ctr < $ngrade) { my ($uname,$udom) = split(/:/,$ENV{'form.unamedom'.$ctr}); - my ($errorflag) = &saveHandGrade($request,$url,$symb,$uname,$udom,$ctr); + my ($errorflag,$pts,$wgt) = &saveHandGrade($request,$url,$symb,$uname,$udom,$ctr); if ($errorflag eq 'no_score') { $ctr++; next; @@ -1344,7 +1357,9 @@ sub processHandGrade { foreach (@msgnum) { $message.=$ENV{'form.'.$_} if ($_ =~ /savemsg|newmsg/ && $_ ne ''); } - $message =~ s/\s+/ /g; + $message =~ s/<([^>]|\n)*>//g; # removes html codes Or should this be lonnet::escape ?? + $message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt; + $message.=" for $ENV{'form.probTitle'}"; $msgstatus = &Apache::lonmsg::user_normal_msg ($uname,$udom, $ENV{'form.msgsub'},$message); } @@ -1466,8 +1481,6 @@ sub processHandGrade { $ENV{'form.student'} = $uname; $ENV{'form.userdom'} = $udom; $ENV{'form.fullname'} = $$fullname{$_}; -# $ENV{'form.'.$_.':submitted_by'} = $submitter; -# print "submitter=$ENV{'form.'.$_.':submitted_by'}= $submitter:'."\n".
'
|
Problem: '.&Apache::lonnet::metadata($url,'title') - .' | ||
Problem: '.$ENV{'form.probTitle'}.' |
'."\n";
- $result.='
|
'."\n";
- $result.='
|
'."\n";
- $result.='
|
+
|
+
'."\n";
- $result.='
|
Problem: '.$probTitle.' | ||
Part '.(split(/_/))[0].' | '. + 'Type: '.$responsetype.' | '. + 'Handgrade: '.$handgrade.' |
'."\n".
+ '
|