# | '. - "\n".'Concept | '. - "\n".'Correct | '. - "\n".'Wrong | '. - "\n".'
---|---|---|---|
".($n+1)." | ". - "\n".''.$Concepts[$n]." | ". - "\n".''.$data1[$n]." | ". - "\n".''.$data2[$n]." | ". - "\n"."From:['.localtime($ConceptData{'Int.'.$k}). - '] To: ['.localtime($ConceptData{'Int.'.($k+1)}-1). - "] | $Correct | $Wrong | "; - - $Str .= "\n".'
P# | '."\n"; - for(my $nIndex=0; $nIndex < (scalar (keys %$headings)); $nIndex++) { - $Result .= ''.''.' | '."\n"; +sub get_students { + if (! @Students) { + &PrepareClasslist() } - $Result .= "\n".'
---|
\# | Problem Title | "; - $Str .= 'Resource | Analysis |
---|---|---|---|
'.$number.' | '; - $Str .= ''.$Temp.' | '; - $Str .= ''.$uri.' | '; - $Str .= '
\# | Set Title | "; - $Str .= 'Results | Tries | ||||||
---|---|---|---|---|---|---|---|---|---|
'.$sequence.' | '; - $Str .= ''.$cache->{$sequence.':title'}.' | '; - - $codes = ''; - $attempts = ''; - foreach my $problemID (split(':', $cache->{$sequence.':problems'})) { - my $problem = $cache->{$problemID.':problem'}; - my $LatestVersion = $cache->{$name.':version:'.$problem}; - - # Output dashes for all the parts of this problem if there - # is no version information about the current problem. - if(!$LatestVersion) { - foreach my $part (split(/\:/,$cache->{$sequence.':'. - $problemID. - ':parts'})) { - $codes .= "-,"; - $attempts .= "0,"; - } - next; - } - - my %partData=undef; - # Initialize part data, display skips correctly - # Skip refers to when a student made no submissions on that - # part/problem. - foreach my $part (split(/\:/,$cache->{$sequence.':'. - $problemID. - ':parts'})) { - $partData{$part.':tries'}=0; - $partData{$part.':code'}='-'; - } - # Looping through all the versions of each part, starting with the - # oldest version. Basically, it gets the most recent - # set of grade data for each part. - for(my $Version=1; $Version<=$LatestVersion; $Version++) { - foreach my $part (split(/\:/,$cache->{$sequence.':'. - $problemID. - ':parts'})) { - - if(!defined($cache->{$name.":$Version:$problem". - ":resource.$part.solved"})) { - # No grade for this submission, so skip - next; - } - my $tries=0; - my $code='U'; - $tries = $cache->{$name.":$Version:$problem". - ":resource.$part.tries"}; - $partData{$part.':tries'}=($tries) ? $tries : 0; - - my $val = $cache->{$name.":$Version:$problem". - ":resource.$part.solved"}; - if ($val eq 'correct_by_student') {$code = 'Y';} - elsif ($val eq 'correct_by_override') {$code = 'y';} - elsif ($val eq 'incorrect_attempted') {$code = 'N';} - elsif ($val eq 'incorrect_by_override'){$code = 'N';} - elsif ($val eq 'excused') {$code = 'x';} - $partData{$part.':code'}=$code; - } +sub DisplayClasslist { + my ($r)=@_; + &Apache::lonhtmlcommon::add_breadcrumb + ({text=>'Select One Student'}); + # + # Output some of the standard interface components + my $Str; + $Str .= &Apache::lonhtmlcommon::breadcrumbs('Select One Student'); + $Str .= '
'.&mt('Sections').' | '; + $Str .= ''.&mt('Groups').' | '; + $Str .= ''.&mt('Access Status').' | '; + $Str .= '
---|---|---|
'. + &Apache::lonstatistics::SectionSelect('Section','multiple',5). + ' | '; + $Str .= ''. + &Apache::lonstatistics::GroupSelect('Group','multiple',5). + ' | '; + $Str .= ''. + &Apache::lonhtmlcommon::StatusOptions(undef,undef,5). + ' | '; + + $Str .= '
'. + &mt('There are no currently enrolled students in the course.'). + '
'; + } elsif (lc($env{'form.Status'}) eq 'expired') { + $Str .= ''. + &mt('There are no previously enrolled students in the course.'). + '
'; + } elsif (lc($env{'form.Status'}) eq 'future') { + $Str .= ''. + &mt('There are no students with future access in the course.'). + '
'; + } else { # 'any' and any others + $Str .= ''. + &mt('There are no students in the course.'). + '
'; } - - # Loop through all the parts for the current problem in the - # correct order and prepare the output - foreach (split(/\:/,$cache->{$sequence.':'.$problemID. - ':parts'})) { - $codes .= $partData{$_.':code'}.','; - $attempts .= $partData{$_.':tries'}.','; + } else { + if (lc($env{'form.Status'}) eq 'active') { + $Str .= ''. + &mt('There are no currently enrolled students in the selected sections.'). + '
'; + } elsif (lc($env{'form.Status'}) eq 'expired') { + $Str .= ''. + &mt('There are no previously enrolled students in the selected sections.'). + '
'; + } elsif (lc($env{'form.Status'}) eq 'future') { + $Str .= ''. + &mt('There are no students with future access in the selected sections.'). + '
'; + } else { # 'any' and any others + $Str .= ''. + &mt('There are no students in the selected sections.'). + '
'; } } - $codes =~ s/,$//; - $attempts =~ s/,$//; - $Str .= '' + .'' + .&mt('Return to the chart').'' + .'
'; + $r->print($Str); + $r->rflush(); + return; } - $Str .= ''.&mt("Click on a student's name or username to view their chart").'
' + .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row(); + foreach my $field (@Fields) { + $Str .= '' + .&mt('Please notify the server administrator [_1]', + ,''.$serveradmin.'') + .'
'); + $r->print(''. + &mt('Course Statistics and Charts cannot be '. + 'retrieved until the database is restarted. '. + 'Your data is intact but cannot be displayed '. + 'at this time.').'
'); + $r->print(&Apache::loncommon::end_page()); + return; + } + # + # Clean out the caches + if (exists($env{'form.ClearCache'})) { + &Apache::loncoursedata::delete_caches($env{'requres.course.id'}); + } + # + # Begin form output + $r->print('\n"); + } + $r->print(&Apache::loncommon::end_page()); + $r->rflush(); + # + return OK; } -sub CreateMenuForm { - my ($cache)=@_; - my $Ptr = '{'OptionResponses'})) { - $Ptr .= ' |
{$cacheName} = $ENV{'form.'.$ENVName};
- } elsif(!defined($cache->{$cacheName})) {
- $cache->{$cacheName} = $default;
- }
+Main handler for statistics and chart.
- return;
-}
+This is part of the LearningOnline Network with CAPA project
+described at http://www.lon-capa.org.
-sub ProcessFormData{
- my ($cacheDB, $isCached)=@_;
- my %cache;
-
- if(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) {
- # Select page to display
- if(defined($ENV{'form.ProblemStatistics'}) ||
- defined($ENV{'form.ProblemStatisticsRecalculate'}) ||
- defined($ENV{'form.DisplayCSVFormat'})) {
- $cache{'GoToPage'} = 'ProblemStatistics';
- &CheckFormElement(\%cache, 'DisplayCSVFormat',
- 'DisplayFormat', 'Display Table Format');
- &CheckFormElement(\%cache, 'Ascend','ProblemStatisticsAscend',
- 'Ascending');
- &CheckFormElement(\%cache, 'Maps', 'ProblemStatisticsMap',
- 'All Maps');
- } elsif(defined($ENV{'form.ProblemAnalysis'})) {
- $cache{'GoToPage'} = 'ProblemAnalysis';
- &CheckFormElement(\%cache, 'Interval', 'Interval', '1');
- } elsif(defined($ENV{'form.StudentAssessment'}) ||
- defined($ENV{'form.CreateStudentAssessment'}) ||
- defined($ENV{'form.NextStudent'}) ||
- defined($ENV{'form.PreviousStudent'})) {
- $cache{'GoToPage'} = 'StudentAssessment';
- if(defined($ENV{'form.NextStudent'})) {
- $cache{'StudentAssessmentMove'} = 'next';
- } elsif(defined($ENV{'form.PreviousStudent'})) {
- $cache{'StudentAssessmentMove'} = 'previous';
- } else {
- $cache{'StudentAssessmentMove'} = 'selected';
- }
- &CheckFormElement(\%cache, 'Maps', 'StudentAssessmentMap',
- 'All Maps');
- &CheckFormElement(\%cache, 'Students', 'StudentAssessmentStudent',
- 'No Student Selected');
- } elsif(defined($ENV{'form.DoDiffGraph'})) {
- $cache{'GoToPage'} = 'DoDiffGraph';
- } elsif(defined($ENV{'form.PercentWrongGraph'})) {
- $cache{'GoToPage'} = 'PercentWrongGraph';
- } elsif(defined($ENV{'form.ActivityLog'})) {
- $cache{'GoToPage'} = 'ActivityLog';
- } else {
- $cache{'GoToPage'} = 'Menu';
- }
+=head1 PACKAGE VARIABLES
- &CheckFormElement(\%cache, 'Status', 'Status', 'Active');
+=over
- foreach (keys(%ENV)) {
- if(/form\.Analyze:::/) {
- $cache{'GoToPage'} = 'Analyze';
- my ($uri, $title, $part, $problem);
- (undef, $uri, $title, $part, $problem)=split(':::', $_);
- $cache{'AnalyzeURI'} = $uri;
- $cache{'AnalyzeTitle'} = $title;
- $cache{'AnalyzePart'} = $part;
- $cache{'AnalyzeProblem'} = $problem;
+=item @FullClasslist The full classlist
- &CheckFormElement(\%cache, 'Interval', 'Interval', '1');
- }
- }
- }
+=item @Students The students we are concerned with for this invocation
- return;
-}
+=item @Sections The sections available in this class
-=pod
+=item @Groups The groups available in the class
-=item &SortStudents()
+=item $curr_student The student currently being examined
-Determines which students to display and in which order. Which are
-displayed are determined by their status(active/expired). The order
-is determined by the sort button pressed (default to username). The
-type of sorting is username, lastname, or section.
+=item $prev_student The student previous in the classlist
-=over 4
+=item $next_student The student next in the classlist
-Input: $students, $CacheData
+=back
-$students: A array pointer to a list of students (username:domain)
+=head1 SUBROUTINES
-$CacheData: A pointer to the hash tied to the cached data
+=over
-Output: \@order
+=item &clear_classlist_variables()
-@order: An ordered list of students (username:domain)
+undef the following package variables:
-=back
+=over 4
-=cut
+=item * @FullClasslist
-sub SortStudents {
- my ($students,$cache)=@_;
+=item * @Students
- my @sorted1Students=();
- foreach (@$students) {
- push(@sorted1Students, $_);
- }
-# my ($end,$start)=split(/\:/,$cache->{$_.':date'});
-# my $active=1;
-# my $now=time;
-# my $Status=$cache->{'form.Status'};
-# $Status = ($Status) ? $Status : 'Active';
-# if((($end) && $now > $end) && (($Status eq 'Active'))) {
-# $active=0;
-# }
-# if(($Status eq 'Expired') && ($end == 0 || $now < $end)) {
-# $active=0;
-# }
-# if($active) {
-# push(@sorted1Students, $_);
-# }
-# }
-
- my $Pos = $cache->{'form.ChartSort'};
- my %sortData;
- if($Pos eq 'Last Name') {
- for(my $index=0; $indexComputation Progress'+ - ''+ - ''); - popwin.document.close(); - -ENDPOP +=item * %StudentData - $r->rflush(); -} +=item * @SelectedStudentData -# update progress -sub Update_PrgWin { - my ($totalStudents,$index,$name)=@_; - $r->print(''); - $r->rflush(); -} +=item * $curr_student -# close Progress Line -sub Close_PrgWin { - $r->print(''); - $r->rflush(); -} +=item * $prev_student -# For loading the colored table for display or un-colored for print -sub setbgcolor { - my $PrintTable=shift; - undef %color; - if ($PrintTable){ - $color{"gb"}="#FFFFFF"; - $color{"red"}="#FFFFFF"; - $color{"yellow"}="#FFFFFF"; - $color{"green"}="#FFFFFF"; - $color{"purple"}="#FFFFFF"; - } else { - $color{"gb"}="#DDFFFF"; - $color{"red"}="#FFDDDD"; - $color{"yellow"}="#EEFFCC"; - $color{"green"}="#DDFFDD"; - $color{"purple"}="#FFDDFF"; - } +=item * $next_student - return; -} +=back -sub initial { - undef %hash; - undef %CachData; - undef %GraphDat; - undef %ConceptData; - undef $Pos; - undef $GData; -} +$curr_student, $prev_student, and $next_student may not be defined, depending +upon the calling context. -#---- END HELPER FUNCTIONS --------------------------------------------------- +=item get_selected_sections() -sub BuildProblemStatisticsPage { - my ($cacheDB, $students)=@_; +Returns an array of the selected sections - my %cache; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) { - $r->print('Unable to tie database.'); - return; - } +=item get_selected_groups() + +Returns an array of the selected groups - my $Ptr = ''; - $Ptr .= ' |