[LON-CAPA-cvs] cvs: loncom /homework inputtags.pm
sakharuk
lon-capa-cvs@mail.lon-capa.org
Mon, 13 Jan 2003 21:22:43 -0000
sakharuk Mon Jan 13 16:22:43 2003 EDT
Modified files:
/loncom/homework inputtags.pm
Log:
Changes (small but important) to print exams with bubbles.
Index: loncom/homework/inputtags.pm
diff -u loncom/homework/inputtags.pm:1.77 loncom/homework/inputtags.pm:1.78
--- loncom/homework/inputtags.pm:1.77 Thu Dec 5 17:59:37 2002
+++ loncom/homework/inputtags.pm Mon Jan 13 16:22:43 2003
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# input definitons
#
-# $Id: inputtags.pm,v 1.77 2002/12/05 22:59:37 albertel Exp $
+# $Id: inputtags.pm,v 1.78 2003/01/13 21:22:43 sakharuk Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -122,6 +122,13 @@
$result=$token->[4];
}
$result.=&Apache::edit::modifiedfield();
+ } elsif ($target eq 'tex') {
+ if ($$tagstack[-2] eq 'essayresponse' and $Apache::lonhomework::type eq 'exam') {
+ my $number_of_lines= &Apache::lonxml::get_param('rows',$parstack,$safeeval);
+ $result = '\fbox{\fbox{\parbox{\textwidth-5mm}{';
+ for (my $i=0;$i<int $number_of_lines*2;$i++) {$result.='\strut \\\\ ';}
+ $result.='\strut \\\\\strut \\\\\strut \\\\\strut \\\\}}}';
+ }
}
return $result;
}
@@ -171,7 +178,7 @@
} elsif ($target eq 'modified') {
my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval,'size');
if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
- } elsif ($target eq 'tex') {
+ } elsif ($target eq 'tex' and $Apache::lonhomework::type ne 'exam') {
my $size = &Apache::lonxml::get_param('size',$parstack,$safeeval);
if ($size != 0) {$size=$size*2; $size.=' mm';} else {$size='40 mm';}
$result='\framebox['.$size.'][s]{\tiny\strut}';