Répondre à : mathml input et tableau de variation

Accueil Forums Programmation WIMS Programmation d’exercices OEF mathml input et tableau de variation Répondre à : mathml input et tableau de variation

#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.