--- loncom/interface/loncoursedata.pm 2003/04/18 19:05:30 1.69 +++ loncom/interface/loncoursedata.pm 2003/04/21 15:12:37 1.70 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.69 2003/04/18 19:05:30 matthew Exp $ +# $Id: loncoursedata.pm,v 1.70 2003/04/21 15:12:37 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -575,6 +575,36 @@ sub init_dbs { } ################################################ +################################################ + +=pod + +=item &delete_caches() + +=cut + +################################################ +################################################ +sub delete_caches { + my $courseid = shift; + $courseid = $ENV{'request.course.id'} if (! defined($courseid)); + # + &setup_table_names($courseid); + # + my $dbh = &Apache::lonmysql::get_dbh(); + foreach my $table ($symb_table,$part_table,$student_table, + $updatetime_table,$performance_table, + $parameters_table ){ + my $command = 'DROP TABLE '.$table.';'; + $dbh->do($command); + if ($dbh->err) { + &Apache::lonnet::logthis($command.' resulted in error: '.$dbh->errstr); + } + } + return; +} + +################################################ ################################################ =pod