--- loncom/interface/statistics/lonsurveyreports.pm 2008/10/23 09:07:51 1.18 +++ loncom/interface/statistics/lonsurveyreports.pm 2011/12/21 21:25:51 1.26 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonsurveyreports.pm,v 1.18 2008/10/23 09:07:51 bisitz Exp $ +# $Id: lonsurveyreports.pm,v 1.26 2011/12/21 21:25:51 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -30,6 +30,7 @@ use strict; use Apache::lonnet; use Apache::loncommon(); use Apache::lonhtmlcommon(); +use Apache::lonquickgrades(); use Apache::loncoursedata(); use Apache::lonstatistics; use Apache::lonlocal; @@ -63,10 +64,13 @@ sub BuildSurveyReportsPage { ); &Apache::loncommon::store_course_settings('survey_reports', \%Saveable_Parameters); - &Apache::loncommon::restore_course_settings('survey_resports', + &Apache::loncommon::restore_course_settings('survey_reports', \%Saveable_Parameters); # &Apache::lonstatistics::PrepareClasslist(); + $r->print(&Apache::lonhtmlcommon::breadcrumbs('Student Submission Reports')); + &Apache::lonquickgrades::startGradeScreen($r,'statistics'); + # $r->print(&CreateInterface()); # @@ -98,7 +102,7 @@ sub BuildSurveyReportsPage { # $r->print('
'); $r->print('

'. - &Apache::lonlocal::locallocaltime(time).','. + &Apache::lonlocal::locallocaltime(time).', '. &Apache::lonstatistics::section_and_enrollment_description(). '

'); $r->rflush(); @@ -133,7 +137,10 @@ sub BuildSurveyReportsPage { $r->print('

'.$resource->compTitle.'

'); $r->print('

'.$resource->src.'

'); if ($env{'form.renderprob'} eq 'true') { - $r->print(&Apache::lonstathelpers::render_resource($resource)); + $r->print('
' + .&Apache::lonstathelpers::render_resource($resource) + .'
' + ); } $r->rflush(); my %Data = &Apache::lonstathelpers::get_problem_data @@ -174,7 +181,7 @@ sub SurveyProblemSelector { my @resources = &Apache::lonstathelpers::get_resources($navmap,$seq); foreach my $res (@resources) { foreach my $part (@{$res->parts}) { - if ($res->is_survey($part)) { + if (($res->is_survey($part)) || ($res->is_anonsurvey($part))) { push(@SurveyProblems,{res=>$res,seq=>$seq,part=>$part}); last; } @@ -201,17 +208,17 @@ sub SurveyProblemSelector { resptype=>undef}); my $checked = ''; if ($env{'form.problemchoice'} eq $value) { - $checked = 'checked '; + $checked = 'checked="checked" '; } my $link = $problem->{'res'}->link. '?symb='.&escape($problem->{'res'}->shown_symb); $Str .= ''. ''.''. - ''. + ''. ''. (' 'x2). - ''.&mt('View survey').''.''.$/; + ''.&mt('View survey').''.$/; } $Str .= ''; return $Str; @@ -227,10 +234,7 @@ sub SurveyProblemSelector { sub compile_student_answers { my ($r,$problem,$ProblemData,$Students) = @_; my $resource = $problem->{'resource'}; - my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin - ($r,'Processing Student Submissions', - 'Processing Student Submissions', - scalar(@$Students),'inline',undef,'Statistics','stats_status'); + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,scalar(@$Students)); foreach my $student (@$Students) { foreach my $partid (@{$resource->parts}) { my @response_ids = $resource->responseIds($partid); @@ -272,8 +276,7 @@ sub compile_student_answers { } } } - &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, - 'last student'); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student'); } &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); return; @@ -336,7 +339,7 @@ sub make_text_report { } else { $r->print('

' .&mt('There is no essay or string response data to output for this survey.') - .''); + .'

'); } $r->rflush(); return; @@ -566,15 +569,20 @@ sub make_HTML_report { sprintf("%.2f",$count/$total*100).'%'. &Apache::loncommon::end_data_table_row().$/; } - $Str .= &Apache::loncommon::start_data_table_row(). - ''.&mt('Foil Name').''. - ''.&mt('Text').''. - ''.&mt('Freq').''. - ''.&mt('Percent').''. - &Apache::loncommon::end_data_table_row().$/. - $tmp; + $Str.='' + .'' + .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row() + .''.&mt('Foil Name').'' + .''.&mt('Text').'' + .''.&mt('Frequency').'' + .''.&mt('Percent').'' + .&Apache::loncommon::end_data_table_header_row().$/ + .$tmp + .&Apache::loncommon::end_data_table() + .''; } - $Str.= &Apache::loncommon::end_data_table().'
'; + $Str.= ''; $r->print($Str); $r->rflush(); } @@ -613,23 +621,23 @@ sub CreateInterface { ) { $output_selector.=''.$/; } $output_selector .= ''.$/; - $Str .= &Apache::lonhtmlcommon::breadcrumbs('Student Submission Reports'); $Str .= '

'; - $Str .= ''."\n"; - $Str .= ''; + $Str .= &Apache::loncommon::start_data_table(); + $Str .= &Apache::loncommon::start_data_table_header_row(); $Str .= ''; $Str .= ''; $Str .= ''; $Str .= ''; - $Str .= ''; - $Str .= ''."\n"; + $Str .= ''; + $Str .= &Apache::loncommon::end_data_table_header_row(); # - $Str .= ''; # @@ -646,23 +654,19 @@ sub CreateInterface { # Render problem checkbox my $prob_checkbox = ''. - &mt('Show problem [_1]',$prob_checkbox).'
'. - ''."\n"; - $Str .= '
'.&mt('Sections').''.&mt('Groups').''.&mt('Access Status').''.&mt('Output Format').''.' '.'
'.&mt('Options').'
'."\n"; + $Str .= &Apache::loncommon::start_data_table_row(); + $Str .= ''."\n"; $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5); $Str .= '
'."\n"; - # - $Str .= '

' - .&mt('Status: [_1]', - '') - .'

'; + $Str .= + '' + .'' + .''; + # + $Str .= &Apache::loncommon::end_data_table_row(); + $Str .= &Apache::loncommon::end_data_table(); + # $Str .= '

'; ## return $Str;