--- loncom/interface/statistics/lonproblemanalysis.pm 2003/10/15 21:30:51 1.39 +++ loncom/interface/statistics/lonproblemanalysis.pm 2006/08/17 21:19:47 1.127 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA # - -# $Id: lonproblemanalysis.pm,v 1.39 2003/10/15 21:30:51 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.127 2006/08/17 21:19:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -25,137 +24,1643 @@ # # http://www.lon-capa.org/ # - package Apache::lonproblemanalysis; use strict; -use Apache::lonnet(); +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 $plotcolors = [qw/ - #33ff00 - #0033cc #990000 #aaaa66 #663399 #ff9933 - #66ccff #ff9999 #cccc33 #660000 #33cc66 - /]; - #[qw/lgreen dgreen dred/]; +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)=@_; - $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 [_1] times.',$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).' | |||
  |
'. - (' 'x4).' | '. - ''.$option.' | '. + ''. + ''.('*'x3).''.' | '. + ''.&HTML::Entities::encode($option,'<>&"').' | '. "
'.$plotlink.' | '.$extrakey." |
'. + ''.('*'x4).' | '. + ''.&HTML::Entities::encode($foil,'<>&"'). + (' 'x2).$extra_data->{$foil}.' | '. + "
".$plothtml.' | '.
- "Start Time: ".$startdateform." ". - "End Time : "." ".$enddateform." ". - 'Plot Title :'.(" "x3). - ' '.$extratable. - " |
'.&mt('Sections').' | '; + $Str .= ''.&mt('Groups').' | '; $Str .= ''.&mt('Enrollment Status').' | '; -# $Str .= ''.&mt('Sequences and Folders').' | '; $Str .= ''; $Str .= ' | '."\n"; + $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5); + $Str .= ' | '; + # $Str .= ''; $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5); $Str .= ' | '; # -# $Str .= ''; - my $only_seq_with_assessments = sub { - my $s=shift; - if ($s->{'num_assess'} < 1) { - return 0; - } else { - return 1; - } - }; - &Apache::lonstatistics::MapSelect('Maps','multiple,all',5, - $only_seq_with_assessments); ## ## $Str .= ' | ';
- { # These braces are here to organize the code, not scope it.
- {
- $Str .= ' '; - } - { - $Str .= ' '; - } - { - $Str .= ' '; + ## + my $analyze_selector = ''; + $Str .= ' '.$/; + ## + my $numplots_selector = ' '; + $Str .= ' | ';
##
##
$Str .= ''."\n";
$Str .= '
'. - ''. - ' | '. - ''.$res->{'title'}.' '; - if ($partdata->{'option'} > 1) { - $seq_str .= &mt('response').' '.$respid; - } - $seq_str .= " |
  | '.$seq->{'title'}.' | '. - "