--- loncom/homework/grades.pm 2010/04/11 22:53:23 1.608
+++ loncom/homework/grades.pm 2010/04/12 12:55:18 1.611
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.608 2010/04/11 22:53:23 www Exp $
+# $Id: grades.pm,v 1.611 2010/04/12 12:55:18 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -9194,28 +9194,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,$symb,$onlyfolderflag) = @_;
- unshift(@$crumbs, {href=>"/adm/grades?command=gradingmenu&symb=".&HTML::Entities::encode($symb,'<>&"'),text=>"Grading"});
+sub startpage {
+ my ($r,$symb,$crumbs,$onlyfolderflag) = @_;
+ unshift(@$crumbs,{href=>"/adm/grades?command=gradingmenu&symb=".&HTML::Entities::encode($symb,'<>&"'),text=>"Grading"});
$r->print(&Apache::loncommon::start_page('Grading',undef,
{'bread_crumbs' => $crumbs}));
- if ($env{'form.symb'}) {
- my $symb=$env{'form.symb'};
- my $title=&Apache::lonnet::gettitle($symb);
- $r->print(&Apache::loncommon::start_data_table());
- unless ($onlyfolderflag) {
- $r->print(&Apache::loncommon::start_data_table_row().
- '
'.&mt('Resource:').' | '.$title.' | '.
- &Apache::loncommon::end_data_table_row());
- }
- my ($map,$id,$resource)=&Apache::lonnet::decode_symb($symb);
- my $folder=&Apache::lonnet::gettitle($map);
- $r->print(&Apache::loncommon::start_data_table_row().
- ''.&mt('Folder:').' | '.$folder.' | '.
- &Apache::loncommon::end_data_table_row().
- &Apache::loncommon::end_data_table());
- }
+ $r->print(&Apache::lonhtmlcommon::resource_info_box($symb,$onlyfolderflag));
}
sub handler {
@@ -9258,50 +9243,70 @@ sub handler {
&init_perm();
if ($command eq 'submission' && $perm{'vgr'}) {
&startpage($request,$symb,[{href=>"", text=>"Student Submissions"}]);
- ($env{'form.student'} eq '' ? &listStudents($request) : &submission($request,0,0));
+ ($env{'form.student'} eq '' ? &listStudents($request,$symb) : &submission($request,0,0,$symb));
} elsif ($command eq 'pickStudentPage' && $perm{'vgr'}) {
+ &startpage($request,$symb);
&pickStudentPage($request,$symb);
} elsif ($command eq 'displayPage' && $perm{'vgr'}) {
+ &startpage($request,$symb);
&displayPage($request,$symb);
} elsif ($command eq 'gradeByPage' && $perm{'mgr'}) {
+ &startpage($request,$symb);
&updateGradeByPage($request,$symb);
} elsif ($command eq 'processGroup' && $perm{'vgr'}) {
+ &startpage($request,$symb);
&processGroup($request,$symb);
} elsif ($command eq 'gradingmenu' && $perm{'vgr'}) {
&startpage($request,$symb);
$request->print(&grading_menu($request,$symb));
} elsif ($command eq 'individual' && $perm{'vgr'}) {
+ &startpage($request,$symb);
$request->print(&submit_options($request,$symb));
} elsif ($command eq 'ungraded' && $perm{'vgr'}) {
+ &startpage($request,$symb);
$request->print(&submit_options($request,$symb));
} elsif ($command eq 'table' && $perm{'vgr'}) {
- $request->print(&submit_options_table($request),$symb);
+ &startpage($request,$symb);
+ $request->print(&submit_options_table($request,$symb));
} elsif ($command eq 'all_for_one' && $perm{'vgr'}) {
+ &startpage($request,$symb);
$request->print(&submit_options_sequence($request,$symb));
} elsif ($command eq 'viewgrades' && $perm{'vgr'}) {
+ &startpage($request,$symb);
$request->print(&viewgrades($request,$symb));
} elsif ($command eq 'handgrade' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&processHandGrade($request,$symb));
} elsif ($command eq 'editgrades' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&editgrades($request,$symb));
} elsif ($command eq 'initialverifyreceipt' && $perm{'vgr'}) {
- $request->print(&initialverifyreceipt($request),$symb);
+ &startpage($request,$symb);
+ $request->print(&initialverifyreceipt($request,$symb));
} elsif ($command eq 'verify' && $perm{'vgr'}) {
+ &startpage($request,$symb);
$request->print(&verifyreceipt($request,$symb));
} elsif ($command eq 'processclicker' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&process_clicker($request,$symb));
} elsif ($command eq 'processclickerfile' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&process_clicker_file($request,$symb));
} elsif ($command eq 'assignclickergrades' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&assign_clicker_grades($request,$symb));
} elsif ($command eq 'csvform' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&upcsvScores_form($request,$symb));
} elsif ($command eq 'csvupload' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&csvupload($request,$symb));
} elsif ($command eq 'csvuploadmap' && $perm{'mgr'} ) {
+ &startpage($request,$symb);
$request->print(&csvuploadmap($request,$symb));
} elsif ($command eq 'csvuploadoptions' && $perm{'mgr'}) {
if ($env{'form.associate'} ne 'Reverse Association') {
+ &startpage($request,$symb);
$request->print(&csvuploadoptions($request,$symb));
} else {
if ( $env{'form.upfile_associate'} ne 'reverse' ) {
@@ -9309,32 +9314,43 @@ sub handler {
} else {
$env{'form.upfile_associate'} = 'forward';
}
+ &startpage($request,$symb);
$request->print(&csvuploadmap($request,$symb));
}
} elsif ($command eq 'csvuploadassign' && $perm{'mgr'} ) {
+ &startpage($request,$symb);
$request->print(&csvuploadassign($request,$symb));
} elsif ($command eq 'scantron_selectphase' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&scantron_selectphase($request,$symb));
} elsif ($command eq 'scantron_warning' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&scantron_do_warning($request,$symb));
} elsif ($command eq 'scantron_validate' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&scantron_validate_file($request,$symb));
} elsif ($command eq 'scantron_process' && $perm{'mgr'}) {
+ &startpage($request,$symb);
$request->print(&scantron_process_students($request,$symb));
} elsif ($command eq 'scantronupload' &&
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})||
&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
+ &startpage($request,$symb);
$request->print(&scantron_upload_scantron_data($request,$symb));
} elsif ($command eq 'scantronupload_save' &&
(&Apache::lonnet::allowed('usc',$env{'request.role.domain'})||
&Apache::lonnet::allowed('usc',$env{'request.course.id'}))) {
+ &startpage($request,$symb);
$request->print(&scantron_upload_scantron_data_save($request,$symb));
} elsif ($command eq 'scantron_download' &&
&Apache::lonnet::allowed('usc',$env{'request.course.id'})) {
+ &startpage($request,$symb);
$request->print(&scantron_download_scantron_data($request,$symb));
} elsif ($command eq 'checksubmissions' && $perm{'vgr'}) {
+ &startpage($request,$symb);
$request->print(&checkscantron_results($request,$symb));
} elsif ($command) {
+ &startpage($request,$symb);
$request->print(''.&mt('Access Denied ([_1])',$command).'
');
}
}