version 1.107, 2003/10/27 21:07:22
|
version 1.110, 2003/12/11 22:18:04
|
Line 73 and/or itself.
|
Line 73 and/or itself.
|
|
|
=item &get_sequence_assessment_data() |
=item &get_sequence_assessment_data() |
|
|
AT THIS TIME THE USE OF THIS FUNCTION IS *NOT* RECOMMENDED |
|
|
|
Use lonnavmaps to build a data structure describing the order and |
Use lonnavmaps to build a data structure describing the order and |
assessment contents of each sequence in the current course. |
assessment contents of each sequence in the current course. |
|
|
Line 190 sub get_sequence_assessment_data {
|
Line 188 sub get_sequence_assessment_data {
|
$title =~ s/\:/\&\#058;/g; |
$title =~ s/\:/\&\#058;/g; |
$symb = $curRes->symb(); |
$symb = $curRes->symb(); |
$src = $curRes->src(); |
$src = $curRes->src(); |
|
# Grab the filename if there is not title available |
|
if (! defined($title) || $title eq '') { |
|
($title) = ($src=~ m:/([^/]*)$:); |
|
} |
my $parts = $curRes->parts(); |
my $parts = $curRes->parts(); |
my %partdata; |
my %partdata; |
foreach my $part (@$parts) { |
foreach my $part (@$parts) { |
Line 1889 sub get_problem_statistics {
|
Line 1891 sub get_problem_statistics {
|
my $dbh = &Apache::lonmysql::get_dbh(); |
my $dbh = &Apache::lonmysql::get_dbh(); |
return undef if (! defined($dbh)); |
return undef if (! defined($dbh)); |
# |
# |
# A) Number of Students attempting problem |
|
# B) Total number of tries of students attempting problem |
|
# C) Mod (largest number of tries for solving the problem) |
|
# D) Mean (average number of tries for solving the problem) |
|
# E) Number of students to solve the problem |
|
# F) Number of students to solve the problem by override |
|
# G) Number of students unable to solve the problem |
|
# H) Degree of difficulty : 1-(E+F)/B |
|
# I) Standard deviation of number of tries |
|
# J) Skew of tries: sqrt(sum(Xi-D)^3)/A |
|
# |
|
$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,tries FROM '.$performance_table. |
' SELECT student_id,solved,award,awarded,tries FROM '.$performance_table. |
' WHERE symb_id='.$symb_id.' AND part_id='.$part_id; |
' WHERE symb_id='.$symb_id.' AND part_id='.$part_id; |
if (defined($students)) { |
if (defined($students)) { |
$request .= ' AND ('. |
$request .= ' AND ('. |
Line 1915 sub get_problem_statistics {
|
Line 1906 sub get_problem_statistics {
|
} |
} |
# &Apache::lonnet::logthis($request); |
# &Apache::lonnet::logthis($request); |
$dbh->do($request); |
$dbh->do($request); |
|
# &Apache::lonnet::logthis('request = '.$/.$request); |
|
$request = 'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) '. |
|
'FROM '.$stats_table; |
my ($num,$tries,$mod,$mean,$STD) = &execute_SQL_request |
my ($num,$tries,$mod,$mean,$STD) = &execute_SQL_request |
($dbh, |
($dbh,$request); |
'SELECT COUNT(*),SUM(tries),MAX(tries),AVG(tries),STD(tries) FROM '. |
# &Apache::lonnet::logthis('request = '.$/.$request); |
$stats_table); |
$request = 'SELECT SUM(awarded) FROM '.$stats_table; |
my ($Solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. |
my ($Solved) = &execute_SQL_request($dbh,$request); |
$stats_table. |
# &Apache::lonnet::logthis('request = '.$/.$request); |
" WHERE solved='correct_by_student' OR solved='correct_by_scantron'"); |
$request = 'SELECT SUM(awarded) FROM '.$stats_table. |
my ($solved) = &execute_SQL_request($dbh,'SELECT COUNT(tries) FROM '. |
" WHERE solved='correct_by_override'"; |
$stats_table. |
# &Apache::lonnet::logthis('request = '.$/.$request); |
" WHERE solved='correct_by_override'"); |
my ($solved) = &execute_SQL_request($dbh,$request); |
|
# $Solved = int($Solved); |
|
# $solved = int($solved); |
|
# |
$num = 0 if (! defined($num)); |
$num = 0 if (! defined($num)); |
$tries = 0 if (! defined($tries)); |
$tries = 0 if (! defined($tries)); |
$mod = 0 if (! defined($mod)); |
$mod = 0 if (! defined($mod)); |
Line 1944 sub get_problem_statistics {
|
Line 1941 sub get_problem_statistics {
|
$wrongpercent=int(10*100*($num-$Solved+$solved)/$num)/10; |
$wrongpercent=int(10*100*($num-$Solved+$solved)/$num)/10; |
} |
} |
# |
# |
$dbh->do('DROP TABLE '.$stats_table); # May return an error |
# $dbh->do('DROP TABLE '.$stats_table); # May return an error |
# |
# |
# Store in metadata |
# Store in metadata |
# |
# |
Line 2018 sub get_student_data {
|
Line 2015 sub get_student_data {
|
} |
} |
} |
} |
|
|
sub get_optionresponse_data { |
sub RD_student_id { return 0; } |
|
sub RD_awarddetail { return 1; } |
|
sub RD_response_eval { return 2; } |
|
sub RD_submission { return 3; } |
|
sub RD_timestamp { return 4; } |
|
sub RD_tries { return 5; } |
|
sub RD_sname { return 6; } |
|
|
|
sub get_response_data { |
my ($students,$symb,$response,$courseid) = @_; |
my ($students,$symb,$response,$courseid) = @_; |
return undef if (! defined($symb) || |
return undef if (! defined($symb) || |
! defined($response)); |
! defined($response)); |
Line 2032 sub get_optionresponse_data {
|
Line 2037 sub get_optionresponse_data {
|
return undef if (! defined($dbh)); |
return undef if (! defined($dbh)); |
my $request = 'SELECT '. |
my $request = 'SELECT '. |
'a.student_id, a.awarddetail, a.response_specific_value, '. |
'a.student_id, a.awarddetail, a.response_specific_value, '. |
'a.submission, b.timestamp, c.tries '. |
'a.submission, b.timestamp, c.tries, d.student '. |
'FROM '.$fulldump_response_table.' AS a '. |
'FROM '.$fulldump_response_table.' AS a '. |
'LEFT JOIN '.$fulldump_timestamp_table.' AS b '. |
'LEFT JOIN '.$fulldump_timestamp_table.' AS b '. |
'ON a.symb_id=b.symb_id AND a.student_id=b.student_id AND '. |
'ON a.symb_id=b.symb_id AND a.student_id=b.student_id AND '. |
Line 2040 sub get_optionresponse_data {
|
Line 2045 sub get_optionresponse_data {
|
'LEFT JOIN '.$fulldump_part_table.' AS c '. |
'LEFT JOIN '.$fulldump_part_table.' AS c '. |
'ON a.symb_id=c.symb_id AND a.student_id=c.student_id AND '. |
'ON a.symb_id=c.symb_id AND a.student_id=c.student_id AND '. |
'a.part_id=c.part_id AND a.transaction = c.transaction '. |
'a.part_id=c.part_id AND a.transaction = c.transaction '. |
|
'LEFT JOIN '.$student_table.' AS d '. |
|
'ON a.student_id=d.student_id '. |
'WHERE '. |
'WHERE '. |
'a.symb_id='.$symb_id.' AND a.response_id='.$response_id; |
'a.symb_id='.$symb_id.' AND a.response_id='.$response_id; |
if (defined($students)) { |
if (defined($students)) { |
Line 2064 sub get_optionresponse_data {
|
Line 2071 sub get_optionresponse_data {
|
} |
} |
} |
} |
|
|
|
sub RT_student_id { return 0; } |
|
sub RT_awarded { return 1; } |
|
sub RT_tries { return 2; } |
|
sub RT_timestamp { return 3; } |
|
|
sub get_response_time_data { |
sub get_response_time_data { |
my ($students,$symb,$part,$courseid) = @_; |
my ($students,$symb,$part,$courseid) = @_; |
return undef if (! defined($symb) || |
return undef if (! defined($symb) || |