[LON-CAPA-cvs] cvs: loncom /homework/CAPA-converter capaLexerDef.flex /homework/CAPA-converter/conversion_wrapper README Std_header cnvprb footer header script serprob.problem serprob.txt
albertel
lon-capa-cvs@mail.lon-capa.org
Wed, 20 Mar 2002 18:15:00 -0000
albertel Wed Mar 20 13:15:00 2002 EDT
Added files:
/loncom/homework/CAPA-converter/conversion_wrapper README
Std_header
cnvprb footer
header script
serprob.problem
serprob.txt
Modified files:
/loncom/homework/CAPA-converter capaLexerDef.flex
Log:
- adding Ohio Universities CAPA -> LON-CAPA cleanup scripts
Index: loncom/homework/CAPA-converter/capaLexerDef.flex
diff -u loncom/homework/CAPA-converter/capaLexerDef.flex:1.18 loncom/homework/CAPA-converter/capaLexerDef.flex:1.19
--- loncom/homework/CAPA-converter/capaLexerDef.flex:1.18 Wed Jan 9 15:43:54 2002
+++ loncom/homework/CAPA-converter/capaLexerDef.flex Wed Mar 20 13:15:00 2002
@@ -1,6 +1,6 @@
/* The LearningOnline Network with CAPA
* CAPA lexer dfinition, heavily modified to become a LON-CAPA convertor
- * $Id: capaLexerDef.flex,v 1.18 2002/01/09 20:43:54 albertel Exp $
+ * $Id: capaLexerDef.flex,v 1.19 2002/03/20 18:15:00 albertel Exp $
*
* Copyright Michigan State University Board of Trustees
*
@@ -579,7 +579,7 @@
}
"/OR" { LLDBUG_PRL1("[OR]"); BEGIN S_ANSCONTINUE; RETURN(ANS_OR); }
{EndLine} { LLDBUG_PR1("[EoL within S_TEXT]\n"); /* end of the whole text line */
- send("\n"); }
+ send("<br />\n"); }
[\\]{Space}*{EndLine} { LLDBUG_PR2("[\\EoL continue](%s)",yytext); /* continuation on next line */ }
^{Spaces}"//"[^\n]*$ { LLDBUG_PRL2("[COMMENT<%s>]\n",yytext);
start_mode(MODE_SCRIPT,NULL);
Index: loncom/homework/CAPA-converter/conversion_wrapper/serprob.problem
+++ loncom/homework/CAPA-converter/conversion_wrapper/serprob.problem
<problem>
<import>/res/ohiou/capa/Tools/StdUnits.library</import>
<import>/res/ohiou/capa/Tools/StdConst.library</import>
<import>/res/ohiou/capa/Tools/StdMacros.library</import>
<hr />
<displayduedate />
<displaytitle />
<script type="loncapa/perl">
# ******************************************************
# / Serway & Faughn chapter 5 problem 68 difficulty 3
# / written at MSU July 1998 T&T
# /******************************************************
# /BEG prob_val=1
# /LET try_val=99
# /HIN space for hints
</script>
<script type="loncapa/perl">
$m=&random(2.20,2.505,0.01);
$k=&random(100.0,120.5,1.0);
$d=&random(15.0,20.05,0.1);
$angle=&random(34.0,40.05,0.1);
$alpha=&web('alpha','$\alpha$','<i>alpha</i>');
$picture=&web('','\centerline{\epsfxsize="2.2in" \epsffile{/res/ohiou/serwaylib/Graphics/Graph05/serw0568.eps}}','<IMG SRC="/res/ohiou/serwaylib/Graphics/Graph05/serw0568.gif">');
</script>
<startouttext /><hr />
A <display>&format(${m},'2f')</display><display>${kg_u}</display> bloke situated on a rough incline (assume an angle of <display>${alpha}</display> = <display>&format(${angle},'1f')</display><display>${deg_u}</display>) is connected to a spring of negligible mass having a spring constant k = of <display>&format(${k},'0f')</display><display>${NPm_u}</display> (see the figure below).<display>${newline}</display>
<display>${newline}</display><display>${picture}</display>
The bloke is released from rest when the spring is unstretched, and the pulley is frictionless. The bloke moves <display>&format(${d},'1f')</display><display>${cm_u}</display> down the incline before coming to rest. Find the coefficient of kinetic friction between bloke and incline.
<br />
<endouttext />
<script type="loncapa/perl">
$mu=-($k*$d/100./2.-$m*9.8*&sin($angle*$pi_c/180.))/$m/9.8/&cos($angle*$pi_c/180.);
</script>
<numericalresponse answer="$mu" format="2E">
<responseparam name="tol" type="tolerance" description="Numerical Tolerance" default="2%" />
<responseparam name="sig" type="int,range,0-12" description="Significant Figures" default="3,5" />
<textline />
</numericalresponse>
<script type="loncapa/perl">
# ******************************************************
</script>
<hr />
more stuff at the foot.
</problem>
Index: loncom/homework/CAPA-converter/conversion_wrapper/serprob.txt
+++ loncom/homework/CAPA-converter/conversion_wrapper/serprob.txt
//******************************************************
// Serway & Faughn chapter 5 problem 68 difficulty 3
// written at MSU July 1998 T&T
//******************************************************
//BEG prob_val=1
//LET try_val=99
//HIN space for hints
/IMP "/serway-lib/Tools/Problem#"
/LET m=random(2.20,2.505,0.01)
/LET k=random(100.0,120.5,1.0)
/LET d=random(15.0,20.05,0.1)
/LET angle=random(34.0,40.05,0.1)
/LET alpha=web("alpha","$\alpha$","<i>alpha</i>")
/LET picture=web("","\centerline{\epsfxsize=2.2in \epsffile{/serway-lib/Graphics/Graph05/serw0568.eps}}","<IMG SRC=/serway-lib/Graphics/Graph05/serw0568.gif>")
A /DIS(m:2f)/DIS(kg_u) block situated on a rough incline (assume an angle of /DIS(alpha) = /DIS(angle:1f)/DIS(deg_u)) is connected to a spring of negligible mass having a spring constant k = of /DIS(k:0f)/DIS(NPm_u) (see the figure below)./DIS(newline)
/DIS(newline)/DIS(picture)
The block is released from rest when the spring is unstretched, and the pulley is frictionless. The block moves /DIS(d:1f)/DIS(cm_u) down the incline before coming to rest. Find the coefficient of kinetic friction between block and incline.
/LET mu=-(k*d/100./2.-m*9.8*sin(angle*pi_c/180.))/m/9.8/cos(angle*pi_c/180.)
/ANS(mu:2E,tol=2%,sig=3 plus 2,wgt=prob_val,tries=try_val)
//******************************************************