';
} elsif ($response eq 'match') {
my %answer=&Apache::lonnet::str2hash($answer);
@@ -273,10 +352,10 @@ sub cleanRecord {
$bottomrow.='
'.$grayFont.$foil.'
';
}
return '
'.
- '
Answer
'.$toprow.'
'.
- '
'.$grayFont.'Item ID
'.
+ '
'.&mt('Answer').'
'.$toprow.'
'.
+ '
'.$grayFont.&mt('Item ID').'
'.
$middlerow.'
'.
- '
'.$grayFont.'Option ID
'.
+ '
'.$grayFont.&mt('Option ID').'
'.
$bottomrow.'
'.'
';
} elsif ($response eq 'radiobutton') {
my %answer=&Apache::lonnet::str2hash($answer);
@@ -286,18 +365,18 @@ sub cleanRecord {
foreach my $foil (@$order) {
if (exists($answer{$foil})) {
if ($foil eq $correct) {
- $toprow.='
true
';
+ $toprow.='
'.&mt('true').'
';
} else {
- $toprow.='
true
';
+ $toprow.='
'.&mt('true').'
';
}
} else {
- $toprow.='
false
';
+ $toprow.='
'.&mt('false').'
';
}
$bottomrow.='
'.$grayFont.$foil.'
';
}
return '
'.
- '
Answer
'.$toprow.'
'.
- '
'.$grayFont.'Option ID
'.
+ '
'.&mt('Answer').'
'.$toprow.'
'.
+ '
'.$grayFont.&mt('Option ID').'
'.
$grayFont.$bottomrow.'
'.'
';
} elsif ($response eq 'essay') {
if (! exists ($env{'form.'.$symb})) {
@@ -349,7 +428,10 @@ sub cleanRecord {
$result.='';
return $result;
}
-
+ } elsif ( $response =~ m/(?:numerical|formula)/) {
+ $answer =
+ &Apache::loncommon::format_previous_attempt_value('submission',
+ $answer);
}
return $answer;
}
@@ -393,8 +475,10 @@ COMMONJSFUNCTIONS
#--- Dumps the class list with usernames,list of sections,
#--- section, ids and fullnames for each user.
sub getclasslist {
- my ($getsec,$filterlist) = @_;
+ my ($getsec,$filterlist,$getgroup) = @_;
my @getsec;
+ my @getgroup;
+ my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
if (!ref($getsec)) {
if ($getsec ne '' && $getsec ne 'all') {
@getsec=($getsec);
@@ -403,10 +487,19 @@ sub getclasslist {
@getsec=@{$getsec};
}
if (grep(/^all$/,@getsec)) { undef(@getsec); }
+ if (!ref($getgroup)) {
+ if ($getgroup ne '' && $getgroup ne 'all') {
+ @getgroup=($getgroup);
+ }
+ } else {
+ @getgroup=@{$getgroup};
+ }
+ if (grep(/^all$/,@getgroup)) { undef(@getgroup); }
- my $classlist=&Apache::loncoursedata::get_classlist();
+ my ($classlist,$keylist)=&Apache::loncoursedata::get_classlist();
# Bail out if we were unable to get the classlist
return if (! defined($classlist));
+ &Apache::loncoursedata::get_group_memberships($classlist,$keylist);
#
my %sections;
my %fullnames;
@@ -423,18 +516,40 @@ sub getclasslist {
$classlist->{$student}->[&Apache::loncoursedata::CL_FULLNAME()];
my $status =
$classlist->{$student}->[&Apache::loncoursedata::CL_STATUS()];
+ my $group =
+ $classlist->{$student}->[&Apache::loncoursedata::CL_GROUP()];
# filter students according to status selected
- if ($filterlist && $env{'form.Status'} ne 'Any') {
- if ($env{'form.Status'} ne $status) {
- delete ($classlist->{$student});
+ if ($filterlist && (!($stu_status =~ /Any/))) {
+ if (!($stu_status =~ $status)) {
+ delete($classlist->{$student});
next;
}
}
+ # filter students according to groups selected
+ my @stu_groups = split(/,/,$group);
+ if (@getgroup) {
+ my $exclude = 1;
+ foreach my $grp (@getgroup) {
+ foreach my $stu_group (@stu_groups) {
+ if ($stu_group eq $grp) {
+ $exclude = 0;
+ }
+ }
+ if (($grp eq 'none') && !$group) {
+ $exclude = 0;
+ }
+ }
+ if ($exclude) {
+ delete($classlist->{$student});
+ }
+ }
$section = ($section ne '' ? $section : 'none');
if (&canview($section)) {
if (!@getsec || grep(/^\Q$section\E$/,@getsec)) {
$sections{$section}++;
- $fullnames{$student}=$fullname;
+ if ($classlist->{$student}) {
+ $fullnames{$student}=$fullname;
+ }
} else {
delete($classlist->{$student});
}
@@ -507,6 +622,7 @@ sub student_gradeStatus {
# Shows a student's view of problem and submission
sub jscriptNform {
my ($symb) = @_;
+ my $stu_status = join(':',&Apache::loncommon::get_env_multiple('form.Status'));
my $jscript='
+GRADINGMENUJS
+ &commonJSfunctions($request);
+ return $Str;
+}
+
+
+#--- Displays the submissions first page -------
+sub submit_options {
my ($request) = @_;
my ($symb)=&get_symb($request);
if (!$symb) {return '';}
@@ -6971,9 +7520,8 @@ sub gradingmenu {
GRADINGMENUJS
&commonJSfunctions($request);
- my $result='
Manual Grading/View Submission
';
my ($table,undef,$hdgrade) = &showResourceInfo($symb,$probTitle);
- $result.=$table;
+ my $result;
my (undef,$sections) = &getclasslist('all','0');
my $savedState = &savedState();
my $saveCmd = ($$savedState{'saveCmd'} eq '' ? 'submission' : $$savedState{'saveCmd'});
@@ -6990,88 +7538,104 @@ GRADINGMENUJS
''."\n".
''."\n";
- $result.='
'."\n".
- '
'."\n".
- ' Select a Grading/Viewing Option
'."\n".
- '
'."\n";
-
- $result.='
';
- $result.='
'."\n".
- ' '.&mt('Select Section').':
';
-
- $result.='
'.
- ''.
- ''.
- ''.
- ''.
- '
'."\n";
-
- $result.='
'.
- '
'."\n";
-
- $result.='
'.
- '
'."\n";
-
- $result.='
'.
- ''.
- '
'."\n";
-
- $result.='
';
-
- $result.='
';
- $result.='
'.
- ''.
- ' '.&mt('scores from file').'
'."\n";
-
- $result.='
'.
- ''.
- ' '.&mt('clicker file').'
'."\n";
-
- $result.='
'.
- ' scantron forms
'."\n";
-
- if ((&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) && ($symb)) {
- $result.='