Rev 15649 | Rev 17238 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 15649 | Rev 17228 | ||
---|---|---|---|
Line 32... | Line 32... | ||
32 | of the pair of parentheses substituted. The result of the substitution |
32 | of the pair of parentheses substituted. The result of the substitution |
33 | will then be used as the name of variable, and finally the whole thing |
33 | will then be used as the name of variable, and finally the whole thing |
34 | will be replaced by the value of the last variable. This allows nested |
34 | will be replaced by the value of the last variable. This allows nested |
35 | substitutions, as well as substitution of a variable which is followed |
35 | substitutions, as well as substitution of a variable which is followed |
36 | by an alphanumeric character. |
36 | by an alphanumeric character. |
37 | <br |
37 | <br>Example: if the variable $(emph)i$emphend has value $(emph)3$emphend |
38 | and the variable $(emph)alpha3beta$emphend has value $(emph)pi$emphend, |
38 | and the variable $(emph)alpha3beta$emphend has value $(emph)pi$emphend, |
39 | the string<pre>3*$$(alpha$$(i)beta)*x</pre> |
39 | the string<pre>3*$$(alpha$$(i)beta)*x</pre> |
40 | will become<pre>3*pi*x</pre> |
40 | will become<pre>3*pi*x</pre> |
41 | after substitution. |
41 | after substitution. |
42 | <p> |
42 | <p> |
Line 52... | Line 52... | ||
52 | </li><li>If the character $emph$$$emphend is followed by the left bracket |
52 | </li><li>If the character $emph$$$emphend is followed by the left bracket |
53 | $emph[$emphend, the matching $emph]$emphend will be located, the content |
53 | $emph[$emphend, the matching $emph]$emphend will be located, the content |
54 | of the pair of brackets substituted then evaluated to a real number value whose |
54 | of the pair of brackets substituted then evaluated to a real number value whose |
55 | precision depends on the value of $emph print_precision$emphend. |
55 | precision depends on the value of $emph print_precision$emphend. |
56 | This value will replace the whole thing |
56 | This value will replace the whole thing |
57 | together with the leading $emph$$$emphend. <br |
57 | together with the leading $emph$$$emphend. <br> |
58 | It can be used for array subscripts. |
58 | It can be used for array subscripts. |
59 | <br |
59 | <br>Example: if the variable $(emph)i$emphend has value $(emph)3$emphend |
60 | and the variables <br |
60 | and the variables <br> |
61 | $(emph)a1$emphend has value $(emph)3$emphend and <br |
61 | $(emph)a1$emphend has value $(emph)3$emphend and <br> |
62 | $(emph)a2$emphend has value $(emph)pi$emphend, <br |
62 | $(emph)a2$emphend has value $(emph)pi$emphend, <br> |
63 | then the string<pre> |
63 | then the string<pre> |
64 | $$(a$$[$$i-1])*x+$$(a$$[$$i-2])</pre>will become<pre> |
64 | $$(a$$[$$i-1])*x+$$(a$$[$$i-2])</pre>will become<pre> |
65 | pi*x+3</pre>after substitution. |
65 | pi*x+3</pre>after substitution. |
66 | </li><li>If the value of a variable being substituted contains the character |
66 | </li><li>If the value of a variable being substituted contains the character |
67 | $emph$$$emphend, this value will again be substituted, until no more |
67 | $emph$$$emphend, this value will again be substituted, until no more |
Line 69... | Line 69... | ||
69 | substitutions; infinite nested substitions will violate this limit and |
69 | substitutions; infinite nested substitions will violate this limit and |
70 | generate an error message. |
70 | generate an error message. |
71 | </li> |
71 | </li> |
72 | </ul> |
72 | </ul> |
73 | 73 | ||
74 | <hr |
74 | <hr> |
75 | <h4>Reserved variable names</h4> |
75 | <h4>Reserved variable names</h4> |
76 | 76 | ||
77 | The following names are reserved for their special meanings. They should not be |
77 | The following names are reserved for their special meanings. They should not be |
78 | used for internal needs of any module. |
78 | used for internal needs of any module. |
79 | 79 | ||
Line 83... | Line 83... | ||
83 | </li><li>Variables named |
83 | </li><li>Variables named |
84 | !for i in cmd,module,session,lang,special_parm,user,useropts,worksheet |
84 | !for i in cmd,module,session,lang,special_parm,user,useropts,worksheet |
85 | $emph$i$emphend, |
85 | $emph$i$emphend, |
86 | !next i |
86 | !next i |
87 | are reserved for special parameter passed by the user. A module's variable |
87 | are reserved for special parameter passed by the user. A module's variable |
88 | processing file or phtml file can read but cannot set them. <br |
88 | processing file or phtml file can read but cannot set them. <br> |
89 | Refer to the section $emph$title_structure$emphend for the meaning of |
89 | Refer to the section $emph$title_structure$emphend for the meaning of |
90 | these variables. |
90 | these variables. |
91 | </li><li>The variable $emph no_name$emphend has a special use: <br |
91 | </li><li>The variable $emph no_name$emphend has a special use: <br> |
92 | Parameters in the user query string with no name (for example when the |
92 | Parameters in the user query string with no name (for example when the |
93 | coordinate of a mappable image is passed this way to the http server) will |
93 | coordinate of a mappable image is passed this way to the http server) will |
94 | be registered under this variable. For this reason, it should not be used |
94 | be registered under this variable. For this reason, it should not be used |
95 | for other purposes. |
95 | for other purposes. |
96 | </li><li>All variable names starting with $emph wims_$emphend will have special |
96 | </li><li>All variable names starting with $emph wims_$emphend will have special |
Line 115... | Line 115... | ||
115 | $table_tr<td>$emph module_address$emphend</td><td>e-mail address of the (principal) author</td></tr> |
115 | $table_tr<td>$emph module_address$emphend</td><td>e-mail address of the (principal) author</td></tr> |
116 | $table_tr<td>$emph module_maintainer$emphend</td><td>name of the current maintainer</td></tr> |
116 | $table_tr<td>$emph module_maintainer$emphend</td><td>name of the current maintainer</td></tr> |
117 | $table_tr<td>$emph module_maintainer_address$emphend</td><td>e-mail address of the maintainer</td></tr> |
117 | $table_tr<td>$emph module_maintainer_address$emphend</td><td>e-mail address of the maintainer</td></tr> |
118 | $table_tr<td>$emph module_copyright$emphend</td><td>copyright notice of the module</td></tr> |
118 | $table_tr<td>$emph module_copyright$emphend</td><td>copyright notice of the module</td></tr> |
119 | $table_tr<td>$emph module_version$emphend</td><td>current version of the module</td></tr> |
119 | $table_tr<td>$emph module_version$emphend</td><td>current version of the module</td></tr> |
120 | $table_tr<td>$emph module_wims_version$emphend</td><td>minimal wims version required<br |
120 | $table_tr<td>$emph module_wims_version$emphend</td><td>minimal wims version required<br> |
121 | to run this module</td></tr> |
121 | to run this module</td></tr> |
122 | $table_tr<td>$emph module_language$emphend</td><td>language of the module<br |
122 | $table_tr<td>$emph module_language$emphend</td><td>language of the module<br>(en, fr, de, or ...)</td></tr> |
123 | $table_tr<td>$emph module_category$emphend</td><td>category of the module<br |
123 | $table_tr<td>$emph module_category$emphend</td><td>category of the module<br> |
124 | (exercise, tool, course, pedia, recreation, adm, other)</td></tr> |
124 | (exercise, tool, course, pedia, recreation, adm, other)</td></tr> |
125 | $table_tr<td>$emph module_level$emphend</td><td>level of the module</td></tr> |
125 | $table_tr<td>$emph module_level$emphend</td><td>level of the module</td></tr> |
126 | $table_tr<td>$emph module_domain$emphend</td><td>algebra, analysis, geometry, ...</td></tr> |
126 | $table_tr<td>$emph module_domain$emphend</td><td>algebra, analysis, geometry, ...</td></tr> |
127 | $table_tr<td>$emph module_keywords$emphend</td><td>keywords, to be placed in the html header</td></tr> |
127 | $table_tr<td>$emph module_keywords$emphend</td><td>keywords, to be placed in the html header</td></tr> |
128 | $table_tr<td>$emph module_scoring$emphend</td><td>= yes if the module gives scores according to wims standard</td></tr> |
128 | $table_tr<td>$emph module_scoring$emphend</td><td>= yes if the module gives scores according to wims standard</td></tr> |
Line 135... | Line 135... | ||
135 | have value "yes" if the module's directory contains the respective |
135 | have value "yes" if the module's directory contains the respective |
136 | .phtml file. These variables are used in the command <span class="tt">!homeref</span>. |
136 | .phtml file. These variables are used in the command <span class="tt">!homeref</span>. |
137 | </li><li>Some environment variables setup by httpd are readable by wims |
137 | </li><li>Some environment variables setup by httpd are readable by wims |
138 | modules under names starting with $emph httpd_$emphend. For example, the |
138 | modules under names starting with $emph httpd_$emphend. For example, the |
139 | environment variable $emph REMOTE_HOST$emphend becomes |
139 | environment variable $emph REMOTE_HOST$emphend becomes |
140 | $emph httpd_REMOTE_HOST$emphend under wims. <br |
140 | $emph httpd_REMOTE_HOST$emphend under wims. <br> |
141 | Please refer to httpd protocol specifications for details of such variables. |
141 | Please refer to httpd protocol specifications for details of such variables. |
142 | </li><li>All variable names starting with $emph ins_$emphend, $emph |
142 | </li><li>All variable names starting with $emph ins_$emphend, $emph |
143 | insplot_$emphend, $emph instex_$emphend will have special meanings for the |
143 | insplot_$emphend, $emph instex_$emphend will have special meanings for the |
144 | corresponding dynamic insertion engines. A module should read or write them |
144 | corresponding dynamic insertion engines. A module should read or write them |
145 | only for the special meanings they are designed for. |
145 | only for the special meanings they are designed for. |