';
- $Ptr .= 'Select Map '."\n";
- $Ptr .= ''."\n";
+=item ¤t_student()
- my $selected = 0;
- foreach my $sequence (split(':',$cache->{'orderedSequences'})) {
- $Ptr .= '{$page.'Map'} eq $cache->{$sequence.':title'}) {
- $Ptr .= ' selected';
- $selected = 1;
- }
- $Ptr .= '>'.$cache->{$sequence.':title'}.' '."\n";
- }
- $Ptr .= '';
- $Ptr .= 'Select Student '."\n";
- $Ptr .= ''."\n";
+=pod
- my $selected=0;
- foreach (@$students) {
- my ($name) = split(':',$_);
- $Ptr .= ''."\n";
- }
+=item &previous_student()
- $Ptr .= ' {$name.':error'} =~ /course/) {
- my ($username)=split(':',$name);
- $Str .= 'No course data for student ';
- $Str .= ''.$username.'. ';
- return $Str;
- }
+#######################################################
+#######################################################
- $Str .= " \# Set Title ";
- $Str .= ' Results Tries '."\n";
-
- my $codes;
- my $attempts;
- foreach my $sequence (split(':', $cache->{'orderedSequences'})) {
- if($cache->{'StudentAssessmentMap'} ne 'All Maps' &&
- $cache->{'StudentAssessmentMap'} ne $cache->{$sequence.':title'}) {
- next;
- }
+=pod
- $Str .= ''.$sequence.' ';
- $Str .= ''.$cache->{$sequence.':title'}.' ';
+=item &next_student()
- $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;
- }
+Returns a pointer to a hash containing data about the next student
+to be viewed.
- 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'}='-';
- }
+=cut
- # 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;
- }
+#######################################################
+#######################################################
+sub next_student {
+ return $next_student;
+}
- 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;
- }
- }
+=pod
- # 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'}.',';
- }
- }
- $codes =~ s/,$//;
- $attempts =~ s/,$//;
- $Str .= ''.$codes.' ';
- $Str .= ''.$attempts.' ';
- $Str .= ' '."\n";
- }
+=item &clear_sequence_variables()
- $Str .= '
'."\n";
+=cut
- return $Str;
+#######################################################
+#######################################################
+sub clear_sequence_variables {
+ undef($top_map);
+ undef(@Sequences);
+ undef(@Assessments);
}
-#---- END Student Assessment Web Page ----------------------------------------
+#######################################################
+#######################################################
-#---- Menu Web Page ----------------------------------------------------------
+=pod
-sub Title {
- my ($downloadTime)=@_;
+=item &SetSelectedMaps($elementname)
- my $Ptr = '';
+Sets the @SelectedMaps array from $ENV{'form.'.$elementname};
- $Ptr .= 'LON-CAPA Statistics '."\n";
- $Ptr .= ''."\n";
- $Ptr .= ''."\n";
- $Ptr .= ' '."\n";
- $Ptr .= ' Course : "';
- $Ptr .= $ENV{'course.'.$ENV{'request.course.id'}.'.description'};
- $Ptr .= '" '."\n";
- $Ptr .= ''.$downloadTime.' ';
+=cut
- return $Ptr;
+#######################################################
+#######################################################
+sub SetSelectedMaps {
+ my $elementname = shift;
+ if (exists($ENV{'form.'.$elementname})) {
+ if (ref($ENV{'form.'.$elementname})) {
+ @SelectedMaps = @{$ENV{'form.'.$elementname}};
+ } else {
+ @SelectedMaps = ($ENV{'form.'.$elementname});
+ }
+ } else {
+ @SelectedMaps = ('all');
+ }
}
-sub CreateMenuForm {
- my ($cache)=@_;
- my $Ptr = '';
- $Ptr .= ' {'OptionResponses'})) {
- $Ptr .= ' {'symb'} ne $map_symb && $map_symb ne 'all');
+ next if ($sequence->{'num_assess'} < 1);
+ push (@Sequences_to_Show,$sequence);
+ }
+ }
+ return @Sequences_to_Show;
}
-#---- END Menu Web Page ------------------------------------------------------
+#######################################################
+#######################################################
+
+=pod
-#---- HELPER FUNCTIONS -------------------------------------------------------
+=item &PrepareCourseData($r)
-sub CheckFormElement {
- my ($cache, $ENVName, $cacheName, $default)=@_;
+=cut
- if(defined($ENV{'form.'.$ENVName})) {
- $cache->{$cacheName} = $ENV{'form.'.$ENVName};
- } elsif(!defined($cache->{$cacheName})) {
- $cache->{$cacheName} = $default;
+#######################################################
+#######################################################
+sub PrepareCourseData {
+ my ($r) = @_;
+ &clear_sequence_variables();
+ my ($top,$sequences,$assessments) =
+ &Apache::loncoursedata::get_sequence_assessment_data();
+ if (! defined($top) || ! ref($top)) {
+ # There has been an error, better report it
+ &Apache::lonnet::logthis('top is undefined');
+ return;
+ }
+ $top_map = $top if (ref($top));
+ @Sequences = @{$sequences} if (ref($sequences) eq 'ARRAY');
+ @Assessments = @{$assessments} if (ref($assessments) eq 'ARRAY');
+ #
+ # Compute column widths
+ foreach my $seq (@Sequences) {
+ my $name_length = length($seq->{'title'});
+ my $num_parts = $seq->{'num_assess_parts'};
+ #
+ # Use 3 digits for each the sum and total, which means 7 total...
+ my $num_col = $num_parts+7;
+ if ($num_col < $name_length) {
+ $num_col = $name_length;
+ }
+ $seq->{'base_width'} = $name_length;
+ $seq->{'width'} = $num_col;
}
-
return;
}
-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';
- }
+=pod
+
+=item &log_sequence($sequence,$recursive,$padding)
- &CheckFormElement(\%cache, 'Status', 'Status', 'Active');
+Write data about the sequence to a logfile. If $recursive is not
+undef the data is written recursively. $padding is used for recursive
+calls.
- 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;
+=cut
- &CheckFormElement(\%cache, 'Interval', 'Interval', '1');
+#######################################################
+#######################################################
+sub log_sequence {
+ my ($seq,$recursive,$padding) = @_;
+ $padding = '' if (! defined($padding));
+ if (ref($seq) ne 'HASH') {
+ &Apache::lonnet::logthis('log_sequence passed bad sequnce');
+ return;
+ }
+ &Apache::lonnet::logthis($padding.'sequence '.$seq->{'title'});
+ while (my($key,$value) = each(%$seq)) {
+ next if ($key eq 'contents');
+ if (ref($value) eq 'ARRAY') {
+ for (my $i=0;$i< scalar(@$value);$i++) {
+ &Apache::lonnet::logthis($padding.$key.'['.$i.']='.
+ $value->[$i]);
}
+ } else {
+ &Apache::lonnet::logthis($padding.$key.'='.$value);
}
}
-
+ if (defined($recursive)) {
+ &Apache::lonnet::logthis($padding.'-'x20);
+ &Apache::lonnet::logthis($padding.'contains:');
+ foreach my $item (@{$seq->{'contents'}}) {
+ if ($item->{'type'} eq 'container') {
+ &log_sequence($item,$recursive,$padding.' ');
+ } else {
+ &Apache::lonnet::logthis($padding.'title = '.$item->{'title'});
+ while (my($key,$value) = each(%$item)) {
+ next if ($key eq 'title');
+ if (ref($value) eq 'ARRAY') {
+ for (my $i=0;$i< scalar(@$value);$i++) {
+ &Apache::lonnet::logthis($padding.$key.'['.$i.']='.
+ $value->[$i]);
+ }
+ } else {
+ &Apache::lonnet::logthis($padding.$key.'='.$value);
+ }
+ }
+ }
+ }
+ &Apache::lonnet::logthis($padding.'end contents of '.$seq->{'title'});
+ &Apache::lonnet::logthis($padding.'-'x20);
+ }
return;
}
-=pod
+##############################################
+##############################################
-=item &SortStudents()
+=pod
-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.
-
-=over 4
+=item &StudentDataSelect($elementname,$status,$numvisible,$selected)
-Input: $students, $CacheData
+Returns html for a selection box allowing the user to choose one (or more)
+of the fields of student data available (fullname, username, id, section, etc)
-$students: A array pointer to a list of students (username:domain)
+=over 4
-$CacheData: A pointer to the hash tied to the cached data
+=item $elementname The name of the HTML form element
-Output: \@order
+=item $status 'multiple' or 'single' selection box
-@order: An ordered list of students (username:domain)
+=item $numvisible The number of options to be visible
=back
=cut
-sub SortStudents {
- my ($students,$cache)=@_;
-
- 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; $index{$sorted1Students[$index].':fullname'}}=
- $sorted1Students[$index];
- }
- } elsif($Pos eq 'Section') {
- for(my $index=0; $index{$sorted1Students[$index].':section'}.
- $sorted1Students[$index]}=$sorted1Students[$index];
- }
- } else {
- # Sort by user name
- for(my $index=0; $index'."\n";
+ #
+ # Deal with 'all'
+ $Str .= ' \n";
+ }
+ $Str .= "\n";
+ return $Str;
}
-sub PrepareData {
- my ($c, $cacheDB)=@_;
+##############################################
+##############################################
- # Test for access to the cache data
- my $isCached=0;
- my $courseID=$ENV{'request.course.id'};
- my $isRecalculate=0;
- if(defined($ENV{'form.ProblemStatisticsRecalculate'}) ||
- defined($ENV{'form.ChartRecalculate'})) {
- $isRecalculate=1;
- }
+=pod
- $isRecalculate=1;
+=item &MapSelect($elementname,$status,$numvisible,$restriction)
- $isCached=&Apache::loncoursedata::TestCacheData($cacheDB, $isRecalculate);
- if($isCached < 0) {
- return "Unable to tie hash to db file.";
- }
- &ProcessFormData($cacheDB, $isCached);
+Returns html for a selection box allowing the user to choose one (or more)
+of the sequences in the course. The values of the sequences are the symbs.
+If the top sequence is selected, the value 'top' will result.
- # Download class list information if not using cached data
- my %cache;
- my @students=();
- if(!$isCached) {
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_WRCREAT,0640)) {
- return "Unable to tie hash to db file.";
- }
+=over 4
- my $processTopResourceMapReturn=
- &Apache::loncoursedata::ProcessTopResourceMap(\%cache, $c);
- if($processTopResourceMapReturn ne 'OK') {
- untie(%cache);
- return $processTopResourceMapReturn;
- }
+=item $elementname The name of the HTML form element
- if($c->aborted()) {
- untie(%cache);
- return 'aborted';
- }
+=item $status 'multiple' or 'single' selection box
- my $classlist=&Apache::loncoursedata::DownloadStudentNamePIDSection(
- $courseID,
- $c);
- my ($checkForError)=keys(%$classlist);
- if($checkForError =~ /^(con_lost|error|no_such_host)/i ||
- defined($classlist->{'error'})) {
- untie(%cache);
- return "Error getting student data.";
- }
+=item $numvisible The number of options to be visible
- if($c->aborted()) {
- untie(%cache);
- return 'aborted';
- }
+=item $restriction Code reference to subroutine which returns true or
+false. The code must expect a reference to a sequence data structure.
- # Active is a temporary solution, remember to change
- @students=&Apache::loncoursedata::ProcessClassList(\%cache,
- $classlist,
- $courseID,
- 'Active', $c);
+=back
- if($c->aborted()) {
- untie(%cache);
- return 'aborted';
- }
+=cut
- untie(%cache);
- } else {
- if(!$c->aborted() && tie(%cache,'GDBM_File',$cacheDB,
- &GDBM_READER,0640)) {
- @students=split(/:::/,$cache{'NamesOfStudents'});
- } else {
- return 'aborted';
+##############################################
+##############################################
+sub MapSelect {
+ my ($elementname,$status,$numvisible,$restriction)=@_;
+ if ($numvisible < 1) {
+ return;
+ }
+ #
+ # Set up array of selected items
+ &SetSelectedMaps($elementname);
+ #
+ # Set up the restriction call
+ if (! defined($restriction)) {
+ $restriction = sub { 1; };
+ }
+ #
+ # Build the form element
+ my $Str = "\n";
+ $Str .= ''."\n";
+ #
+ # Deal with 'all'
+ foreach (@SelectedMaps) {
+ if ($_ eq 'all') {
+ @SelectedMaps = ('all');
+ last;
}
}
-
- return ('OK', $isCached, \@students);
+ #
+ # Put in option for 'all'
+ $Str .= ' ($seq));
+ $Str .= ' {'symb'} eq $_) {
+ $Str .= 'selected ';
+ last;
+ }
+ }
+ $Str .= '>'.$seq->{'title'}." \n";
+ }
+ $Str .= " \n";
+ return $Str;
}
-# Create progress
-sub Create_PrgWin {
- $r->print(<
- popwin=open('','popwin','width=400,height=100');
- popwin.document.writeln(''+
- 'LON-CAPA Statistics '+
- 'Computation Progress '+
- ''+
- '');
- popwin.document.close();
-
-ENDPOP
+##############################################
+##############################################
- $r->rflush();
-}
+=pod
-# update progress
-sub Update_PrgWin {
- my ($totalStudents,$index,$name)=@_;
- $r->print('');
- $r->rflush();
-}
+=item &SectionSelect($elementname,$status,$numvisible)
-# close Progress Line
-sub Close_PrgWin {
- $r->print('');
- $r->rflush();
-}
-
-# 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";
- }
+Returns html for a selection box allowing the user to choose one (or more)
+of the sections in the course.
- return;
-}
+Uses the package variables @Sections and @SelectedSections
+=over 4
-sub initial {
- undef %hash;
- undef %CachData;
- undef %GraphDat;
- undef %ConceptData;
- undef $GData;
-}
-
-#---- END HELPER FUNCTIONS ---------------------------------------------------
-
-sub BuildProblemStatisticsPage {
- my ($cacheDB, $students)=@_;
-
- my %cache;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- $r->print('Unable to tie database.');
- return;
- }
+=item $elementname The name of the HTML form element
- my $Ptr = '';
- $Ptr .= '
');
-
- $r->print(&ProblemStatisticsLegend());
-
-# my $discriminantFactor;
-# my @list=();
-# foreach (@$students) {
-# ($discriminantFactor, $list) = &ExtractStudentData(\%cache, $_,
-# \@list);
-# }
-
-# my ($upper, $lower) = &Discriminant($discriminantFactor);
-# my %Header = (0,"Homework Sets Order",1,"#Stdnts",2,"Tries",3,"Mod",
-# 4,"Mean",5,"#YES",6,"#yes",7,"%Wrng",8,"DoDiff",
-# 9,"S.D.",10,"Skew.",11,"D.F.1st",12,"D.F.2nd", 13, "Disc.");
-# &BuildStatisticsTable(\%cache, $discriminantFactor, \@list, \%Header,
-# $students);
+=item $status 'multiple' or 'single' selection box
- $r->print('');
+=item $numvisible The number of options to be visible
- untie(%cache);
+=back
- return;
+=cut
+
+##############################################
+##############################################
+sub SectionSelect {
+ my ($elementname,$status,$numvisible)=@_;
+ if ($numvisible < 1) {
+ return;
+ }
+ #
+ # Make sure we have the data we need to continue
+ if (! @Sections) {
+ &PrepareClasslist()
+ }
+ #
+ # Build the form element
+ my $Str = "\n";
+ $Str .= ''."\n";
+ #
+ # Loop through the sequences
+ foreach my $s (@Sections) {
+ $Str .= ' \n";
+ }
+ $Str .= " \n";
+ return $Str;
}
-sub BuildDiffGraph {
- my ($courseID)=@_;
+#######################################################
+#######################################################
- my $graphData = &GetGraphData('DiffGraph', $courseID);
- $r->print(' ');
+=pod
- return;
-}
+=item &CreateAndParseOutputSelector()
-sub BuildWrongGraph {
- my ($courseID)=@_;
+Construct a selection list of options for output and parse output selections.
- my $graphData = &GetGraphData('WrongGraph', $courseID);
- $r->print(' ');
+=cut
- return;
+#######################################################
+#######################################################
+sub OutputDescriptions {
+ my (@OutputOptions) = @_;
+ my $Str = '';
+ $Str .= "Output Modes \n";
+ $Str .= "\n";
+ foreach my $outputmode (@OutputOptions) {
+ $Str .=" ".$outputmode->{'name'}." \n";
+ $Str .=" ".$outputmode->{'description'}." \n";
+ }
+ $Str .= " \n";
+ return $Str;
}
-sub BuildAnalyzePage {
- my ($cacheDB, $students, $courseID)=@_;
-
- my %cache;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- $r->print('Unable to tie database.');
- return;
+sub CreateAndParseOutputSelector {
+ my ($elementname,$default,@OutputOptions) = @_;
+ my $output_mode;
+ my $show;
+ my $Str = '';
+ #
+ # Format for output options is 'mode, restrictions';
+ my $selected = $default;
+ if (exists($ENV{'form.'.$elementname})) {
+ if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) {
+ $selected = $ENV{'form.'.$elementname}->[0];
+ } else {
+ $selected = $ENV{'form.'.$elementname};
+ }
+ }
+ #
+ # Set package variables describing output mode
+ $output_mode = 'html';
+ $show = 'all';
+ foreach my $option (@OutputOptions) {
+ next if ($option->{'value'} ne $selected);
+ $output_mode = $option->{'mode'};
+ $show = $option->{'show'};
+ }
+ #
+ # Build the form element
+ $Str = qq//;
+ foreach my $option (@OutputOptions) {
+ if (exists($option->{'special'}) &&
+ $option->{'special'} =~ /do not show/) {
+ next;
+ }
+ $Str .= "\n".' {'value'} eq $selected);
+ $Str .= ">".&mt($option->{'name'})."<\/option>";
}
+ $Str .= "\n ";
+ return ($Str,$output_mode,$show);
+}
- &ShowOpGraph(\%cache, $students, $courseID);
+###############################################
+###############################################
- untie(%cache);
+=pod
- return;
-}
+=item &Gather_Student_Data()
-sub BuildProblemAnalysisPage {
- my ($cacheDB)=@_;
+Ensures all student data is up to date.
- my %cache;
- unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER,0640)) {
- $r->print('Unable to tie database.');
- return;
+=cut
+
+###############################################
+###############################################
+sub Gather_Student_Data {
+ my ($r) = @_;
+ my $c = $r->connection();
+ #
+ &Apache::loncoursedata::clear_internal_caches();
+ #
+ my @Sequences = &Apache::lonstatistics::Sequences_with_Assess();
+ #
+ my @Students = @Apache::lonstatistics::Students;
+ #
+ # Open the progress window
+ my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin
+ ($r,'Statistics Compilation Status',
+ 'Statistics Compilation Progress', scalar(@Students));
+ #
+ while (my $student = shift @Students) {
+ return if ($c->aborted());
+ my ($status,undef) = &Apache::loncoursedata::ensure_current_data
+ ($student->{'username'},$student->{'domain'},
+ $ENV{'request.course.id'});
+ &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,
+ &mt('last student'));
}
+ &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state);
+ $r->rflush();
+}
- $r->print(''."\n");
+###############################################
+###############################################
- untie(%cache);
+=pod
- return;
-}
-
-sub BuildStudentAssessmentPage {
- my ($cacheDB, $students, $courseID)=@_;
+=item &Gather_Full_Student_Data()
- my %cache;
+Ensures all student data is up to date.
- my $Ptr = '';
- $Ptr .= '