version 1.88, 2004/09/28 20:41:58
|
version 1.93, 2004/10/05 14:03:45
|
Line 56 my @SubmitButtons = ({ name => 'PrevProb
|
Line 56 my @SubmitButtons = ({ name => 'PrevProb
|
{ name => 'ExcelOutput', |
{ name => 'ExcelOutput', |
text => 'Produce Excel Output' }); |
text => 'Produce Excel Output' }); |
|
|
|
|
sub BuildProblemAnalysisPage { |
sub BuildProblemAnalysisPage { |
my ($r,$c)=@_; |
my ($r,$c)=@_; |
# |
# |
Line 135 sub BuildProblemAnalysisPage {
|
Line 134 sub BuildProblemAnalysisPage {
|
my $resource = $current_problem->{'resource'}; |
my $resource = $current_problem->{'resource'}; |
$r->print('<h1>'.$resource->{'title'}.'</h1>'); |
$r->print('<h1>'.$resource->{'title'}.'</h1>'); |
$r->print('<h3>'.$resource->{'src'}.'</h3>'); |
$r->print('<h3>'.$resource->{'src'}.'</h3>'); |
$r->print(&Apache::lonstathelpers::render_resource($resource)); |
if ($ENV{'form.show_prob'} eq 'true') { |
|
$r->print(&Apache::lonstathelpers::render_resource($resource)); |
|
} |
$r->rflush(); |
$r->rflush(); |
my %Data = &Apache::lonstathelpers::get_problem_data |
my %Data = &Apache::lonstathelpers::get_problem_data |
($resource->{'src'}); |
($resource->{'src'}); |
Line 404 sub RadioResponseAnalysis {
|
Line 405 sub RadioResponseAnalysis {
|
} else { |
} else { |
$analysis_html .= '<h2>'. |
$analysis_html .= '<h2>'. |
&mt('The analysis you have selected is not supported at this time'). |
&mt('The analysis you have selected is not supported at this time'). |
'</h2>'; |
'</h2>'; |
} |
} |
$r->print($analysis_html); |
$r->print($analysis_html); |
} |
} |
Line 481 sub RR_Tries_Foil_Analysis {
|
Line 482 sub RR_Tries_Foil_Analysis {
|
} |
} |
} |
} |
} |
} |
my $title='Attempt '.$try; |
my $title='Attempt '.$try.' (N='.$total.')'; |
my $xlabel = $total.' Submissions'; |
my $xlabel = 'Foil Chosen'; |
$html.= &Apache::loncommon::DrawBarGraph($title, |
$html.= &Apache::loncommon::DrawBarGraph($title, |
$xlabel, |
$xlabel, |
'Percent Choosing', |
'Percent Choosing', |
Line 618 sub OR_tries_analysis {
|
Line 619 sub OR_tries_analysis {
|
foreach my $foilid (@{$concept->{'foils'}}) { |
foreach my $foilid (@{$concept->{'foils'}}) { |
for (my $try=$mintries;$try<=$maxtries;$try++) { |
for (my $try=$mintries;$try<=$maxtries;$try++) { |
# concept analysis data |
# concept analysis data |
$concept_data[$j]->{'_correct'} += |
$concept_data[$j]->[$try]->{'_correct'} += |
$response_data{$foilid}->[$try]->{'_correct'}; |
$response_data{$foilid}->[$try]->{'_correct'}; |
$concept_data[$j]->{'_total'} += |
$concept_data[$j]->[$try]->{'_total'} += |
$response_data{$foilid}->[$try]->{'_total'}; |
$response_data{$foilid}->[$try]->{'_total'}; |
# |
# |
# foil analysis data |
# foil analysis data |
Line 662 sub OR_tries_analysis {
|
Line 663 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++) { |
|
if (! defined($response_data{'_total'}->[$try]) || |
|
$response_data{'_total'}->[$try] == 0) { |
|
if ($try > 1) { |
|
$analysis_html.= '<tr><td align="center" colspan="4"><b>'. |
|
&mt('None of the selected students attempted the problem more than [_1] times.',$try-1). |
|
'</b></td></tr>'; |
|
} else { |
|
$analysis_html.= '<tr><td colspan="4" align="center"><b>'. |
|
&mt('None of the selected students have attempted the problem').'</b></td></tr>'; |
|
} |
|
last; |
|
} |
my $concept_graph=''; |
my $concept_graph=''; |
if ($num_concepts > 1) { |
if ($num_concepts > 1) { |
# |
# |
# Create concept plot |
# Create concept plot |
my @concept_plot_data; |
my @concept_plot_data; |
for (my $j=0;$j<=$#concept_data;$j++) { |
for (my $j=0;$j<=$#concept_data;$j++) { |
my $total = $concept_data[$j]->{'_total'}; |
my $total = $concept_data[$j]->[$try]->{'_total'}; |
if ($total == 0) { |
if ($total == 0) { |
$concept_plot_data[$j] = 0; |
$concept_plot_data[$j] = 0; |
} else { |
} else { |
$concept_plot_data[$j] = 100 * |
$concept_plot_data[$j] = 100 * |
sprintf('%0.3f', |
sprintf('%0.3f', |
$concept_data[$j]->{'_correct'} / $total); |
$concept_data[$j]->[$try]->{'_correct'} / |
|
$total); |
} |
} |
} |
} |
# |
# |
Line 830 sub OR_time_analysis {
|
Line 844 sub OR_time_analysis {
|
> $starttime); |
> $starttime); |
} |
} |
$begin_index = $j; |
$begin_index = $j; |
while (++$j < scalar(@$performance_data)) { |
while ($j < scalar(@$performance_data)) { |
last if (&get_time_from_row($performance_data->[$j]) > $endtime); |
if (&get_time_from_row($performance_data->[$j]) > $endtime) { |
|
last; |
|
} else { |
|
$j++; |
|
} |
} |
} |
$end_index = $j; |
$end_index = $j; |
## |
## |
Line 924 sub OR_Foil_Time_Analysis {
|
Line 942 sub OR_Foil_Time_Analysis {
|
# |
# |
# Create the plot |
# Create the plot |
my $count = $end_index-$begin_index; |
my $count = $end_index-$begin_index; |
|
return ('No data','') if ($count <= 0); |
my $title; |
my $title; |
if ($count == 0) { |
if ($count == 0) { |
$title = 'no submissions'; |
$title = 'no submissions'; |
} elsif ($count == 1) { |
} elsif ($count == 1) { |
$title = 'one submission'; |
$title = 'one submission'; |
} else { |
} elsif ($count > 1) { |
$title = $count.' submissions'; |
$title = $count.' submissions'; |
} |
} |
my $correct_plot = &Apache::loncommon::DrawBarGraph($title, |
my $correct_plot = &Apache::loncommon::DrawBarGraph($title, |
Line 945 sub OR_Foil_Time_Analysis {
|
Line 964 sub OR_Foil_Time_Analysis {
|
$count = $end_index-$begin_index-$TimeData{'_correct'}; |
$count = $end_index-$begin_index-$TimeData{'_correct'}; |
if ($count == 0) { |
if ($count == 0) { |
$title = 'no submissions'; |
$title = 'no submissions'; |
|
} elsif ($count < 0) { |
|
return ($correct_plot,''); |
} elsif ($count == 1) { |
} elsif ($count == 1) { |
$title = 'one submission'; |
$title = 'one submission'; |
} else { |
} else { |
Line 956 sub OR_Foil_Time_Analysis {
|
Line 977 sub OR_Foil_Time_Analysis {
|
100, |
100, |
$plotcolors, |
$plotcolors, |
undef, |
undef, |
@plotdata); |
@plotdata); |
|
|
return ($correct_plot,$incorrect_plot); |
return ($correct_plot,$incorrect_plot); |
} |
} |
|
|
Line 1376 sub CreateInterface {
|
Line 1396 sub CreateInterface {
|
## |
## |
## |
## |
$Str .= '<td>'; |
$Str .= '<td>'; |
{ # These braces are here to organize the code, not scope it. |
## |
{ |
my $showprob_checkbox = |
$Str .= '<nobr>'.&mt('Analyze Over '); |
'<input type="checkbox" name="show_prob" value="true" '; |
$Str .= &Apache::loncommon::help_open_topic |
if ($ENV{'form.show_prob'} eq 'true') { |
('Analysis_Analyze_Over'); |
$showprob_checkbox .= 'checked '; |
$Str .='<select name="AnalyzeOver" >'; |
} |
$Str .= '<option value="Tries" '; |
$showprob_checkbox.= ' />'; |
if (! exists($ENV{'form.AnalyzeOver'}) || |
$Str.= '<nobr><label>'. |
$ENV{'form.AnalyzeOver'} eq 'Tries'){ |
&mt('Show problem [_1]',$showprob_checkbox). |
# Default to Tries |
'</label></nobr><br />'; |
$Str .= ' selected '; |
## |
} |
my $analyze_selector = '<select name="AnalyzeOver" >'; |
$Str .= '>'.&mt('Tries').'</option>'; |
$analyze_selector .= '<option value="Tries" '; |
$Str .= '<option value="Time" '; |
if (! exists($ENV{'form.AnalyzeOver'}) || |
$Str .= ' selected ' if ($ENV{'form.AnalyzeOver'} eq 'Time'); |
$ENV{'form.AnalyzeOver'} eq 'Tries'){ |
$Str .= '>'.&mt('Time').'</option>'; |
# Default to Tries |
$Str .= '</select>'; |
$analyze_selector .= ' selected '; |
$Str .= '</nobr><br />'; |
} |
} |
$analyze_selector .= '>'.&mt('Tries').'</option>'; |
{ |
$analyze_selector .= '<option value="Time" '; |
$Str .= '<nobr>'.&mt('Number of Plots:'); |
$analyze_selector .= ' selected ' if ($ENV{'form.AnalyzeOver'} eq 'Time'); |
$Str .= &Apache::loncommon::help_open_topic |
$analyze_selector .= '>'.&mt('Time').'</option>'; |
('Analysis_num_plots'); |
$analyze_selector .= '</select>'; |
$Str .= '<select name="NumPlots">'; |
$Str .= '<nobr><label>'. |
if (! exists($ENV{'form.NumPlots'}) |
&mt('Analyze Over [_1] [_2]', |
|| $ENV{'form.NumPlots'} < 1 |
$analyze_selector, |
|| $ENV{'form.NumPlots'} > 20) { |
&Apache::loncommon::help_open_topic('Analysis_Analyze_Over')). |
$ENV{'form.NumPlots'} = 5; |
'</label></nobr><br />'.$/; |
} |
## |
foreach my $i (1,2,3,4,5,6,7,8,10,15,20) { |
my $numplots_selector = '<select name="NumPlots">'; |
$Str .= '<option value="'.$i.'" '; |
if (! exists($ENV{'form.NumPlots'}) |
if ($ENV{'form.NumPlots'} == $i) { $Str.=' selected '; } |
|| $ENV{'form.NumPlots'} < 1 |
$Str .= '>'.$i.'</option>'; |
|| $ENV{'form.NumPlots'} > 20) { |
} |
$ENV{'form.NumPlots'} = 5; |
$Str .= '</select></nobr><br />'; |
} |
} |
foreach my $i (1,2,3,4,5,6,7,8,10,15,20) { |
{ |
$numplots_selector .= '<option value="'.$i.'" '; |
$Str .= '<nobr>'.&mt('Status: [_1]', |
if ($ENV{'form.NumPlots'} == $i) { $numplots_selector.=' selected '; } |
|
$numplots_selector .= '>'.$i.'</option>'; |
|
} |
|
$numplots_selector .= '</select></nobr><br />'; |
|
$Str .= '<nobr><label>'.&mt('Number of Plots [_1]',$numplots_selector). |
|
'</label></nobr>'; |
|
## |
|
$Str .= '<nobr><label>'.&mt('Status: [_1]', |
'<input type="text" '. |
'<input type="text" '. |
'name="stats_status" size="60" value="" />' |
'name="stats_status" size="60" value="" />' |
). |
). |
'</nobr><br />'; |
'</label></nobr>'; |
} |
|
} |
|
$Str .= '</td>'; |
$Str .= '</td>'; |
## |
## |
## |
## |