Subversion Repositories wimsdev

Rev

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