--- loncom/interface/lonpickcode.pm 2006/03/16 21:54:40 1.10 +++ loncom/interface/lonpickcode.pm 2007/11/13 01:47:56 1.15 @@ -1,7 +1,7 @@ # The LearningOnline Network # Pick a CODE from the list of possible CODEs # -# $Id: lonpickcode.pm,v 1.10 2006/03/16 21:54:40 albertel Exp $ +# $Id: lonpickcode.pm,v 1.15 2007/11/13 01:47:56 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -75,6 +75,8 @@ sub handler { } if ($env{'form.command'} eq 'codelist') { &code_list($r); + $r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'}, + $env{'form.url'})); } elsif ($env{'form.command'} eq 'showcodes') { &show_codes($r); } else { @@ -85,23 +87,44 @@ sub handler { } sub code_list { - my ($r,$secondview)=@_; - if (!$secondview) { + my ($r,$context)=@_; + # $context = 0 Print page header and enclosing table + # $context = 1 No page header, print enclosing table + # $context = 2 No page header, no enclosing table + my $table_head; + my $extra_css; + if (!$context) { $r->print(&Apache::loncommon::start_page("View CODEs",undef, {'no_nav_bar' => 1})); - $r->print("

".&mt('Select a set of saved CODEs to view.')."

"); - } else { - $r->print("

".&mt('Select another set of saved CODEs to view.')."

"); - } - $r->print("
"); + $table_head = &mt('Select a set of saved CODEs to view.'); + } elsif ($context eq 1) { + $table_head = &mt('Select another set of saved CODEs to view.'); + } elsif ($context eq 2) { + $table_head = &mt('Select a set of saved CODEs to view.'); + $extra_css = 'LC_scantron_action'; + } + $r->print(""); + $r->print(' + '.&Apache::loncommon::start_data_table($extra_css).' + '.&Apache::loncommon::start_data_table_header_row()); + $r->print(''); + $r->print($table_head); + $r->print(''); + $r->print(' + '.&Apache::loncommon::end_data_table_header_row().' + '.&Apache::loncommon::start_data_table_row()); + $r->print(''); + $r->print(" "); $r->print(&Apache::grades::scantron_CODElist()); + $r->print(''); + $r->print(' + '.&Apache::loncommon::end_data_table_row().' + '.&Apache::loncommon::end_data_table()); $r->print(""); $r->print(""); $r->print(""); - $r->print(""); $r->print("
"); - $r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'}, - $env{'form.url'})); + } sub show_codes { @@ -116,6 +139,8 @@ sub show_codes { } $r->print(''); &code_list($r,1); + $r->print(&Apache::grades::show_grading_menu_form($env{'form.symb'}, + $env{'form.url'})); } sub picking_a_code { @@ -143,7 +168,7 @@ ENDSCRIPT my %code_freq=&get_code_freq($r); my $num_matches=length($env{'form.curCODE'}); for (my $i=$num_matches;$i>=0;$i--) { - my $to_print="

CODEs with $i matches

"; + my $to_print="

".&mt("CODEs with [_1] matching letters",$i)."

"; $to_print.=''; my $print; foreach my $code (sort(keys(%codes))) {
CODEexams using this CODE