version 1.88, 2013/04/25 17:58:32
|
version 1.97, 2025/02/21 20:55:17
|
Line 55 sub start_matchresponse {
|
Line 55 sub start_matchresponse {
|
$result=&Apache::response::meta_package_write('matchresponse'); |
$result=&Apache::response::meta_package_write('matchresponse'); |
} 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).'</td>' |
'<tr><td>'.&Apache::loncommon::insert_folding_button().&Apache::lonxml::description($token).'</td>' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.'<td><span class="LC_nobreak">'.&mt('Delete?').' ' |
.&Apache::edit::deletelist($target,$token) |
.&Apache::edit::deletelist($target,$token) |
.'</span></td>' |
.'</span></td>' |
Line 170 sub end_itemgroup {
|
Line 170 sub end_itemgroup {
|
undef($columns); |
undef($columns); |
} |
} |
if ($target eq 'web') { |
if ($target eq 'web') { |
|
my $table='<table class="LC_itemgroup">'; # extra space to match what latex does. |
my $table='<br /><table>'; # extra space to match what latex does. |
|
if ((!$columns) || ($columns < 0)) { |
if ((!$columns) || ($columns < 0)) { |
if ($direction eq 'horizontal') { |
if ($direction eq 'horizontal') { |
if (@names > 0) { |
if (@names > 0) { |
Line 201 sub end_itemgroup {
|
Line 200 sub end_itemgroup {
|
if ($i % $columns == 0) { |
if ($i % $columns == 0) { |
$table.='<tr>'; |
$table.='<tr>'; |
} |
} |
$table.= '<td>'.$label.'</td><td>'.$item.'</td>'; |
$table.= '<th>'.$label.'</th><td>'.$item.'</td>'; |
if ($columns > 1) { |
if ($columns > 1) { |
$table .= '<td> </td>'; |
$table .= '<td> </td>'; |
} |
} |
Line 319 sub start_foilgroup {
|
Line 318 sub start_foilgroup {
|
&Apache::response::pushrandomnumber(undef,$target); |
&Apache::response::pushrandomnumber(undef,$target); |
if ($target eq 'edit') { |
if ($target eq 'edit') { |
$result.=&Apache::edit::start_table($token) |
$result.=&Apache::edit::start_table($token) |
.'<tr><td>'.&mt('Collection Of Foils').'</td>' |
.'<tr><td>'.&Apache::loncommon::insert_folding_button() |
|
.&mt('Collection Of Foils').'</td>' |
.'<td><span class="LC_nobreak">'.&mt('Delete?') |
.'<td><span class="LC_nobreak">'.&mt('Delete?') |
.&Apache::edit::deletelist($target,$token) |
.&Apache::edit::deletelist($target,$token) |
.'</span></td>' |
.'</span></td>' |
Line 580 sub format_prior_answer {
|
Line 580 sub format_prior_answer {
|
my $output; |
my $output; |
|
|
foreach my $name (@{ $foil_order }) { |
foreach my $name (@{ $foil_order }) { |
my $item=shift(@items); |
my $item = &HTML::Entities::encode(shift(@items),'<>&"'); |
|
if ($item eq '') { |
|
$item = ' '; |
|
} |
$output .= '<tr><td>'.$item.'</td></tr>'; |
$output .= '<tr><td>'.$item.'</td></tr>'; |
} |
} |
return if (!defined($output)); |
return if (!defined($output)); |
Line 652 sub displayfoils {
|
Line 655 sub displayfoils {
|
$newvariation = 1; |
$newvariation = 1; |
} |
} |
} |
} |
unless ((($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') || ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred') && (defined($env{'form.grade_symb'}))) || $newvariation) { |
unless ($newvariation) { |
$lastresponse=$Apache::lonhomework::history{"resource.$part.$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'}))) { |
|
$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); |
my @alphabet=('A'..'Z'); |
my @alphabet=('A'..'Z'); |
my @used_letters=sort(keys(%letter_name_map)); |
my @used_letters=sort(keys(%letter_name_map)); |
Line 671 sub displayfoils {
|
Line 684 sub displayfoils {
|
my $last_letter=$name_letter_map{$lastopt}; |
my $last_letter=$name_letter_map{$lastopt}; |
my $optionlist = ''; |
my $optionlist = ''; |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$optionlist="<option></option>\n"; |
$optionlist="<option value=\"\"></option>\n"; |
} else { |
} else { |
if ($Apache::lonhomework::type ne 'exam') { |
if ($Apache::lonhomework::type ne 'exam') { |
if($env{'form.pdfFormFields'} eq 'yes' |
if($env{'form.pdfFormFields'} eq 'yes' |
Line 688 sub displayfoils {
|
Line 701 sub displayfoils {
|
foreach $option (@used_letters) { |
foreach $option (@used_letters) { |
if ($option eq $last_letter) { |
if ($option eq $last_letter) { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$optionlist.="<option selected=\"selected\">$option</option>\n"; |
$optionlist.="<option value=\"$option\" selected=\"selected\">$option</option>\n"; |
} elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes' |
} elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes' |
&& $Apache::inputtags::status['-1'] eq 'CAN_ANSWER' |
&& $Apache::inputtags::status['-1'] eq 'CAN_ANSWER' |
&& $Apache::lonhomework::type ne 'exam') { |
&& $Apache::lonhomework::type ne 'exam') { |
Line 696 sub displayfoils {
|
Line 709 sub displayfoils {
|
} |
} |
} else { |
} else { |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
$optionlist.="<option>$option</option>\n"; |
$optionlist.="<option value=\"$option\">$option</option>\n"; |
} elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes' |
} elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes' |
&& $Apache::inputtags::status['-1'] eq 'CAN_ANSWER' |
&& $Apache::inputtags::status['-1'] eq 'CAN_ANSWER' |
&& $Apache::lonhomework::type ne 'exam') { |
&& $Apache::lonhomework::type ne 'exam') { |
Line 705 sub displayfoils {
|
Line 718 sub displayfoils {
|
} |
} |
} |
} |
if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') { |
if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') { |
$optionlist='<select onchange="javascript:setSubmittedPart(\''. |
$optionlist='<label><select onchange="javascript:setSubmittedPart(\''. |
$part.'\');" name="HWVAL_'. |
$part.'\');" name="HWVAL_'. |
$Apache::inputtags::response[-1].':'.$temp.'">'. |
$Apache::inputtags::response[-1].':'.$temp.'">'. |
$optionlist."</select>\n"; |
$optionlist."</select>\n"; |
Line 732 sub displayfoils {
|
Line 745 sub displayfoils {
|
} |
} |
if ($target ne 'tex') { |
if ($target ne 'tex') { |
if ($Apache::lonhomework::type ne 'exam') { |
if ($Apache::lonhomework::type ne 'exam') { |
$question.="<br />\n".$optionlist.$text; |
$question.='<div class="LC_matchfoil">'."\n".$optionlist.$text.'</label></div>'; |
} else { |
} else { |
$question.="<br />\n".$text; |
$question.="<br />\n".$text; |
} |
} |
Line 740 sub displayfoils {
|
Line 753 sub displayfoils {
|
my @blank; |
my @blank; |
$question.=&Apache::optionresponse::webbubbles(\@used_letters,\@blank,$temp,$last_letter); |
$question.=&Apache::optionresponse::webbubbles(\@used_letters,\@blank,$temp,$last_letter); |
} |
} |
} else { |
} else { |
# Note that if left or right positioned, we must |
# Note that if left or right positioned, we must |
# confine the bubbles to righttabsize: |
# confine the bubbles to righttabsize: |
# |
# |