Subversion Repositories wimsdev

Rev

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