--- loncom/interface/lonquickgrades.pm 2010/12/02 00:53:37 1.52 +++ 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.52 2010/12/02 00:53:37 www Exp $ +# $Id: lonquickgrades.pm,v 1.53 2010/12/03 15:19:09 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -93,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 @@ -334,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");