--- loncom/interface/statistics/lonstathelpers.pm 2004/12/02 21:53:33 1.32 +++ loncom/interface/statistics/lonstathelpers.pm 2005/02/22 22:56:32 1.37 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstathelpers.pm,v 1.32 2004/12/02 21:53:33 matthew Exp $ +# $Id: lonstathelpers.pm,v 1.37 2005/02/22 22:56:32 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -86,7 +86,7 @@ sub render_resource { ($base,undef) = ($resource->{'src'} =~ m|(.*/)[^/]*$|); $base = "http://".$ENV{'SERVER_NAME'}.$base; my $rendered_problem = - &Apache::lonnet::ssi_body($resource->{'src'}); + &Apache::lonnet::ssi_body($resource->{'src'}.'?symb='.&Apache::lonnet::escape($resource->{'symb'})); $rendered_problem =~ s/<\s*form\s*/)|<\/nop>|g; return '\n"; $rb_count++; } @@ -280,16 +282,6 @@ END return $Str; } -sub get_title { - my ($title,$src) = @_; - if ($title eq '') { - ($title) = ($src =~ m|/([^/]+)$|); - } else { - $title =~ s/\:/:/g; - } - return $title; -} - sub new_accumulator { my ($title,$src,$symb,$seq_id,$inputname) = @_; my $target; @@ -308,7 +300,8 @@ sub new_accumulator { 'value="'.&Apache::lonnet::escape($res->symb).'" />'. ' '.$res->compTitle.''. (' 'x2).'view'. + 'href="'.$res->src.'?symb='. + &Apache::lonnet::escape($res->{'symb'}).'">view'. ''.$/; } else { if (defined($target)) { @@ -1338,9 +1331,7 @@ sub manage_caches { if (defined($update_message)) { $r->print($update_message); } - &Apache::lonstatistics::Gather_Full_Student_Data($r,$formname, - $inputname); - + &gather_full_student_data($r,$formname,$inputname); } # my @Buttons = @@ -1362,7 +1353,38 @@ sub manage_caches { return @Buttons; } - +sub gather_full_student_data { + my ($r,$formname,$inputname) = @_; + my $status_type; + if (defined($formname)) { + $status_type = 'inline'; + } else { + $status_type = 'popup'; + } + my $c = $r->connection(); + # + &Apache::loncoursedata::clear_internal_caches(); + # + my @Students = @Apache::lonstatistics::Students; + # + # Open the progress window + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin + ($r,&mt('Student Data Compilation Status'), + &mt('Student Data Compilation Progress'), scalar(@Students), + $status_type,undef,$formname,$inputname); + # + while (my $student = shift @Students) { + return if ($c->aborted()); + my $status = &Apache::loncoursedata::ensure_current_full_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(); + return; +} ####################################################
'. @@ -149,8 +149,10 @@ sub ProblemSelector { if (scalar(@{$partdata->{'ResponseIds'}}) > 1) { $seq_str .= &mt('response').' '.$respid; } + my $link = $res->{'src'}.'?symb='. + &Apache::lonnet::escape($res->{'symb'}); $seq_str .= (' 'x2). - qq{view}; + qq{view}; $seq_str .= "