File:  [LON-CAPA] / loncom / html / adm / help / tex / Numerical_Response_Randomization.tex
Revision 1.2: download - view: text, annotated - select for diffs
Thu Jul 18 15:52:27 2002 UTC (22 years ago) by bowersj2
Branches: MAIN
CVS tags: version_2_9_X, version_2_9_99_0, version_2_9_1, version_2_9_0, version_2_8_X, version_2_8_99_1, version_2_8_99_0, version_2_8_2, version_2_8_1, version_2_8_0, version_2_7_X, version_2_7_99_1, version_2_7_99_0, version_2_7_1, version_2_7_0, version_2_6_X, version_2_6_99_1, version_2_6_99_0, version_2_6_3, version_2_6_2, version_2_6_1, version_2_6_0, version_2_5_X, version_2_5_99_1, version_2_5_99_0, version_2_5_2, version_2_5_1, version_2_5_0, version_2_4_X, version_2_4_99_0, version_2_4_2, version_2_4_1, version_2_4_0, version_2_3_X, version_2_3_99_0, version_2_3_2, version_2_3_1, version_2_3_0, version_2_2_X, version_2_2_99_1, version_2_2_99_0, version_2_2_2, version_2_2_1, version_2_2_0, version_2_1_X, version_2_1_99_3, version_2_1_99_2, version_2_1_99_1, version_2_1_99_0, version_2_1_3, version_2_1_2, version_2_1_1, version_2_1_0, version_2_10_X, version_2_10_1, version_2_10_0_RC2, version_2_10_0_RC1, version_2_10_0, version_2_0_X, version_2_0_99_1, version_2_0_2, version_2_0_1, version_2_0_0, version_1_99_3, version_1_99_2, version_1_99_1_tmcc, version_1_99_1, version_1_99_0_tmcc, version_1_99_0, version_1_3_X, version_1_3_3, version_1_3_2, version_1_3_1, version_1_3_0, version_1_2_X, version_1_2_99_1, version_1_2_99_0, version_1_2_1, version_1_2_0, version_1_1_X, version_1_1_99_5, version_1_1_99_4, version_1_1_99_3, version_1_1_99_2, version_1_1_99_1, version_1_1_99_0, version_1_1_3, version_1_1_2, version_1_1_1, version_1_1_0, version_1_0_99_3, version_1_0_99_2, version_1_0_99_1, version_1_0_99, version_1_0_3, version_1_0_2, version_1_0_1, version_1_0_0, version_0_99_5, version_0_99_4, version_0_99_3, version_0_99_2, version_0_99_1, version_0_99_0, version_0_6_2, version_0_6, version_0_5_1, version_0_5, loncapaMITrelate_1, language_hyphenation_merge, language_hyphenation, conference_2003, bz6209-base, bz6209, bz5969, bz2851, PRINT_INCOMPLETE_base, PRINT_INCOMPLETE, HEAD, GCI_3, GCI_2, GCI_1, BZ5971-printing-apage, BZ5434-fox, BZ4492-merge, BZ4492-feature_horizontal_radioresponse
Convenince labels added to the top of each file to assist in creating
index-type help files for things like the XML editor screen (where
there's nothing to hook help to).

    1: \label{Numerical_Response_Randomization}
    2: 
    3: For LON-CAPA, one of the most important functions is the \texttt{random}
    4: function. Random takes three parameters: a \emph{lower limit}, an \emph{upper
    5: limit}, and an \emph{interval}. The \texttt{\&random} function returns a
    6: random value between the upper and lower limit, some integer number of \emph{interval}'s
    7: away from the lower limit. Thus, for example, \texttt{\&random(1,2,.2)} might
    8: return 1, 1.2, 1.4, 1.6, 1.8, or 2. \texttt{\&random} uses a uniform distribution.
    9: Other distributions are available in LON-CAPA, and can be found by consulting
   10: the function list.
   11: 
   12: %
   13: \begin{figure}
   14: \begin{lyxcode}
   15: \$a~=~\&random(1.0,10.0,1.0);
   16: 
   17: \$b~=~\&random(-10.0,~-3.0,~1.0);
   18: 
   19: \$answer~=~\$a+\$b;
   20: \end{lyxcode}
   21: 
   22: \caption{Sample \texttt{random} Calls \label{Sample Random Calls figure}}
   23: \end{figure}
   24: If you put the script in ``Sample Random Calls'' into the
   25: \textbf{Script} block (replacing whatever contents might be in the block
   26: already), you'll get two random variables \$a and \$b. Now, in the \textbf{Text
   27: Block}, put {}``What is \$a plus \$b?'', and in the \textbf{Answer} put
   28: {}``\$answer'', without the quotes for either of them. (It is a good idea
   29: to create a variable to hold the answer and call it \$answer, or some other
   30: reasonably standard name. Do not try to compute the answer in the \textbf{Answer}
   31: field itself; it will not work as you expect.) Now save the problem and \textbf{View}
   32: it. You'll see a randomized problem.
   33: 
   34: For each student, the same random number will be used each time they visit
   35: the problem, but each student will get different random numbers. For any
   36: but the simplest random problems, you'll want to see several random problems
   37: to make sure everything is working out correctly. This is what the \textbf{Random
   38: Seed\index{Random Seed}} field is for. To see another randomized version
   39: of the problem you've just created, put another number into the \textbf{Random
   40: Seed} field and hit \textbf{Change}. It doesn't really matter what number
   41: you put into the field. But for any given \textbf{Random Seed} with the same
   42: problem, you'll see the same randomized problem generated for you. (If you
   43: change the \textbf{Script}, you are no longer guaranteed to get the same
   44: problem.) 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>