--- loncom/interface/lonquickgrades.pm 2010/11/29 22:37:26 1.51 +++ loncom/interface/lonquickgrades.pm 2010/12/03 15:19:09 1.53 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Quick Student Grades Display # -# $Id: lonquickgrades.pm,v 1.51 2010/11/29 22:37:26 www Exp $ +# $Id: lonquickgrades.pm,v 1.53 2010/12/03 15:19:09 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -79,6 +79,8 @@ sub real_handler { {'bread_crumbs' => $brcrum}) ); + $r->print(&Apache::lonhtmlcommon::coursepreflink(&mt('Grade display settings'),'grading')); + if (!$showPoints && !$notshowSPRSlink ) { $r->print('

' .&mt('This screen shows how many problems (or problem parts) you have completed' @@ -91,19 +93,32 @@ sub real_handler { $r->print('

'.&mt('This may take a few moments to display.').'

'); $r->rflush(); - my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=&getData($showPoints); - &outputTable($r,$showPoints,$notshowTotals, + + my $uname='korte'; + my $udom='gerd'; + + my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)= + &getData($showPoints,$uname,$udom); + + if ($showCategories) { + &outputCategories($r,$showPoints,$notshowTotals, $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted); + } else { + &outputTable($r,$showPoints,$notshowTotals, + $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted); + } return OK; } sub getData { - my ($showPoints)=@_; + my ($showPoints,$uname,$udom)=@_; + + &Apache::lonnet::logthis("About to call with $uname $udom"); # Create the nav map - my $navmap = Apache::lonnavmaps::navmap->new(); + my $navmap = Apache::lonnavmaps::navmap->new($uname,$udom); my $res = $navmap->firstResource(); # temp resource to access constants @@ -332,6 +347,16 @@ sub outputTable { } +# +# Outputting category-based grades. +# + +sub outputCategories { + + my ($r,$showPoints,$notshowTotals, + $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=@_; +} + # Pass this two refs to arrays for the start and end color, and a number # from 0 to 1 for how much of the latter you want to mix in. It will # return a string ready to show ("#FFC309");