[LON-CAPA-cvs] cvs: loncom /homework grades.pm
schulted
schulted@source.lon-capa.org
Sat, 20 Dec 2008 04:04:36 -0000
schulted Sat Dec 20 04:04:36 2008 EDT
Modified files:
/loncom/homework grades.pm
Log:
Changes related to LON-CAPA redesign project.
Modified grades.pm to use the new menu generator.
Index: loncom/homework/grades.pm
diff -u loncom/homework/grades.pm:1.537 loncom/homework/grades.pm:1.538
--- loncom/homework/grades.pm:1.537 Wed Dec 17 13:06:17 2008
+++ loncom/homework/grades.pm Sat Dec 20 04:04:36 2008
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.537 2008/12/17 13:06:17 harmsja Exp $
+# $Id: grades.pm,v 1.538 2008/12/20 04:04:36 schulted Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -3796,8 +3796,8 @@
$result.=$table;
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n";
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n";
- $result.=' <b>'.&mt('Specify a file containing the class scores for current resource').
- '.</b></td></tr>'."\n";
+ $result.=' <b>'.&mt('Specify a file containing the class scores for current resource.').
+ '</b></td></tr>'."\n";
$result.='<tr bgcolor=#ffffe6><td>'."\n";
my $upload=&mt("Upload Scores");
my $upfile_select=&Apache::loncommon::upfile_select_html();
@@ -7996,36 +7996,49 @@
'saveState'=>"",
'gradingMenu'=>1,
'showgrading'=>"yes");
- my $url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- my @menu = ({ url => $url,
- name => &mt('Manual Grading/View Submissions'),
- short_description =>
- &mt('Start the process of hand grading submissions.'),
- });
+
+ my $url1 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
$fields{'command'} = 'csvform';
- $url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- push(@menu, { url => $url,
- name => &mt('Upload Scores'),
- short_description =>
- &mt('Specify a file containing the class scores for current resource.')});
+ my $url2 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
$fields{'command'} = 'processclicker';
- $url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- push(@menu, { url => $url,
- name => &mt('Process Clicker'),
- short_description =>
- &mt('Specify a file containing the clicker information for this resource.')});
+ my $url3 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
$fields{'command'} = 'scantron_selectphase';
- $url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- push(@menu, { url => $url,
- name => &mt('Grade/Manage/Review Scantron Forms'),
- short_description =>
- &mt('Grade scantron exams, upload/download scantron data files, and review previously graded scantron exams.')});
- $fields{'command'} = 'verify';
- $url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
- push(@menu, { url => "",
- name => &mt('Verify Receipt'),
- short_description =>
- &mt('')});
+ my $url4 = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
+
+ my @menu = ({ categorytitle=>'Course Grading',
+ items =>[
+ { linktext => 'Manual Grading/View Submissions',
+ url => $url1,
+ permission => 'F',
+ icon => 'edit-find-replace.png',
+ linktitle => 'Start the process of hand grading submissions.'
+ },
+ { linktext => 'Upload Scores',
+ url => $url2,
+ permission => 'F',
+ icon => 'uploadscores.png',
+ linktitle => 'Specify a file containing the class scores for current resource.'
+ },
+ { linktext => 'Process Clicker',
+ url => $url3,
+ permission => 'F',
+ icon => 'addClickerInfoFile.png',
+ linktitle => 'Specify a file containing the clicker information for this resource.'
+ },
+ { linktext => 'Grade/Manage/Review Scantron Forms',
+ url => $url4,
+ permission => 'F',
+ icon => 'stat.png',
+ linktitle => 'Grade scantron exams, upload/download scantron data files, and review previously graded scantron exams.'
+ }
+ ]
+ });
+
+ #$fields{'command'} = 'verify';
+ #$url = &Apache::lonhtmlcommon::build_url('grades/',\%fields);
#
# Create the menu
my $Str;
@@ -8039,24 +8052,15 @@
'<input type="hidden" name="gradingMenu" value="1" />'."\n".
'<input type="hidden" name="showgrading" value="yes" />'."\n";
- foreach my $menudata (@menu) {
- if ($menudata->{'name'} ne &mt('Verify Receipt')) {
- $Str .=' <h3><a '.
- $menudata->{'jscript'}.
- ' href="'.
- $menudata->{'url'}.'" >'.
- $menudata->{'name'}."</a></h3>\n";
- } else {
- $Str .='<hr /><input type="button" value="'.&mt('Verify Receipt').'" '.
- $menudata->{'jscript'}.
- ' onClick="javascript:checkChoice(document.forms.gradingMenu,\'5\',\'verify\')" '.
- ' /> '.
- &Apache::lonnet::recprefix($env{'request.course.id'}).
- '-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />';
- }
- $Str .= ' '.(' 'x8).$menudata->{'short_description'}.
- "\n";
- }
+ $Str .= Apache::lonhtmlcommon::generate_menu(@menu);
+ #$menudata->{'jscript'}
+ $Str .='<hr /><input type="button" value="'.&mt('Verify Receipt').'" '.
+ ''.
+ ' onClick="javascript:checkChoice(document.forms.gradingMenu,\'5\',\'verify\')" '.
+ ' /> '.
+ &Apache::lonnet::recprefix($env{'request.course.id'}).
+ '-<input type="text" name="receipt" size="4" onChange="javascript:checkReceiptNo(this.form,\'OK\')" />';
+
$Str .="</form>\n";
$request->print(<<GRADINGMENUJS);
<script type="text/javascript" language="javascript">
@@ -8354,8 +8358,8 @@
$result.=$table;
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n";
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n";
- $result.=' <b>'.&mt('Specify a file containing the clicker information for this resource').
- '.</b></td></tr>'."\n";
+ $result.=' <b>'.&mt('Specify a file containing the clicker information for this resource.').
+ '</b></td></tr>'."\n";
$result.='<tr bgcolor=#ffffe6><td>'."\n";
# Attempt to restore parameters from last session, set defaults if not present
my %Saveable_Parameters=&clicker_grading_parameters();