version 1.89, 2003/09/26 18:31:31
|
version 1.94, 2003/09/30 15:35:56
|
Line 197 sub get_sequence_assessment_data {
|
Line 197 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; |
|
# Count how many responses of each type there are in this part |
|
foreach (@Responses) { |
|
$partdata{$part}->{$_}++; |
|
} |
} |
} |
my $assessment = { title => $title, |
my $assessment = { title => $title, |
src => $src, |
src => $src, |
Line 456 The response table holds data (documente
|
Line 460 The response table holds data (documente
|
associated with a particular response id which is stored when a student |
associated with a particular response id which is stored when a student |
attempts a problem. The following are the columns of the table, in order: |
attempts a problem. The following are the columns of the table, in order: |
'symb_id','part_id','response_id','student_id','transaction','tries', |
'symb_id','part_id','response_id','student_id','transaction','tries', |
'awarddetail', 'awarded','response_specific' (data particular to the response |
'awarddetail', 'response_specific' (data particular to the response |
type), 'response_specific_value', and 'submission (the text of the students |
type), 'response_specific_value', and 'submission (the text of the students |
submission). The primary key is based on the first five columns listed above. |
submission). The primary key is based on the first five columns listed above. |
|
|
Line 712 sub init_dbs {
|
Line 716 sub init_dbs {
|
restrictions => 'NOT NULL' }, |
restrictions => 'NOT NULL' }, |
{ name => 'awarddetail', |
{ name => 'awarddetail', |
type => 'TINYTEXT' }, |
type => 'TINYTEXT' }, |
{ name => 'awarded', |
|
type => 'TINYTEXT' }, |
|
# { name => 'message', |
# { name => 'message', |
# type => 'CHAR' }, |
# type => 'CHAR' }, |
{ name => 'response_specific', |
{ name => 'response_specific', |
Line 1157 sub update_full_student_data {
|
Line 1159 sub update_full_student_data {
|
next; |
next; |
} elsif ($parameter eq 'version') { |
} elsif ($parameter eq 'version') { |
next; |
next; |
} elsif ($parameter =~ /^resource\.(.*)\.(tries|award|awarded|previous|solved|awarddetail|submission)\s*$/){ |
} elsif ($parameter =~ /^resource\.(.*)\.(tries| |
|
award| |
|
awarded| |
|
previous| |
|
solved| |
|
awarddetail| |
|
submission| |
|
submissiongrading| |
|
molecule)\s*$/x){ |
# we do not have enough information to store an |
# we do not have enough information to store an |
# entire row, so we save it up until later. |
# entire row, so we save it up until later. |
my ($part_and_resp_id,$field) = ($1,$2); |
my ($part_and_resp_id,$field) = ($1,$2); |
Line 1169 sub update_full_student_data {
|
Line 1179 sub update_full_student_data {
|
} else { |
} else { |
$part_id = &get_part_id($part_and_resp_id); |
$part_id = &get_part_id($part_and_resp_id); |
} |
} |
|
# Deal with part specific data |
if ($field =~ /^(tries|award|awarded|previous)$/) { |
if ($field =~ /^(tries|award|awarded|previous)$/) { |
$partdata->{$symb_id}->{$part_id}->{$transaction}->{$field}=$value; |
$partdata->{$symb_id}->{$part_id}->{$transaction}->{$field}=$value; |
} |
} |
|
# deal with response specific data |
if (defined($resp_id) && |
if (defined($resp_id) && |
$field =~ /^(tries|awarddetail|awarded|submission)$/) { |
$field =~ /^(tries| |
|
awarddetail| |
|
submission| |
|
submissiongrading| |
|
molecule)$/x) { |
if ($field eq 'submission') { |
if ($field eq 'submission') { |
# We have to be careful with user supplied input. |
# We have to be careful with user supplied input. |
# most of the time we are okay because it is escaped. |
# most of the time we are okay because it is escaped. |
Line 1185 sub update_full_student_data {
|
Line 1201 sub update_full_student_data {
|
$value =~ s/\\$/\\\\/; |
$value =~ s/\\$/\\\\/; |
} |
} |
} |
} |
$respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{$field}=$value; |
if ($field eq 'submissiongrading' || |
|
$field eq 'molecule') { |
|
$respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{'response_specific'}=$field; |
|
$respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{'response_specific_value'}=$value; |
|
} else { |
|
$respdata->{$symb_id}->{$part_id}->{$resp_id}->{$transaction}->{$field}=$value; |
|
} |
} |
} |
} |
} |
} |
} |
Line 1231 sub update_full_student_data {
|
Line 1253 sub update_full_student_data {
|
$transaction, |
$transaction, |
$data->{'tries'}, |
$data->{'tries'}, |
$data->{'awarddetail'}, |
$data->{'awarddetail'}, |
$data->{'awarded'}, |
$data->{'response_specific'}, |
'','', |
$data->{'response_specific_value'}, |
$data->{'submission'})."'),"; |
$data->{'submission'})."'),"; |
$store_rows++; |
$store_rows++; |
} |
} |
Line 1411 sub store_student_data {
|
Line 1433 sub store_student_data {
|
chop $store_performance_command; |
chop $store_performance_command; |
chop $store_performance_command; |
chop $store_performance_command; |
my $start = Time::HiRes::time; |
my $start = Time::HiRes::time; |
|
$dbh->do($store_performance_command); |
|
if ($dbh->err()) { |
|
&Apache::lonnet::logthis(' bigass insert error:'.$dbh->errstr()); |
|
&Apache::lonnet::logthis('command = '.$store_performance_command); |
|
$returnstatus = 'error: unable to insert performance into database'; |
|
return ($returnstatus,$student_data); |
|
} |
$dbh->do($store_parameters_command) if ($num_parameters>0); |
$dbh->do($store_parameters_command) if ($num_parameters>0); |
if ($dbh->err()) { |
if ($dbh->err()) { |
&Apache::lonnet::logthis(' bigass insert error:'.$dbh->errstr()); |
&Apache::lonnet::logthis(' bigass insert error:'.$dbh->errstr()); |
Line 1420 sub store_student_data {
|
Line 1449 sub store_student_data {
|
$returnstatus = 'error: unable to insert parameters into database'; |
$returnstatus = 'error: unable to insert parameters into database'; |
return ($returnstatus,$student_data); |
return ($returnstatus,$student_data); |
} |
} |
$dbh->do($store_performance_command); |
|
if ($dbh->err()) { |
|
&Apache::lonnet::logthis(' bigass insert error:'.$dbh->errstr()); |
|
&Apache::lonnet::logthis('command = '.$store_performance_command); |
|
$returnstatus = 'error: unable to insert performance into database'; |
|
return ($returnstatus,$student_data); |
|
} |
|
$elapsed += Time::HiRes::time - $start; |
$elapsed += Time::HiRes::time - $start; |
return ($returnstatus,$student_data); |
return ($returnstatus,$student_data); |
} |
} |
Line 1842 sub get_problem_statistics {
|
Line 1864 sub get_problem_statistics {
|
$stats_table); |
$stats_table); |
my ($Solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. |
my ($Solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. |
$stats_table. |
$stats_table. |
" WHERE solved='correct_by_student'"); |
" WHERE solved='correct_by_student' OR solved='correct_by_scantron'"); |
my ($solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. |
my ($solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. |
$stats_table. |
$stats_table. |
" WHERE solved='correct_by_override'"); |
" WHERE solved='correct_by_override'"); |