# The LearningOnline Network with CAPA # # $Id: lonproblemanalysis.pm,v 1.138 2010/01/14 17:20:51 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LON-CAPA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # /home/httpd/html/adm/gpl.txt # # http://www.lon-capa.org/ # package Apache::lonproblemanalysis; use strict; use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); use Apache::loncoursedata(); use Apache::lonstatistics; use Apache::lonlocal; use Apache::lonstathelpers(); use Apache::lonstudentsubmissions(); use HTML::Entities(); use Time::Local(); use capa; use lib '/home/httpd/lib/perl/'; use LONCAPA; my $plotcolors = ['#33ff00', '#0033cc', '#990000', '#aaaa66', '#663399', '#ff9933', '#66ccff', '#ff9999', '#cccc33', '#660000', '#33cc66', ]; my @SubmitButtons = ({ name => 'PrevProblemAnalysis', text => 'Previous Problem' }, { name => 'ProblemAnalysis', text => 'Analyze Problem Again' }, { name => 'NextProblemAnalysis', text => 'Next Problem' }, { name => 'break'}, { name => 'SelectAnother', text => 'Choose a different Problem' }); sub BuildProblemAnalysisPage { my ($r,$c)=@_; # my %Saveable_Parameters = ('Status' => 'scalar', 'Section' => 'array', 'Groups' => 'array', 'NumPlots' => 'scalar', 'AnalyzeOver' => 'scalar', ); &Apache::loncommon::store_course_settings('problem_analysis', \%Saveable_Parameters); &Apache::loncommon::restore_course_settings('problem_analysis', \%Saveable_Parameters); # &Apache::lonstatistics::PrepareClasslist(); # $r->print(&CreateInterface()); # my @Students = @Apache::lonstatistics::Students; # if (@Students < 1 && exists($env{'form.firstrun'})) { $r->print('
'.
&mt($no_data_message,$plot_num,@extra_data).
' | |
'. &mt($header_message,$plot_num,@extra_data). ' | |
'. &mt($stats_message, $stats->{'submission_count'}, $stats->{'correct_count'}, $stats->{'incorrect_count'}, $stats->{'students'}, @extra_data). ' | |
'. &numerical_plot_percent($r,$responses,$stats).' | '. ''. &numerical_plot_differences($r,$responses,$stats).' | '. '
'.$post_message.' |
'.&mt('Bar').' | '. ''.&mt('Range').' | '. ''.&mt('Incorrect').' | '. ''.&mt('Correct').' | '. ''.&mt('Count').' | '. '||
---|---|---|---|---|---|---|
'.$labels->[$i].' | '. ''.$lownum.' | '. '- | '. ''.$highnum.' | '. ''.$incorrect->[$i].' | '. ''.$correct->[$i].' | '. ''.$count->[$i].' | '. '
'.
''.&mt('Distribution of correct answers').''.
' '.&mt('[_1] students, [_2] distinct correct answers', $n,scalar(keys(%$data))). ' '.&mt('Maximum number of coinciding values: [_1]',$max_y). ' | ||
'.$min_x.' | '. ''.$plotresult.' | '. ''.$max_x.' | '. '
'. ''. &mt($pre_graph_text, $plot_num,$foil_choice_data->{'_count'}, $correct, $incorrect, $foil_choice_data->{'_students'}, @extra_data). ' | ||||
'.$concept_plot.' | '. ''.$choice_plot.' | '; if ($stacked_plot ne '') { $analysis_html .= ''.$stacked_plot.' | '. ''.&build_foil_key($foils,$count_by_foil).' | '; } else { $analysis_html .= (''x2); } $analysis_html.=' |
'. $post_graph_text.' | ||||
'.
' '.
&mt($no_data_text,
$plot_num,$foil_choice_data->{'_count'},
$correct,
$foil_choice_data->{'_count'}-$correct,
@extra_data).
' ';
if (defined($post_graph_text)) {
$analysis_html.=''.$post_graph_text; } $analysis_html.=' |
'
.' '
.&mt('None of the selected students attempted the problem more than [quant,_1,time].'
,$try-1)
.' '
.' | ||||
'
.' '
.&mt('None of the selected students have attempted the problem.')
.' '
.' | ||||
'. ''. &mt('Attempt [_1], [_2] submissions, [_3] correct, [_4] incorrect', $try,$data_count,$correct,$data_count-$correct). ''.' | ||||
'.$concept_graph.' | '. ''.$correct_graph.' | '. ''.$incorrect_graph.' | '. ''.$optionkey.' | '. ' |
'. &mt('Data from [_1] to [_2]', &Apache::lonlocal::locallocaltime($starttime), &Apache::lonlocal::locallocaltime($endtime)). ' | |||
'. &mt('[_1] submissions from [_2] students, [_3] correct, [_4] incorrect', $data_count,$student_count,$correct,$data_count-$correct). ' | |||
'.$concept_correct_plot.' | '. ''.$foil_correct_plot.' | '. ''.$foil_incorrect_plot.' | '. ''.$foilkey.' |
'.
&mt('Start time: [_1]',$startdateform).' '. &mt('End time: [_1]',$enddateform).' | |||
'. ''.('*'x3).''.' | '. ''.&HTML::Entities::encode($option,'<>&"').' | '. "
'. ''.('*'x4).' | '. ''.&HTML::Entities::encode($foil,'<>&"'). (' 'x2).$extra_data->{$foil}.' | '. "
'; $Str .= &Apache::loncommon::start_data_table(); $Str .= &Apache::loncommon::start_data_table_header_row(); $Str .= '