mathml input et tableau de variation

Accueil Forums Programmation WIMS Programmation d’exercices OEF mathml input et tableau de variation

Vous lisez 8 fils de discussion
  • Auteur
    Messages
    • #3841
      Julien
      Modérateur
      Up
      1
      Down
      ::

      Bonjour,

      Je regard comment on peut insérer des input dans des tableaux de variation et/ou signes de manière propre avec le type special mathml. Mon tableau latex est loin d’être top. Si quelqu’un a un bout de code plus sympa, je suis preneur.

      Voili voilou

      \title{special mathml}
      
      \statement{
      <div class="wimscenter">
      \special{mathmlinput [\begin{array}{c|lcccr|}
          x    &-\infty  &             &0&            &+\infty\\ \hline
                &+\infty&             &  &            &+\infty\\
          x^2&          &\searrow&  &\nearrow&         \\
                &          &             &reply1&             &          \\ 
        \end{array}],6
      reply1,3}
      </div>
      
      }
      \answer{}{aaa}{type=atext}
      answer{}{bbb}{type=atext}
      answer{}{5}{type=numeric}
      answer{}{1}{type=numeric}
      answer{}{2}{type=numeric}
    • #3842
      jm.evers
      Participant
      Up
      0
      Down
      ::

      Hi,
      I’m not sure what your problem is, but I guess it’s the \hline…this is not implemented in wims_mathml (item2mml).
      see changelog:

      
      added extra (non LaTeX) option to \begin{array}{} commmand.
      now a single  "-" will produce on all rows a "\hline"
      now "-.-.-" will produce a hline under row1,row3,row5 
      (the MathML code attribute is:  rowlines="solid none solid none solid")
      The options do not adversely interfere with normal latex (for gif)
      
      example:  
      
      \begin{array}{c|c:|c-.-.-.} 
      1 & 2 & 3 \\ 
      1 & 2 & 3 \\ 
      1 & 2 & 3 \\ 
      1 & 2 & 3 \\ 
      1 & 2 & 3 \\ 
      1 & 2 & 3 
      \end{array}                                                                                                
      

      Or in your example:

      \special{mathmlinput [
      \begin{array}{-c|lcccr|}
      x   & -\infty &          & 0     &           & +\infty \\ 
          & +\infty &          &       &           & +\infty \\
      x^2 &         & \searrow &       & \nearrow  &         \\
          &         &          &reply1 &           &         \\ 
      \end{array}],6
      reply1,3}
      • Cette réponse a été modifiée le il y a 6 années et 10 mois par jm.evers.
      • Cette réponse a été modifiée le il y a 6 années et 10 mois par jm.evers.
      • Cette réponse a été modifiée le il y a 6 années et 10 mois par jm.evers. Raison: typos
    • #3846
      Julien
      Modérateur
      Up
      0
      Down
      ::

      Hello Joke,

      Thank you for your answer.

      The variation table generated by this code is not of very good quality. I will look with the html5.

    • #3847
      jm.evers
      Participant
      Up
      0
      Down
      ::

      well, using html5&canvas , in createxo something like
      this could be produced
      (of course things in createxo are more complex than directly written in ‘wims phtml’)

      \text{fun=wims(mathmlmath \frac{1}{x^{2}})}
      \text{math_x  = wims(mathmlmath x)}
      \text{plus_infty = wims(mathmlmath +\infty)}
      \text{min_infty = wims(mathmlmath -\infty)}
      
      \text{f = wims(replace internal " by ' in \fun)}
      \text{x = wims(replace internal " by ' in \math_x)}
      \text{infp =  wims(replace internal " by ' in \plus_infty)}
      \text{infm =  wims(replace internal " by ' in \min_infty)}
      
      \text{src=size 400,200
      xrange -5,5
      yrange -1,5
      linewidth 1
      segment -4,3,4,3,red
      segment -3,4,-3,-4,red
      segment 3,4,3,-4,red
      fontfamily Italic 18px Ariel
      centerstring black,3.5,0
      input -1,0,8,1,?
      mathml -4,3.5,0,0,\x
      mathml 3.5,3.5,5,0,\x
      mathml -4,2,0,0,\f
      mathml 3.5,2,5,0,\f
      arrow -3,2,-0.5,0.1,8,blue
      arrow 3,2,0.5,0.1,8,blue
      mathml-3,3.5,0,0,\infm
      mathml 2,3.5,5,0,\infp
      mathml -3,2.3,0,0,\infp
      mathml 2,2.3,5,0,\infm
      
      }
      \text{img=wims(exec canvasdraw \src )}
      
      \statement{
      
      img = \img
      <input type="button" value="click" onclick='javascript:var fun=eval("read_canvas"+canvas_scripts[0]);alert(fun());' />
      }

      instead of calling wims_mathml and replace stuff… (needed for createxo), you could use unicode
      string color,x,y,\unicode

      kind regards,
      joke

      • Cette réponse a été modifiée le il y a 6 années et 10 mois par jm.evers.
      • Cette réponse a été modifiée le il y a 6 années et 10 mois par jm.evers.
    • #3850
      Avatar photoOlivier
      Maître des clés
      Up
      0
      Down
      ::

      Je ne sais pas si ca peut aider, mais éventuellement, un simple tableau HTML pourrait peut-être convenir ?

      \title{special mathml}
      
      \statement{
      <table class="wimsborder wimscenter">
          <tr><th>\(x)</th><th>\(-\infty)</th><th colspan="3">0</th><th>\(+\infty)</th></tr>
          <tr><td style="line-height:3em;">\(x^2)</td><td style="vertical-align:top;">\(+\infty)</td><td>\(\searrow)</td><td style="vertical-align:bottom;">\embed{r1,3}</td><td>\(\nearrow)</td><td style="vertical-align:top;">\(+\infty)</td></tr>
      </table>
      }
      \answer{}{aaa}{type=atext}
      • Cette réponse a été modifiée le il y a 6 années et 10 mois par Avatar photoOlivier.
      • Cette réponse a été modifiée le il y a 6 années et 10 mois par Avatar photoOlivier. Raison: supprime les cellules vides a coté du zéro

      Olivier Bado-Faustin / Université Côte d’Azur

    • #3853
      bernadette
      Maître des clés
      Up
      0
      Down
      ::

      Bien sûr, mais ce que veut faire Julien est de pouvoir insérer des champs de réponses en utilisant \special{mathmlinput } (pour oef, mais une « interface oef »
      pour ce que propose Joke.

      Sinon, j’avais modifié des exos avec tableau de variation. Voir par exemple
      H5/analysis/OEFevalwimsfctg1S.fr&exo=majmin1

      \css{<style type="text/css">
      table.tab_var {margin-left:auto;margin-right:auto;
         border:solid 1px black;}
      table.tab_var tr, table.tab_var td, table.tab_var th {
         padding:7pt;margin-top:10px; margin-bottom:10px;
         text-align:center; border-collapse:collapse; min-width:10pt;
         }
      table.tab_var th { border:solid 1px black}
      table.tab_var tr { border:solid 1px black}
      </style>
      }

      Bernadette

    • #3859
      Julien
      Modérateur
      Up
      0
      Down
      ::

      Bonjour,

      Je regardais rapidement comment faire de beaux tableaux de variations et/ou signes tout en pouvant implanter des types de réponses. Mathmlinput me semblait peut-être répondre à une partie de la problématique. En fait je m’aperçois que pour faire de beaux tableaux sous latex il faut implenter un module qui ne sera pas compatible avec mathml donc l’utilisation de canvadraw me semble être pertinente.

      Joke, can we analyze the construction of arrow with canvadraw and input text ? If I want to add an analysis of the answer such that only the 1/3 value is accepted how I should proceed ?

      Voili voilou

    • #3860
      jm.evers
      Participant
      Up
      0
      Down
      ::

      all userdraw objects (points,arrows,segments…etc) including inputfields | drag&drop | onclick stuff, can be read with the next js-code (see directexec module)

      <script type="text/javascript">
      //<![CDATA[
      "use strict";
       <!-- will return all 'userdraw' or 'userinput' data from all canvas javascript includes -->
       <!-- will return all 'drag&drop' or 'onclick' data from all canvas javascript includes -->
       function read_canvas(){
        if( typeof popup !== 'undefined' ){
         var fun = popup['read_canvas'+canvas_scripts[0]];
         return fun();
        }
        else
        {
         var script_len = canvas_scripts.length;var draw_reply = "";var found_result = false;for(var p = 0 ; p < script_len ; p++){var fun = eval("read_canvas"+canvas_scripts[p]);if( typeof fun === 'function'){var result = fun();if( result  && result.length != 0){if(script_len == 1 ){ return result;};found_result = true;draw_reply = draw_reply + "["+p+"]="+ result + "\n";};};};if( found_result ){return draw_reply;}else{return null;}
        };
       };
       function read_dragdrop(){
        if( typeof popup !== 'undefined' ){
         var fun = popup['read_dragdrop'+canvas_scripts[0]];
         return fun();
        }else{
         var script_len = canvas_scripts.length;var dragdrop_reply = "";var found_result = false; for(var p = 0 ; p < script_len ; p++){var fun = eval("read_dragdrop"+canvas_scripts[p]); if(typeof fun === 'function'){var result = fun();if( result && result.length != 0 ){if(script_len == 1 ){ return result;};found_result = true;dragdrop_reply = dragdrop_reply + "["+p+"]=" + result +"\n";};};};if( found_result ){return dragdrop_reply;}else{return null;}
        };
       };
      

      canvasdraw info

      note: as for the real answer checking, the sky is the limit…
      Joke

      • Cette réponse a été modifiée le il y a 6 années et 10 mois par jm.evers.
    • #3868
      Avatar photoOlivier
      Maître des clés
      Up
      0
      Down
      ::

      Pour ma part, j’ai assez peur de ce que peuvent donner les dessins canvas lorsqu’ils sont lus par une synthèse vocale.
      Pour des raisons d’accessibilité, je conseillerai donc tout de même de passer par le simple tableau HTML tant que c’est possible, et ne réserver les dessins canvas que dans le cas contraire.

      Olivier Bado-Faustin / Université Côte d’Azur

Vous lisez 8 fils de discussion
  • Vous devez être connecté pour répondre à ce sujet.