--- loncom/homework/radiobuttonresponse.pm 2013/04/25 17:58:32 1.156
+++ loncom/homework/radiobuttonresponse.pm 2016/09/14 18:18:51 1.157.2.2
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# mutliple choice style responses
#
-# $Id: radiobuttonresponse.pm,v 1.156 2013/04/25 17:58:32 bisitz Exp $
+# $Id: radiobuttonresponse.pm,v 1.157.2.2 2016/09/14 18:18:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -80,7 +80,8 @@ sub start_radiobuttonresponse {
$result=&Apache::response::meta_package_write('radiobuttonresponse');
} elsif ($target eq 'edit' ) {
$result.=&Apache::edit::start_table($token)
- .'
'.&Apache::lonxml::description($token)
+ .' |
'.&Apache::loncommon::insert_folding_button()
+ .&Apache::lonxml::description($token)
.&Apache::loncommon::help_open_topic('Radio_Response_Problems')
.' | '
.''.&mt('Delete?').' '
@@ -376,24 +377,19 @@ sub get_last_survey_response {
}
}
$showanswer = &Apache::response::show_answer();
- unless (
- (
- (
- $Apache::lonhomework::history{"resource.$part.type"} eq
- 'anonsurvey'
- )
- || ( $Apache::lonhomework::history{"resource.$part.type"} eq
- 'anonsurveycred' )
- )
- && ( defined( $env{'form.grade_symb'} ) )
- || ( $newvariation && !$showanswer )
- )
- {
- $lastresponse =
- $Apache::lonhomework::history{"resource.$part.$id.submission"};
+ unless ($newvariation && !$showanswer) {
+ 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'}))) {
+ $lastresponse = $Apache::lonhomework::history{"resource.$part.$id.submission"};
+ } else {
+ unless (($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') ||
+ ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) {
+ $lastresponse = $Apache::lonhomework::history{"resource.$part.$id.submission"};
+ }
+ }
}
my %lastresponse = &Apache::lonnet::str2hash($lastresponse);
-
return \%lastresponse;
@@ -829,10 +825,10 @@ sub html_radiobutton {
my $result=' |