[LON-CAPA-cvs] cvs: loncom /homework/templates HintFormula.problem HintFormula.problem.meta HintMathResponse.problem HintMathResponse.problem.meta SimpleFormula.problem.meta SimpleFormulaCAS.problem SimpleFormulaCAS.problem.meta /html/adm/help/tex Formula_Response_Sampling.tex Math_Response_Problems.tex doc/help author.manual.texxml doc/loncapafiles loncapafiles.lpml
www
lon-capa-cvs@mail.lon-capa.org
Mon, 22 Jan 2007 21:49:26 -0000
This is a MIME encoded message
--www1169502566
Content-Type: text/plain
www Mon Jan 22 16:49:26 2007 EDT
Added files:
/loncom/homework/templates HintFormula.problem
HintFormula.problem.meta
HintMathResponse.problem
HintMathResponse.problem.meta
SimpleFormulaCAS.problem
SimpleFormulaCAS.problem.meta
/loncom/html/adm/help/tex Math_Response_Problems.tex
Modified files:
/doc/help author.manual.texxml
/doc/loncapafiles loncapafiles.lpml
/loncom/homework/templates SimpleFormula.problem.meta
/loncom/html/adm/help/tex Formula_Response_Sampling.tex
Log:
* Templates for formula and mathresponse
* Adding documentation to the manual
* stringresponse, etc, are not a subsubsection of "Foils" in author manual
--www1169502566
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20070122164926.txt"
Index: doc/help/author.manual.texxml
diff -u doc/help/author.manual.texxml:1.11 doc/help/author.manual.texxml:1.12
--- doc/help/author.manual.texxml:1.11 Fri Sep 16 18:11:51 2005
+++ doc/help/author.manual.texxml Mon Jan 22 16:48:12 2007
@@ -36,21 +36,24 @@
<subsection name="Foils">
<file name="Foils.tex"/>
</subsection>
- <subsubsection name="Radio Response Problems">
+ <subsection name="Radio Response Problems">
<file name="Radio_Response_Problems.tex"/>
- </subsubsection>
- <subsubsection name="Option Response Problems">
+ </subsection>
+ <subsection name="Option Response Problems">
<file name="Option_Response_Problems.tex"/>
- </subsubsection>
- <subsubsection name="String Response Problems">
+ </subsection>
+ <subsection name="String Response Problems">
<file name="String_Response_Problems.tex"/>
- </subsubsection>
- <subsubsection name="Numerical Response Problems">
+ </subsection>
+ <subsection name="Numerical Response Problems">
<file name="Numerical_Response_Problems.tex"/>
- </subsubsection>
- <subsubsection name="Formula Response Problems">
+ </subsection>
+ <subsection name="Formula Response Problems">
<file name="Formula_Response_Problems.tex"/>
- </subsubsection>
+ </subsection>
+ <subsection name="Math Response Problems">
+ <file name="Math_Response_Problems.tex"/>
+ </subsection>
<subsection name="Creating Radio Response Problems">
<file name="Creating_Radio_Response_Problems.tex"/>
<subsubsection name="Randomization">
@@ -76,6 +79,9 @@
<file name="Option_Response_Simple.tex"/>
</subsubsection>
</subsection>
+ <subsection name="Custom Response Problems">
+ <file name="Custom_Response_Problems.tex"/>
+ </subsection>
<subsection name="Creating a String Response Problem">
<file name="String_Response_Problem_Creation.tex"/>
</subsection>
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.520 doc/loncapafiles/loncapafiles.lpml:1.521
--- doc/loncapafiles/loncapafiles.lpml:1.520 Mon Dec 11 09:14:24 2006
+++ doc/loncapafiles/loncapafiles.lpml Mon Jan 22 16:48:33 2007
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/lpml.dtd">
<!-- loncapafiles.lpml -->
-<!-- $Id: loncapafiles.lpml,v 1.520 2006/12/11 14:14:24 raeburn Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.521 2007/01/22 21:48:33 www Exp $ -->
<!--
@@ -1389,6 +1389,10 @@
Essay.problem.meta;
examupload.problem;
examupload.problem.meta;
+HintFormula.problem;
+HintFormula.problem.meta;
+HintMathResponse.problem;
+HintMathResponse.problem.meta;
man1.jpg;
man1.jpg.meta;
numerical.problem;
@@ -1419,6 +1423,8 @@
script.library.meta;
SimpleFormula.problem;
SimpleFormula.problem.meta;
+SimpleFormulaCAS.problem;
+SimpleFormualCAS.problem.meta;
StringResponse.problem;
StringResponse.problem.meta;
SimpleMatching.problem;
@@ -2778,6 +2784,7 @@
Latex_Header.tex;
Leaving_Feedback.tex;
Login_To_LON-CAPA.tex;
+Math_Response_Problems.tex;
Metadata_Description.tex;
Navigation_Screen.tex;
Navmap_Host_Down.tex;
Index: loncom/homework/templates/SimpleFormula.problem.meta
diff -u loncom/homework/templates/SimpleFormula.problem.meta:1.2 loncom/homework/templates/SimpleFormula.problem.meta:1.3
--- loncom/homework/templates/SimpleFormula.problem.meta:1.2 Mon Jul 28 20:59:31 2003
+++ loncom/homework/templates/SimpleFormula.problem.meta Mon Jan 22 16:48:55 2007
@@ -1 +1 @@
-<title>Formula Response</title>
+<title>Formula Response with Samples</title>
Index: loncom/html/adm/help/tex/Formula_Response_Sampling.tex
diff -u loncom/html/adm/help/tex/Formula_Response_Sampling.tex:1.4 loncom/html/adm/help/tex/Formula_Response_Sampling.tex:1.5
--- loncom/html/adm/help/tex/Formula_Response_Sampling.tex:1.4 Sat Apr 22 16:57:34 2006
+++ loncom/html/adm/help/tex/Formula_Response_Sampling.tex Mon Jan 22 16:49:26 2007
@@ -2,8 +2,18 @@
As you may know, it is extremely difficult to determine whether a given expression
is exactly equal to another expression in general. For example, is $\sin 2x=2\sin x\cos x$?
-Symbolically proving it one way or another is impossible in general. Therefore,
-LON-CAPA uses a sampling system. If your answer and the student's answer
+LON-CAPA has two ways of finding out if it is:
+\begin{itemize}
+\item algebraically, using a symbolic algebra system
+\item numerically, using sampling points
+\end{itemize}
+
+You need to determine which way is the safest in a given situation.
+
+If you don't specify sampling points, the symbolic algebra system is used.
+
+If you do specify sampling points, LON-CAPA uses them.
+If your answer and the student's answer
agree at the sampling points within your given tolerance factor, the student's
answer will be accepted. If the student's answer does not agree at the sampling points within your given tolerance factor, it will be rejected.
Index: loncom/homework/templates/HintFormula.problem
+++ loncom/homework/templates/HintFormula.problem
<problem>
<script type="loncapa/perl">
$a1=&random(3,6,1);
$e1=&random(3,6,1);
$a2=&random(6,8,1);
$e2=&random(6,8,1);
$da1=$a1*$e1;
$da2=$a2*$e2;
$de1=$e1-1;
$de2=$e2-1;
@derivative=($da1.'t^'.$de1,$da2.'t^'.$de2);
@wrongderivative=($a1.'t^'.$de1,$a2.'t^'.$de2);
</script>
<startouttext />What is the derivative of
<m eval="on">\[\left(\begin{array}{c}$a1 t^$e1\\ $a2 t^$e2\end{array}\right)\]</m>
with respect to <m>$t$</m>?<endouttext />
<formularesponse answer="@derivative">
<textline readonly="no" size="25" />
<hintgroup showoncorrect="no">
<formulahint answer="@wrongderivative" name="nomulti"></formulahint>
<hintpart on="nomulti">
<startouttext />You need to multiply with the original exponent.<endouttext />
</hintpart>
</hintgroup>
</formularesponse>
</problem>
Index: loncom/homework/templates/HintFormula.problem.meta
+++ loncom/homework/templates/HintFormula.problem.meta
<title>Formula Response using Computer Algebra System and Hints</title>
Index: loncom/homework/templates/HintMathResponse.problem
+++ loncom/homework/templates/HintMathResponse.problem
<problem>
<script type="loncapa/perl">
$a1 = random(-6,6,4);
$a2 = random(-6,6,4);
$n1 = random(3,11,2);
$n2 = random(2,10,2);
$function = "$a1*cos($n1*x)+$a2*sin($n2*x)";
$example=&xmlparse('An example would be <m eval="on">$(sin($n1\cdot x)+cos($n2\cdot x))/\sqrt{2}$</m>');</script>
<startouttext />
Give an example of a function
<ol>
<li>which is orthogonal to <algebra>$function</algebra> with respect to the
scalar product
<m>\[<g \mid h> =
\frac{1}{\pi} \int_{-\pi}^{\pi}dx g(x) \cdot h(x)\]</m>
</li>
<li>whose norm is 1.</li>
</ol><endouttext />
<mathresponse answerdisplay="$example" cas="maxima" args="$function">
<answer>overlap:integrate((RESPONSE[1])*(LONCAPALIST[1]),x,-%pi,%pi)/%pi;
norm:integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
is(overlap=0 and norm=1);</answer>
<textline readonly="no" size="50" />
<hintgroup showoncorrect="no">
<mathhint name="ortho" args="$function" cas="maxima">
<answer>overlap: integrate((LONCAPALIST[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
is(not overlap = 0);</answer>
</mathhint>
<mathhint name="norm" args="$function" cas="maxima">
<answer>norm: integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
is(not norm = 1);</answer>
</mathhint> <hintpart on="norm">
<startouttext />
The function you have provided does not have a norm of one.<endouttext />
</hintpart>
<hintpart on="ortho">
<startouttext />
The function you have provided is not orthogonal.<endouttext />
</hintpart>
</hintgroup>
</mathresponse>
<postanswerdate><startouttext /><p>Note that with respect to the above norm, <m>$\cos(nx)$</m> is perpendicular to <m>$\sin(nx)$</m> and perpendicular to <m>$\cos(mx)$</m> for <m>$n\ne m$</m>.</p><endouttext />
</postanswerdate>
</problem>
Index: loncom/homework/templates/HintMathResponse.problem.meta
+++ loncom/homework/templates/HintMathResponse.problem.meta
<title>Math Response using Computer Algebra System and Hints</title>
Index: loncom/homework/templates/SimpleFormulaCAS.problem
+++ loncom/homework/templates/SimpleFormulaCAS.problem
<problem>
<script type="loncapa/perl">$k=&random(3,6,1);
$formula="a*x^$k";
$m=$k-1;
$derivative="$k*a*x^$m";</script>
<startouttext />What is the derivative of <tt>$formula</tt> with respect to x?<endouttext />
<formularesponse answer="$derivative">
<responseparam description="Numerical Tolerance" type="tolerance" default="0.00001" name="tol" />
<textline size="25" />
</formularesponse>
</problem>
Index: loncom/homework/templates/SimpleFormulaCAS.problem.meta
+++ loncom/homework/templates/SimpleFormulaCAS.problem.meta
<title>Formula Response using Computer Algebra System</title>
Index: loncom/html/adm/help/tex/Math_Response_Problems.tex
+++ loncom/html/adm/help/tex/Math_Response_Problems.tex
\label{Math_Response_Problems}
Math Response is a way to have a problem graded based on an algorithm that is executed inside of a computer algebra system.
The use of this response type is
generally discouraged, since the responses will not be analyzable by the LON-CAPA statistics tools.
Which computer algebra system is to be used is specified in the cas argument of the mathresponse tag; currently, only Maxima is available.
LON-CAPA sets up two arrays inside the computer algebra system: RESPONSE and LONCAPALIST. RESPONSE contains the student input by component, for example, if "3,42,17" is entered, RESPONSE[2] would be 42. LONCAPALIST contains the arguments passed in the args of mathresponse.
The answerdisplay is what is displayed when the problem is in "Show Answer" mode.
The following example illustrates this.
\begin{verbatim}
<problem>
<script type="loncapa/perl">
$a1 = random(-6,6,4);
$a2 = random(-6,6,4);
$n1 = random(3,11,2);
$n2 = random(2,10,2);
$function = "$a1*cos($n1*x)+$a2*sin($n2*x)";
$example=&xmlparse('An example would be <m eval="on">$(sin($n1\cdot x)+cos($n2\cdot x))/\sqrt{2}$</m>');</script>
<startouttext />
Give an example of a function
<ol>
<li>which is orthogonal to <algebra>$function</algebra> with respect to the
scalar product
<m>\[<g \mid h> =
\frac{1}{\pi} \int_{-\pi}^{\pi}dx g(x) \cdot h(x)\]</m>
</li>
<li>whose norm is 1.</li>
</ol><endouttext />
<mathresponse answerdisplay="$example" cas="maxima" args="$function">
<answer>overlap:integrate((RESPONSE[1])*(LONCAPALIST[1]),x,-%pi,%pi)/%pi;
norm:integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
is(overlap=0 and norm=1);</answer>
<textline readonly="no" size="50" />
<hintgroup showoncorrect="no">
<mathhint name="ortho" args="$function" cas="maxima">
<answer>overlap: integrate((LONCAPALIST[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
is(not overlap = 0);</answer>
</mathhint>
<mathhint name="norm" args="$function" cas="maxima">
<answer>norm: integrate((RESPONSE[1])*(RESPONSE[1]),x,-%pi,%pi)/%pi;
is(not norm = 1);</answer>
</mathhint> <hintpart on="norm">
<startouttext />
The function you have provided does not have a norm of one.<endouttext />
</hintpart>
<hintpart on="ortho">
<startouttext />
The function you have provided is not orthogonal.<endouttext />
</hintpart>
</hintgroup>
</mathresponse>
<postanswerdate><startouttext /><p>Note that with respect to the above norm, <m>$\cos(nx)$</m> is perpendicular to <m>$\sin(nx)$</m> and perpendicular to <m>$\cos(mx)$</m> for <m>$n\ne m$</m>.</p><endouttext />
</postanswerdate>
</problem>
\end{verbatim}
--www1169502566--