--- loncom/homework/response.pm 2003/05/23 19:37:33 1.79
+++ loncom/homework/response.pm 2003/07/28 22:44:54 1.82
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# various response type definitons response definition
#
-# $Id: response.pm,v 1.79 2003/05/23 19:37:33 albertel Exp $
+# $Id: response.pm,v 1.82 2003/07/28 22:44:54 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -93,10 +93,13 @@ sub setrandomnumber {
$rndmod+=&Apache::lonnet::numval($Apache::inputtags::response[-1]);
}
if ($rndseed =~/,/) {
- my ($num1,$num2)=split(/,/,$rndseed);
- $num1+=$rndmod;
- $num2+=$rndmod;
- $rndseed="$num1,$num2";
+ {
+ use integer;
+ my ($num1,$num2)=split(/,/,$rndseed);
+ $num1+=$rndmod;
+ $num2+=$rndmod;
+ $rndseed="$num1,$num2";
+ }
} else {
$rndseed+=$rndmod;
}
@@ -368,13 +371,8 @@ sub answer_header {
$result = ' \vskip 0 mm \begin{tabular}{|c|}\hline Answer for Part: '.
$Apache::inputtags::part.' \\\\ \hline ';
} else {
- if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse' ) {
- $result = '
Answer for Part:'.
- $Apache::inputtags::part. ' |
---|
'."\n";
- } else {
- $result = 'Answer for Part:'.
- $Apache::inputtags::part. ' | '."\n";
- }
+ $result = 'Answer for Part:'.
+ $Apache::inputtags::part. ' | '."\n";
}
return $result;
}
@@ -383,13 +381,9 @@ sub answer_part {
my ($type,$answer) = @_;
my $result;
if ($ENV{'form.answer_output_mode'} eq 'tex') {
- $result = ' '.$answer.'\\\\ \hline ';
+ $result = ' \verb|'.$answer.'|\\\\ \hline ';
} else {
- if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
- $result = ''.$answer.' | ';
- } else {
- $result = ''.$answer.' | ';
- }
+ $result = ''.$answer.' | ';
}
return $result;
}
@@ -400,11 +394,7 @@ sub answer_footer {
if ($ENV{'form.answer_output_mode'} eq 'tex') {
$result = ' \end{tabular} \vskip 0 mm ';
} else {
- if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') {
- $result = '
';
- } else {
- $result = '
';
- }
+ $result = '
';
}
return $result;
}