Annotation of doc/homework/homework5.html, revision 1.3
1.1 albertel 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2: <html>
3: <head>
4: <title>LON-CAPA Homework System</title>
5: </head>
6:
7: <body>
8: <h1>LON-CAPA Homework System</h1>
9:
10: <h2>Tags</h2>
11: <ul>
12: <li>
13: Response tags
14: <p>
15: Arguments for all response tags
16: </p>
17: <ul>
18: <li>
19: <i>ID</i>, if this isn't set it will be set during
20: the publication step. It is used to assign parameters names
21: in a way that can be tracked if an instructor modifies
22: things by hand.
23: </li>
24: <li>
25: <i>name</i> optional, if set, it will be used by the
26: resource assembly tool when one is modifying parameters.
27: </li>
28: </ul>
29: <p>
30: Implemented response tags
31: </p>
32: <ul>
33: <li>
1.2 albertel 34: <b><responseparam></b> if it appears it should be
35: inside of a <*response> tag, defines an externally
36: adjustable parameter for this question. Arguments:
37: <ul>
38: <li>
39: <i>default</i> required, specifies a default value for
40: the parameter
41: </li>
42: <li>
43: <i>name</i> required, specifies an internal name for
44: the parameter
45: </li>
46: <li>
47: <i>type</i> required specifies the type of parameter,
48: one of "tolerance", "int", "float", "string", "date"
49: (configuration of paramters is handled by
50: lonparmset.pm and parameter.html)
51: </li>
52: <li>
53: <i>description</i> a string describing the parameter,
54: this is what is used to talk about a parameter outside
55: of a problem
56: </li>
57: </ul>
58: </li>
59: <li>
1.1 albertel 60: <b><numericalresponse></b> implements a numerical
61: answer, it needs an internal <b><textline></b> for
62: the response to go in. It checks all styles of numerical
63: supported in CAPA. Possible args are:
64: <ul>
65: <li><i>answer</i> required, specifies the correct answer, must be a perl list</li>
66: <li><i>type</i> optional, CAPA style str args, cs/ci/mc</li>
67: <li><i>units</i> optional, specifies unit of correct answer, CAPA style</li>
68: </ul>
69: </li>
70: <li>
71: <b><essayresponse></b> implements a ungraded large
72: text response, it need an internal <b><textarea></b>
73: for the response to go in.
74: </li>
75: <li>
76: <b><imageresponse></b> implements a image click
77: style image submission, uses the foil structure tags <a
78: href="#foil">below</a>. Additional tags that should appear
79: in a <foil> are:
80: <ul>
81: <li><b><image></b> required, the contained text
82: specifies a published graphical resource that is the
83: image used, should only appear once per foil</li>
84: <li><b><rectangle></b> required, the contained text
85: specifies a rectangular area that is correct, should
86: look like (1,2)-(3,4), at least 1 required</li>
87: <li><b><text></b> required, the contained text is
88: printed on top of the image.</li>
89: </ul>
90: </li>
91: <li>
92: <b><optionresponse></b> implements a "select from
93: these choices" style question, the choices are specified
94: by the instructor, it uses the foil structure tags <a
95: href="#foil">below</a> with this additional args:
96: <ul>
97: <li>
98: <b><foilgroup></b> is required to have
99: <i>options</i> which should be a perl list of possible
100: options for the student.
101: </li>
102: </ul>
103: </li>
104: <li>
105: <b><radiobuttonresponse></b> implements a true / false
106: style question with 1 correct answer.it uses the foil
107: structure tags <a href="#foil">below</a> but the
108: <i>value</i> of a <foil>can only be "true" or
109: "false" or "unused"
110: </li>
111: </ul>
112: <li>
113: <a name="foil">Foil Structure Tags</a>
114: <p>
115: All tags that implement a foil structure have an optional
116: arg of <i>max</i> that controls the maximum number of total
117: foils to show.
118: </p>
119: <ul>
120: <li>
121: <b><foilgroup></b> required, must be the tag that
122: surrounds all foil definitions
123: </li>
124: <li>
125: <b><foil></b> required, all data inside is a possible foil
126: </li>
127: <li>
128: <b><conceptgroup></b> optional, surrounds a
129: collection of <foil>, when a problem is displayed
130: only one of the contained <foil>is selected for
131: display. It receives one required argument
132: <i>concept</i>.
133: </li>
134: </ul>
135: </li>
136: <li>
137: Hint structure
138: <p>
139: All of these tags must appear inside a <b><*response></b> tag.
140: </p>
141: <ul>
142: <li>
143: <b><hintgroup></b> Tag that surrounds all of a hint.
144: </li>
145: <li>
146: <b><hintpart></b> required, Tag to implement
147: conditional hints. It has a required argument
148: <i>on</i>. When a <*hint> tag named the same as the
149: value the </i>on</i> attribute evaluates to be correct the
150: <hintpart> will show. If no other <hintpart>
151: are to show then all hintparts with a <i>on</i> of
152: "default" will show
153: </li>
154: <li>
155: <b><numericalhint></b> has all the arguments that
156: <numericalresponse>, does and the required attribute
157: <i>name</i> which should be set to the value of which
158: <hintpart> will be shown.
159: </li>
160: </ul>
161: </li>
162: <li>
163: Input Tags
164: <p>
165: This group of tags implement a mechanism for getting data
166: for students, they will usually be used by a
167: <*response>.
168: </p>
169: <ul>
170: <li>
171: <b><textarea></b> creates a Large text input box, If
172: data appears between the start and end tags, the data will
173: appear i the textarea if the student has not yet made a
174: submission. Additionally it takes two arguments <i>rows</i>
175: and <i>cols</i> which control the height and width of the
176: area respectively. It defaults to 10 and 80.
177: </li>
178: <li>
179: <b><textline></b> creates a single line of input
180: element, it accepts 1 argument <i>size</i> which controls
181: the width on the textline, it defaults to 20.
182: </li>
183: </ul>
184: </li>
185: <li>
186: Output Tags
187: <p>
188: This group of tags generate useful pieces of output.
189: </p>
190: <ul>
191: <li>
192: <b><displayduedate></b> this will insert the current
193: duedate if one is set into the document. It is generated
194: to be inside a table of 1x1 elements
195: </li>
196: <li>
197: <b><displaytitle></b> this will insert the title of
198: the problem from the metadata of the problem
199: </li>
200: <li>
201: <b><window></b> the text in between is put in a
202: popup javascript window
203: </li>
204: </ul>
205: </li>
206: <li>
207: Scripting
208: <p>
209: These tags allow the document to behave programatically
210: </p>
211: <ul>
212: <li>
213: <b><display></b> the intervening perl script is
214: evaluated in the safe space and the return value of the
215: script replaces the entire tag
216: </li>
217: <li>
218: <b><import></b> causes the parse to read in the file
219: named in the body of the tag and parse it as if the entire
220: text of the file had existed at location of the tag
221: </li>
222: <li>
223: <b><parserlib></b> the enclosed filename contains
224: definitions for new tags
225: </li>
226: <li>
227: <b><script></b> if the argument <i>type</i> is set
228: to "loncapa/perl" the enclosed data is a perl script which
229: is evaluated inside the perl Safe space. The return value
230: of the script is ignored.
231: </li>
232: <li>
233: <b><scriptlib></b> the enclosed filename contains
234: perl code to run in the safe space
235: </li>
236: <li>
237: <b><block></b> has a required argument
238: <i>condition</i> that is evaluated, it the condition is
239: true everything inside the tag is evaluated, if it is false
240: everything inside the block tag is skipped
241: </li>
242: <li>
243: <b><notsolved></b> everything inside the tag is
244: skipped if the problem is "solved"
245: </li>
246: <li>
247: <b><postanswerdate></b> everything inside the tag is
248: skipped if the problem is before the answer date
249: </li>
250: <li>
251: <b><preduedate></b> everything inside the tag is
252: skipped if the problem is after the due date
253: </li>
254: <li>
255: <b><randomlist></b> the enclosed tags are parsed in
256: a stable random order
257: </li>
258: <li>
259: <b><solved></b> everything inside the tag is
260: skipped if the problem is "not solved"
261: </li>
262: <li>
263: <b><while></b> implements a while loop, required
264: argument <i>condition</i> is a perl scriptlet that when
265: evaluated results in a true or false value, on true the
266: entirety of the text between the whiles is parsed. The
267: condition is tested again, etc. If false it goes to the
268: next node in the parse.
269: </li>
270: </ul>
271: </li>
272: <li>
273: Structure Tags
274: <p>
275: These tags give the problem a structure and take care of the
276: recording of data and giving the student messages.
277: </p>
278: <ul>
279: <li>
280: <b><problem></b> must be the first tag in the file,
281: this tag sets up the header of the webpage and generates
282: the submit buttons, it also handles due dates properly
283: </li>
284: <li>
285: <b><part></b> must be below <problem> if it is
286: going to be used. It does many of the same tasks as
287: <problem> but allows multiple separate problems to
288: exist in a single file.
289: </li>
290: <li>
291: <b><startouttext></b><b><endouttext></b> these
292: tags are somewhat special, they must have no internal text
293: and occur in pairs. Their use is to mark up the problem so
294: the web editor knows what sections should be edited in a
295: plain text block on the web.
296: </li>
297: </ul>
298: </li>
299: </ul>
300: <h2><script> Functions</h2>
301: <p>
302: A list of functions that have been written that are available in
303: the Safe space scripting environment inside a problem. The eventual
1.3 ! ng 304: goal is to provide all of the functions available in CAPA. Detailed
! 305: descriptions of each function and comparison with CAPA is given in
! 306: <a href="homework6.html">CAPA to LON-CAPA Functions</a>.
1.1 albertel 307: </p>
308: <ul>
1.3 ! ng 309: <li>sin(x), cos(x), tan(x)</li>
! 310: <li>asin(x), acos(x), atan(x), atan2(y,x)</li>
! 311: <li>log(x), log10(x)</li>
! 312: <li>exp(), pow(x,y), sqrt(x)</li>
! 313: <li>abs(x), sgn(x)</li>
! 314: <li>erf(x), erfc(x)</li>
! 315: <li>ceil(x), floor(x)</li>
! 316: <li>min(...), max(...)</li>
! 317: <li>factorial(n)</li>
! 318: <li>N%M</li>
! 319: <li>sinh(x), cosh(x), tanh(x)</li>
! 320: <li>asinh(x), acosh(x), atanh(x)</li>
! 321: <li>roundto(x,n)</li>
! 322: <li>web("a","b","c") or web(a,b,c)</li>
! 323: <li>html("a") or html(a)</li>
! 324: <li>j0(x), j1(x), jn(n,x), jv(y,x)</li>
! 325: <li>y0(x), y1(x), yn(n,x), yv(y,x)</li>
1.1 albertel 326: <li>random</li>
327: <li>choose</li>
1.3 ! ng 328: <li>tex("a","b") or tex(a,b)</li>
! 329: <li>var_in_tex(a)</li>
! 330: <li>to_string(x), to_string(x,y)</li>
! 331: <li>class(), section()</li>
! 332: <li>name(), student_number()</li>
! 333: <li>open_date(), due_date(), answer_date()</li>
! 334: <li>sub_string()</li>
! 335: <li>array_moments(array)</li>
! 336: <li>format(x,y)</li>
! 337: <li>map(...)</li>
1.1 albertel 338: <li>caparesponse_check</li>
339: <li>caparesponse_check_list</li>
340: </ul>
341: <h2><script> Variables</h2>
342: <ul>
343: <li>
344: $external::target - set to the current target the xml parser
345: is parsing for
346: </li>
347: <li>
348: $external::part - set to the <i>id</i> of the current problem
349: <part>; zero if there are now <part>
350: </li>
351: <li>
352: $external::gradestatus - set to the value of the current
353: resource.partid.solved value
354: </li>
355: <li>
356: $external::datestatus - set to the current status of the clock
357: either CLOSED, CAN_ANSWER, CANNOT_ANSWER, or SHOW_ANSWER
358: </li>
359: <li>
360: $external::randomseed - set to the number that was used to
361: seed the random number generator
362: </li>
363: <li>$pi - set to PI </li>
1.3 ! ng 364: <li>$rad2deg - converts radians to degrees </li>
! 365: <li>$deg2rad - converts degrees to radians </li>
1.1 albertel 366: </ul>
367:
368: <hr>
369: <address><a href="mailto:albertel@marvin.lite.msu.edu">Guy Albertelli</a></address>
370: <!-- Created: Thu May 17 15:05:35 EDT 2001 -->
371: <!-- hhmts start -->
1.2 albertel 372: Last modified: Fri May 18 21:29:39 EDT 2001
1.1 albertel 373: <!-- hhmts end -->
374: </body>
375: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>