--- loncom/interface/statistics/lonproblemanalysis.pm 2002/11/22 03:46:57 1.11 +++ loncom/interface/statistics/lonproblemanalysis.pm 2013/12/30 14:19:58 1.142.2.3 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA -# (Publication Handler # -# $Id: lonproblemanalysis.pm,v 1.11 2002/11/22 03:46:57 minaeibi Exp $ +# $Id: lonproblemanalysis.pm,v 1.142.2.3 2013/12/30 14:19:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,635 +24,2050 @@ # # http://www.lon-capa.org/ # -# (Navigate problems for statistical reports -# YEAR=2002 -# 5/12,7/26,9/7,11/22 Behrouz Minaei -# -### - 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 %cache; - unless(tie(%cache,'GDBM_File',$cacheDB,&GDBM_READER(),0640)) { - $r->print('Unable to tie database.'); - return; - } - - my $Ptr = ''; - $Ptr .= '
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 .= ' |
'.&Apache::lonstatistics::section_and_enrollment_description().'
'); + if ($env{'form.show_prob'} eq 'true') { + $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].' | '. + '