--- loncom/interface/statistics/lonsurveyreports.pm 2008/09/14 15:16:30 1.16 +++ loncom/interface/statistics/lonsurveyreports.pm 2010/02/28 23:58:55 1.24 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonsurveyreports.pm,v 1.16 2008/09/14 15:16:30 raeburn Exp $ +# $Id: lonsurveyreports.pm,v 1.24 2010/02/28 23:58:55 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -63,7 +63,7 @@ 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(); @@ -73,7 +73,7 @@ sub BuildSurveyReportsPage { my @Students = @Apache::lonstatistics::Students; # if (@Students < 1) { - $r->print('

There are no students in the sections selected

'); + $r->print('

'.&mt('There are no students in the sections selected.').'

'); } # my @CacheButtonHTML = @@ -98,7 +98,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 +133,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 +177,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; } @@ -182,9 +185,9 @@ sub SurveyProblemSelector { } } if (! scalar(@SurveyProblems)) { - $Str = '

'. - &mt('There are no survey problems in this course'). - '

'.$/; + $Str = '

'. + &mt('There are no survey problems in this course.'). + '

'.$/; return $Str; } $Str .= ''.$/; @@ -201,17 +204,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 .= ''. - ''.$/; + ''.&mt('View survey').''.$/; } $Str .= '
'. ''.''. - ''. + ''. + ''. (' 'x2). - qq{view}.'
'; return $Str; @@ -326,16 +329,17 @@ sub make_text_report { } close($file); if($something_has_been_output) { - $r->print('

'. - &mt('Your text file.'). + $r->print('

'. + &mt('Your text file'). '

'."\n"); $r->print(''); } else { - $r->print('

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

'); + $r->print('

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

'); } $r->rflush(); return; @@ -386,8 +390,8 @@ sub make_Excel_report { my $warned_about_size = 0; foreach my $data (@{$data->{'responses'}}) { if (length($data) > 255 && ! $warned_about_size) { - $r->print('

'. - &mt('[_1]:[_2] responses to [_3] may be too long to fit Excel spreadsheet.', + $r->print('

'. + &mt('[_1]:[_2] responses to [_3] may be too long to fit Excel spreadsheet.', $resource->compTitle, $resource->part_display($partid), $respid). @@ -447,12 +451,12 @@ sub make_Excel_report { } #response ids } # partids $workbook->close(); - $r->print('

'. + $r->print('

'. &mt('Your Excel spreadsheet.'). '

'."\n"); $r->print(''); $r->rflush(); return; @@ -506,14 +510,17 @@ sub make_HTML_report { } } elsif (exists($data->{'foil_count'}) && exists($data->{'foil_responses'})) { - $Str.=''. - ''; + $Str.='' + .''; + &mt('Percent'))).'' + .&Apache::loncommon::end_data_table_header_row(); my @foils = sort(keys(%{$ProblemData->{$partid.'.'.$respid}->{'_Foils'}})); foreach my $foilid (@foils) { my $prob_data = $ProblemData->{$partid.'.'.$respid}; @@ -521,7 +528,7 @@ sub make_HTML_report { my $foiltext = $prob_data->{'_Foils'}->{$foilid}->{'text'}; my $foilname = $prob_data->{'_Foils'}->{$foilid}->{'name'}; my $rowspan = scalar(@{$prob_data->{'_Options'}}); - my $preamble = ''. + my $preamble = &Apache::loncommon::start_data_table_row(). ''. ''. ''.$/; - $preamble = ''; + ''.&Apache::loncommon::end_data_table_row().$/; + $preamble = &Apache::loncommon::continue_data_table_row(); #&Apache::loncommon::start_data_table_row(); } } - $Str.=$tmp.'
' + .&Apache::loncommon::start_data_table() + .&Apache::loncommon::start_data_table_header_row(); my $tmp = ''.join('', (&mt('Foil Name'), &mt('Foil Text'), &mt('Option'), &mt('Frequency'), - &mt('Percent'))).'
'. $foilname.''. @@ -534,11 +541,12 @@ sub make_HTML_report { ''.$count.''. sprintf('%.2f',100*$count/$foil_count).'%'. - '
'; + $Str.=$tmp.&Apache::loncommon::end_data_table() + .''; } elsif (exists($data->{'_count'}) && exists($data->{'foil_values'}) && exists($data->{'map'})) { @@ -553,23 +561,28 @@ sub make_HTML_report { my $count = $data->{'foil_values'}->{$value}; my $foiltext = $ProblemData->{$partid.'.'.$respid}->{'_Foils'}->{$foilid}->{'text'}; my $foilname = $ProblemData->{$partid.'.'.$respid}->{'_Foils'}->{$foilid}->{'name'}; - $tmp .= ''. + $tmp .= &Apache::loncommon::start_data_table_row(). ''.$foilname.''. ''.$foiltext.''. ''.$count.''. ''. sprintf("%.2f",$count/$total*100).'%'. - ''.$/; + &Apache::loncommon::end_data_table_row().$/; } - $Str .= ''. - ''.&mt('Foil Name').''. - ''.&mt('Text').''. - ''.&mt('Freq').''. - ''.&mt('Percent').''. - ''.$/. - $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.= '
'; + $Str.= ''; $r->print($Str); $r->rflush(); } @@ -608,23 +621,24 @@ 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 .= ''; # @@ -641,22 +655,25 @@ 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 .= '

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

'; + $Str .= '

'; ## return $Str; }