--- loncom/homework/grades.pm 2010/04/14 00:38:09 1.618
+++ loncom/homework/grades.pm 2010/04/17 22:48:52 1.622
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# The LON-CAPA Grading handler
#
-# $Id: grades.pm,v 1.618 2010/04/14 00:38:09 www Exp $
+# $Id: grades.pm,v 1.622 2010/04/17 22:48:52 www Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -43,6 +43,7 @@ use Apache::lonmsg();
use Apache::Constants qw(:common);
use Apache::lonlocal;
use Apache::lonenc;
+use Apache::lonstathelpers;
use String::Similarity;
use LONCAPA;
@@ -1129,7 +1130,7 @@ sub check_buttons {
# Displays the submissions for one student or a group of students
sub processGroup {
- my ($request) = shift;
+ my ($request,$symb) = @_;
my $ctr = 0;
my @stuchecked = &Apache::loncommon::get_env_multiple('form.stuinfo');
my $total = scalar(@stuchecked)-1;
@@ -1139,7 +1140,7 @@ sub processGroup {
$env{'form.student'} = $uname;
$env{'form.userdom'} = $udom;
$env{'form.fullname'} = $fullname;
- &submission($request,$ctr,$total);
+ &submission($request,$ctr,$total,$symb);
$ctr++;
}
return '';
@@ -1845,6 +1846,11 @@ sub files_exist {
sub download_all_link {
my ($r,$symb) = @_;
+ unless (&files_exist($r, $symb)) {
+ $r->print(&mt('There are currently no submitted documents.'));
+ return;
+ }
+
my $all_students =
join("\n", &Apache::loncommon::get_env_multiple('form.stuinfo'));
@@ -1857,7 +1863,14 @@ sub download_all_link {
'cgi.'.$identifier.'.parts' => $parts,});
$r->print(''.
&mt('Download All Submitted Documents').'');
- return
+ return;
+}
+
+sub submit_download_link {
+ my ($request,$symb) = @_;
+ if (!$symb) { return ''; }
+#FIXME: Figure out which type of problem this is and provide appropriate download
+ &download_all_link($request,$symb);
}
sub build_section_inputs {
@@ -1903,10 +1916,7 @@ sub submission {
# header info
if ($counter == 0) {
&sub_page_js($request);
- &sub_page_kw_js($request) if ($env{'form.handgrade'} eq 'yes');
- if ($env{'form.handgrade'} eq 'yes' && &files_exist($request, $symb)) {
- &download_all_link($request, $symb);
- }
+ &sub_page_kw_js($request);
$request->print('
'.&mt('Submission Record').'
');
# option to display problem, only once else it cause problems
@@ -2208,6 +2218,7 @@ KEYWORDS
$request->print(''."\n");
# return if view submission with no grading option
+# FIXME: the logic seems off here. Why show the grade button if you cannot grade?
if (!&canmodify($usec)) {
my $toGrade.=' 'F',
icon => 'edit-find-replace.png',
linktitle => 'Grade all resources in current page/sequence/folder for one student.'
+ },
+ { linktext => 'Download submissions',
+ url => $url1e,
+ permission => 'F',
+ icon => 'edit-find-replace.png',
+ linktitle => 'Download all students submissions.'
}]},
{ categorytitle=>'Automated Grading',
items =>[
@@ -8516,8 +8536,28 @@ sub submit_options_table {
return $result;
}
+sub submit_options_download {
+ my ($request,$symb) = @_;
+ if (!$symb) {return '';}
+
+ &commonJSfunctions($request);
+
+ my $result='';
+ return $result;
+}
+
#--- Displays the submissions first page -------
sub submit_options {
my ($request,$symb) = @_;
@@ -9130,6 +9170,14 @@ sub startpage {
}
}
+sub select_problem {
+ my ($r)=@_;
+ $r->print('