--- loncom/interface/statistics/lonproblemanalysis.pm 2003/10/14 22:02:49 1.38 +++ loncom/interface/statistics/lonproblemanalysis.pm 2013/12/30 14:19:58 1.142.2.3 @@ -1,7 +1,6 @@ # The LearningOnline Network with CAPA # - -# $Id: lonproblemanalysis.pm,v 1.38 2003/10/14 22:02:49 matthew 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,709 +24,2048 @@ # # 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 @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('
'.
- ' |
'.&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('Concept Number').' | '. - ''.&mt('Concept').' | '. - ''.&mt('Foil Number').' | '. - ''.&mt('Foil Name').' | '. - ''.&mt('Foil Text').' | '. - ''.&mt('Correct Value').' | '. - "
---|---|---|---|---|---|
'.$conceptindex.' | '. - ''.$concept->{'name'}.' | '. - ''.$foilindex++.' | '. - ''.$Foildata{$firstfoil}->{'name'}.' | '. - ''.$Foildata{$firstfoil}->{'text'}.' | '. - ''.$Foildata{$firstfoil}->{'value'}.' | '. - "
'. - ' | '. - ' | '.$foilindex.' | '. - ''.$Foildata{$foilid}->{'name'}.' | '. - ''.$Foildata{$foilid}->{'text'}.' | '. - ''.$Foildata{$foilid}->{'value'}.' | '. - "
'.&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.=' |
'.$plotlink.' | '; - for (my $i=1;$i<$plots_per_row;$i++) { - if ($plotlink = shift(@Plots)) { - $table .= ''.$plotlink.' | '; + my $analysis_html = "
'
+ .' '
+ .&mt('None of the selected students attempted the problem more than [quant,_1,time].'
+ ,$try-1)
+ .' '
+ .' | '; + $analysis_html.= ' | |||
'
+ .' '
+ .&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('Not enough data for concept analysis.'. + ' Performing Foil Analysis instead.'). + '
'. + $table; + } + # + my $num_plots = $env{'form.NumPlots'}; + my $num_data = scalar(@$performance_data)-1; + # + my $current_index; $table .= "'. + &mt('Data from [_1] to [_2]', + &Apache::lonlocal::locallocaltime($starttime), + &Apache::lonlocal::locallocaltime($endtime)). + ' | |||
".$plothtml.' | '.
- "Start Time: ".$startdateform." ". - "End Time : "." ".$enddateform." ". - 'Plot Title :'.(" "x3). - ' '. - " | ||
'. + &mt('[quant,_1,submission,submissions,No submissions] from [quant,_2,student], [_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}.' | '. + "
'.&mt('Sections').' | '; - $Str .= ''.&mt('Enrollment Status').' | '; -# $Str .= ''.&mt('Sequences and Folders').' | '; - $Str .= ''; - $Str .= ' | '.&mt('Sections').' | '; + $Str .= ''.&mt('Groups').' | '; + $Str .= ''.&mt('Access Status').' | '; + $Str .= ''.&mt('Options').' | '; + $Str .= &Apache::loncommon::end_data_table_header_row(); ## ## - $Str .= '
---|---|---|---|---|---|---|
'."\n"; + $Str .= &Apache::loncommon::start_data_table_row(); + $Str .= ' | '."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $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 $showprob_checkbox =
+ '';
+ $Str.= ' '; ## + my $analyze_selector = ''; + $Str .= ' '.$/; ## - $Str .= ' |
'. - ''. - ' | '. - ''.$res->{'title'}.' '; - if ($partdata->{'option'} > 1) { - $seq_str .= &mt('response').' '.$respid; - } - $seq_str .= " |
  | '.$seq->{'title'}.' | '. - "