version 1.132, 2004/04/30 14:36:52
|
version 1.135, 2004/06/15 14:12:56
|
Line 199 sub get_sequence_assessment_data {
|
Line 199 sub get_sequence_assessment_data {
|
my @Ids = $curRes->responseIds($part); |
my @Ids = $curRes->responseIds($part); |
$partdata{$part}->{'ResponseTypes'}= \@Responses; |
$partdata{$part}->{'ResponseTypes'}= \@Responses; |
$partdata{$part}->{'ResponseIds'} = \@Ids; |
$partdata{$part}->{'ResponseIds'} = \@Ids; |
|
$partdata{$part}->{'Survey'} = $curRes->is_survey($part); |
# Count how many responses of each type there are in this part |
# Count how many responses of each type there are in this part |
foreach (@Responses) { |
foreach (@Responses) { |
$partdata{$part}->{$_}++; |
$partdata{$part}->{$_}++; |
Line 547 store student data.
|
Line 548 store student data.
|
################################################ |
################################################ |
################################################ |
################################################ |
sub init_dbs { |
sub init_dbs { |
my $courseid = shift; |
my ($courseid,$drop) = @_; |
&setup_table_names($courseid); |
&setup_table_names($courseid); |
# |
# |
# Drop any of the existing tables |
# Drop any of the existing tables |
foreach my $table (@Tables) { |
if ($drop) { |
&Apache::lonmysql::drop_table($table); |
foreach my $table (@Tables) { |
|
&Apache::lonmysql::drop_table($table); |
|
} |
} |
} |
# |
# |
# Note - changes to this table must be reflected in the code that |
# Note - changes to this table must be reflected in the code that |
Line 1081 sub populate_student_table {
|
Line 1084 sub populate_student_table {
|
} |
} |
# |
# |
&setup_table_names($courseid); |
&setup_table_names($courseid); |
|
&init_dbs($courseid,0); |
my $dbh = &Apache::lonmysql::get_dbh(); |
my $dbh = &Apache::lonmysql::get_dbh(); |
my $request = 'INSERT IGNORE INTO '.$student_table. |
my $request = 'INSERT IGNORE INTO '.$student_table. |
"(student,section,status) VALUES "; |
"(student,section,status) VALUES "; |
Line 1594 sub ensure_tables_are_set_up {
|
Line 1598 sub ensure_tables_are_set_up {
|
!$found_performance || !$found_parameters || |
!$found_performance || !$found_parameters || |
!$found_fulldump_part || !$found_fulldump_response || |
!$found_fulldump_part || !$found_fulldump_response || |
!$found_fulldump_timestamp || !$found_weight ) { |
!$found_fulldump_timestamp || !$found_weight ) { |
if (&init_dbs($courseid)) { |
if (&init_dbs($courseid,1)) { |
return 'error'; |
return 'error'; |
} |
} |
} |
} |
Line 2030 sub get_problem_statistics {
|
Line 2034 sub get_problem_statistics {
|
} |
} |
my ($solved) = &execute_SQL_request($dbh,$request); |
my ($solved) = &execute_SQL_request($dbh,$request); |
# |
# |
|
$Solved -= $solved; |
|
# |
$num = 0 if (! defined($num)); |
$num = 0 if (! defined($num)); |
$tries = 0 if (! defined($tries)); |
$tries = 0 if (! defined($tries)); |
$max = 0 if (! defined($max)); |
$max = 0 if (! defined($max)); |
$min = 0 if (! defined($min)); |
$min = 0 if (! defined($min)); |
$STD = 0 if (! defined($STD)); |
$STD = 0 if (! defined($STD)); |
$Solved = 0 if (! defined($Solved)); |
$Solved = 0 if (! defined($Solved) || $Solved < 0); |
$solved = 0 if (! defined($solved)); |
$solved = 0 if (! defined($solved)); |
# |
# |
# Compute the more complicated statistics |
# Compute the more complicated statistics |