Subversion Repositories wimsdev

Rev

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