--- loncom/interface/loncoursedata.pm 2004/05/13 13:55:35 1.133 +++ loncom/interface/loncoursedata.pm 2004/06/15 14:12:56 1.135 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.133 2004/05/13 13:55:35 matthew Exp $ +# $Id: loncoursedata.pm,v 1.135 2004/06/15 14:12:56 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -199,6 +199,7 @@ sub get_sequence_assessment_data { my @Ids = $curRes->responseIds($part); $partdata{$part}->{'ResponseTypes'}= \@Responses; $partdata{$part}->{'ResponseIds'} = \@Ids; + $partdata{$part}->{'Survey'} = $curRes->is_survey($part); # Count how many responses of each type there are in this part foreach (@Responses) { $partdata{$part}->{$_}++; @@ -547,12 +548,14 @@ store student data. ################################################ ################################################ sub init_dbs { - my $courseid = shift; + my ($courseid,$drop) = @_; &setup_table_names($courseid); # # Drop any of the existing tables - foreach my $table (@Tables) { - &Apache::lonmysql::drop_table($table); + if ($drop) { + foreach my $table (@Tables) { + &Apache::lonmysql::drop_table($table); + } } # # Note - changes to this table must be reflected in the code that @@ -1081,6 +1084,7 @@ sub populate_student_table { } # &setup_table_names($courseid); + &init_dbs($courseid,0); my $dbh = &Apache::lonmysql::get_dbh(); my $request = 'INSERT IGNORE INTO '.$student_table. "(student,section,status) VALUES "; @@ -1594,7 +1598,7 @@ sub ensure_tables_are_set_up { !$found_performance || !$found_parameters || !$found_fulldump_part || !$found_fulldump_response || !$found_fulldump_timestamp || !$found_weight ) { - if (&init_dbs($courseid)) { + if (&init_dbs($courseid,1)) { return 'error'; } }