--- loncom/interface/statistics/lonproblemanalysis.pm 2002/09/07 23:07:38 1.10 +++ loncom/interface/statistics/lonproblemanalysis.pm 2020/11/12 00:15:27 1.142.2.5 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA -# (Publication Handler # -# $Id: lonproblemanalysis.pm,v 1.10 2002/09/07 23:07:38 minaeibi Exp $ +# $Id: lonproblemanalysis.pm,v 1.142.2.5 2020/11/12 00:15:27 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,507 +24,2060 @@ # # http://www.lon-capa.org/ # -# (Navigate problems for statistical reports -# YEAR=2002 -# 5/12,7/26 Behrouz Minaei -# -### - -package Apache::lonproblemanalysis; +package Apache::lonproblemanalysis; use strict; -use Apache::lonnet(); +use Apache::lonnet; +use Apache::loncommon(); use Apache::lonhtmlcommon(); -use GDBM_File; - -my $jr; +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 ($cacheDB, $r)=@_; + 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(&Apache::lonhtmlcommon::breadcrumbs('Detailed Problem Analysis')); + + $r->print(&CreateInterface()); + # + my @Students = @Apache::lonstatistics::Students; + # + if (@Students < 1 && exists($env{'form.firstrun'})) { + $r->print('
'.&Apache::lonstatistics::section_and_enrollment_description().'
'); + if ($env{'form.show_prob'} eq 'true') { + $r->print('Select Sections'; - $Ptr .= ' | '."\n"; - $Ptr .= ''."\n"; - my @sectionsSelected = split(':',$cache{'sectionsSelected'}); - my @sections = split(':',$cache{'sectionList'}); - $Ptr .= &Apache::lonhtmlcommon::MultipleSectionSelect(\@sections, - \@sectionsSelected, - 'Statistics'); - $Ptr .= ' |
Intervals | '."\n"; - $Ptr .= ''; - $Ptr .= &IntervalOptions($cache{'Interval'}); - $Ptr .= ' |
'.
+ &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].' | '. + '