--- loncom/homework/grades.pm 2003/07/19 15:11:27 1.120 +++ loncom/homework/grades.pm 2003/07/21 13:32:49 1.121 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.120 2003/07/19 15:11:27 ng Exp $ +# $Id: grades.pm,v 1.121 2003/07/21 13:32:49 ng Exp $ # # Copyright Michigan State University Board of Trustees # @@ -197,6 +197,7 @@ COMMONJSFUNCTIONS #--- section, ids and fullnames for each user. sub getclasslist { my ($getsec,$filterlist) = @_; + $getsec = $getsec eq '' ? 'all' : $getsec; my $classlist=&Apache::loncoursedata::get_classlist(); # Bail out if we were unable to get the classlist return if (! defined($classlist)); @@ -721,9 +722,9 @@ sub sub_page_js { return; } -//=========== Check that a point is assigned for all the parts (essay grading only) ============ +//=========== Check that a point is assigned for all the parts ============ function checksubmit(formname,val,total,parttot) { - document.SCORE.gradeOpt.value = val; + formname.gradeOpt.value = val; if (val == "Save & Next") { for (i=0;i<=total;i++) { for (j=0;j'."\n". - ''."\n". - ''."\n"; - $request->print($result); + $request->print(''."\n"); # return if view submission with no grading option if ($ENV{'form.showgrading'} eq '' || (!&canmodify($usec))) { my $toGrade.='  '."\n"; + 'onClick="javascript:checksubmit(this.form,\'Grade Student\',\'' + .$counter.'\');" TARGET=_self>  '."\n" if (&canmodify($usec)); $toGrade.=''."\n"; $toGrade.=&show_grading_menu_form($symb,$url) if (($ENV{'form.command'} eq 'submission') || @@ -1459,7 +1457,7 @@ KEYWORDS return; } - # essay grading options + # essay grading message center if ($ENV{'form.handgrade'} eq 'yes') { my ($lastname,$givenn) = split(/,/,$ENV{'form.fullname'}); my $msgfor = $givenn.' '.$lastname; @@ -1469,15 +1467,17 @@ KEYWORDS } $msgfor =~ s/\'/\\'/g; #' stupid emacs - no! javascript # $result.=''."\n". - $result=' '."\n". + ''."\n"; + $result.=' '. 'Compose Message to student'.(scalar(@col_fullnames) >= 1 ? 's' : '').'  '. ''."\n". '
 (Message will be sent when you click on Save & Next below.)'."\n" if ($ENV{'form.handgrade'} eq 'yes'); + $request->print($result); } - $request->print($result); my %seen = (); my @partlist; @@ -1503,7 +1503,6 @@ KEYWORDS # print end of form if ($counter == $total) { my $endform='
'."\n"; -# ''."\n"; $endform.='  '."\n"; @@ -1666,7 +1665,6 @@ sub processHandGrade { $ENV{'course.'.$ENV{'request.course.id'}.'.num'}); } # Called by Save & Refresh from Highlight Attribute Window -# my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'0'); my (undef,undef,$fullname) = &getclasslist($ENV{'form.section'},'1'); if ($ENV{'form.refresh'} eq 'on') { my ($ctr,$total) = (0,0); @@ -1686,8 +1684,9 @@ sub processHandGrade { return ''; } -# Go directly to grade student - from submission page +# Go directly to grade student - from submission or link from chart page if ($button eq 'Grade Student') { + (undef,undef,$ENV{'form.handgrade'},undef,undef) = &showResourceInfo($url); my $processUser = $ENV{'form.unamedom'.$ENV{'form.studentNo'}}; ($ENV{'form.student'},$ENV{'form.userdom'}) = split(/:/,$processUser); $ENV{'form.fullname'} = $$fullname{$processUser};