version 1.155, 2012/02/10 00:26:42
|
version 1.159, 2015/04/07 15:08:12
|
Line 80 sub start_radiobuttonresponse {
|
Line 80 sub start_radiobuttonresponse {
|
$result=&Apache::response::meta_package_write('radiobuttonresponse'); |
$result=&Apache::response::meta_package_write('radiobuttonresponse'); |
} elsif ($target eq 'edit' ) { |
} elsif ($target eq 'edit' ) { |
$result.=&Apache::edit::start_table($token) |
$result.=&Apache::edit::start_table($token) |
.'<tr><td>'.&Apache::lonxml::description($token) |
.'<tr><td>'.&Apache::loncommon::insert_folding_button() |
|
.&Apache::lonxml::description($token) |
.&Apache::loncommon::help_open_topic('Radio_Response_Problems') |
.&Apache::loncommon::help_open_topic('Radio_Response_Problems') |
.'</td>' |
.'</td>' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
Line 90 sub start_radiobuttonresponse {
|
Line 91 sub start_radiobuttonresponse {
|
.&Apache::edit::start_spanning_row(); |
.&Apache::edit::start_spanning_row(); |
$result.= |
$result.= |
&Apache::edit::text_arg('Max Number Of Shown Foils:','max', |
&Apache::edit::text_arg('Max Number Of Shown Foils:','max', |
$token,'4').' 'x 3 . |
$token,'4'). |
&Apache::edit::select_arg('Randomize Foil Order:','randomize', |
&Apache::edit::select_arg('Randomize Foil Order:','randomize', |
['yes','no'],$token).' 'x 3 . |
['yes','no'],$token). |
&Apache::edit::select_arg('Display Direction:','direction', |
&Apache::edit::select_arg('Display Direction:','direction', |
['vertical','horizontal'],$token). |
['vertical','horizontal'],$token). |
&Apache::edit::end_row(). |
&Apache::edit::end_row(). |
Line 376 sub get_last_survey_response {
|
Line 377 sub get_last_survey_response {
|
} |
} |
} |
} |
$showanswer = &Apache::response::show_answer(); |
$showanswer = &Apache::response::show_answer(); |
unless ( |
unless ($newvariation && !$showanswer) { |
( |
if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) || |
( |
(($env{'form.grade_username'} eq $env{'user.name'}) && |
$Apache::lonhomework::history{"resource.$part.type"} eq |
($env{'form.grade_domain'} eq $env{'user.domain'}))) { |
'anonsurvey' |
$lastresponse = $Apache::lonhomework::history{"resource.$part.$id.submission"}; |
) |
} else { |
|| ( $Apache::lonhomework::history{"resource.$part.type"} eq |
unless (($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || |
'anonsurveycred' ) |
($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) { |
) |
$lastresponse = $Apache::lonhomework::history{"resource.$part.$id.submission"}; |
&& ( defined( $env{'form.grade_symb'} ) ) |
} |
|| ( $newvariation && !$showanswer ) |
} |
) |
|
{ |
|
$lastresponse = |
|
$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
|
} |
} |
my %lastresponse = &Apache::lonnet::str2hash($lastresponse); |
my %lastresponse = &Apache::lonnet::str2hash($lastresponse); |
|
|
|
|
return \%lastresponse; |
return \%lastresponse; |
|
|
Line 829 sub html_radiobutton {
|
Line 825 sub html_radiobutton {
|
|
|
my $result='<label>'; |
my $result='<label>'; |
|
|
$result .= '<input type="radio" |
$result .= '<input type="radio" ' |
onchange="javascript:setSubmittedPart(' . "'$part');\"" |
. 'onchange="javascript:setSubmittedPart(' . "'$part');\" " |
. 'name="HWVAL_' . $fieldname . '"' |
. 'name="HWVAL_' . $fieldname . '" ' |
. "value='$value'"; |
. 'value="'.$value.'"'; |
|
|
if (defined($last_responses->{$name})) { |
if (defined($last_responses->{$name})) { |
$result .= ' checked="checked" '; |
$result .= ' checked="checked" '; |
Line 874 sub get_last_response {
|
Line 870 sub get_last_response {
|
} |
} |
} |
} |
unless ($newvariation) { |
unless ($newvariation) { |
$lastresponse = |
if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) || |
$Apache::lonhomework::history{"resource.$part.$id.submission"}; |
(($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); |
my %lastresponse = &Apache::lonnet::str2hash($lastresponse); |
|
|
return \%lastresponse; |
return \%lastresponse; |