\hrule \section{Prototype Set with Three Problems} \vskip 0.2in \hrule \vskip 0.2in \subsection{\bf General Description.} The source code for a class's problems are contained in files named {\sl set$x$.qz} where {\em x} is the problem set number. These files usually incorporate information from other files (problem libraries) using the import command, {\tt /IMP}. The example\footnote{\fbox{Boxed} items denote Clicking on a Button selection} below was assembled with {\sf Quizzer} by (1) selecting \fbox{File} in the main menu then (2) choosing \fbox{New}. You will then be prompted to choose the {\sl capa.config} file for the class you are working in, for example {\sl /usr/users/teacher/CAPA5/nsc121s9/capa.config}. In the new window, (3) click \fbox{Std. Header} then (4) \fbox{Import} three times, each time selecting a problem to be imported from the {\sl /demolibrary /type00/sample-prob$xx$}. Each time you import a problem you will be asked to set the weight of the problem and the number of tries allowed. Finally, (5) click \fbox{Endline}. Note: each time you click on one of the buttons, you will be prompted if your cursor is in the correct position. Make sure the cursor is at the beginning of a blank line and not within header and question text. \index{sample problem set} \begin{capacode} //CAPA system software is copyrighted by Michigan State University. //By using these materials, the User agrees to: //1) Protect the source code files from unauthorized copying. //2) Limit access of the source material to teaching staff. //3) The User is free to mix, cut and paste, modify, adapt, delete, // improve, etc. the problems and graphics for his/her own use. // /IMP "/demolibrary/Tools/StdMacros" /IMP "/demolibrary/Tools/StdUnits" /IMP "/demolibrary/Tools/StdConst" /IMP "/demolibrary/Tools/GreekWeb2" /IMP "HWTop" // // /BEG prob_val=1 /LET try_val=99 /LET hint_val=1 /DIS("/demolibrary/type00/sample-prob01") /IMP "/demolibrary/type00/sample-prob01" /DIS(stdline) // /BEG prob_val=1 /LET try_val=99 /LET hint_val=1 /DIS("/demolibrary/type00/sample-prob02") /IMP "/demolibrary/type00/sample-prob02" /DIS(stdline) // /BEG prob_val=1 /LET try_val=99 /LET hint_val=1 /DIS("/demolibrary/type00/sample-prob03") /IMP "/demolibrary/type00/sample-prob03" /DIS(stdline) /END(stdendline) \end{capacode} \capa\ processes the above set in a number of ways. By choosing \fbox{Create .dvi} and selecting a student by entering {\tt A87654321}, one obtains the result displayed on the following page. This set is similar to {\sl nsc121s9/set2.qz} in the distribution. \\ \\ \\ \index{sample problems!tex output} { \parbox[t]{3.9in}{ \noindent{\large\bf Student, Jaimie .\hfill Section {\Large 1}}\newline \vskip -.1in \noindent {\large \it Sample \capa Questions \hfill Set 2}\newline \vskip -.16in \noindent{\bf nsc121s9} Due Fri, May 28, 1999 at 10:00\hfill CAPA\_ID 8239 \vskip .05in \pagestyle{empty} /demolibrary/type00/sample-prob01 {\par \bf 1.} [1pt] Find the area of a rectangle with a length of 8.0$\, cm$ and width of 4.0$\, cm$. \vskip .05in \hrule width2in height0.6pt \hfill \vskip .02in /demolibrary/type00/sample-prob02 {\par \bf 2.} [1pt] The graph below shows the function \\ \centerline{$Y=ax$} Make a careful determination of the value of $a$. \epsfxsize=3.6in \epsffile{/demolibrary/Graphics/Gtype00/Ym39x.ps} \vskip .05in \hrule width2in height0.6pt \hfill \vskip .02in /demolibrary/type00/sample-prob03 {\par \bf 3.} [1pt] A mass M = 0.13$\, kg$ is on a smooth horizontal surface with negligible friction. It is attached to a spring with spring constant k = 15.3$\, N/m$. The mass is displaced from its equilibrium position by a distance of 0.14$\, m$ and then released from rest. (Give all of the correct answers, i.e., A or BC or ABC...) \begin{choicelist} \item[] A) The amplitude doesn't vary with time \item[] B) The motion of M is simple harmonic motion. \item[] C) The frequency of oscillation is independent of k. \end{choicelist} \vskip .05in \hrule width2in height0.6pt \hfill \vskip .02in \vskip .05in \hrule width3.55in height0.6pt \hfill \vskip -.07in \noindent {\tiny College of Natural Science, Michigan State University \dotfill {CAPA\copyright msu}} \index{HWTop file!sample output} }\hspace*{.3in}\parbox[t]{2.9 in}{ \footnotesize {\tt <==} The first 3-lines on the left are generated by the HWTop file. This file uses definition in the StdMacros file so that the order of /IMP in the set{\em x}.qz is important. \vspace*{0.2in} \index{/DIS!sample output} {\tt <==} This line shows the path of the imported problem. It is essential for classifying the content of a library. It is also useful while debugging a set. Before printing for students, just change the {\tt /DIS...} to a comment, i.e., to {\tt //DIS...} in the {\sl set$x$.qz} file. \vspace*{1.2in} \index{sample problems!graphics} {\tt <==} The paths for {\sl .ps} or {\sl .gif} version of the picture are specified in the problem file. This is one of 14 pictures randomly selected for students as will be seen below from the problem code. \vspace*{01.4in} \index{problem value} {\tt <==} The point value here is set by the {\tt /BEG prob\_val=2} at the start of Problem 3. [Note: {\tt /BEG} is just an alias for {\tt /LET} \vspace*{0.7in}{\tt <==} This type of problem should have at least 4 statements unless it is in an exam where students have just one try. That is, at least one of the three statements should have two choices for \capa\ to randomize from. Therefore, there may be several versions of each of the statements (see problem code in ``Problem 3'' section.) } \newpage \index{Tools directory!StdMacros} \index{Tools directory!StdUnits} \index{Tools directory!StdConst} \subsection{\bf Imported Standard Files.} All the files below should be read as examples of CAPA coding and may be edited and adapted by users. \begin{itemize} \item The {\sl /demolibrary/Tools/StdMacros} contains a set of useful macros such as ``stdline'' to facilitate coding. \item The {\sl /demolibrary/Tools/StdUnits} has a large number of unit combinations pre-formatted for presentation on the printed page and Web browsers. \item The {\sl /demolibrary/Tools/StdConst} defines variables for a number of often used fundamental constants. \item The {\sl /demolibrary/Tools/GreekWeb2} file is a list of variables for displaying greek letters, symbols, etc. You can view the symbols in the output of {\sl set13.qz} in the distribution class. \index{HWTop file!description} \index{copyright line} \index{Department Name} \item The {\sl HWTop} file resides in the classname folder. Two lines which construct the stdendline require editing. They are visually separated from other items in the file by rows of asterisks. Please edit these lines to reflect the correct course and department information. \begin{capacode} //************* Edit the 2 statements below to suit **************** /LET coursename="Sample \capa Questions" /LET DeptID="College of Natural Science, Michigan State University" //****************************************************************** // /IF (tex("Y","N")=="Y") /DIS("\noindent{\large\bf "+name()+"\hfill Section {\Large "+section()+"}}\newline") /DIS("\vskip -.1in") /DIS("\noindent {\large \it "+coursename+" \hfill Set "+set()+"}\newline") /DIS("\vskip -.16in") /DIS("\noindent{\bf "+class()+"} Due "+due_date()+"\hfill CAPA\_ID "+capa_id()) /DIS("\vskip .05in \pagestyle{empty}") /ENDIF /DIS(html(""+name()+"")) /LET stdendline=stdendlineA+DeptID+stdendlineB //A & B are in Tools/StdMacros \end{capacode} \item {\sl HWTopSN} is similar except for an extra line of code which displays the student number. This is not recommended because the combination of the student number and \capa\ ID is all that is needed to access the system for this and preceeding problem sets. \end{itemize} \newpage \subsection{\bf Problem 1.} \index{sample problems} The text of {\sl /demolibrary/type00/sample-prob01} is: \vskip 3mm {\footnotesize { \begin{minipage}[t]{4.2in} \begin{verbatim} //************************************** //BEG prob_val=1 //LET try_val=20 /IMP "/demolibrary/Tools/Problem#" // By kashy@nscl.msu.edu, No commercial use. /HIN The area of a rectangle is the product of the two sides. /EXP Multiply the length by the width and enter the result. // /LET long=random(7.0,9.1,1.0) /LET wide=random(2.0,5.1,2.0) // Find the area of a rectangle with a length of /DIS(long:1f)\ /DIS(cm_u) and width of /DIS(wide:1f)/DIS(cm_u). // /LET area=long*wide /ANS(area:1f,tol=0.2,wgt=prob_val,tries=10,hint=hint\_val,unit="cm^2") //************************************** \end{verbatim} \end{minipage}\hspace*{8mm} \begin{minipage}[t]{2.4in} \vspace*{2mm}{\tt <==} The {\tt //BEG prob\_val=2} and {\tt //LET try\_val=2} are comments. The variables {\tt prob\_val} and {\tt try\_val} are defined in the {\sl set$x$.qz}. \\ \index{hints!usage} \index{explanations!usage} \vspace*{-2mm}{\tt <==} Hints and Explanations are optional. Additional hints can be inserted directly in the {\sl set$x$.qz} file for each problem.\\ \index{random function!usage} \vspace*{-1mm}{\tt <==} This questions was built when the \capa\ sets were built on a different computer than the ones that the students logged into. There were slight parsing differences with respect to real numbers between the computers. Therefore, adding a little to the high end avoided this problem (i.e. using 9.1 instead of 9.0 in the definition of {\tt long}). Even better though would be to parse only random integers and avoid the problem entirely. \\ \index{answer format!example} \vspace*{-1mm}{\tt <==} Note the unit for the problem is defined as a string. \end{minipage} } } \newpage \index{sample problems} \subsection{\bf Problem 2.} {\sl /demolibrary/type00/sample-prob02:} \vskip 3mm {\footnotesize { \begin{minipage}[t]{4.0in} \begin{verbatim} //************************************** //BEG prob_val=1 //LET try_val=20 /IMP "/demolibrary/Tools/Problem#" //By E. Kashy, kashy@nscl.msu.edu, No commercial use // /LET k=random(1,14,1) /LET file=choose(k,"35","45","56","62","77","86","93","m26",\ "m39","m47","m51","m66","m74","m84") // // // // // /LET slope=choose(k,3.5, 4.5, 5.6, 6.2, 7.7, 8.6, 9.3, -2.6,\ -3.9, -4.7, -5.1, -6.6, -7.4, -8.4) // // // // /LET TexGraph="\epsfxsize=3.6in \epsffile{/demolibrary"+ \ "/Graphics/Gtype00/Y"+label+"x.ps}" /LET WebGraph="a") /LET functStr=web("Y=ax","\\ \centerline{$Y=ax$}","Y=ax") // // The graph shows the function /DIS(functStr) Make a careful determination of the value of /DIS(constStr). // /DIS(web("", TexGraph, WebGraph)) // // /ANS(slope:2E,tol=5%,wgt=prob_val,hint=hint\_val,tries=try_val) //************************************** \end{verbatim} \end{minipage}\hspace*{8mm} \begin{minipage}[t]{2.9in} \index{/IMP function!usage} \vspace*{7.5mm}{\tt <==} The {\tt /IMP} command imports a file to format the problem number.\\ \index{random function!usage} \index{choose function!usage} \vspace*{1.5mm}{\tt <==} The computer code picks a random number, k. For k=4, the choose function selects the string variable, 62 which is then concatenated into the name of the .eps or .gif file to be displayed. \index{continuation character}\index{line continuation} NOTE: The back slash is a line continuation character which hides the carriage return so that the {\tt /LET} statement has no carriage return.\\ \index{choose function!sample} \vspace*{1.5mm}{\tt <==} The answer (slope) is also specified with a {\tt choose()} function using the same selection index {\tt k}. Thus, the data in the first {\tt choose()} function corresponds to the answers in the second {\tt choose()} function. \index{sample problems!graphics} \index{graphics!commands to input} \vspace*{2mm}{\tt <==} Commands and paths for the TeX and Web figures. The continuation character is outside the ``string''.\\ \index{web function!sample usage} \index{tex function!sample usage} \vspace*{8mm}{\tt <==} This formats the equation for Web and TeX\\ \vspace*{10mm}{\tt <==} Text of problem.\\ \index{/DIS!sample usage} \vspace*{1mm}{\tt <==} Displays the figure in TeX and Web.\\ \end{minipage} } } \newpage \subsection{\bf Problem 3.} {\bf /demolibrary/type00/sample-prob03:} \vskip 3mm {\footnotesize { \index{sample problems} \begin{minipage}[t]{3.8in} \begin{verbatim} //************************************** //BEG prob_val=1 /IMP "/demolibrary/Tools/Problem#" // //By E. Kashy, kashy@nscl.msu.edu, No Commercial Use // /demolibrary/CAPA46/MCTools/Nof3 Select N correct //of 3 Statements // A mass M = 0.13/DIS(kg_u) is on a smooth horizontal surface \ with negligible friction. It is attached to a spring with \ spring constant k = 15.3/DIS(NPm_u). The mass is displaced \ from its equilibrium position by a distance of 0.14 m and \ then released from rest. (Give all of the correct answers, \ i.e., A or BC or ABC...) //---------------------------------------- /LET s1a="The motion of M is simple harmonic motion." /LET s1b="Statement 1 variation b" /LET s1c="Statement 1 variation c" /LET s1d="Statement 1 variation d" /LET mix1=random(1,1,1) /LET a1a=1 /LET a1b=26 /LET a1c=26 /LET a1d=26 // /LET s2a="The amplitude varies with time." /LET s2b="The amplitude doesn't vary with time" /LET s2c="Statement 2 variation c" /LET s2d="Statement 2 variation d" /LET mix2=random(1,2,1) /LET a2a=2 /LET a2b=1 /LET a2c=26 /LET a2d=26 // /LET s3a="The frequency of oscillation is independent of k." /LET s3b="The Period of oscillation is independent of k." /LET s3c="The frequency of oscillation depends of k." /LET s3d="Statement 3 variation d" /LET mix3=random(1,3,1) /LET a3a=2 /LET a3b=2 /LET a3c=1 /LET a3d=26 // // /IMP "/demolibrary/MCTools/Nof3aux" // // /ANS(Nof3right,wgt=prob_val,str=mc,hint=hint_val,tries=try_val) //************************************** \end{verbatim} \end{minipage}\hspace*{8mm} \begin{minipage}[t]{2.9in} \index{MCTools!sample usage} \vspace*{11mm}{\tt <==} This problem starts as a template {\sl Nof3} which is located in {\sl /demolibrary/MCTools}. \index{StdUnits!sample usage} \vspace*{11mm}{\tt <==} \ Certain variables ({\tt kg\_u, NPm\_u}) are not defined within the problem. Because they are used often, they were defined in a files imported once at the start of the set ({\tt /IMP "/demolibrary/Tools/StdUnits"})\\ \index{choose function!sample usage} \vspace*{13mm}{\tt <==} The {\tt mix1} variable will allow only the one variation of this statement and all students will have it. It is identified as correct by {\tt a1a=1}. \\ \vspace*{11mm}{\tt <==} The {\tt mix2} variable will select either of 2 variations of this statement for a particular student. The first leaf is identified as incorrect by {\tt a2a=2}, while the second is correct, with {\tt a2b=1}. This templates allows up to 4 variations for each statement.\\ \vspace*{24mm}{\tt <==} The {\tt mix3} variable will select one of the 3 variations of this 3rd statement to be given to a particular student. \\ \index{.aux files} \vspace*{10mm}{\tt <==} The {\sl .aux} file randomizes the order and formats presentation. Note the names of the statement and answer variables s3a, s3b, a3a, a3b, etc. must correspond to those used in the {\sl Nof3aux} file.\\ \index{answer formatting!order and case,sample usage} \vspace*{-2mm}{\tt <==} The three letters in the answer can be in any order because {\tt str=mc} is selected. \end{minipage} } }