--- loncom/interface/statistics/lonproblemanalysis.pm 2003/10/06 20:51:20 1.25
+++ loncom/interface/statistics/lonproblemanalysis.pm 2006/02/04 19:06:53 1.124
@@ -1,6 +1,6 @@
# The LearningOnline Network with CAPA
#
-# $Id: lonproblemanalysis.pm,v 1.25 2003/10/06 20:51:20 matthew Exp $
+# $Id: lonproblemanalysis.pm,v 1.124 2006/02/04 19:06:53 bowersj2 Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -24,378 +24,1955 @@
#
# 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;
+
+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('
'.&mt('Option Response Problem Analysis').'
');
+ #
+ my %Saveable_Parameters = ('Status' => 'scalar',
+ 'Section' => '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());
- if (exists($ENV{'form.problemchoice'})) {
- $r->print('
');
- &Apache::lonstatistics::Gather_Full_Student_Data($r);
+ #
+ my @Students = @Apache::lonstatistics::Students;
+ #
+ if (@Students < 1 && exists($env{'form.firstrun'})) {
+ $r->print('There are no students in the sections selected
');
+ }
+ #
+ my @CacheButtonHTML =
+ &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
+ $r->rflush();
+ #
+ my $problem_types = '(option|radiobutton|numerical)';
+ if (exists($env{'form.problemchoice'}) &&
+ ! exists($env{'form.SelectAnother'})) {
+ foreach my $button (@SubmitButtons) {
+ if ($button->{'name'} eq 'break') {
+ $r->print("
\n");
+ } else {
+ $r->print('{'text'}).'" />');
+ $r->print(' 'x5);
+ }
+ }
+ foreach my $html (@CacheButtonHTML) {
+ $r->print($html.(' 'x5));
+ }
+ #
+
+ # This is commented out pending actual implementation of
+ # CSV and Excel output.
+ #$r->print(&Apache::lonstathelpers::submission_report_form
+ # ('problem_analysis'));
#
- my ($symb,$part,$resid) = &get_problem_symb(
- &Apache::lonnet::unescape($ENV{'form.problemchoice'})
- );
$r->print('
');
- my $resource = &get_resource_from_symb($symb);
- if (defined($resource)) {
- my %Data = &get_problem_data($resource->{'src'});
- my $ORdata = $Data{$part.'.'.$resid};
- ##
- ## Render the problem for display
- my $base;
- ($base,undef) = ($resource->{'src'} =~ m|(.*/)[^/]*$|);
- $base = "http://".$ENV{'SERVER_NAME'}.$base;
- $r->print(''.
- ''.
- ''.
-# &Apache::loncommon::get_student_view
-# ($symb,$ENV{'user.name'},$ENV{'user.domain'},$ENV{'request.course.id'},'web').
- &Apache::lonnet::ssi_body($resource->{'src'}).
- ' |
'.
- '