Subversion Repositories wimsdev

Rev

Rev 16238 | Rev 16767 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !nocache
  2. !! useful when one comes from modtool
  3. !set modu_lang=$lang
  4. !read oef/$modu_lang/names.proc
  5. !if $lang_exists!=yes
  6.   !let modu_lang=en
  7.   !read oef/$modu_lang/names.proc
  8. !endif
  9. !set wims_backslash_insmath=yes
  10. !set proc=oef
  11. !if robot isin $session
  12.   !changeto content.html
  13. !endif
  14. !read oef/default
  15.  
  16. !if $latex_exists=yes
  17.   $name_latex
  18. !endif
  19. !!!#### contributions
  20. !! very tricky ...
  21. !reset authorlist
  22. !set dictionary=$module_dir/$(class_header)Exauthors
  23. !set translator_unknown=delete
  24. !set exolist_cnt=!itemcnt $exolist
  25.  
  26. !for ex = 1 to $exolist_cnt
  27.   !if - notin $(exolist[$ex]) and . notin $(exolist[$ex])
  28.     !set tmp=!exec translator $(exolist[$ex])
  29.     !set tmp=!replace internal , by $ $ in $tmp
  30.     !set tmp=!singlespace $tmp
  31.     !set authorlist=!append item $tmp to $authorlist
  32.   !endif
  33. !next ex
  34. !set authorlist=!replace internal $translator_unknown by in $authorlist
  35. !set authorlist=!replace internal ; by , in $authorlist
  36. !if $authorlist!= and $authorlist notsametext $exolist
  37.   !set authorlist=!listuniq $authorlist
  38.   !set tmp=!items2words $module_author
  39.   !set tmp=!replace internal ; by ,$ in $tmp
  40.   !set tmp=!singlespace $tmp
  41.   !set authorlist=!singlespace $authorlist
  42.   !!set authorlist1=!listcomplement $tmp in $authorlist
  43.   !set authorlist1=$authorlist
  44.   !set authorlist_cnt=!itemcnt $authorlist1
  45.   !set authorlist=!replace internal , by ,$ $ in $authorlist
  46.   !if $authorlist_cnt > 0
  47.     <div class="wims_contribute">$name_Contribute $authorlist.</div>
  48.   !endif
  49. !endif
  50. !if $related_modules!=no
  51.   !if $keyw=$empty
  52.     !set keyw=!getdef keywords in INDEX
  53.     !set keyw=!nonempty items $keyw
  54.   !endif
  55.   !set level=!getdef level in INDEX
  56.   !set level=!makelist level x for x in $level
  57.   !set level=!nospace $level
  58.   !set level=!lowercase $level
  59.   !set keywlevel=$keyw;$level
  60.  
  61.   <div class="wims_smallremark">
  62.     !read related.phtml $keywlevel
  63.   </div>
  64. !endif
  65.  
  66. !set test_data=!replace internal data/ by in $module_data
  67. !set test_data=!defof title in datamodule/$test_data/INDEX
  68. !if $test_data= and $module_data!=
  69.   <p class="name_datamodule">
  70.    <i>$name_datamodule</i>
  71.   </p>
  72. !endif
  73. <hr style="width:35%" />
  74.  
  75. !if robot isin $session
  76.   !changeto content.html
  77. !endif
  78.  
  79. !! When we come back to Intro after an exo, $special_parm3 contains the last params used.
  80. !if $special_parm3!=$empty
  81.   !let tmp=!replace internal ; by $ $ in $special_parm3
  82.   !!!should use the script getparm
  83.  
  84.   !! replace line breaks temporary
  85.   !set testw=!replace internal $\
  86. $ by %0A in $special_parm3
  87.   !set testw=!replace internal ; by $\
  88. $ in $testw
  89.   !set testw=!replace internal = by , in $testw
  90.   !for cle in exo,qnum,qcmlevel,scoredelay,intro_qcmpresent,intro_sol,intro_feed,\
  91.    intro_check,intro_good,intro_hint,intro_sepow,intro_expow,intro_calc,random,confparm1,confparm2,confparm3,\
  92.    confparm4,confparm5,confparm6,confparm7,confparm8,intro_expert,seedrepeat,exotrymax
  93.     !set testw0=!select $testw where column 1=$cle
  94.     !set get_$cle=$(testw0[;2..-1])
  95.     !set get_$cle=!singlespace $(get_$cle)
  96.     !set get_$cle=!words2items $(get_$cle)
  97.     !set get_$cle=!listuniq $(get_$(cle))
  98.     !! recover line breaks
  99.     !set get_$cle=!replace internal %0A by $\
  100. $ in $(get_$(cle))
  101.  
  102.     !default $(cle)=$(get_$cle)
  103.   !next cle
  104.   !if $scoredelay=0
  105.     !reset scoredelay
  106.   !endif
  107.   !if $exo=0
  108.     !reset exo
  109.   !endif
  110.   !if yes isin $intro_expert
  111.     !let special_parm2=!append word expert to $special_parm4
  112.   !endif
  113. !endif
  114.  
  115. !if $wims_class!=$empty and $wims_user=supervisor and ($special_parm3=$empty or intro_expert isin $special_parm3)
  116.   !default qnum=$wims_oefdefault_qnum
  117.   !default qcmlevel=$wims_oefdefault_qcmlevel
  118.   !default scoredelay=$wims_oefdefault_scoredelay
  119.   !default intro_qcmpresent=$wims_oefdefault_qcmpresent
  120.   !default intro_sol=$wims_oefdefault_sol
  121.   !default intro_feed=$wims_oefdefault_feed
  122.   !default intro_check=$wims_oefdefault_check
  123.   !default intro_good=$wims_oefdefault_good
  124.   !default intro_hint=$wims_oefdefault_hint
  125.   !default intro_sepow=$wims_oefdefault_sepow
  126.   !default intro_expow=$wims_oefdefault_expow
  127.   !default intro_precw=$wims_oefdefault_precw
  128.   !!$wims_oefdefault_precw
  129.   !default seedrepeat=$wims_oefdefault_seedrepeat
  130.   !default exotrymax=$wims_oefdefault_exotrymax
  131.   !let special_parm2=$special_parm
  132.   !if ($special_parm3=$empty or intro_expert=yes isin $special_parm3) and ($wims_oefdefault_qcmpresent$wims_oefdefault_sol$wims_oefdefault_feed$wims_oefdefault_good$wims_oefdefault_hint$wims_oefdefault_sepow$wims_oefdefault_expow$wims_oefdefault_precw$wims_oefdefault_seedrepeat!=$empty)
  133.     !let expert_option=yes
  134.   !else
  135.     !let expert_option=no
  136.   !endif
  137. !endif
  138. !reset special_parm3
  139.  
  140. !if ////classes/ isin ////$module
  141.   !set class_header=wimshome/log/classes/$wims_class/
  142. !endif
  143.  
  144. !read $(class_header)Exindex
  145. !set exocnt=!itemcnt $exolist
  146. !set qcnt=$[min($exocnt,15)]
  147. !if $wims_user=supervisor and #classes/ isin #$module
  148.  !set wims_menu_items=!append line add_exo,1,module=adm/createxo\
  149.       to $wims_menu_items
  150.   !if $exocnt<1
  151.     !exit
  152.   !endif
  153. !else
  154.   !if $exocnt<1
  155.     $name_noexercise
  156.     !exit
  157.   !endif
  158. !endif
  159.  
  160. !if $lang notsametext $module_language and $(titlelist_$lang) notsametext
  161.   !set titlelist=$(titlelist_$lang)
  162. !endif
  163.  
  164. !!if $exocnt=1
  165. !! $name_oneexercise, <span class="bold">
  166. !! !item 1 of $titlelist
  167. !! </span>.
  168. !! !else
  169. !!   !if $wims_user=supervisor
  170. !!  <div class="formHelp">
  171. !!   $name_remarkallexo
  172. !!  </div>
  173. !!   !endif
  174. !!!endif
  175.  
  176. !form new
  177. <input type="hidden" name="module" value="$module" />
  178. <div id="oef_intro_params">
  179.   <h2 class="legend oef_name_menu">$name_menu</h2>
  180.   <div class="formHelp">$name_remarkintro1</div>
  181.  
  182.   <fieldset class="property_fields blockcenter" id="general_parms">
  183.     <legend>$name_general_parms</legend>
  184. !if $oefintro_custom_select=$empty
  185.       <div class="field">
  186.   !if $exocnt>1
  187.     !set special_parm=!trim $special_parm
  188.     !if select iswordof $special_parm2 and $special_parm notsametext $empty
  189.         <label for="exo">$name_chooseexo$name_exercisescontaining</label> &laquo;<em style="color:blue">$special_parm</em>&nbsp;&raquo;&nbsp;:
  190.     !endif
  191.   !endif
  192.   !read oef/select.phtml
  193.       </div>
  194.  
  195.   !if * isin $titlelist
  196.       <p>$name_remarkintro2</p>
  197.   !endif
  198. !else
  199.   !read $oefintro_custom_select
  200. !endif
  201.   </fieldset>
  202.  
  203. !!test if there is an introhook
  204. !if _classes/ isin _$module
  205.   !set introhook_exists=no
  206. !else
  207.   !readproc introhook.phtml
  208.   !if $introhook_exists=$empty
  209.     !set tmp=!record 0 of introhook.phtml
  210.     !if $tmp=$empty
  211.       !!! only comment in the file introhook.phtml
  212.       !set introhook_exists=no
  213.       !reset tmp
  214.     !endif
  215.   !endif
  216. !endif
  217. !if $introhook_exists!=no
  218.   <fieldset class="introhook property_fields blockcenter">
  219.     <legend>$name_module_setup</legend>
  220.   !if $introhook_tableless=yes
  221.     !read introhook.phtml
  222.   !else
  223.       <table>
  224.     !read introhook.phtml
  225.       </table>
  226.   !endif
  227.   </fieldset>
  228. !endif
  229.  
  230. !if $oefintro_custom_series_setup=$empty
  231.   !read oef/intromenu_series.phtml
  232. !endif
  233.  
  234. !set wims_ref_class=wims_button
  235. !set trimmed_parm2=!trim $special_parm2
  236. !set trimmed_parm3=!trim $special_parm3
  237.  
  238. !if expert notwordof $trimmed_parm2 and yes notin $expert_option
  239.   <p class="oef_intro_buttons" id="score_setup">
  240.   !set trimmed_parm2=$trimmed_parm2 expert
  241.   !set trimmed_parm3=!replace internal intro_expert=no by $ in $trimmed_parm3
  242.   !set trimmed_parm3=$trimmed_parm3 intro_expert=yes
  243.   !href module=$module&special_parm=$special_parm&special_parm2=$trimmed_parm2&special_parm3=$trimmed_parm3&special_parm4=$special_parm4#general_parms $name_expertmenu
  244.  </p>
  245.   !read oef/intromenu_nonexpert.phtml
  246. !else
  247.   <p class="oef_intro_buttons" id="score_setup">
  248.   !set trimmed_parm2=!replace word expert by $ in $trimmed_parm2
  249.   !set trimmed_parm3=!replace internal intro_expert=yes by $ in $trimmed_parm3
  250.   !set trimmed_parm3=$trimmed_parm3 intro_expert=no
  251.   !href module=$module&special_parm=$special_parm&special_parm2=$trimmed_parm2&special_parm3=$trimmed_parm3&special_parm4=$special_parm4#general_parms $name_simplifiedmenu_back
  252.  </p>
  253.   !read oef/intromenu_expert.phtml
  254. !endif
  255. </div>
  256.  
  257. <div class="oef_intro_buttons spacer" id="oef_intro_launch">
  258.   <button type="submit" class="wims_button icon_button">
  259.     <span class="work">$wims_name_work</span>
  260.   </button>&nbsp;
  261.   <button type="submit" class="wims_button wims_secondary_button icon_button" name="print" id="print" value="yes">
  262.     <span class="printable">$name_print</span>
  263.   </button>
  264.   <input type="hidden" name="special_parm2" value="$special_parm2" />
  265.   <input type="hidden" name="special_parm4" value="$special_parm4" />
  266. </div>
  267.  
  268. !formend
  269.  
  270. !if $exocnt>10
  271.   !form intro
  272.     <input type="hidden" name="special_parm2" value="select $special_parm2" />
  273.     <input type="hidden" name="special_parm3" value="$special_parm3" />
  274.     <input type="hidden" name="special_parm4" value="$special_parm4" />
  275.     <input type="hidden" name="module" value="$module" />
  276.     <label for="special_parm">$name_select</label>
  277.     <input size="12" maxlength="12" name="special_parm" value="$special_parm" id="special_parm" />
  278.     <input type="submit" value="$wims_name_send" />
  279.   !formend
  280. !endif
  281.  
  282. !if expert iswordof $special_parm2 or yes isin $expert_option
  283.   <div class="formHelp">
  284.   $name_remarkseverity
  285.   !read oef/helpseverity
  286.   !read oef/helppenality
  287.   </div>
  288. !endif
  289. !if $wims_class!=$empty and $wims_user=supervisor and (../devel/ notin ../$module or $wims_devel_modules iswordof open)
  290.   !set wims_menu_items=!append line addallexo,1,module=adm/class/addmodule&job=addallexo&dir=$module&scoring=$module_scoring\
  291. ,0, to $wims_menu_items
  292. !endif
  293.