--- loncom/homework/grades.pm 2003/06/13 15:43:28 1.96
+++ loncom/homework/grades.pm 2003/06/18 18:59:20 1.101
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.96 2003/06/13 15:43:28 albertel Exp $
+# $Id: grades.pm,v 1.101 2003/06/18 18:59:20 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -2395,7 +2395,7 @@ sub csvuploadassign {
}
$request->print('
Assigning Grades
');
my $courseid=$ENV{'request.course.id'};
- my ($classlist) = &getclasslist('all','1');
+ my ($classlist) = &getclasslist('all',0);
my @skipped;
my $countdone=0;
foreach my $grade (@gradedata) {
@@ -2427,7 +2427,6 @@ sub csvuploadassign {
$request->print('
Skipped Students
');
foreach my $student (@skipped) { $request->print("
$student"); }
}
- $request->print(&view_edit_entire_class_form($symb,$url));
$request->print(&show_grading_menu_form($symb,$url));
return '';
}
@@ -2598,10 +2597,9 @@ sub getSymbMap {
my $countProblems = 0;
$mapiterator->next(); # skip the first BEGIN_MAP
my $mapcurRes = $mapiterator->next(); # for "current resource"
- my $ctr=0;
while ($mapdepth > 0) {
if($mapcurRes == $mapiterator->BEGIN_MAP) { $mapdepth++; }
- if($mapcurRes == $mapiterator->END_MAP) { $mapdepth++; }
+ if($mapcurRes == $mapiterator->END_MAP) { $mapdepth--; }
if (ref($mapcurRes) && $mapcurRes->is_problem() && !$mapcurRes->randomout) {
$countProblems++;
@@ -2669,12 +2667,12 @@ sub displayPage {
' No | '.
' '.($ENV{'form.vProb'} eq 'no' ? 'Title' : 'Problem View').'/Grade | ';
- my ($depth,$ctr,$question) = (1,0,1);
+ my ($depth,$question) = (1,1);
$iterator->next(); # skip the first BEGIN_MAP
my $curRes = $iterator->next(); # for "current resource"
- while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
+ while ($depth > 0) {
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) {
my $parts = $curRes->parts();
@@ -2757,9 +2755,10 @@ sub displayPage {
}
$curRes = $iterator->next();
- $ctr++;
}
+ $navmap->untieHashes();
+
$studentTable.=''."\n".
' '.
@@ -2803,10 +2802,10 @@ sub updateGradeByPage {
$iterator->next(); # skip the first BEGIN_MAP
my $curRes = $iterator->next(); # for "current resource"
- my ($depth,$ctr,$question,$changeflag)= (1,0,1,0);
- while ($depth > 0 && $ctr < 100) { # ctr, just in case it never gets out of loop
+ my ($depth,$question,$changeflag)= (1,1,0);
+ while ($depth > 0) {
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) {
my $parts = $curRes->parts();
@@ -2866,9 +2865,10 @@ sub updateGradeByPage {
}
$curRes = $iterator->next();
- $ctr++;
}
+ $navmap->untieHashes();
+
$studentTable.='';
$studentTable.=&show_grading_menu_form($ENV{'form.symb'},$ENV{'form.url'});
my $grademsg=($changeflag == 0 ? 'No score was changed or updated.' :
@@ -3425,15 +3425,14 @@ sub handler {
if ($tsymb) {
my ($map,$id,$url)=split(/\_\_\_/,$tsymb);
if (&Apache::lonnet::allowed('mgr',$tcrsid)) {
- $request->print(
- &Apache::lonnet::ssi('/res/'.$url,
- ('grade_username' => $tuname,
- 'grade_domain' => $tudom,
- 'grade_courseid' => $tcrsid,
- 'grade_symb' => $tsymb)));
+ $request->print(&Apache::lonnet::ssi_body('/res/'.$url,
+ ('grade_username' => $tuname,
+ 'grade_domain' => $tudom,
+ 'grade_courseid' => $tcrsid,
+ 'grade_symb' => $tsymb)));
} else {
$request->print('Not authorized: '.$token.'
');
- }
+ }
} else {
$request->print('Not a valid DocID: '.$token.'
');
}