version 1.114, 2004/02/02 21:45:12
|
version 1.117, 2004/02/17 19:56:30
|
Line 1235 sub update_full_student_data {
|
Line 1235 sub update_full_student_data {
|
# However, there is one wrinkle: submissions which end in |
# However, there is one wrinkle: submissions which end in |
# and odd number of '\' cause insert errors to occur. |
# and odd number of '\' cause insert errors to occur. |
# Best trap this somehow... |
# Best trap this somehow... |
$value =~ s/\'/\\\'/g; |
$value = $dbh->quote($value); |
my ($offensive_string) = ($value =~ /(\\+)$/); |
|
if (length($offensive_string) % 2) { |
|
$value =~ s/\\$/\\\\/; |
|
} |
|
} |
} |
if ($field eq 'submissiongrading' || |
if ($field eq 'submissiongrading' || |
$field eq 'molecule') { |
$field eq 'molecule') { |
Line 1919 able to answer it correctly.
|
Line 1915 able to answer it correctly.
|
################################################ |
################################################ |
################################################ |
################################################ |
sub get_problem_statistics { |
sub get_problem_statistics { |
my ($students,$symb,$part,$courseid) = @_; |
my ($Sections,$status,$symb,$part,$courseid) = @_; |
return if (! defined($symb) || ! defined($part)); |
return if (! defined($symb) || ! defined($part)); |
$courseid = $ENV{'request.course.id'} if (! defined($courseid)); |
$courseid = $ENV{'request.course.id'} if (! defined($courseid)); |
# |
# |
Line 1933 sub get_problem_statistics {
|
Line 1929 sub get_problem_statistics {
|
# |
# |
$dbh->do('DROP TABLE '.$stats_table); # May return an error |
$dbh->do('DROP TABLE '.$stats_table); # May return an error |
my $request = |
my $request = |
'CREATE TEMPORARY TABLE '.$stats_table. |
'CREATE TEMPORARY TABLE '.$stats_table.' '. |
' SELECT student_id,solved,award,awarded,tries FROM '.$performance_table. |
'SELECT a.student_id,a.solved,a.award,a.awarded,a.tries '. |
' WHERE symb_id='.$symb_id.' AND part_id='.$part_id; |
'FROM '.$performance_table.' AS a '; |
if (defined($students)) { |
if ((defined($Sections) && lc($Sections->[0]) ne 'all') || |
|
(defined($status) && lc($status) ne 'any')) { |
|
$request .= 'NATURAL LEFT JOIN '.$student_table.' AS b '; |
|
} |
|
$request .= ' WHERE a.symb_id='.$symb_id.' AND a.part_id='.$part_id; |
|
if (defined($Sections) && lc($Sections->[0]) ne 'all') { |
$request .= ' AND ('. |
$request .= ' AND ('. |
join(' OR ', map {'student_id='. |
join(' OR ', map { "b.section='".$_."'" } @$Sections |
&get_student_id($_->{'username'}, |
|
$_->{'domain'}) |
|
} @$students |
|
).')'; |
).')'; |
} |
} |
# &Apache::lonnet::logthis($request); |
if (defined($status) && lc($status) ne 'any') { |
|
$request .= " AND b.status='".$status."'"; |
|
} |
$dbh->do($request); |
$dbh->do($request); |
# &Apache::lonnet::logthis('request = '.$/.$request); |
# &Apache::lonnet::logthis('request = '.$/.$request); |
$request = 'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) '. |
$request = 'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) '. |
Line 2107 sub get_response_data {
|
Line 2107 sub get_response_data {
|
} |
} |
my $dataset = $sth->fetchall_arrayref(); |
my $dataset = $sth->fetchall_arrayref(); |
if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) { |
if (ref($dataset) eq 'ARRAY' && scalar(@$dataset)>0) { |
|
# Clear the \'s from around the submission |
|
for (my $i =0;$i<scalar(@$dataset);$i++) { |
|
$dataset->[$i]->[3] =~ s/(\'$|^\')//g; |
|
} |
return $dataset; |
return $dataset; |
} |
} |
} |
} |
Line 2164 sub get_response_time_data {
|
Line 2168 sub get_response_time_data {
|
|
|
=pod |
=pod |
|
|
=item &get_student_scores($Students,$Symbs,$enrollment,$courseid) |
=item &get_student_scores($Sections,$Symbs,$enrollment,$courseid) |
|
|
=cut |
=cut |
|
|