Subversion Repositories wimsdev

Rev

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