Rev 5755 | Rev 5903 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5755 | Rev 5900 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | 1 | ||
2 | <center><h3>Examples of interactive exercises under OEF format</h3></center> <p> |
2 | <center><h3>Examples of interactive exercises under OEF format</h3></center> <p> |
3 | 3 | ||
4 | Here are some exampls of interactive exercises one can create by Createxo. |
4 | Here are some exampls of interactive exercises one can create by Createxo. |
5 | <ol> |
5 | <ol> |
- | 6 | ||
- | 7 | <li> |
|
6 |
|
8 | <hr style="width:50%"/> |
7 |
|
9 | <b>Length of vector 2D</b>, a simple computation of the length of |
8 | a vector in the plane. Here is the complete source of this exercise. |
10 | a vector in the plane. Here is the complete source of this exercise. |
9 | 11 | ||
10 | <p><pre> |
12 | <p><pre> |
11 | \title{Norm of vector 2D} |
13 | \title{Norm of vector 2D} |
12 | \language{en} |
14 | \language{en} |
Line 19... | Line 21... | ||
19 | \statement{What is the length of the vector (\x,\y) in R<sup>2</sup>?} |
21 | \statement{What is the length of the vector (\x,\y) in R<sup>2</sup>?} |
20 | 22 | ||
21 | \hint{The length of a vector (x,y) is equal to |
23 | \hint{The length of a vector (x,y) is equal to |
22 | sqrt(x^2+y^2).} |
24 | sqrt(x^2+y^2).} |
23 | \answer{The length}{\norm} |
25 | \answer{The length}{\norm} |
24 | </pre |
26 | </pre> |
25 | 27 | ||
26 | In this exercise, one has defined 2 random integers, x et y, who are the |
28 | In this exercise, one has defined 2 random integers, x et y, who are the |
27 | coordinates of the vector. Then a third parameter, this time real, is defined |
29 | coordinates of the vector. Then a third parameter, this time real, is defined |
28 | by the formula of the length. The exercise takes a freestyle reply under the |
30 | by the formula of the length. The exercise takes a freestyle reply under the |
29 | name of ``the length'', and the good reply should be the value of the third |
31 | name of ``the length'', and the good reply should be the value of the third |
Line 31... | Line 33... | ||
31 | formula of the length. <p> |
33 | formula of the length. <p> |
32 | You can |
34 | You can |
33 | !set parm=oef_answercnt=1&oef_choicecnt=0&oef_title=Norm of vector 2D&oef_format=html&oef_computeanswer=no&level=2&oef_parms=%5Cinteger%7Bx%3Drandom%28-10..10%29%7D%0D%0A%5Cinteger%7By%3Drandom%28-10..10%29%7D%0D%0A%5Creal%7Bnorm%3Dsqrt%28%28%5Cx%29%5E2%2B%28%5Cy%29%5E2%29%7D&oef_statement=What is the length of the vector %28%5Cx%2C%5Cy%29 in R%3Csup%3E2%3C%2Fsup%3E%3F&ansprompt1=The length&ansgood1=%5Cnorm&oef_hint=The length f a vector %28x%2Cy%29 is equal to %0D%0Asqrt%28x%5E2%2By%5E2%29.&oef_solution= $ |
35 | !set parm=oef_answercnt=1&oef_choicecnt=0&oef_title=Norm of vector 2D&oef_format=html&oef_computeanswer=no&level=2&oef_parms=%5Cinteger%7Bx%3Drandom%28-10..10%29%7D%0D%0A%5Cinteger%7By%3Drandom%28-10..10%29%7D%0D%0A%5Creal%7Bnorm%3Dsqrt%28%28%5Cx%29%5E2%2B%28%5Cy%29%5E2%29%7D&oef_statement=What is the length of the vector %28%5Cx%2C%5Cy%29 in R%3Csup%3E2%3C%2Fsup%3E%3F&ansprompt1=The length&ansgood1=%5Cnorm&oef_hint=The length f a vector %28x%2Cy%29 is equal to %0D%0Asqrt%28x%5E2%2By%5E2%29.&oef_solution= $ |
34 | !href cmd=reply&mode=guided&$parm load this example into the menu |
36 | !href cmd=reply&mode=guided&$parm load this example into the menu |
35 | to test it. (You can also copy the source into the menu under raw mode.) |
37 | to test it. (You can also copy the source into the menu under raw mode.) |
36 | 38 | </p> |
|
- | 39 | </li> |
|
37 | < |
40 | <li> <hr style="width:50%"/> |
38 |
|
41 | <b>Trace of matrix 2x2</b>, computes the trace of a matrix. The question |
39 | is formatted by TeX, for a better presentation of the matrix. Here is |
42 | is formatted by TeX, for a better presentation of the matrix. Here is |
40 | the complete source of the exercise. |
43 | the complete source of the exercise. |
41 |
|
44 | <pre> |
42 | \title{Trace of matrix 2x2} |
45 | \title{Trace of matrix 2x2} |
43 | \language{en} |
46 | \language{en} |
44 | \computeanswer{yes} |
47 | \computeanswer{yes} |
45 | \format{tex} |
48 | \format{tex} |
46 | 49 | ||
Line 50... | Line 53... | ||
50 | \integer{c=random(-\range..\range)} |
53 | \integer{c=random(-\range..\range)} |
51 | \integer{d=random(-\range..\range)} |
54 | \integer{d=random(-\range..\range)} |
52 | \integer{trace=(\a)+(\d)} |
55 | \integer{trace=(\a)+(\d)} |
53 | \statement{Compute the trace of the matrix |
56 | \statement{Compute the trace of the matrix |
54 | $$\pmatrix{\a&\b\cr \c&\d}$$.} |
57 | $$\pmatrix{\a&\b\cr \c&\d}$$.} |
55 | 58 | ||
56 | \answer{The trace}{\trace} |
59 | \answer{The trace}{\trace} |
57 | </pre |
60 | </pre> |
58 | We have first defined an integer ``range'', to be used to bound the |
61 | We have first defined an integer ``range'', to be used to bound the |
59 | random values a,b,c,d which are the elements of the matrix. And the trace is |
62 | random values a,b,c,d which are the elements of the matrix. And the trace is |
60 | of course defined by the sum of the elements on the diagonal. Please take |
63 | of course defined by the sum of the elements on the diagonal. Please take |
61 | care to the definition <tt>trace=(\a)+(\d)</tt>: the pairs of parentheses |
64 | care to the definition <tt>trace=(\a)+(\d)</tt>: the pairs of parentheses |
62 | are necessary, for the substitution is literary. If you define |
65 | are necessary, for the substitution is literary. If you define |
Line 67... | Line 70... | ||
67 | You can |
70 | You can |
68 | !set parm=oef_answercnt=1&oef_choicecnt=0&oef_title=Trace of matrix 2x2&oef_format=tex&oef_computeanswer=yes&level=2&oef_parms=%5Cinteger%7Brange%3D20%7D%0D%0A%5Cinteger%7Ba%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bb%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bc%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bd%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Btrace%3D%28%5Ca%29%2B%28%5Cd%29%7D&oef_statement=Compute the trace of the matrix%0D%0A%24%5Cpmatrix%7B%5Ca%26%5Cb%5Ccr %5Cc%26%5Cd%7D%24.&ansprompt1=The trace&ansgood1=%5Ctrace&oef_hint= &oef_solution= $ |
71 | !set parm=oef_answercnt=1&oef_choicecnt=0&oef_title=Trace of matrix 2x2&oef_format=tex&oef_computeanswer=yes&level=2&oef_parms=%5Cinteger%7Brange%3D20%7D%0D%0A%5Cinteger%7Ba%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bb%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bc%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Bd%3Drandom%28-%5Crange..%5Crange%29%7D%0D%0A%5Cinteger%7Btrace%3D%28%5Ca%29%2B%28%5Cd%29%7D&oef_statement=Compute the trace of the matrix%0D%0A%24%5Cpmatrix%7B%5Ca%26%5Cb%5Ccr %5Cc%26%5Cd%7D%24.&ansprompt1=The trace&ansgood1=%5Ctrace&oef_hint= &oef_solution= $ |
69 | !href cmd=reply&mode=guided&$parm load this example into the menu |
72 | !href cmd=reply&mode=guided&$parm load this example into the menu |
70 | to test it. (You can also copy the source into the menu under raw mode.) |
73 | to test it. (You can also copy the source into the menu under raw mode.) |
71 | 74 | ||
72 | 75 | </li> |
|
73 | </ol> |
76 | </ol> |
74 | 77 |