--- loncom/interface/statistics/lonstudentsubmissions.pm 2011/11/18 22:20:20 1.54.10.3 +++ loncom/interface/statistics/lonstudentsubmissions.pm 2011/11/18 22:35:33 1.54.10.4 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentsubmissions.pm,v 1.54.10.3 2011/11/18 22:20:20 raeburn Exp $ +# $Id: lonstudentsubmissions.pm,v 1.54.10.4 2011/11/18 22:35:33 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -77,7 +77,7 @@ sub BuildStudentSubmissionsPage { '
'.&mt('Loading student data...').'
'); $r->rflush(); # - if (exists($env{'form.problemchoice'}) && + if ((exists($env{'form.problemchoice'}) || (exists($env{'form.allproblems'}))) && ! exists($env{'form.SelectAnother'})) { foreach my $button (@SubmitButtons) { if ($button->{'name'} eq 'break') { @@ -95,16 +95,32 @@ sub BuildStudentSubmissionsPage { $r->print('
'.$/); $r->rflush(); # + + # + # Get resource objects + my $navmap = Apache::lonnavmaps::navmap->new(); + # Determine which problems we are to analyze my @Symbs = &Apache::lonstathelpers::get_selected_symbs('problemchoice'); + if (defined($navmap)) { + if ($env{'form.allproblems'}) { + my $iterator = $navmap->getIterator(undef, undef, undef, 1); + while (my $curRes = $iterator->next()) { + next if (! ref($curRes)); + if ($curRes->is_problem) { + my $symb = $curRes->symb; + unless(grep(/^\Q$symb\E$/,@Symbs)) { + push(@Symbs,$symb); + } + } + } + } + } foreach my $selected (@Symbs) { $r->print(''.$/); } - # - # Get resource objects - my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { $r->print('
'.&mt("Internal error").'
'); return; @@ -112,7 +128,9 @@ sub BuildStudentSubmissionsPage { my %already_seen; my (@Problems,$show_named); unless (&Apache::loncommon::needs_gci_custom()) { - $show_named = 1; + unless ($env{'form.anonymized'} eq 'true') { + $show_named = 1; + } } foreach my $symb (@Symbs) { my $resource = $navmap->getBySymb($symb); @@ -136,6 +154,9 @@ sub BuildStudentSubmissionsPage { $threshold = 10; } } + unless (&Apache::loncommon::needs_gci_custom()) { + $threshold = 0; + } # $r->print('

'. &Apache::lonstatistics::section_and_enrollment_description(). @@ -341,6 +362,9 @@ sub prepare_html_output { $prob_span += $part_span; } my $title = $prob->compTitle; + unless (&Apache::loncommon::needs_gci_custom()) { + ($title) = ($prob->src =~ m{/([^/]+)$}); + } if ($prob_span > 0) { $headers{'problem'}.= qq{$title}; } elsif ($single_response) { @@ -778,6 +802,9 @@ sub prepare_excel_output { my %start_col; foreach my $prob (@$Problems) { my $title = $prob->compTitle; + unless (&Apache::loncommon::needs_gci_custom()) { + ($title) = ($prob->src =~ m{/([^/]+)$}); + } $worksheet->write($title_row,$cols_output, $title,$format->{'h3'}); foreach my $partid (@{$prob->parts}) { @@ -867,7 +894,7 @@ sub prepare_excel_output { } } } - # Prepend current student's user information to all rows + # Fill in the remaining rows with the students data for (my $row = $student_row;$row<$max_row;$row++) { my $cols = 0; foreach my $field (@StudentColumns) { @@ -1042,7 +1069,11 @@ sub prepare_csv_output { foreach my $prob (@$problems) { my %analysis = &Apache::lonstathelpers::get_problem_data($prob->src); $problem_analysis{$prob->src}=\%analysis; - $headers{'problem'}->[$max_column] = $prob->compTitle; + my $title = $prob->compTitle; + unless (&Apache::loncommon::needs_gci_custom()) { + ($title) = ($prob->src =~ m{/([^/]+)$}); + } + $headers{'problem'}->[$max_column] = $title; foreach my $partid (@{$prob->parts}) { $headers{'part'}->[$max_column] = $prob->part_display($partid); my $responses = [$prob->responseIds($partid)]; @@ -1234,7 +1265,19 @@ sub CreateInterface { $prob_status_checkbox .= 'checked="checked" '; } $prob_status_checkbox .= 'value="true" />'; - # + my $anon_checkbox; + unless (&Apache::loncommon::needs_gci_custom()) { + # + # anonymized checkbox + # + $anon_checkbox = ''. &mt('Show problem').' '.$prob_checkbox.'
'. @@ -1245,8 +1288,14 @@ sub CreateInterface { '
'. '
'. - ''; + '
'; + + unless (&Apache::loncommon::needs_gci_custom()) { + $Str .= '
'; + } + $Str .= ''; # $Str .= ''.$output_selector.''; #