version 1.127, 2006/08/17 21:19:47
|
version 1.131, 2008/10/23 09:07:51
|
Line 144 sub BuildProblemAnalysisPage {
|
Line 144 sub BuildProblemAnalysisPage {
|
$r->print(&Apache::lonstathelpers::render_resource($resource)); |
$r->print(&Apache::lonstathelpers::render_resource($resource)); |
} |
} |
$r->rflush(); |
$r->rflush(); |
my %Data = &Apache::lonstathelpers::get_problem_data |
if (@Students) { |
($resource->src); |
my %Data = &Apache::lonstathelpers::get_problem_data |
my $problem_data = $Data{$current_problem->{'part'}. |
($resource->src); |
'.'. |
my $problem_data = $Data{$current_problem->{'part'}. |
$current_problem->{'respid'}}; |
'.'. |
if ($current_problem->{'resptype'} eq 'option') { |
$current_problem->{'respid'}}; |
&OptionResponseAnalysis($r,$current_problem, |
if ($current_problem->{'resptype'} eq 'option') { |
$problem_data, |
&OptionResponseAnalysis($r,$current_problem, |
\@Students); |
$problem_data, |
} elsif ($current_problem->{'resptype'} eq 'radiobutton') { |
\@Students); |
&radio_response_analysis($r,$current_problem, |
} elsif ($current_problem->{'resptype'} eq 'radiobutton') { |
$problem_data, |
&radio_response_analysis($r,$current_problem, |
\@Students); |
$problem_data, |
} elsif ($current_problem->{'resptype'} eq 'numerical') { |
\@Students); |
&numerical_response_analysis($r,$current_problem, |
} elsif ($current_problem->{'resptype'} eq 'numerical') { |
$problem_data,\@Students); |
&numerical_response_analysis($r,$current_problem, |
} else { |
$problem_data,\@Students); |
$r->print('<h2>Analysis of '.$current_problem->{'resptype'}.' is not supported</h2>'); |
} else { |
} |
$r->print('<h2>Analysis of '.$current_problem->{'resptype'}.' is not supported</h2>'); |
|
} |
|
} |
} |
} |
$r->print('<hr />'); |
$r->print('<hr />'); |
} else { |
} else { |
Line 327 sub numerical_plot_percent {
|
Line 329 sub numerical_plot_percent {
|
last; |
last; |
} |
} |
} |
} |
|
$percent_spread = $highest_percent - $lowest_percent; |
my $bin_size = 1; |
my $bin_size = 1; |
foreach (qw/0.01 0.05 0.1 0.5 1 2 5 10 20 25 50 100/) { |
foreach (qw/0.01 0.05 0.1 0.5 1 2 5 10 20 25 50 100/) { |
if ($lowest_percent/2 < $_){ |
if ($lowest_percent/2 < $_){ |
$bin_size = $_; |
$bin_size = $_; |
last; |
if ( ($percent_spread/$bin_size) < $max_bins ) { |
|
last; |
|
} |
} |
} |
} |
} |
my @bins; |
my @bins; |
Line 406 sub numerical_plot_differences {
|
Line 411 sub numerical_plot_differences {
|
} elsif ($low_bin < 0 && $high_bin < -$low_bin) { |
} elsif ($low_bin < 0 && $high_bin < -$low_bin) { |
$high_bin = -$low_bin; |
$high_bin = -$low_bin; |
} |
} |
|
if ($high_bin == $low_bin) { |
|
$high_bin+=1; |
|
$low_bin-=1; |
|
} |
if (!$min_bin_size || |
if (!$min_bin_size || |
($high_bin -$low_bin)/$min_bin_size * 2 > $max_bins) { |
($high_bin -$low_bin)/$min_bin_size * 2 > $max_bins) { |
$min_bin_size = abs($high_bin - $low_bin) / $max_bins * 2; |
$min_bin_size = abs($high_bin - $low_bin) / $max_bins * 2; |
Line 627 sub numerical_determine_answers {
|
Line 636 sub numerical_determine_answers {
|
$sdom); |
$sdom); |
# make the key |
# make the key |
my $key = $partid.'.'.$respid; |
my $key = $partid.'.'.$respid; |
|
# pick one of the possible answers |
|
my $which = 'INTERNAL'; |
|
if (!exists($analysis->{$key}{$which})) { |
|
$which = (sort(keys(%{ $analysis->{$key} })))[0]; |
|
} |
foreach my $item ('answer','unit','ans_high','ans_low') { |
foreach my $item ('answer','unit','ans_high','ans_low') { |
$correct->{$sname.':'.$sdom}->{$item} = |
if (ref($analysis->{$key.'.'.$item}) eq 'ARRAY') { |
$analysis->{$key.'.'.$item}->[0]; |
$correct->{$sname.':'.$sdom}->{$item} = |
|
$analysis->{$key.'.'.$item}[0]; |
|
} else { |
|
$correct->{$sname.':'.$sdom}->{$item} = |
|
$analysis->{$key.'.'.$item}{$which}[0][0]; |
|
} |
} |
} |
$answers{$analysis->{$key.'.answer'}->[0]}++; |
$answers{$correct->{$sname.':'.$sdom}{'answer'}}++; |
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
&mt('last student')); |
&mt('last student')); |
} |
} |
Line 1835 sub CreateInterface {
|
Line 1854 sub CreateInterface {
|
$Str .= '<tr>'; |
$Str .= '<tr>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Sections').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Groups').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Groups').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Enrollment Status').'</b></td>'; |
$Str .= '<td align="center"><b>'.&mt('Access Status').'</b></td>'; |
$Str .= '<td align="center"> </td>'; |
$Str .= '<td align="center"> </td>'; |
$Str .= '</tr>'."\n"; |
$Str .= '</tr>'."\n"; |
## |
## |
Line 1899 sub CreateInterface {
|
Line 1918 sub CreateInterface {
|
$Str .= '<nobr><label>'.&mt('Number of Plots [_1]',$numplots_selector). |
$Str .= '<nobr><label>'.&mt('Number of Plots [_1]',$numplots_selector). |
'</label></nobr>'; |
'</label></nobr>'; |
## |
## |
$Str .= '<nobr><label>'.&mt('Status: [_1]', |
$Str .= '<span class="LC_nobreak"><label>' |
'<input type="text" '. |
.&mt('Status: [_1]', |
'name="stats_status" size="60" value="" />' |
'<input type="text" name="stats_status"' |
). |
.' size="60" value="" readonly="readonly" />') |
'</label></nobr>'; |
.'</label></span>'; |
$Str .= '</td>'; |
$Str .= '</td>'; |
## |
## |
## |
## |