--- loncom/interface/lonquickgrades.pm 2003/09/25 19:22:14 1.28 +++ loncom/interface/lonquickgrades.pm 2004/12/11 23:33:05 1.33 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Quick Student Grades Display # -# $Id: lonquickgrades.pm,v 1.28 2003/09/25 19:22:14 bowersj2 Exp $ +# $Id: lonquickgrades.pm,v 1.33 2004/12/11 23:33:05 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,6 +67,8 @@ sub real_handler { my $showPoints = $ENV{'course.'.$ENV{'request.course.id'}.'.grading'} eq 'standard'; + my $notshowSPRSlink = + $ENV{'course.'.$ENV{'request.course.id'}.'.grading'} eq 'external'; # Create the nav map my $navmap = Apache::lonnavmaps::navmap->new(); @@ -82,10 +84,10 @@ sub real_handler { my $res = $navmap->firstResource(); # temp resource to access constants # Header - my $title = $showPoints ? "Quick Points Display" : "Quick Completed Problems Display"; + my $title = $showPoints ? "Points Display" : "Completed Problems Display"; $r->print(&Apache::loncommon::bodytag($title, '', '')); - if (!$showPoints) { + if (!$showPoints && !$notshowSPRSlink ) { $r->print(<This screen shows how many problems (or problem parts) you have completed, and how many you have not yet done. You can also look at a detailed @@ -148,8 +150,11 @@ HEADER # it's an "attempted" point if ($curRes->problemstatus($part) eq 'no' && ($dateStatus != $curRes->ANSWER_OPEN)) { - $partsAttempted += $curRes->weight($part); - $totalAttempted += $partsAttempted; + my $status = $curRes->simpleStatus($part); + if ($status == $curRes->ATTEMPTED) { + $partsAttempted += $curRes->weight($part); + $totalAttempted += $partsAttempted; + } } else { $score = $curRes->weight($part) * $curRes->awarded($part); } @@ -165,8 +170,7 @@ HEADER my $status = $curRes->simpleStatus($part); my $thisright = 0; $partsCount++; - if ($status == $curRes->CORRECT || - $status == $curRes->INCORRECT ) { + if ($status == $curRes->CORRECT ) { $partsRight++; $totalRight++; $thisright = 1; @@ -281,8 +285,6 @@ HEADER $r->print(""); - $navmap->untieHashes(); - return OK; }