--- loncom/interface/lonquickgrades.pm 2011/06/03 00:04:47 1.99 +++ loncom/interface/lonquickgrades.pm 2011/06/04 19:49:28 1.101 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Quick Student Grades Display # -# $Id: lonquickgrades.pm,v 1.99 2011/06/03 00:04:47 www Exp $ +# $Id: lonquickgrades.pm,v 1.101 2011/06/04 19:49:28 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -35,6 +35,8 @@ use Apache::loncommon; use Apache::lonlocal; use Apache::lonnet; use Apache::grades; +use Apache::loncoursedata; +use Apache::lonstudentassessment; sub handler { my $r = shift; @@ -89,6 +91,39 @@ sub real_handler { my $udom; my $stdid; if ($cangrade) { + $r->print("

".&mt("Download Multiple")."

". + ''."\n". + ''. + ''. + ''. + ''. + ''. + ''."\n". + ''."\n". + '
'.&mt('Sections').''. + &Apache::loncommon::help_open_topic("Chart_Sections"). + ''.&mt('Groups').''. + ''.&mt('Student Data').''. + &Apache::loncommon::help_open_topic("Chart_Student_Data"). + ''.&mt('Access Status').''. + &Apache::loncommon::help_open_topic("Chart_Enrollment_Status"). + ''.&mt('Output Format').''. + &Apache::loncommon::help_open_topic("Chart_Output_Formats"). + ' 
'."\n". + &Apache::lonstatistics::SectionSelect('Section','multiple',5). + ''. + &Apache::lonstatistics::GroupSelect('Group','multiple',5). + ''. + &Apache::lonstatistics::StudentDataSelect('StudentData','multiple',5,undef). + ''."\n". + &Apache::lonhtmlcommon::StatusOptions(undef,undef,5). + ''."\n". + &Apache::lonstudentassessment::CreateAndParseOutputSelector(). + ''. + ''. + '
'."\n" + ); + $r->print("

".&mt("Display Individual")."

"); if ($env{'form.uname'}) { $uname=$env{'form.uname'}; } if ($env{'form.udom'}) { $udom=$env{'form.udom'}; } if ($env{'form.id'}) { $stdid=$env{'form.id'}; } @@ -106,8 +141,8 @@ sub real_handler { $r->print(&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]' ,'' ,' ' - ,$chooseopt).'
'. - '

'); + ,$chooseopt). + '  

'); if (($uname) && ($udom)) { $r->print('

'.&mt('Full Name: [_1]',&Apache::loncommon::plainname($uname,$udom)).'

'); } @@ -125,7 +160,6 @@ sub real_handler { $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted); } if ($cangrade) { $r->print("\n\n"); } - &endGradeScreen($r); return OK; @@ -141,9 +175,22 @@ sub getStudentCatGrade { sub getAllStudentData { my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my %categories=&Apache::lonnet::dump('grading_categories',$cdom,$cnum); -#FIXME: debugging output - return &getStudentCatGrade('korte','gerd',%categories); + + my $classlist = &Apache::loncoursedata::get_classlist(); + + my $statusidx = &Apache::loncoursedata::CL_STATUS(); + my $usernameidx = &Apache::loncoursedata::CL_SNAME(); + my $domainidx = &Apache::loncoursedata::CL_SDOM(); + my $fullnameidx = &Apache::loncoursedata::CL_FULLNAME(); + + foreach my $key (keys(%{$classlist})) { + my $student = $classlist->{$key}; + my $perc=&getStudentCatGrade($classlist->{$student}->[$usernameidx], + $classlist->{$student}->[$domainidx], + %categories); + } }