version 1.145, 2009/06/23 03:01:15
|
version 1.148, 2010/10/14 04:59:08
|
Line 326 sub caparesponse_check_list {
|
Line 326 sub caparesponse_check_list {
|
$element =~ s/\s//g; |
$element =~ s/\s//g; |
} |
} |
my $appendunit=$unit; |
my $appendunit=$unit; |
if (($unit=~/\%/) && ($answerunit ne '%')) { |
# Deal with percentages |
$element=$element/100; |
# unit is unit entered by student, answerunit is unit by author |
$appendunit=~s/\%//; |
# Deprecated: divide answer by 100 if student entered percent, |
} |
# but author did not. Too much confusion |
|
# if (($unit=~/\%/) && ($answerunit ne '%')) { |
|
# $element=$element/100; |
|
# $appendunit=~s/\%//; |
|
# } |
|
# Author entered percent, student did not |
|
if (($unit!~/\%/) && ($answerunit=~/\%/)) { |
|
$element=$element*100; |
|
$appendunit='%'.$appendunit; |
|
} |
|
# Zero does not need a dimension |
if (($element==0) && ($unit!~/\w/) && ($answerunit=~/\w/)) { |
if (($element==0) && ($unit!~/\w/) && ($answerunit=~/\w/)) { |
$appendunit=$answerunit; |
$appendunit=$answerunit; |
} |
} |
$element .= " $appendunit"; |
if ($appendunit ne '') { |
|
$element .= " $appendunit"; |
|
} |
&LONCAPA_INTERNAL_DEBUG("Made response element :$element:"); |
&LONCAPA_INTERNAL_DEBUG("Made response element :$element:"); |
} |
} |
} |
} |