--- loncom/homework/grades.pm 2010/04/06 14:56:37 1.605 +++ loncom/homework/grades.pm 2010/04/07 21:08:35 1.607 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.605 2010/04/06 14:56:37 www Exp $ +# $Id: grades.pm,v 1.607 2010/04/07 21:08:35 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -5190,6 +5190,52 @@ sub scantron_selectphase { $ssi_error = 0; + if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) || + &Apache::lonnet::allowed('usc',$env{'request.course.id'})) { + + # Chunk of form to prompt for a scantron file upload. + + $r->print(' +
+ '.&Apache::loncommon::start_data_table('LC_scantron_action').' + '.&Apache::loncommon::start_data_table_header_row().' + +  '.&mt('Specify a bubblesheet data file to upload.').' + + '.&Apache::loncommon::end_data_table_header_row().' + '.&Apache::loncommon::start_data_table_row().' + +'); + my $default_form_data=&defaultFormData(&get_symb($r,1)); + my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'}; + my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'}; + $r->print(&Apache::lonhtmlcommon::scripttag(' + function checkUpload(formname) { + if (formname.upfile.value == "") { + alert("'.&mt('Please use the browse button to select a file from your local directory.').'"); + return false; + } + formname.submit(); + }')); + $r->print(' +
+ '.$default_form_data.' + + + + '.&mt('File to upload: [_1]','').' +
+ +
+'); + + $r->print(' + + '.&Apache::loncommon::end_data_table_row().' + '.&Apache::loncommon::end_data_table().' +'); + } + # Chunk of form to prompt for a file to grade and how: $result.= ' @@ -5237,51 +5283,7 @@ sub scantron_selectphase { $r->print($result); - if (&Apache::lonnet::allowed('usc',$env{'request.role.domain'}) || - &Apache::lonnet::allowed('usc',$env{'request.course.id'})) { - - # Chunk of form to prompt for a scantron file upload. - - $r->print(' -
- '.&Apache::loncommon::start_data_table('LC_scantron_action').' - '.&Apache::loncommon::start_data_table_header_row().' - -  '.&mt('Specify a bubblesheet data file to upload.').' - - '.&Apache::loncommon::end_data_table_header_row().' - '.&Apache::loncommon::start_data_table_row().' - -'); - my $default_form_data=&defaultFormData(&get_symb($r,1)); - my $cdom= $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $cnum= $env{'course.'.$env{'request.course.id'}.'.num'}; - $r->print(&Apache::lonhtmlcommon::scripttag(' - function checkUpload(formname) { - if (formname.upfile.value == "") { - alert("'.&mt('Please use the browse button to select a file from your local directory.').'"); - return false; - } - formname.submit(); - }')); - $r->print(' -
- '.$default_form_data.' - - - - '.&mt('File to upload: [_1]','').' -
- -
-'); - $r->print(' - - '.&Apache::loncommon::end_data_table_row().' - '.&Apache::loncommon::end_data_table().' -'); - } # Chunk of the form that prompts to view a scoring office file, # corrected file, skipped records in a file. @@ -9237,6 +9239,13 @@ sub navmap_errormsg { &mt('It is recommended that you [_1]re-initialize the course[_2] and then return to this grading page.','',''). ''; } +sub startpage{ + my ($r,$crumbs) = @_; + + unshift(@$crumbs, {href=>"/adm/grades",text=>"Grading"}); + $r->print(&Apache::loncommon::start_page('Grading',undef, + {'bread_crumbs' => $crumbs})); +} sub handler { my $request=$_[0]; @@ -9256,11 +9265,8 @@ sub handler { if ($#commands > 0) { &Apache::lonnet::logthis("grades got multiple commands ".join(':',@commands)); } - + $ssi_error = 0; - my $brcrum = [{href=>"/adm/grades",text=>"Grading"}]; - $request->print(&Apache::loncommon::start_page('Grading',undef, - {'bread_crumbs' => $brcrum})); if ($symb eq '' && $command eq '') { # # Not called from a resource @@ -9269,6 +9275,7 @@ sub handler { } else { &init_perm(); if ($command eq 'submission' && $perm{'vgr'}) { + &startpage($request, [{href=>"", text=>"Student Submissions"}]); ($env{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0)); } elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) { &pickStudentPage($request); @@ -9279,6 +9286,7 @@ sub handler { } elsif ($command eq 'processGroup' && $perm{'vgr'}) { &processGroup($request); } elsif ($command eq 'gradingmenu' && $perm{'vgr'}) { + &startpage($request); $request->print(&grading_menu($request)); } elsif ($command eq 'individual' && $perm{'vgr'}) { $request->print(&submit_options($request));