--- loncom/homework/inputtags.pm 2013/04/26 18:08:48 1.316 +++ loncom/homework/inputtags.pm 2013/04/30 03:03:34 1.317 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.316 2013/04/26 18:08:48 bisitz Exp $ +# $Id: inputtags.pm,v 1.317 2013/04/30 03:03:34 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -216,7 +216,16 @@ sub start_textfield { } } unless ($newvariation) { - $oldresponse = $Apache::lonhomework::history{"resource.$partid.$resid.submission"}; + if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) || + (($env{'form.grade_username'} eq $env{'user.name'}) && + ($env{'form.grade_domain'} eq $env{'user.domain'}))) { + $oldresponse = $Apache::lonhomework::history{"resource.$partid.$resid.submission"}; + } elsif (($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurvey') || + ($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurveycred')) { + $oldresponse = '* '.&mt('only shown to submitter').' *'; + } else { + $oldresponse = $Apache::lonhomework::history{"resource.$partid.$resid.submission"}; + } } if ($Apache::inputtags::status[-1] eq 'CAN_ANSWER') { my $cols = &Apache::lonxml::get_param('cols',$parstack,$safeeval); @@ -407,7 +416,18 @@ sub start_textline { } } unless ($newvariation) { - $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"}; + if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) || + (($env{'form.grade_username'} eq $env{'user.name'}) && + ($env{'form.grade_domain'} eq $env{'user.domain'}))) { + $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"}; + } elsif (($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurvey') || + ($Apache::lonhomework::history{"resource.$partid.type"} eq 'anonsurveycred') || + ($Apache::lonhomework::type eq 'anonsurvey') || + ($Apache::lonhomework::type eq 'anonsurveycred')) { + $oldresponse = '* '.&mt('only shown to submitter').' *'; + } else { + $oldresponse = $Apache::lonhomework::history{"resource.$partid.$id.submission"}; + } &Apache::lonxml::debug("oldresponse $oldresponse is ".ref($oldresponse)); if (ref($oldresponse) eq 'ARRAY') { $oldresponse = $oldresponse->[$#Apache::inputtags::inputlist];