[LON-CAPA-cvs] cvs: modules /gerd/inter baeck.problem test.pl

www lon-capa-cvs-allow@mail.lon-capa.org
Thu, 20 Mar 2008 22:51:37 -0000


www		Thu Mar 20 18:51:37 2008 EDT

  Added files:                 
    /modules/gerd/inter	baeck.problem test.pl 
  Log:
  Test for UTF8
  
  

Index: modules/gerd/inter/baeck.problem
+++ modules/gerd/inter/baeck.problem
<problem>
<script type="loncapa/perl">#Enter the computations here
$a=&random(5,25,1);
$b=&random(5,25,1);
$c=&random(5,25,1);
$d=&random(5,25,1);
$e=110/($a+$b+$c+$d);</script>
<startouttext />Där sünd für Wüdärstönde, die sünd in Seriä änß eine 110V Überspännugßquälle eingeschlöße.
The resistors are $a ohms, $b ohms, $c ohms and $d Öhmßkäs. Änd what is danne die Stromstärke?
<m>\[\vec{c}\left(\begin{array}{c}4\\ 5\\ 6\end{array}\right)\int_0^\infty\frac{1}{x^2}dx\]</m><endouttext />
<numericalresponse unit="A" format="3s" answer="$e" id="11">
        <responseparam name="tol" default=".01" type="tolerance" description="Nu" />
        <responseparam name="sig" default="2,6" type="int_range,0-16" description="Significant Figures" />
        <textline readonly="no" />
        <hintgroup showoncorrect="no">
                <startouttext />Equivalent resistance for resistors in series are equal to the sum of all the resistors in the series.<endouttext />
        </hintgroup>
</numericalresponse>
</problem>
Index: modules/gerd/inter/test.pl
+++ modules/gerd/inter/test.pl
use utf8;
use locale;
use POSIX qw(locale_h strftime);
setlocale(LC_CTYPE,"de_DE.utf8");
open(IN,'baeck.problem');
$content=join("",<IN>);
close(IN);
print "===\n$content\n===";
print "===\n".lc($content)."\n===";
my $wordonly=$content;
$wordonly=~s/\W//gs;
print "===\n".$wordonly."\n===";
my $iswordonly=$content;
$iswordonly=~s/\P{IsWord}//gs;
print "===\n".$iswordonly."\n===";

print "\n";