-
-Resource: $ENV{'form.url'}
-Username Name Domain
-View Problem Submissions Action
+ View Submissions for a Student or a Group of Students
+ Resource: $ENV{'form.url'}
+
+ View Problem: no
+ yes
+ Submissions: last
+ all
+
+
+
+
+
+
+ Select Username
+ Fullname Domain
+ Grade Status
ENDTABLEST
- my (%classlist) = &getclasslist($cdom,$cnum,'0');
- foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
+ if ($ENV{'form.url'}) {
+ $request->print(' '."\n");
+ }
+ if ($ENV{'form.symb'}) {
+ $request->print(' '."\n");
+ }
+ $request->print(' '."\n");
+
+ my ($classlist) = &getclasslist($getsec,'0');
+ foreach my $student ( sort(@{ $$classlist{$getsec} }) ) {
my ($sname,$sdom) = split(/:/,$student);
+ my ($type,$status) = &student_gradeStatus($ENV{'form.url'},$cdom,$sname);
+ next if ($status eq 'nothing' && $submitonly eq 'yes');
- my %name=&Apache::lonnet::get('environment', ['lastname','generation',
- 'firstname','middlename'],
- $sdom,$sname);
- my $fullname;
- my ($tmp) = keys(%name);
- if ($tmp !~ /^(con_lost|error|no_such_host)/i) {
- $fullname=$name{'lastname'}.$name{'generation'};
- if ($fullname =~ /[^\s]+/) { $fullname.=', '; }
- $fullname.=$name{'firstname'}.' '.$name{'middlename'};
- }
+ my $fullname = &get_fullname($sname,$sdom);
if ( $Apache::grades::viewgrades eq 'F' ) {
- $request->print("\n".''."$sname $fullname $sdom ".
- ' ');
-# $request->print('');
+ $request->print("\n".''.
+ ' '."\n".
+ ' '.$sname.' '."\n".
+ ' '.$fullname.' '."\n".
+ ' '.$sdom.' '."\n");
+ $request->print(' '.$status.' '."\n");
+
+ $request->print(' ');
}
}
$request->print('
');
+ $request->print(' ');
}
+sub processGroup {
+ my ($request) = shift;
+ my $ctr = 0;
+ my @stuchecked = (ref($ENV{'form.stuinfo'}) ? @{$ENV{'form.stuinfo'}}
+ : ($ENV{'form.stuinfo'}));
+ my $total = scalar(@stuchecked)-1;
+ if ($stuchecked[0] eq '') {
+ &userError($request,'No student was selected for viewing/grading.');
+ return;
+ }
+ foreach (@stuchecked) {
+ my ($sname,$sdom,$fullname) = split(/:/);
+ $ENV{'form.student'} = $sname;
+ $ENV{'form.fullname'} = $fullname;
+ &submission($request,$ctr,$total);
+ $ctr++;
+ }
+ return 'The End';
+}
+
+sub userError {
+ my ($request, $reason, $step) = @_;
+ $request->print('LON-CAPA User Error '."\n");
+ $request->print('Reason: '.$reason.' '."\n");
+ $request->print('Step: '.($step ne '' ? $step : 'Use your browser back button to correct')
+ .' '."\n");
+ return '';
+}
#FIXME - needs to handle multiple matches
sub finduser {
my ($name) = @_;
my $domain = '';
-
if ( $Apache::grades::viewgrades eq 'F' ) {
- #get classlist
- my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
- #print "Found $cdom:$cnum ";
- my (%classlist) = &getclasslist($cdom,$cnum,'0');
- foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
- my ($posname,$posdomain) = split(/:/,$student);
+ my ($classlist) = &getclasslist('all','0');
+ foreach ( sort(@{ $$classlist{'all'} }) ) {
+ my ($posname,$posdomain) = split(/:/);
if ($posname =~ $name) { $name=$posname; $domain=$posdomain; last; }
}
return ($name,$domain);
@@ -200,20 +226,28 @@ sub finduser {
}
sub getclasslist {
- my ($coursedomain,$coursenum,$hideexpired) = @_;
+ my ($getsec,$hideexpired) = @_;
+ my ($coursedomain,$coursenum) = split(/_/,$ENV{'request.course.id'});
my %classlist=&Apache::lonnet::dump('classlist',$coursedomain,$coursenum);
my $now = time;
+ my (@holdsec,@sections);
foreach my $student (keys(%classlist)) {
my ($end,$start)=split(/:/,$classlist{$student});
# still a student?
if (($hideexpired) && ($end) && ($end < $now)) {
- #print "Skipping:$name:$end:$now \n";
next;
}
- #print "record=$record ";
- push( @{ $classlist{'allids'} }, $student);
+ my ($unam,$udom) = split(/:/,$student,2);
+ my $section = &Apache::lonnet::usection($udom,$unam,$ENV{'request.course.id'});
+ $section = ($section ne '-1' ? $section : 'no');
+ push @holdsec,$section;
+ push (@{ $classlist{$getsec} }, $student) if ($getsec eq 'all' || $getsec eq $section);
+ }
+ my %seen = ();
+ foreach my $item (@holdsec) {
+ push (@sections, $item) unless $seen{$item}++;
}
- return (%classlist);
+ return (\%classlist,\@sections);
}
sub getpartlist {
@@ -234,60 +268,46 @@ sub viewstudentgrade {
my $cellclr = '"#ffffdd"';
my ($username,$domain) = split(/:/,$student);
- my (@requests) = ('lastname','firstname','middlename','generation');
- my (%name) = &Apache::lonnet::get('environment',\@requests,$domain,$username);
+ my $fullname = &get_fullname($username,$domain);
my %record=&Apache::lonnet::restore($symb,$courseid,$domain,$username);
- my $fullname=$name{'lastname'}.$name{'generation'};
- if ($fullname =~ /[^\s]+/) { $fullname.=', '; }
- $fullname.=$name{'firstname'}.' '.$name{'middlename'};
$result.="$username $fullname $domain \n";
foreach my $part (@parts) {
my ($temp,$part,$type)=split(/_/,$part);
- #print "resource.$part.$type = ".$record{"resource.$part.$type"}." \n";
- if ($type eq 'awarded') {
- my $score=$record{"resource.$part.$type"};
- $result.=" \n";
- } elsif ($type eq 'tries') {
- my $score=$record{"resource.$part.$type"};
- $result.=" \n"
+ my $score=$record{"resource.$part.$type"};
+ if ($type eq 'awarded' || $type eq 'tries') {
+ $result.=' '."\n";
} elsif ($type eq 'solved') {
- my $score=$record{"resource.$part.$type"};
+ my ($status,$foo)=split(/_/,$score,2);
$result.="\n";
- if ($score =~ /^correct/) {
- $result.="correct \nincorrect \nexcused \nungraded \nnothing \n";
- } elsif ($score =~ /^incorrect/) {
- $result.="correct \nincorrect \nexcused \nungraded \nnothing \n";
- } elsif ($score eq '') {
- $result.="correct \nincorrect \nexcused \nungraded \nnothing \n";
- } elsif ($score =~ /^excused/) {
- $result.="correct \nincorrect \nexcused \nungraded \nnothing \n";
- } elsif ($score =~ /^ungraded/) {
- $result.="correct \nincorrect \nexcused \nungraded \nnothing \n";
- }
+ my $optsel = 'correct incorrect excused '.
+ 'ungraded partial nothing '."\n";
+ $status = 'nothing' if ($status eq '');
+ $optsel =~ s/$status/ $status/;
+ $result.=$optsel;
$result.=" \n";
}
}
$result.=' ';
return $result;
}
-#FIXME need to look at the meatdata spec on what type of data to accept and provide an
+
+#FIXME need to look at the metadata spec on what type of data to accept and provide an
#interface based on that, also do that to above function.
sub setstudentgrade {
my ($url,$symb,$courseid,$student,@parts) = @_;
-
+ print "set student grade parts=@parts ";
my $result ='';
-
my ($stuname,$domain) = split(/:/,$student);
-
my %record=&Apache::lonnet::restore($symb,$courseid,$domain,$stuname);
-
my %newrecord;
foreach my $part (@parts) {
my ($temp,$part,$type)=split(/_/,$part);
my $oldscore=$record{"resource.$part.$type"};
my $newscore=$ENV{"form.GRADE.$student.$part.$type"};
+ print "old=$oldscore:new=$newscore: ";
if ($type eq 'solved') {
my $update=0;
if ($newscore eq 'nothing' ) {
@@ -298,10 +318,11 @@ sub setstudentgrade {
} elsif ($oldscore !~ m/^$newscore/) {
$update=1;
$result.="Updating $stuname to $newscore \n";
- if ($newscore eq 'correct') { $newscore = 'correct_by_override'; }
+ if ($newscore eq 'correct') { $newscore = 'correct_by_override'; }
if ($newscore eq 'incorrect') { $newscore = 'incorrect_by_override'; }
- if ($newscore eq 'excused') { $newscore = 'excused'; }
- if ($newscore eq 'ungraded') { $newscore = 'ungraded_attempted'; }
+ if ($newscore eq 'excused') { $newscore = 'excused'; }
+ if ($newscore eq 'ungraded') { $newscore = 'ungraded_attempted'; }
+ if ($newscore eq 'partial') { $newscore = 'correct_partially_by_override'; }
} else {
#$result.="$stuname:$part:$type:unchanged $oldscore to $newscore: \n";
}
@@ -316,89 +337,432 @@ sub setstudentgrade {
}
}
if ( scalar(keys(%newrecord)) > 0 ) {
- $newrecord{"resource.regrader"}="$ENV{'user.name'}:$ENV{'user.domain'}";
- &Apache::lonnet::cstore(\%newrecord,$symb,$courseid,$domain,$stuname);
+ $newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
+# &Apache::lonnet::cstore(\%newrecord,$symb,$courseid,$domain,$stuname);
$result.="Stored away ".scalar(keys(%newrecord))." elements. \n";
}
return $result;
}
+#
+# --------------------------- show submissions of a student, option to grade --------
sub submission {
- my ($request) = @_;
- my $url=$ENV{'form.url'};
- $url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
- if ($ENV{'form.student'} eq '') { &moreinfo($request,"Need student login id"); return ''; }
-# if ($ENV{'form.student'} eq '') { &listStudents($request); return ''; }
- my ($uname,$udom) = &finduser($ENV{'form.student'});
- if ($uname eq '') { &moreinfo($request,"Unable to find student"); return ''; }
- my $symb;
- if ($ENV{'form.symb'}) {
- $symb=$ENV{'form.symb'};
- } else {
- $symb=&Apache::lonnet::symbread($url);
+ my ($request,$counter,$total) = @_;
+
+ if ($counter == 0) {
+ $request->print(<
+ function updateRadio(radioButton,formtextbox,formsel,wgt) {
+ var pts = formtextbox.value;
+ var resetbox =false;
+ if (isNaN(pts) || pts < 0) {
+ alert("A number equal or greater than 0 is expected. Entered value = "+pts);
+ for (var i=0; i 0 && pts < wgt) {
+ formsel[4].selected = true;
+ }
+ if (pts == wgt) {
+ formsel[0].selected = true;
+ }
+ return;
+ }
+
+ function keywords(keyform) {
+ var keywds = keyform.value;
+ var nret = prompt("Keywords list, separate by a space or comma. Add/delete to list if desired.",keywds);
+ if (nret==null) return;
+ keyform.value = nret;
+ return;
+ }
+
+ function addmsg(msgform) {
+ var msg = msgform.value;
+ var nret = prompt("Enter the message you wish to send to the student.",msg);
+ if (nret==null) return;
+ msgform.value = nret;
+ return;
+ }
+
+ function savedmsg(msgform) {
+ var Nmsg = msgform.value;
+ var nret = prompt("Number of saved messages = ",Nmsg);
+ if (nret==null) return;
+ msgform.value = nret;
+ return;
+ }
+
+
+JAVASCRIPT
+}
+ (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+ if ($ENV{'form.student'} eq '') { &moreinfo($request,'Need student login id'); return ''; }
+ my ($uname,$udom) = &finduser($ENV{'form.student'});
+ if ($uname eq '') { &moreinfo($request,'Unable to find student'); return ''; }
+
+ my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url)));
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }
+ my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : '');
+#
+# header info
+ if ($counter == 0) {
+ $request->print('Submission Record ');
+ }
- my $result='Submission Record ';
- $result.='Username: '.$uname.'Fullname: '.$ENV{'form.fullname'}.'Domain: '.$udom.' ';
- $result.='Resource: '.$url.'
';
- if ($ENV{'form.vProb'} eq 'yes') {
+#
+# option to display problem, only once else it cause problems with the form later since the problem has a form.
+ if ($ENV{'form.vProb'} eq 'yes' && $counter == 0) {
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom,
$ENV{'request.course.id'});
my $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom,
$ENV{'request.course.id'});
- $result.='';
- $result.='';
- $result.='Student\'s view of the problem: '.$rendered.' ';
+ my $result.='';
+ $result.='';
+ $result.='Student\'s view of the problem '.$rendered.' ';
$result.='Correct answer: '.$companswer;
$result.='
';
$result.='
';
+ $request->print($result);
+ }
+#
+# beginning of form
+ if ($counter == 0) {
+ my %keyhash = &Apache::lonnet::get
+ ('nohist_handgrade',[$symb.'_keywords'],
+ $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
+ $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+
+ $request->print('';
+ $request->print($endform);
+ }
+ return '';
+}
+
+sub get_last_submission {
+ my ($symb,$username,$domain,$course)=@_;
+ if ($symb) {
+ my (%returnhash)=&Apache::lonnet::restore($symb,$course,$domain,$username);
+ if ($returnhash{'version'}) {
+ my %lasthash=();
+ my $version;
+ for ($version=1;$version<=$returnhash{'version'};$version++) {
+ foreach (sort(split(/\:/,$returnhash{$version.':keys'}))) {
+ $lasthash{$_}=$returnhash{$version.':'.$_};
+ }
+ }
+ foreach ((keys %lasthash)) {
+ if ($_ =~ /\.submission$/) {return $lasthash{$_}}
+ }
+ return '';
+ }
+ }
+}
+
+sub keywords_highlight {
+ my $string = shift;
+ (my $url=$ENV{'form.url'})=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+ my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url)));
+ my %keyhash = &Apache::lonnet::get
+ ('nohist_handgrade',[$symb.'_keywords'],
+ $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
+ $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+ my @keylist = split(/[,\s+]/,$keyhash{$symb.'_keywords'});
+ foreach my $word (@keylist) {
+ next if ($word eq '');
+ $string =~ s/\b$word(\b|\.)/\$word\<\/font\>/gi;
+ }
+ return $string;
+}
+
+sub processHandGrade {
+ my ($request) = shift;
+ my $url = $ENV{'form.url'};
+ my $symb = $ENV{'form.symb'};
+ my $button = $ENV{'form.gradeOpt'};
+ my $ngrade = $ENV{'form.NCT'};
+ my $ntstu = $ENV{'form.NTSTU'};
+ my $keywords= $ENV{'form.keywords'};
+ my $addmsg = $ENV{'form.addmsg'};
+ print "addmsg=$addmsg ";
+ if ($keywords ne '') {
+ my $crsname = $ENV{'course.'.$ENV{'request.course.id'}.'.num'};
+ my $crsdom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'};
+ my $putresult = &Apache::lonnet::put
+ ('nohist_handgrade',{$symb.'_keywords' => $keywords},
+ $crsdom,$crsname);
+ }
my (@parts) = sort(&getpartlist($url));
- #start the form
- $result.= '';
- return $result;
+ my (@nextlist,@prevlist);
+ my ($nextflg,$prevflg,$ctr,$ctprev) = (0,0,0,0);
+ foreach my $student ( sort(@{ $$classlist{$ENV{'form.section'}} }) ) {
+ my ($uname,$udom) = split(/:/,$student);
+ if ($nextflg == 1 && $button =~ /Next$/) {
+ push @nextlist,$uname if ($ctr < $ntstu);
+ $ctr++;
+ }
+ $nextflg = 1 if ($student eq $laststu);
+ $prevflg = 1 if ($student eq $firststu);
+ if ($prevflg == 0 && $button eq 'Previous') {
+ push @prevlist,$uname;
+ $ctprev++;
+ }
+ }
+ if ($button eq 'Previous') {
+ if ($ctprev <= $ntstu) {
+ @nextlist = @prevlist;
+ } else {
+ my $idx = 0;
+ my $start = $ctprev - $ntstu;
+ while ($idx < $ntstu) {
+ $nextlist[$idx] = $prevlist[$start+$idx];
+ $idx++;
+ }
+ }
+ }
+ $ctr = 0;
+ my $total = scalar(@nextlist)-1;
+ foreach my $student (@nextlist) {
+ $ENV{'form.student'} = $student;
+ &submission($request,$ctr,$total);
+ $ctr++;
+ }
+
+ return 'The End';
}
-sub get_symb_and_url {
- my ($request) = @_;
- my $url=$ENV{'form.url'};
- $url=~s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
- my $symb=$ENV{'form.symb'};
- if (!$symb) { $symb=&Apache::lonnet::symbread($url); }
- if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }
- return ($symb,$url);
+sub saveHandGrade {
+ my ($url,$symb,$stuname,$domain,$newflg,@parts) = @_;
+ my %record=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},$domain,$stuname);
+ my %newrecord;
+
+ foreach my $part (@parts) {
+ my ($temp,$part,$type)=split(/_/,$part);
+ my $oldscore=$record{"resource.$part.$type"};
+ my $newscore;
+ if ($type eq 'awarded' && $newflg >= 0) {
+ my $pts = ($ENV{'form.GRADE_BOX'.$newflg} ne '' ?
+ $ENV{'form.GRADE_BOX'.$newflg} : $ENV{'form.RADVAL'.$newflg});
+ my $wgt = $ENV{'form.WGT'.$newflg};
+# my $sel = $ENV{'form.GRADE_SEL'.$newflg};
+ $newscore = $pts/$wgt if ($wgt != 0);
+ }
+ if ($type eq 'solved') {
+ $newscore = $ENV{'form.GRADE_SEL'.$newflg} if ($newflg >= 0);
+ my $update=0;
+ if ($newscore eq 'nothing' ) {
+ if ($oldscore ne '') {
+ $update=1;
+ $newscore = '';
+ }
+ } elsif ($oldscore !~ m/^$newscore/) {
+ $update=1;
+ if ($newscore eq 'correct') { $newscore = 'correct_by_override'; }
+ if ($newscore eq 'incorrect') { $newscore = 'incorrect_by_override'; }
+ if ($newscore eq 'excused') { $newscore = 'excused'; }
+ if ($newscore eq 'ungraded') { $newscore = 'ungraded_attempted'; }
+ if ($newscore eq 'partial') { $newscore = 'correct_partially_by_override'; }
+ }
+ if ($update) { $newrecord{"resource.$part.$type"}=$newscore; }
+ } else {
+ if ($oldscore ne $newscore) {
+ $newrecord{"resource.$part.$type"}=$newscore;
+ }
+ }
+ }
+ if ( scalar(keys(%newrecord)) > 0 ) {
+ $newrecord{'resource.regrader'}="$ENV{'user.name'}:$ENV{'user.domain'}";
+# while (my ($k,$v) = each %newrecord) {
+# print "k=$k:v=$v: \n";
+# }
+# print "symb=$symb,courseid=$ENV{'request.course.id'},dom=$domain,name=$stuname ";
+# &Apache::lonnet::cstore(\%newrecord,$symb,$ENV{'request.course.id'},$domain,$stuname);
+ }
+ return '';
}
-sub view_edit_entire_class_form {
- my ($symb,$url)=@_;
- my $result.=''."\n";
- return $result;
+sub get_symb_and_url {
+ my ($request) = @_;
+ (my $url=$ENV{'form.url'}) =~ s-^http://($ENV{'SERVER_NAME'}|$ENV{'HTTP_HOST'})--;
+ my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url)));
+ if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; }
+ return ($symb,$url);
}
sub show_grading_menu_form {
@@ -416,31 +780,119 @@ sub gradingmenu {
my ($request) = @_;
my ($symb,$url)=&get_symb_and_url($request);
if (!$symb) {return '';}
+ my $allkeys = &Apache::lonnet::metadata($url,'keys');
+ my $handgrade = ($allkeys =~ /parameter_.*?_handgrade/ ? 'yes' : 'no');
+ my ($responsetype,$foo) = split(/_/,&Apache::lonnet::metadata($url,'packages'));
+
+ my $result=' Select a Grading Method ';
+ $result.='';
+ $result.='Resource: '.
+ ''.$url.' ';
+ $result.='Type: '.
+ ''.$responsetype.' Handgrade: '.$handgrade.' ';
+ $result.='
';
+
+ $result.=&view_edit_entire_class_form($symb,$url).' ';
+ $result.=&upcsvScores_form($symb,$url).' ';
+ $result.=&viewGradeaStu_form($symb,$url,$responsetype,$handgrade).' ';
+ $result.=&verifyReceipt_form($symb,$url);
+ return $result;
+}
- my $result=' Select a Grading Method ';
- $result.=''."\n";
- $result.=''."\n";
- $result.=' Resource : '.$url.' '."\n";
+sub view_edit_entire_class_form {
+ my ($symb,$url)=@_;
+ my $result.=''."\n";
+ $result.=''."\n";
+ $result.='
'."\n";
+ return $result;
+}
+
+sub upcsvScores_form {
+ my ($symb,$url) = @_;
+ if (!$symb) {return '';}
+ my $result.=''."\n";
+ $result.=''."\n";
+ $result.='
'."\n";
+ return $result;
+}
+
+sub viewGradeaStu_form {
+ my ($symb,$url,$response,$handgrade) = @_;
+ my ($classlist,$sections) = &getclasslist('all','0');
+ my $result.=''."\n";
+ $result.=''."\n";
+ $result.='
'."\n";
+ return $result;
+}
+
+sub verifyReceipt_form {
+ my ($symb,$url) = @_;
+ my $cdom=$ENV{"course.$ENV{'request.course.id'}.domain"};
+ my $cnum=$ENV{"course.$ENV{'request.course.id'}.num"};
+ my $hostver=unpack("%32C*",$Apache::lonnet::perlvar{'lonHostID'});
+
+ my $result.=''."\n";
+ $result.=''."\n";
+ $result.=' Verify a Submission Receipt Issued by this Server '."\n";
+ $result.=''."\n";
+ $result.='';
$result.='
'."\n";
$result.='
'."\n";
return $result;
@@ -456,7 +908,7 @@ sub viewgrades {
#get classlist
my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
#print "Found $cdom:$cnum ";
- my (%classlist) = &getclasslist($cdom,$cnum,'0');
+ my ($classlist) = &getclasslist('all','0');
my $headerclr = '"#ccffff"';
my $cellclr = '"#ffffcc"';
@@ -471,7 +923,7 @@ sub viewgrades {
' '."\n".
' '."\n".
' '."\n".
- ''."\n".
+ ''."\n".
''."\n".
'Username Name Domain '."\n";
foreach my $part (@parts) {
@@ -481,10 +933,13 @@ sub viewgrades {
}
$result.=' ';
#get info for each student
- foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
+ foreach my $student ( sort(@{ $$classlist{'all'} }) ) {
+ my $display=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},$student,@parts);
+# print "ID=$ENV{'request.course.id'}:STU=$student:DIS=$display: \n";
$result.=&viewstudentgrade($url,$symb,$ENV{'request.course.id'},$student,@parts);
}
- $result.='
';
+ $result.='
';
+ $result.=' ';
$result.=&show_grading_menu_form($symb,$url);
return $result;
}
@@ -497,9 +952,9 @@ sub editgrades {
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$symb:$ENV{'form.url'}"); return ''; }
my $url=$ENV{'form.url'};
#get classlist
- my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
+# my ($cdom,$cnum) = split(/_/,$ENV{'request.course.id'});
#print "Found $cdom:$cnum ";
- my (%classlist) = &getclasslist($cdom,$cnum,'0');
+ my ($classlist) = &getclasslist('all','0');
#get list of parts for this problem
my (@parts) = &getpartlist($url);
@@ -510,7 +965,7 @@ sub editgrades {
' '."\n".
' '."\n";
- foreach my $student ( sort(@{ $classlist{'allids'} }) ) {
+ foreach my $student ( sort(@{ $$classlist{'all'} }) ) {
$result.=&setstudentgrade($url,$symb,$ENV{'request.course.id'},$student,@parts);
}
@@ -518,25 +973,6 @@ sub editgrades {
return $result;
}
-sub csvupload {
- my ($request)= @_;
- my $result;
- my ($symb,$url)=&get_symb_and_url($request);
- if (!$symb) {return '';}
- my $upfile_select=&Apache::loncommon::upfile_select_html();
- $result.=<
-
-
-
-
-Specify a file containing the class grades for resource $url
-$upfile_select
-
-ENDUPFORM
- return $result;
-}
-
sub csvupload_javascript_reverse_associate {
return(<print('Assigning Grades ');
my $courseid=$ENV{'request.course.id'};
- my $cdom=$ENV{"course.$courseid.domain"};
- my $cnum=$ENV{"course.$courseid.num"};
- my (%classlist) = &getclasslist($cdom,$cnum,'1');
+# my $cdom=$ENV{"course.$courseid.domain"};
+# my $cnum=$ENV{"course.$courseid.num"};
+ my ($classlist) = &getclasslist('all','1');
my @skipped;
my $countdone=0;
foreach my $grade (@gradedata) {
my %entries=&Apache::loncommon::record_sep($grade);
my $username=$entries{$fields{'username'}};
my $domain=$entries{$fields{'domain'}};
- if (!exists($classlist{"$username:$domain"})) {
+ if (!exists($$classlist{"$username:$domain"})) {
push(@skipped,"$username:$domain");
next;
}
@@ -837,11 +1273,15 @@ sub handler {
$Apache::grades::viewgrades=&Apache::lonnet::allowed('vgr',$ENV{'request.course.id'});
if ($command eq 'submission') {
&listStudents($request) if ($ENV{'form.student'} eq '');
- $request->print(&submission($request)) if ($ENV{'form.student'} ne '');
+ &submission($request,0,0) if ($ENV{'form.student'} ne '');
+ } elsif ($command eq 'processGroup') {
+ &processGroup($request);
} elsif ($command eq 'gradingmenu') {
$request->print(&gradingmenu($request));
} elsif ($command eq 'viewgrades') {
$request->print(&viewgrades($request));
+ } elsif ($command eq 'handgrade') {
+ $request->print(&processHandGrade($request));
} elsif ($command eq 'editgrades') {
$request->print(&editgrades($request));
} elsif ($command eq 'verify') {
@@ -850,8 +1290,8 @@ sub handler {
$request->print(&csvupload($request));
} elsif ($command eq 'csvuploadmap') {
$request->print(&csvuploadmap($request));
- } elsif ($command eq 'receiptInput') {
- &receiptInput($request);
+# } elsif ($command eq 'receiptInput') {
+# &receiptInput($request);
} elsif ($command eq 'csvuploadassign') {
if ($ENV{'form.associate'} ne 'Reverse Association') {
$request->print(&csvuploadassign($request));