--- loncom/interface/statistics/lonstudentassessment.pm 2003/03/03 22:54:05 1.32 +++ loncom/interface/statistics/lonstudentassessment.pm 2003/03/06 21:12:54 1.36 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.32 2003/03/03 22:54:05 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.36 2003/03/06 21:12:54 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -143,6 +143,7 @@ the button marked "Update Disp

ENDMSG +# $r->print(&OutputDescriptions()); return; } # @@ -155,6 +156,10 @@ ENDMSG $initialize = \&excel_initialize; $output_student = \&excel_outputstudent; $finish = \&excel_finish; + } elsif ($output_mode eq 'multi-sheet excel') { + $initialize = \&multi_sheet_excel_initialize; + $output_student = \&multi_sheet_excel_outputstudent; + $finish = \&multi_sheet_excel_finish; } elsif ($output_mode eq 'csv') { $initialize = \&csv_initialize; $output_student = \&csv_outputstudent; @@ -232,7 +237,7 @@ sub CreateInterface { $Str .= ''; $Str .= 'Sections'; $Str .= 'Student Data'; - $Str .= 'Sequences and Folders'; + $Str .= 'Problem Sets'; $Str .= 'Output Format'; $Str .= ''."\n"; # @@ -273,33 +278,112 @@ sub CreateInterface { my @OutputOptions = ({ name => 'HTML, with links', value => 'html, with links', - description => ''}, + description => 'Output HTML with each symbol linked to the problem '. + 'which generated it.', + mode => 'html', + show => 'all', + show_links => 'yes', + }, { name => 'HTML, without links', value => 'html, without links', - description => ''}, - { name => 'HTML, totals', - value => 'html, totals', - description => ''}, + description => 'Output HTML. By not including links, the size of the'. + ' web page is greatly reduced. If your browser crashes on the '. + 'full display, try this.', + mode => 'html', + show => 'all', + show_links => 'no', + }, { name => 'HTML, scores only', value => 'html, scores only', - description => ''}, - { name => 'Excel, totals', - value => 'excel, totals', - description => ''}, + description => 'Output HTML, only showing the total number of correct'. + ' problems (or problem parts) and not the maximum possible for '. + 'each student', + mode => 'html', + show => 'scores', + show_links => 'no', + }, + { name => 'HTML, totals', + value => 'html, totals', + description => 'Output HTML, but only the summary statistics for each'. + ' sequence selected.', + mode => 'html', + show => 'totals', + show_links => 'no', + }, { name => 'Excel, scores only', value => 'excel, scores only', - description => ''}, - { name => 'CSV, totals', - value => 'csv, totals', - description => ''}, - { name => 'CSV, scores only', - value => 'csv, scores only', - description => ''}, + description => 'Output an Excel file (compatable with Excel 95), '. + 'with a single column for each sequence showing the students '. + 'score.', + mode => 'excel', + show => 'scores', + show_links => 'no', + }, + { name => 'Excel, totals', + value => 'excel, totals', + description => 'Output an Excel file (compatable with Excel 95), '. + 'with two columns for each sequence, the students score on the '. + 'sequence and the students maximum possible on the sequence', + mode => 'excel', + show => 'totals', + show_links => 'no', + }, + { name => 'multi-sheet Excel', + value => 'multi-sheet excel', + description => 'Output an Excel file (compatable with Excel 95), '. + 'with a seperate worksheet for each sequence you have selected '. + 'the data for each problem part '. + '(number of tries, status, points awarded) will be listed.', + mode => 'multi-sheet excel', + show => 'totals', + show_links => 'no', + }, + { name => 'multi-sheet Excel, by section', + value => 'multi-sheet excel, by section', + description => 'Output an Excel file (compatable with Excel 95), '. + 'with a seperate worksheet for each sequence you have selected '. + 'the data for each problem part '. + '(number of tries, status, points awarded) will be listed. '. + 'There will be one Excel workbook for each section selected.', + mode => 'multi-sheet excel', + show => 'by section', + show_links => 'no', + }, { name => 'CSV, everything', value => 'csv, everything', - description => ''} + description => '', + mode => 'csv', + show => 'all', + show_links => 'no', + }, + { name => 'CSV, scores only', + value => 'csv, scores only', + description => '', + mode => 'csv', + show => 'scores', + show_links => 'no', + }, + { name => 'CSV, totals', + value => 'csv, totals', + description => '', + mode => 'csv', + show => 'totals', + show_links => 'no', + }, ); +sub OutputDescriptions { + my $Str = ''; + $Str .= "

Output Modes

\n"; + $Str .= "
\n"; + foreach my $outputmode (@OutputOptions) { + $Str .="
".$outputmode->{'name'}."
\n"; + $Str .="
".$outputmode->{'description'}."
\n"; + } + $Str .= "
\n"; + return $Str; +} + sub CreateAndParseOutputSelector { my $Str = ''; my $elementname = 'outputmode'; @@ -318,25 +402,13 @@ sub CreateAndParseOutputSelector { $show_links = 'no'; $output_mode = 'html'; $show = 'all'; - my ($mode,$restriction) = split(',',$selected); - $restriction =~ s/^\s*//; - if ($mode =~ /^(html|excel|csv)$/) { - $output_mode = $mode; - } else { - $output_mode = 'html'; - } - if ($restriction eq 'with links') { - $show_links = 'yes'; - } else { - $show_links = 'no'; - } - if ($restriction eq 'totals') { - $show = 'totals'; - } elsif ($restriction eq 'scores only') { - $show = 'scores'; - } else { - $show = 'everything'; + foreach my $option (@OutputOptions) { + next if ($option->{'value'} ne $selected); + $output_mode = $option->{'mode'}; + $show = $option->{'show'}; + $show_links = $option->{'show_links'}; } + # # Build the form element $Str = qq/