Subversion Repositories wimsdev

Rev

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