[LON-CAPA-cvs] cvs: loncom /homework optionresponse.pm
albertel
lon-capa-cvs@mail.lon-capa.org
Fri, 23 Apr 2004 21:37:41 -0000
albertel Fri Apr 23 17:37:41 2004 EDT
Modified files:
/loncom/homework optionresponse.pm
Log:
- Make TeXlayout Editable
- move TeXlayout to <optionreponse> from <foilgroup>
- remove some debug messages
Index: loncom/homework/optionresponse.pm
diff -u loncom/homework/optionresponse.pm:1.107 loncom/homework/optionresponse.pm:1.108
--- loncom/homework/optionresponse.pm:1.107 Fri Apr 23 13:57:18 2004
+++ loncom/homework/optionresponse.pm Fri Apr 23 17:37:41 2004
@@ -1,7 +1,7 @@
# LearningOnline Network with CAPA
# option list style responses
#
-# $Id: optionresponse.pm,v 1.107 2004/04/23 17:57:18 sakharuk Exp $
+# $Id: optionresponse.pm,v 1.108 2004/04/23 21:37:41 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -56,10 +56,14 @@
$token,'4').
&Apache::edit::select_arg('Randomize Foil Order','randomize',
['yes','no'],$token).
+ &Apache::edit::select_arg(&mt('Display of options when printed'),'TeXlayout',
+ [['horizontal',&mt('Normal list')],
+ ['vertical',&mt('Listed in a vertical column')]],$token).
&Apache::edit::end_row().&Apache::edit::start_spanning_row();
} elsif ($target eq 'modified') {
my $constructtag=&Apache::edit::get_new_args($token,$parstack,
- $safeeval,'max','randomize');
+ $safeeval,'max','randomize',
+ 'TeXlayout');
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
} elsif ($target eq 'meta') {
$result=&Apache::response::meta_package_write('optionresponse');
@@ -159,8 +163,8 @@
my $name;
my @opt;
eval '@opt ='.&Apache::lonxml::get_param('options',$parstack,$safeeval);
- my $TeXlayout=&Apache::lonxml::get_param('TeXlayout',$parstack,$safeeval,undef,0);
- &Apache::lonnet::logthis("PARAMETER U>$TeXlayout<U");
+ my $TeXlayout=&Apache::lonxml::get_param('TeXlayout',$parstack,$safeeval,
+ -2,0);
if ($target eq 'tex' && $tex_option_switch eq 'nochoice') {@opt=();}
&Apache::lonxml::debug("Options are $#opt");
my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
@@ -309,7 +313,6 @@
sub displayfoils {
my ($target,$max,$randomize,$TeXlayout,@opt)=@_;
- &Apache::lonnet::logthis("PARAMETER >>$TeXlayout<<");
if (!defined(@{ $Apache::response::foilgroup{'names'} })) {return;}
my @names = @{ $Apache::response::foilgroup{'names'} };
my @truelist;
@@ -438,7 +441,6 @@
sub optionlist_correction {
my ($TeXlayout,@options) = @_;
- &Apache::lonnet::logthis("PARAMETER >$TeXlayout<");
my $texoptionlist='\\item [] Choices: ';
if ($TeXlayout eq 'vertical') {$texoptionlist='\\item []';}
if (scalar(@options) > 0) {
@@ -597,7 +599,6 @@
if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
$text=&Apache::lonxml::endredirection;
$text=~/(\w)/;
- &Apache::lonnet::logthis("TTTEXT IS HERE NOW >>$text<< >>>$1<<<");
if (($target eq 'tex') and ($Apache::lonhomework::type ne 'exam') and ($text=~/\S/)) {$text = '\vspace*{-2 mm}\item '.$text;}
}
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer'