--- loncom/imspackages/imsexport.pm 2012/05/07 02:12:54 1.10 +++ loncom/imspackages/imsexport.pm 2014/12/11 00:33:22 1.12 @@ -1,6 +1,6 @@ # The LearningOnline Network # -# $Id: imsexport.pm,v 1.10 2012/05/07 02:12:54 raeburn Exp $ +# $Id: imsexport.pm,v 1.12 2014/12/11 00:33:22 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -673,6 +673,7 @@ sub simpleproblem { %values = &evaloptionhash($options); $output .= qq| + $qtext |; @@ -701,8 +702,9 @@ sub simpleproblem { } else { $output .= qq| + $qtext - + |; for (my $k=0; $k<10; $k++) { my $iter = $k+1; @@ -727,14 +729,14 @@ sub simpleproblem { |; } - } elsif ($qtype eq 'stringanswer') { + } elsif ($qtype eq 'string') { my $stringanswer = $qparms{$prefix.'stringanswer'}; my $stringtype=$qparms{$prefix.'stringtype'}; $output .= qq| - - + $qtext + |; if ($hint) { $output .= ' @@ -748,6 +750,55 @@ sub simpleproblem { |; + } elsif ($qtype eq 'numerical') { + my $sigfigs = $qparms{$prefix.'numericalsigfigs'}; + my $unit = $qparms{$prefix.'numericalunit'}; + my $answer = $qparms{$prefix.'numericalanswer'}; + my $tolerance = $qparms{$prefix.'numericaltolerance'}; + my $format = $qparms{$prefix.'numericalformat'}; + my $scriptblock = $qparms{$prefix.'numericalscript'}; + $output .= qq| + +|; + if ($scriptblock) { + $output .= qq| +|; + } + $output .= qq| +$qtext +|; + } + if ($sigfigs) { + $output .= qq| + |; + } + $output .= qq| + |; + if ($hint) { + $output .= qq| + + + '.$hint.' + + |; + } + $output .= qq| + + +|; } else { $output .= qq| @@ -846,7 +897,7 @@ sub templatedpage { $udom |; } - foreach (sort keys %syllabusfields) { + foreach (sort(keys(%syllabusfields))) { $output .= qq| <$_> $syllabusfields{$_}