-
- | $fullname->{$student} |
+ $fullname->{$student} ($studentdis) |
RESULT
}
@@ -1377,6 +1563,9 @@ RESULT
if ($status{'version'}) {
$result .= ' '.&mt('Version').' '.$status{'version'};
}
+ if ($status{'grader'}) {
+ $result .= ' '.&mt('(Graded by [_1])',$status{'grader'}).' ';
+ }
$result.= ' | ';
if ($status{'reviewqueue'} eq 'enqueued') {
$result .= &mt('Awaiting Review');
@@ -1400,17 +1589,23 @@ RESULT
}
sub get_student_status {
- my ($symb,$cdom,$cnum,$udom,$uname)=@_;
- my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},
- $udom,$uname);
+ my ($symb,$cdom,$cnum,$udom,$uname,$type)=@_;
+
my %status;
- $status{'status'}=$record{'resource.status'};
- $status{'version'}=$record{'resource.version'};
- $status{'grader'}=$record{'resource.grader'};
- $status{'reviewqueue'}=&check_queue_for_key($cdom,$cnum,'reviewqueue',
- &encode_queue_key($symb,$udom,$uname));
- $status{'gradingqueue'}=&check_queue_for_key($cdom,$cnum,'gradingqueue',
- &encode_queue_key($symb,$udom,$uname));
+
+ if ($type eq 'Task') {
+ my %record = &Apache::lonnet::restore($symb,$env{'request.course.id'},
+ $udom,$uname);
+ $status{'status'}=$record{'resource.0.status'};
+ $status{'version'}=$record{'resource.0.version'};
+ $status{'grader'}=$record{'resource.0.regrader'};
+ }
+ $status{'reviewqueue'}=
+ &check_queue_for_key($cdom,$cnum,'reviewqueue',
+ &encode_queue_key($symb,$udom,$uname));
+ $status{'gradingqueue'}=
+ &check_queue_for_key($cdom,$cnum,'gradingqueue',
+ &encode_queue_key($symb,$udom,$uname));
return %status;
}
@@ -1510,15 +1705,15 @@ sub get_instance {
foreach my $instance (@instances) {
@Apache::scripttag::parser_env = @_;
$result.=&Apache::scripttag::xmlparse($dimension{$instance.'.text'});
- if ($Apache::lonhomework::history{"resource.$version.status"} eq 'pass' ||
- $Apache::lonhomework::history{"resource.$version.status"} eq 'fail') {
+ if ($Apache::lonhomework::history{"resource.$version.0.status"} eq 'pass' ||
+ $Apache::lonhomework::history{"resource.$version.0.status"} eq 'fail') {
- my $dim_status=$Apache::lonhomework::history{"resource.$version.$dim.status"};
+ my $dim_status=$Apache::lonhomework::history{"resource.$version.0.$dim.status"};
my $mandatory='Mandatory';
if ($Apache::bridgetask::dimensionmandatory{$dim} eq 'N') {
$mandatory='Optional';
}
- my $dim_info="\n";
+ my $dim_info=" \n";
if ($dim_status eq 'pass') {
$dim_info.=' Question : you passed this '.$mandatory.' question';
}
@@ -1533,12 +1728,12 @@ sub get_instance {
if ($dimension{$instance.'.criteria.'.$id.'.mandatory'}
eq 'N') {
$opt_count++;
- if ($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"} eq 'pass') {
+ if ($Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.status"} eq 'pass') {
$opt_passed++;
}
} else {
$man_count++;
- if ($Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"} eq 'pass') {
+ if ($Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.status"} eq 'pass') {
$man_passed++;
}
}
@@ -1552,8 +1747,8 @@ sub get_instance {
$result=~s/\Q$internal_location\E/$dim_info/;
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
- my $status=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.status"};
- my $comment=$Apache::lonhomework::history{"resource.$version.$dim.$instance.$id.comment"};
+ my $status=$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.status"};
+ my $comment=$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.comment"};
my $mandatory=($dimension{$instance.'.criteria.'.$id.'.mandatory'} ne 'N');
if ($mandatory) {
$mandatory='Mandatory';
@@ -1568,13 +1763,14 @@ sub get_instance {
my $status_display=$status;
$status_display=~s/^([a-z])/uc($1)/e;
@Apache::scripttag::parser_env = @_;
- $result.=' '."\n";
+ $result.=&grading_history($version,$dim,$instance,$id);
$last_link=$link;
}
} elsif ($target eq 'grade' && $env{'form.webgrade'}) {
@@ -1619,8 +1816,8 @@ sub get_instance {
my $ungraded=0;
my $review=0;
foreach my $id (@{$dimension{$instance.'.criterias'}}) {
- my $status=$Apache::lonhomework::results{"resource.$version.$dim.$instance.$id.status"}=$env{'form.HWVAL_criteria_'.$instance.'_'.$id};
- $Apache::lonhomework::results{"resource.$version.$dim.$instance.$id.comment"}=$env{'form.HWVAL_comment_criteria_'.$instance.'_'.$id};
+ my $status=$Apache::lonhomework::results{"resource.$version.0.$dim.$instance.$id.status"}=$env{'form.HWVAL_criteria_'.$instance.'_'.$id};
+ $Apache::lonhomework::results{"resource.$version.0.$dim.$instance.$id.comment"}=$env{'form.HWVAL_comment_criteria_'.$instance.'_'.$id};
my $mandatory=($dimension{$instance.'.criteria.'.$id.'.mandatory'} ne 'N');
if ($status eq 'pass') {
if (!$mandatory) { $optional_passed++; }
@@ -1639,16 +1836,16 @@ sub get_instance {
}
&Apache::lonxml::debug("all instance ".join(':',@{$dimension{$instance.'.criterias'}})." results -> m_f $mandatory_failed o_p $optional_passed u $ungraded r $review");
if ($review) {
- $Apache::lonhomework::results{"resource.$version.$dim.status"}=
+ $Apache::lonhomework::results{"resource.$version.0.$dim.status"}=
'review';
} elsif ($ungraded) {
- $Apache::lonhomework::results{"resource.$version.$dim.status"}=
+ $Apache::lonhomework::results{"resource.$version.0.$dim.status"}=
'ungraded';
} elsif ($mandatory_failed) {
- $Apache::lonhomework::results{"resource.$version.$dim.status"}=
+ $Apache::lonhomework::results{"resource.$version.0.$dim.status"}=
'fail';
} else {
- $Apache::lonhomework::results{"resource.$version.$dim.status"}=
+ $Apache::lonhomework::results{"resource.$version.0.$dim.status"}=
'pass';
}
} else {
@@ -1659,15 +1856,47 @@ sub get_instance {
}
}
+sub grading_history {
+ my ($version,$dim,$instance,$criteria) = @_;
+ if (!&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
+ return '';
+ }
+ my ($result,$grader);
+ my $scope="resource.$version.0.$dim.$instance.$criteria";
+ foreach my $t (1..$Apache::lonhomework::history{'version'}) {
+ if (exists($Apache::lonhomework::history{$t.':resource.0.regrader'})) {
+ my ($gname,$gdom) =
+ split('@',$Apache::lonhomework::history{$t.':resource.0.regrader'});
+ my $fullname = &Apache::loncommon::plainname($gname,$gdom);
+ $grader = &Apache::loncommon::aboutmewrapper($fullname,
+ $gname,$gdom);
+ }
+ my $entry;
+ if (exists($Apache::lonhomework::history{"$t:$scope.status"})) {
+ $entry.=" ".$Apache::lonhomework::history{"$t:$scope.status"}.'';
+ }
+ if (exists($Apache::lonhomework::history{"$t:$scope.comment"})) {
+ $entry.=' comment: "'.$Apache::lonhomework::history{"$t:$scope.comment"}.'"';
+ }
+ if ($entry) {
+ $result.= " $grader : $entry ";
+ }
+ }
+ if ($result) {
+ return ' ';
+ }
+ return '';
+}
+
sub start_IntroParagraph {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $result;
if ($target eq 'web' || $target eq 'webgrade') {
if ($tagstack->[-2] eq 'Dimension') {
- $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser);
+ $dimension{'intro'}=&Apache::lonxml::get_all_text('/introparagraph',$parser,$style);
} elsif ($target eq 'webgrade') {
- &Apache::lonxml::get_all_text('/introparagraph',$parser);
+ &Apache::lonxml::get_all_text('/introparagraph',$parser,$style);
}
}
@@ -1696,9 +1925,9 @@ sub end_Instance {
}
sub start_InstanceText {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $instance_id=$Apache::bridgetask::instance[-1];
- my $text=&Apache::lonxml::get_all_text('/instancetext',$parser);
+ my $text=&Apache::lonxml::get_all_text('/instancetext',$parser,$style);
if ($target eq 'web' || $target eq 'webgrade') {
$dimension{$instance_id.'.text'}=$text;
}
@@ -1710,9 +1939,9 @@ sub end_InstanceText {
}
sub start_Criteria {
- my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
my $instance_id=$Apache::bridgetask::instance[-1];
- my $criteria=&Apache::lonxml::get_all_text('/criteria',$parser);
+ my $criteria=&Apache::lonxml::get_all_text('/criteria',$parser,$style);
if ($target eq 'web' || $target eq 'webgrade' || $target eq 'grade') {
my $id=&get_id($parstack,$safeeval);
$dimension{$instance_id.'.criteria.'.$id}=$criteria;
@@ -1742,7 +1971,7 @@ sub proctor_validation_screen {
Proctor Validation
Your room's proctor needs to validate your access to this resource.
$msg
- |