version 1.116, 2005/02/28 23:07:32
|
version 1.117, 2005/03/11 21:14:41
|
Line 1170 sub OptionResponseAnalysis {
|
Line 1170 sub OptionResponseAnalysis {
|
my ($r,$problem,$problem_data,$Students) = @_; |
my ($r,$problem,$problem_data,$Students) = @_; |
my ($resource,$respid) = ($problem->{'resource'}, |
my ($resource,$respid) = ($problem->{'resource'}, |
$problem->{'respid'}); |
$problem->{'respid'}); |
&Apache::lonnet::logthis('option response analysis on '.$resource->symb); |
|
# Note: part data is not needed. |
# Note: part data is not needed. |
my $PerformanceData = &Apache::loncoursedata::get_response_data |
my $PerformanceData = &Apache::loncoursedata::get_response_data |
(\@Apache::lonstatistics::SelectedSections, |
(\@Apache::lonstatistics::SelectedSections, |
Line 1216 sub OR_tries_analysis {
|
Line 1215 sub OR_tries_analysis {
|
if (! defined($Concepts)) { |
if (! defined($Concepts)) { |
$Concepts = []; |
$Concepts = []; |
} |
} |
&Apache::lonnet::logthis('got '.scalar(@$PerformanceData).' data points'); |
|
my %response_data = &OR_analyze_by_tries($r,$PerformanceData, |
my %response_data = &OR_analyze_by_tries($r,$PerformanceData, |
$mintries,$maxtries); |
$mintries,$maxtries); |
my $analysis = ''; |
my $analysis = ''; |
Line 1273 sub OR_tries_analysis {
|
Line 1271 sub OR_tries_analysis {
|
if (defined($Concepts)) { $num_concepts = scalar(@$Concepts); } |
if (defined($Concepts)) { $num_concepts = scalar(@$Concepts); } |
# |
# |
for (my $try=$mintries;$try<=$maxtries;$try++) { |
for (my $try=$mintries;$try<=$maxtries;$try++) { |
&Apache::lonnet::logthis('try = '.$try); |
|
if (! defined($response_data{'_total'}->[$try]) || |
if (! defined($response_data{'_total'}->[$try]) || |
$response_data{'_total'}->[$try] == 0) { |
$response_data{'_total'}->[$try] == 0) { |
if ($try > 1) { |
if ($try > 1) { |
Line 1307 sub OR_tries_analysis {
|
Line 1304 sub OR_tries_analysis {
|
('Correct Concepts','Concept Number','Percent Correct', |
('Correct Concepts','Concept Number','Percent Correct', |
100,$plotcolors,undef,\@concept_plot_data,{xskip=>1}); |
100,$plotcolors,undef,\@concept_plot_data,{xskip=>1}); |
} |
} |
&Apache::lonnet::logthis('got here a_0'); |
|
# |
# |
# Create Foil Plots |
# Create Foil Plots |
my $data_count = $response_data{'_total'}->[$try]; |
my $data_count = $response_data{'_total'}->[$try]; |
my $correct = $response_data{'_correct'}->[$try]; |
my $correct = $response_data{'_correct'}->[$try]; |
|
if (! defined($correct)) { $correct = 0; } |
my @Datasets; |
my @Datasets; |
foreach my $option ('_correct',@{$ORdata->{'_Options'}}) { |
foreach my $option ('_correct',@{$ORdata->{'_Options'}}) { |
&Apache::lonnet::logthis('checking option '.$option); |
|
next if (! exists($foil_plot[$try]->{$option})); |
next if (! exists($foil_plot[$try]->{$option})); |
push(@Datasets,$foil_plot[$try]->{$option}); |
push(@Datasets,$foil_plot[$try]->{$option}); |
} |
} |
&Apache::lonnet::logthis('got here a'); |
|
# |
# |
# Put a blank in the data set between concepts |
# Put a blank in the data set between concepts |
for (my $set =0;$set<=$#Datasets;$set++) { |
for (my $set =0;$set<=$#Datasets;$set++) { |
Line 1335 sub OR_tries_analysis {
|
Line 1330 sub OR_tries_analysis {
|
} |
} |
# |
# |
# Set up the labels needed for the bar graph |
# Set up the labels needed for the bar graph |
&Apache::lonnet::logthis('got here b'); |
|
my @Labels; |
my @Labels; |
my $idx = 1; |
my $idx = 1; |
foreach my $concept (@{$Concepts}) { |
foreach my $concept (@{$Concepts}) { |
Line 1351 sub OR_tries_analysis {
|
Line 1345 sub OR_tries_analysis {
|
|
|
# |
# |
# |
# |
&Apache::lonnet::logthis('got here c'); |
|
next if (! defined($Datasets[0])); |
next if (! defined($Datasets[0])); |
&Apache::lonnet::logthis('got here d'); |
|
for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) { |
for (my $i=0; $i< scalar(@{$Datasets[0]});$i++) { |
$Datasets[0]->[$i]=0; |
$Datasets[0]->[$i]=0; |
} |
} |
Line 1362 sub OR_tries_analysis {
|
Line 1354 sub OR_tries_analysis {
|
my $incorrect_graph = &Apache::loncommon::DrawBarGraph |
my $incorrect_graph = &Apache::loncommon::DrawBarGraph |
('Incorrect Statements','Statement','% Chosen Incorrectly', |
('Incorrect Statements','Statement','% Chosen Incorrectly', |
100,$plotcolors,\@Labels,@Datasets,{xskip=>1}); |
100,$plotcolors,\@Labels,@Datasets,{xskip=>1}); |
&Apache::lonnet::logthis('incorrect graph = '.$incorrect_graph); |
|
$analysis_html.= |
$analysis_html.= |
'<tr><td colspan="4" align="center">'. |
'<tr><td colspan="4" align="center">'. |
'<font size="+1">'. |
'<font size="+1">'. |