Subversion Repositories wimsdev

Rev

Rev 10908 | Rev 12163 | 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. !if $special_parm3!=$empty
  61.  !let tmp=!replace internal ; by $ $ in $special_parm3
  62. !!!should use the script getparm
  63.  !set testw=!replace internal ; by $\
  64. $ in $special_parm3
  65.  !set testw=!replace internal = by , in  $testw
  66.  !for cle in exo,qnum,qcmlevel,scoredelay,intro_qcmpresent,intro_presentsol,\
  67.    intro_check,intro_sepow,intro_expow,intro_precw,random,confparm1,confparm2,confparm3,\
  68.    confparm4,confparm5,confparm6,confparm7,confparm8,intro_expert
  69.   !set testw0=!select $testw where column 1=$cle
  70.   !set get_$cle=$(testw0[;2..-1])
  71.   !set get_$cle=!singlespace $(get_$cle)
  72.   !set get_$cle=!words2items $(get_$cle)
  73.   !set get_$cle=!listuniq $(get_$(cle))
  74.    !default $(cle)=$(get_$cle)
  75.  !next cle
  76.  !if $scoredelay=0
  77.   !reset scoredelay
  78.  !endif
  79.  !if $exo=0
  80.   !reset exo
  81.  !endif
  82.  !if yes isin $intro_expert
  83.   !let special_parm2=!append word expert to $special_parm4
  84.  !endif
  85. !endif
  86.  
  87. !if $wims_class!=$empty and $wims_user=supervisor and ($special_parm3=$empty or intro_expert isin $special_parm3)
  88.  !default qnum=$wims_oefdefault_qnum
  89.  !default qcmlevel=$wims_oefdefault_qcmlevel
  90.  !default scoredelay=$wims_oefdefault_scoredelay
  91.  !default intro_qcmpresent=$wims_oefdefault_qcmpresent
  92.  !default intro_presentsol=$wims_oefdefault_presentsol
  93.  !default intro_check=$wims_oefdefault_check
  94.  !default intro_sepow=$wims_oefdefault_sepow
  95.  !default intro_expow=$wims_oefdefault_expow
  96.  !default intro_precw=$wims_oefdefault_precw
  97.  !let special_parm2=$special_parm
  98.  !if ($special_parm3=$empty or intro_expert=yes isin $special_parm3) and ($wims_oefdefault_qcmpresent$wims_oefdefault_presentsol$wims_oefdefault_check$wims_oefdefault_sepow$wims_oefdefault_expow$wims_oefdefault_precw!=$empty)
  99.     !let expert_option=yes
  100.  !else
  101.     !let expert_option=no
  102.  !endif
  103. !endif
  104. !reset special_parm3
  105.  
  106. !if ////classes/ isin ////$module
  107.  !set class_header=wimshome/log/classes/$wims_class/
  108. !endif
  109.  
  110. !read $(class_header)Exindex
  111. !set exocnt=!itemcnt $exolist
  112. !set qcnt=$[min($exocnt,15)]
  113. !if $wims_user=supervisor and #classes/ isin #$module
  114.  !set wims_menu_items=!append line add_exo,1,module=adm/createxo\
  115.   to $wims_menu_items
  116.     !if $exocnt<1
  117.      !exit
  118.     !endif
  119. !else
  120.    !if $exocnt<1
  121.     $name_noexercise
  122.     !exit
  123.    !endif
  124. !endif
  125.  
  126. !if $lang notsametext $module_language and $(titlelist_$lang) notsametext
  127.  !set titlelist=$(titlelist_$lang)
  128. !endif
  129.  
  130. !!if $exocnt=1
  131. !! $name_oneexercise, <span class="bold">
  132. !! !item 1 of $titlelist
  133. !! </span>.
  134. !! !else
  135. !!   !if $wims_user=supervisor
  136. !!  <div class="formHelp">
  137. !!   $name_remarkallexo
  138. !!  </div>
  139. !!   !endif
  140. !!!endif
  141.  
  142. !form new
  143. <input type="hidden" name="module" value="$module" />
  144. <div id="oef_intro_params">
  145.   <h2 class="legend oef_name_menu">$name_menu</h2>
  146.   <div class="formHelp">$name_remarkintro1</div>
  147.  
  148.   <fieldset class="property_fields blockcenter" id="general_parms">
  149.     <legend>$name_general_parms</legend>
  150.     !if $oefintro_custom_select=$empty
  151.       <div class="field">
  152.         !if $exocnt>1
  153.           !set special_parm=!trim $special_parm
  154.           !if select iswordof $special_parm2 and $special_parm notsametext $empty
  155.             <span>$name_chooseexo$name_exercisescontaining</span> &laquo;<em style="color:blue">$special_parm</em>&nbsp;&raquo;&nbsp;:
  156.           !endif
  157.         !endif
  158.         !read oef/select.phtml
  159.       </div>
  160.  
  161.       !if * isin $titlelist
  162.         <p>$name_remarkintro2</p>
  163.       !endif
  164.     !else
  165.       !read $oefintro_custom_select
  166.     !endif
  167.   </fieldset>
  168.  
  169.   !!test if there is an introhook (works with new modules)
  170.   !if _classes/ isin _$module
  171.     !set introhook_exists=no
  172.   !else
  173.     !readproc introhook.phtml
  174.   !endif
  175.  
  176.   !if $introhook_exists!=no
  177.     <fieldset class="introhook property_fields blockcenter">
  178.       <legend>$name_module_setup</legend>
  179.       !if $introhook_tableless=yes
  180.         !read introhook.phtml
  181.       !else
  182.         <table>
  183.           !read introhook.phtml
  184.         </table>
  185.       !endif
  186.     </fieldset>
  187.   !endif
  188.  
  189.   !if $oefintro_custom_series_setup=$empty
  190.     !read oef/intromenu_series.phtml
  191.   !endif
  192.  
  193. !set wims_ref_class=wims_button
  194. !set trimmed_parm2=!trim $special_parm2
  195. !set trimmed_parm3=!trim $special_parm3
  196.  
  197. !if expert notwordof $trimmed_parm2 and yes notin $expert_option
  198.   <p class="oef_intro_buttons" id="score_setup">
  199.     !set trimmed_parm2=$trimmed_parm2 expert
  200.     !set trimmed_parm3=!replace internal intro_expert=no by $ in $trimmed_parm3
  201.     !set trimmed_parm3=$trimmed_parm3 intro_expert=yes
  202.     !href module=$module&special_parm=$special_parm&special_parm2=$trimmed_parm2&special_parm3=$trimmed_parm3&special_parm4=$special_parm4#general_parms $name_expertmenu
  203.  </p>
  204.   <fieldset class="oef_expert property_fields blockcenter">
  205.     <legend>$name_score_setup</legend>
  206.     <div class="field">
  207.       <label for="qcmlevel">$name_levelseverity:</label>
  208.       !default qcmlevel=$(default_choice[2])
  209.       !formselect qcmlevel from 1 to 9
  210.       <div class="formHelp">$name_warning_levelseverity</div>
  211.     </div>
  212.   </fieldset>
  213. !else
  214.   <p class="oef_intro_buttons" id="score_setup">
  215.     !set trimmed_parm2=!replace word expert by $ in $trimmed_parm2
  216.     !set trimmed_parm3=!replace internal intro_expert=yes by $ in $trimmed_parm3
  217.     !set trimmed_parm3=$trimmed_parm3 intro_expert=no
  218.     !href module=$module&special_parm=$special_parm&special_parm2=$trimmed_parm2&special_parm3=$trimmed_parm3&special_parm4=$special_parm4#general_parms $name_simplifiedmenu_back
  219.  </p>
  220.   <fieldset class="oef_expert property_fields blockcenter">
  221.     <legend>$name_score_setup</legend>
  222.     !!default intro_check=1,2,3,4
  223.     !reset name_prompt_expower2 name_prompt_sepower2
  224.     !set powercnt=!itemcnt $list_expow
  225.     !for j=1 to $powercnt
  226.       !set name_prompt_expower2=!append item $(name_prompt_expower[$j]) ($(list_expow[$j])) to $name_prompt_expower2
  227.       !set name_prompt_sepower2=!append item $(name_prompt_sepower[$j]) ($(list_sepow[$j])) to $name_prompt_sepower2
  228.     !next
  229.     !default intro_sepow=$(list_sepow[1])
  230.     !default intro_expow=$(list_expow[1])
  231.     !default intro_precw=$(list_precw[1])
  232.  
  233.     <input type="hidden" name="intro_expert" value="yes" />
  234.  
  235.     <div class="field">
  236.       <label for="intro_presentsol">$name_solutiongiven? </label>
  237.       !default intro_presentsol=$(default_choice[3])
  238.       !formselect intro_presentsol list 0,1,2 prompt $name_choice
  239.     </div>
  240.  
  241.     <div class="field">
  242.       !set wims_ref_id=introcheck3
  243.       !formcheckbox  intro_check list 3 prompt $(name_choice_check[3])
  244.     </div>
  245.  
  246.     <div class="field">
  247.       !set wims_ref_id=introcheck4
  248.       !formcheckbox intro_check list 4 prompt $(name_choice_check[4])
  249.     </div>
  250.  
  251.     <div class="field">
  252.       $name_expower:
  253.       <div>
  254.         !set wims_ref_class=wims_formradio
  255.         !formradio intro_expow list $list_expow prompt $name_prompt_expower2
  256.         <div class="formHelp">$name_warning_expower</div>
  257.       </div>
  258.     </div>
  259.  
  260.     <div class="field">
  261.       $name_sepower:
  262.       <div>
  263.        !set wims_ref_class=wims_formradio
  264.        !formradio intro_sepow list $list_sepow prompt $name_prompt_sepower2
  265.        <div class="formHelp">
  266.         $name_warning_sepower $name_warning_pow
  267.        </div>
  268.       </div>
  269.      </div>
  270.  
  271.     <div class="field">
  272.       $name_precweight:
  273.       !set wims_ref_class=wims_formradio
  274.       !formradio intro_precw list $list_precw
  275.       <div class="formHelp">$name_help_precweight</div>
  276.     </div>
  277.   </fieldset>
  278.   !if $oefintro_custom_choices_setup=$empty
  279.     !read oef/intromenu_choices.phtml
  280.   !endif
  281. !endif
  282. </div>
  283.  
  284. <div class="oef_intro_buttons spacer">
  285.         <input type="submit" value="$wims_name_work" />&nbsp;
  286.         <input type="submit" name="print" value="$name_print" />
  287.         <input type="hidden" name="special_parm2" value="$special_parm2" />
  288.         <input type="hidden" name="special_parm4" value="$special_parm4" />
  289. </div>
  290. !formend
  291.  
  292. !if $exocnt>10
  293.   !form intro
  294.     <input type="hidden" name="special_parm2" value="select $special_parm2" />
  295.     <input type="hidden" name="special_parm3" value="$special_parm3" />
  296.     <input type="hidden" name="special_parm4" value="$special_parm4" />
  297.     <input type="hidden" name="module" value="$module" />
  298.     <label for="special_parm">$name_select</label>
  299.     <input size="12" maxlength="12" name="special_parm" value="$special_parm" id="special_parm" />
  300.     <input type="submit" value="$wims_name_send" />
  301.   !formend
  302. !endif
  303.  
  304. !if expert iswordof $special_parm2 or yes isin $expert_option
  305.   <div class="formHelp">
  306.     $name_remarkseverity
  307.     !read oef/helpseverity
  308.     !read oef/helppenality
  309.   </div>
  310. !endif
  311.  
  312. !if $wims_class!=$empty and $wims_user=supervisor and (../devel/ notin ../$module or $wims_devel_modules iswordof open)
  313.     !set wims_menu_items=!append line addallexo,1,module=adm/class/addmodule&job=addallexo&dir=$module&scoring=$module_scoring\
  314. ,0, to $wims_menu_items
  315. !endif
  316.