version 1.30, 2009/12/02 18:33:20
|
version 1.32, 2010/06/06 02:40:35
|
Line 110 ENDSCRIPT
|
Line 110 ENDSCRIPT
|
|
|
sub foil { |
sub foil { |
my $number=shift; |
my $number=shift; |
my %values=''; |
my (%values,%defaultvalues,%customvalues); |
|
%defaultvalues = &Apache::lonlocal::texthash( |
|
'unused' => 'Not shown, not used' |
|
); |
if ($qtype eq 'radio') { |
if ($qtype eq 'radio') { |
%values=('true' => 'True', 'false' => 'False'); |
%customvalues = &Apache::lonlocal::texthash( |
|
'true' => 'True', |
|
'false' => 'False' |
|
); |
} elsif ($qtype eq 'option') { |
} elsif ($qtype eq 'option') { |
%values=&evaloptionhash($qparms{$prefix.'options'}); |
%customvalues=&evaloptionhash($qparms{$prefix.'options'}); |
} |
} |
$values{'unused'}='Not shown, not used'; |
%values = (%defaultvalues,%customvalues); |
my $value=$qparms{$prefix.'value'.$number}; |
my $value=$qparms{$prefix.'value'.$number}; |
unless (defined($value)) { $value='unused'; } |
unless (defined($value)) { $value='unused'; } |
unless ($values{$value}) { $value='unused'; } |
unless ($values{$value}) { $value='unused'; } |
Line 131 sub foil {
|
Line 137 sub foil {
|
my $selectvalue=&Apache::loncommon::select_form( |
my $selectvalue=&Apache::loncommon::select_form( |
$value, |
$value, |
'value'.$number, |
'value'.$number, |
&Apache::lonlocal::texthash(%values)); |
\%values); |
my $selectposition=&Apache::loncommon::select_form( |
my $selectposition=&Apache::loncommon::select_form( |
$position, |
$position, |
'position'.$number, |
'position'.$number, |
&Apache::lonlocal::texthash(%positions)); |
{&Apache::lonlocal::texthash(%positions)}); |
my $text=$qparms{$prefix.'text'.$number}; |
my $text=$qparms{$prefix.'text'.$number}; |
my %lt=&Apache::lonlocal::texthash('foil' => 'Foil', |
my %lt=&Apache::lonlocal::texthash('foil' => 'Foil', |
'value' => 'Value', |
'value' => 'Value', |
Line 303 sub handler {
|
Line 309 sub handler {
|
.&Apache::loncommon::select_form( |
.&Apache::loncommon::select_form( |
$qtype, |
$qtype, |
'questiontype', |
'questiontype', |
&Apache::lonlocal::texthash(%questiontypes)) |
{&Apache::lonlocal::texthash(%questiontypes)}) |
.'</fieldset>' |
.'</fieldset>' |
); |
); |
$r->print( |
$r->print( |
Line 337 sub handler {
|
Line 343 sub handler {
|
&Apache::loncommon::select_form( |
&Apache::loncommon::select_form( |
$randomize, |
$randomize, |
'randomize', |
'randomize', |
&Apache::lonlocal::texthash(%randomizes)). |
{&Apache::lonlocal::texthash(%randomizes)}). |
'</td></tr><tr><td bgcolor="#F0F0F0">'); |
'</td></tr><tr><td bgcolor="#F0F0F0">'); |
# Option Response: Options |
# Option Response: Options |
if ($qtype eq 'option') { |
if ($qtype eq 'option') { |
Line 350 sub handler {
|
Line 356 sub handler {
|
$options.'" />'.&mt('Add new option').': '. |
$options.'" />'.&mt('Add new option').': '. |
'<input type="text" name="newopt" size="15" />'. |
'<input type="text" name="newopt" size="15" />'. |
&mt('Delete an option').': '. |
&mt('Delete an option').': '. |
&Apache::loncommon::select_form('','delopt',('' => '',%optionshash)). |
&Apache::loncommon::select_form('','delopt',{'' => '',%optionshash}). |
'</td></tr><tr><td>'); |
'</td></tr><tr><td>'); |
} |
} |
# Foils |
# Foils |
Line 383 sub handler {
|
Line 389 sub handler {
|
&Apache::loncommon::select_form( |
&Apache::loncommon::select_form( |
$stringtype, |
$stringtype, |
'stringtype', |
'stringtype', |
&Apache::lonlocal::texthash(%stringtypes)). |
{&Apache::lonlocal::texthash(%stringtypes)}). |
'</td></tr></table><br />'); |
'</td></tr></table><br />'); |
# Hint |
# Hint |
$r->print(&hint()); |
$r->print(&hint()); |