Subversion Repositories wimsdev

Rev

Rev 17476 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. !nocache
  2. !! Pendant la creation via Createxo, c'est le module adm/createxo qui appelle ce fichier.
  3.  
  4. !if $oef_test=yes
  5.  !set renewlink=cmd=next&retest=again
  6.  !!$header_js
  7.  !goto tester
  8. !else
  9.  !if $exocnt=1
  10.    !set exoo=!item 1 of $exolist
  11.    !if $module_init_parm=$empty
  12.      !set module_init_parm=exo=$exoo
  13.    !else
  14.      !if &exo notin &$module_init_parm
  15.        !set module_init_parm=exo=$exoo&$module_init_parm
  16.      !endif
  17.    !endif
  18.  !endif
  19.  !set init_parm=!translate + to $ $ in $module_init_parm
  20.  !set init_parm=!replace internal $\
  21. $ by ; in $init_parm
  22.  !set renewlink=cmd=renew&worksheet=$worksheet&$init_parm
  23. !endif
  24.  
  25. !if $(title_$lang)!=$empty
  26.  !set title=$(title_$lang)
  27. !endif
  28. !if $(title_$lang_choice)!=$empty
  29.  !set title=$(title_$lang_choice)
  30. !endif
  31. !!define the content of the balise title in the header.
  32. !default module_title2=!detag $title
  33.  
  34. !if $printing=yes
  35.  !changeto oef/print.phtml
  36. !endif
  37.  
  38. !if $title!=$empty
  39.  !set module_title=$title
  40.  !set module_author=$author
  41.  !set module_address=$email
  42. !endif
  43.  
  44. !if 0$delay2>0 and $status!=$empty
  45.  !set now_=$wims_nowseconds
  46.  !set wims_html_header=!append line <script src="scripts/js/chronoid.js"></script> to $wims_html_header
  47.  !set wims_html_onload= clockid($[max(0,$delay1-($now_-$starttime))],'clockoef');$wims_html_onload
  48. !endif
  49. !set wims_html_header=!append line $header_js to $wims_html_header
  50. !set wims_html_header=!append line $oefcss to $wims_html_header
  51.  
  52. !if $wims_class!= and $class_css=yes
  53.  !set parentsession=!translate _ to $ $ in $session
  54.  !set parentsession=!word 1 of $parentsession
  55.  !set wims_html_header=!append line <link href="$wims_ref_name?session=$parentsession&+cmd=getfile&+special_parm=css.css" rel="stylesheet">\
  56.    to $wims_html_header
  57. !endif
  58.  
  59. !if $status!=waiting
  60.  !set wims_html_header=!append line <link rel="stylesheet" disabled="disabled" href="html/themes/_css/oef_print_solution.css" id="css_print" title="Solution only">\
  61.    to $wims_html_header
  62. !endif
  63.  
  64. !header1
  65.  
  66. !default wims_exotitleform=0
  67.  
  68. !if $wims_user=supervisor and $oefobservation!=$empty
  69.  <div class="wims_msg info">
  70.    <details>
  71.     <summary>$name_authordesc</summary>
  72.     $oefobservation
  73.    <div class="formHelp">$name_authordesc_desc</div>
  74.    </details>
  75.  </div>
  76. !endif
  77.  
  78. !if $intro_calc iswordof 1 2
  79.  !reset tmp
  80.  !if $intro_calc=1
  81.    !set tmp=basic
  82.  !endif
  83.  <div class="float_right">
  84.  !readproc slib/utilities/mathcalc $tmp
  85.  $slib_out
  86.  </div>
  87.  !reset tmp
  88. !endif
  89. !if $(wims_exoicon[$wims_exo])!=$empty \
  90.    and $(wims_exoicon[$wims_exo])!=none and _exam notin $wims_session
  91.  <h1 class="oeftitle text_icon icon_$(wims_exoicon[$wims_exo]) fullwidth">
  92. !else
  93.  <h1 class="oeftitle">
  94. !endif
  95. !if _exam notin $wims_session
  96.  !if $wims_exo!=$empty
  97.    !if $wims_exotitleform>0
  98.      !let p=!positionof item $wims_exo in $wims_listexo
  99.      !if $wims_exotitleform=1
  100.        $wims_name_sheet $wims_sheet - $wims_name_Serie $p
  101.      !else
  102.        $wims_sheettitle
  103.        <br>
  104.        !if $wims_exotitleform=2
  105.          $wims_name_Serie $p
  106.        !else
  107.          $(wims_exotitle[$wims_exo])
  108.        !endif
  109.      !endif
  110.    !else
  111.      !if $wims_exotitleform=0
  112.        $title
  113.      !endif
  114.    !endif
  115.  !else
  116.    $title
  117.  !endif
  118. !else _exam isin $wims_session
  119.  !if $wims_exrandomlist!=$empty
  120.    !let t=!replace internal . by , in $worksheet
  121.    !let t2=!positionof item $(t[2]) in $(wims_exrandomlist[1;])
  122.    $(t[1]).$t2
  123.  !else
  124.    $worksheet
  125.  !endif
  126. !endif
  127. !if _exam notin $wims_session and $wims_exo!=$empty
  128.  !set tmp=$(wims_exodesc[$wims_exo])
  129.  !if $tmp notsametext $empty
  130.    <div class="wims_tooltip" style="font-size:0.50em;">[...]
  131.     <div class="wims_tooltiptext bottom_left" style="width:300px">$tmp</div>
  132.    </div>
  133.  !endif
  134. !endif
  135. </h1>
  136.  
  137. !if $module_checkdata!=yes
  138.  !read oef/$modu_lang/nodata.phtml
  139.  !goto end
  140. !endif
  141.  
  142. !if $title=$empty
  143.  $name_emptytitle
  144.  <p class="wimscenter">
  145.    !set wims_ref_class=wims_button
  146.    !href module=$module $name_restart
  147.    $wims_name_or
  148.    !set wims_ref_class=wims_button
  149.    !href $ $wims_name_giveup
  150.  </p>
  151.  <div class="wims_msg info small">$name_exo_giveup</div>
  152.  !goto end
  153. !endif
  154.  
  155. !if 0$delay1>0 and $status!=$empty
  156.  !! TODO table needed ?
  157.  <table class="wimsborder wimscenter" style="border:3px solid $wims_ref_bgcolor">
  158.  <tr><td><span class="wims_warning">$wims_name_warning!</span>
  159.  !if $qnum>1
  160.    $name_serie_limit
  161.  !else
  162.    $name_exo_limit
  163.  !endif
  164.  <span id="clockoef"></span>
  165.  </td></tr></table>
  166. !endif
  167.  
  168. :tester
  169. !! this div will close at :end
  170. <div class="oefform">
  171.  !read oef/present.phtml
  172.  
  173. !if $wims_theme_version= or $wims_theme_version<1
  174.  <hr style="width:50%">
  175. !endif
  176.  
  177. !if $cmd=hint
  178.  !read oef/hint.phtml
  179.  !goto end
  180. !endif
  181.  
  182. !if $status=waiting
  183.  !if $error!=$empty
  184.    <div class="wims_msg alert">
  185.    !read oef/msg.phtml
  186.    </div>
  187.  !endif
  188.  !if ($hint!=$empty and $givehint>0) or $help!=$empty
  189.    <div id="oef_helphint">
  190.    !if $hint!=$empty and $givehint>0
  191.      !if _exam isin $wims_session
  192.        <span class="disabled_link">$name_Hint</span>
  193.      !else
  194.        !set wims_ref_class=wims_button_help
  195.        !set wims_ref_id=oef_hint
  196.        !href cmd=hint $name_Hint
  197.      !endif
  198.      $
  199.    !endif
  200.    !if $help!=$empty
  201.      !!FIXME should be in src/exec.c
  202.      !if _exam isin $wims_session
  203.        <span class="disabled_link">$wims_name_help</span>
  204.      !else
  205.        !set wims_ref_class=wims_button_help
  206.        !set wims_ref_id=oef_help
  207.        !href cmd=help $wims_name_help
  208.      !endif
  209.      $
  210.    !endif
  211.    </div> <!-- id oef_helphint-->
  212.  !endif
  213.  !read oef/form.phtml
  214.  <div id="oef_actions">
  215.    !if $fieldtot = 0
  216.      <div class="oef_exo_renew">
  217.        !set wims_ref_class=wims_button
  218.        !set wims_ref_id=oef_renew
  219.        !href $renewlink $name_exo_renew
  220.      </div>
  221.    </div>
  222.      !goto endmain
  223.    !endif
  224.    !!_check is there for examlog
  225.    !if _exam notin $wims_session and _check notin $wims_session
  226.      !if $jquery_defined=yes
  227.        !! Displays a Modal dialog box explaining what the "giveup" button will do.
  228.        <script>
  229.        /*<![CDATA[*/
  230.          jQuery(function(jq){
  231.            jq("#exo_giveup").dialog({
  232.              autoOpen: false,
  233.              modal: true,
  234.              buttons: {
  235.                "$wims_name_yes": function() {window.location = '?session=$session&$renewlink';},
  236.                "$wims_name_no": function() {jq(this).dialog("close");}
  237.              }
  238.            });
  239.            jq("#exo_giveup_opener").on("click", function() {
  240.              jq("#exo_giveup").dialog("open");
  241.            });
  242.          });
  243.        /*]]>*/
  244.        </script>
  245.        <button class="wims_button wims_secondary_button" type="button" data-toggle="exo_giveup" id="exo_giveup_opener">$wims_name_giveup</button>
  246.      !endif jquery
  247.      <div class="dropdown-pane wims_msg info small" id="exo_giveup" title="$wims_name_giveup" data-dropdown>
  248.        <div>
  249.          !if $qnum>1
  250.            $name_serie_giveup
  251.          !else
  252.            $name_exo_giveup
  253.          !endif
  254.        </div>
  255.        !if $jquery_defined!=yes
  256.          <div class="oef_exo_renew">
  257.            !set wims_ref_class=wims_button wims_secondary_button
  258.            !set wims_ref_id=oef_renew
  259.            !href $renewlink $wims_name_giveup
  260.          </div>
  261.        !else
  262.          <p>$name_giveup_confirm</p>
  263.        !endif
  264.      </div>
  265.    !endif _exam notin $wims_session
  266.  
  267.    $
  268.    !if $qnum>1
  269.      <div class="oef_serie_exo spacer">
  270.        <span>$name_serie_exo</span>
  271.        <ul class="wims_serie_bar inline">
  272.          !for j=1 to $[$reply_cnt]
  273.            <li class="wims_exo_done" title="$name_exo $j ($wims_name_exo_tried)">$j</li>
  274.          !next
  275.          <li class="wims_exo_todo" title="$name_exo $j">$[$reply_cnt+1]</li>
  276.          !for j=$[$reply_cnt+2] to $qnum
  277.            <li title="$name_exo $j ($wims_name_exo_untry)">$j</li>
  278.          !next
  279.        </ul>
  280.      </div>
  281.    !endif
  282.  </div><!-- #oef_actions -->
  283. !else status=waiting
  284.  !if $error!=$empty
  285.    <div class="wims_msg alert">
  286.    !read oef/msg.phtml
  287.    </div>
  288.  !endif
  289.  
  290.  !read oef/answer.phtml
  291.  
  292.  !if $status!=$empty
  293.    <div id="oef_actions">
  294.      <div class="oef_serie_exo2 spacer">$name_serie_exo2
  295.      $name_serie_new2
  296.      <ul class="wims_serie_bar inline">
  297.    !for j=1 to $[$reply_cnt]
  298.      <li class="wims_exo_done" title="$name_exo $j ($wims_name_exo_tried)">$j</li>
  299.    !next
  300.      <li class="wims_next_exo" title="$name_serie_nextexo">
  301.    !href cmd=next > $[$reply_cnt+1]
  302.      </li>
  303.    !for j=$[$reply_cnt+2] to $qnum
  304.      <li title="$name_exo $j ($wims_name_exo_untry)">$j</li>
  305.    !next
  306.      </ul>
  307.      </div> <!-- class oef_serie_exo2-->
  308.      <div class="oef_buttons">
  309.    !set wims_ref_class=wims_button
  310.    !set wims_ref_id=oef_serie_nextexo
  311.    !href cmd=next <span class="oef_serie_nextexo">$name_serie_nextexo</span>
  312.    !if _exam notin $wims_session
  313.      $wims_name_or
  314.      !set wims_ref_class=wims_button wims_secondary_button
  315.      !set wims_ref_id=oef_serie_renew
  316.      !if $jquery_defined=yes
  317.      !! Displays a Modal dialog box explaining what the "giveup" button will do.
  318.      <script>
  319.      /*<![CDATA[*/
  320.        $$(function(jq){
  321.          jq("#exo_giveup").dialog({
  322.            autoOpen: false,
  323.            modal: true,
  324.            buttons: {
  325.              "$wims_name_yes": function() {window.location = '?session=$session&$renewlink';},
  326.              "$wims_name_no": function() {jq(this).dialog("close");}
  327.            }
  328.          });
  329.          jq("#exo_giveup_opener").on("click", function() {
  330.            jq("#exo_giveup").dialog("open");
  331.          });
  332.        });
  333.      /*]]>*/
  334.      </script>
  335.      <button class="wims_button wims_secondary_button" type="button" data-toggle="exo_giveup" id="exo_giveup_opener">$wims_name_giveup</button>
  336.      !endif jquery
  337.      <div class="dropdown-pane wims_msg info small" id="exo_giveup" title="$wims_name_giveup" data-dropdown>
  338.      <p>$name_serie_giveup</p>
  339.      !if $jquery_defined!=yes
  340.        <div class="oef_exo_renew">
  341.        !set wims_ref_class=wims_button wims_secondary_button
  342.        !set wims_ref_id=oef_renew
  343.        !href $renewlink $wims_name_giveup
  344.        </div>
  345.      !endif jquery
  346.    !endif not exam
  347.     </div> <!-- id oef_button-->
  348.  !else status
  349.    <div id="oef_actions">
  350.    !if $qnum>1
  351.      !set wims_ref_class=wims_button
  352.      !set wims_ref_id=oef_serie_renew
  353.      !if $seedlastcnt < $seedrepeat and $module_score!=$empty and $module_score<9.8 and _exam notin $wims_session
  354.        !set tmp=$(wims_name_thsheet[14]) $[$seedlastcnt+1]/$seedrepeat
  355.      !else
  356.        !set tmp=$name_exo_renew
  357.      !endif
  358.      !href $renewlink <span class="oef_serie_renew">$tmp</span>
  359.  $
  360.      !if $wims_sheet=$empty and ($wims_user=supervisor or $wims_class=$empty)
  361.        !set wims_ref_class=wims_button wims_secondary_button
  362.        !set wims_ref_id=oef_exo_intro
  363.        <span class="oef_exo_intro">
  364.        !href exo_Intro
  365.        </span>
  366.   $
  367.      !endif
  368.      !!</div><!-- id oef_buttons ???-->
  369.    !else qnum=1
  370.      <p class="renew_et_intro">
  371.      !if $seedlastcnt < $seedrepeat and $module_score!=$empty and $module_score<9.8 and _exam notin $wims_session
  372.        !set tmp=$(wims_name_thsheet[14]) $[$seedlastcnt+1]/$seedrepeat
  373.      !else
  374.        !set tmp=$name_exo_renew
  375.      !endif
  376.      !set wims_ref_class=wims_button
  377.      !set wims_ref_id=oef_renew
  378.      !href $renewlink <span class="oef_exo_renew">$tmp</span>
  379.    $
  380.      !if $wims_sheet=$empty and $oef_test!=yes and ($wims_user=supervisor or $wims_class=$empty)
  381.        !set wims_ref_class=wims_button wims_secondary_button
  382.        !set wims_ref_id=oef_exo_intro
  383.        !href exo_Intro
  384.   $
  385.      !endif
  386.      </p>
  387.    !endif qnum
  388.  !endif status
  389.  </div><!-- id oef_action-->
  390. !endif
  391.  
  392. !if $replydefaulted=yes
  393.  <p id="oef_devel_mode">
  394.  $name_devel_mode:
  395.  !if $oef_default=yes
  396.    $name_devel_warning
  397.  !else
  398.    !set wims_ref_class=wims_button wims_secondary_button
  399.    !set wims_ref_id=oef_default
  400.    !href cmd=config&oef_default=yes $name_devel_insert
  401.    $
  402.  !endif
  403.  </p>
  404. !endif
  405.  
  406. :endmain
  407. <div id="oef_endhook">
  408.  !read ./endhook.phtml
  409.  !if _exam notin $wims_session and _check notin $wims_session
  410.    !read oef/endhook.phtml
  411.  !endif
  412. </div>
  413. !reset seedlastcnt
  414. :end
  415. </div> <!-- .oefform -->
  416.  
  417. !if $oef_anstype_css!=$empty
  418.  <style>$oef_anstype_css</style>
  419. !endif
  420. <!--fin oef Main.phtml-->
  421. !tail
  422.  
  423. !if debug iswordof $m_oefenv
  424.  !reset module_score
  425. !endif
  426.  
  427.