Subversion Repositories wimsdev

Rev

Blame | Last modification | View Log | RSS feed

  1.  
  2. <html>
  3. <head>testing probability tree applet</head>
  4. <body>
  5.     <script language="javascript" type="text/javascript">                                                                                      
  6.         function READTHIS(){                                                                                                                          
  7.             var applet_data=document.applets[0].ReadApplet(1);
  8.  
  9.             <!--- ReadApplet(0) : gives textdata for probability tree -->
  10.             <!-- ReadApplet(whatever) gives all objects and coordinates -->
  11.            
  12.             <!-- catch some errors before sending the data to wims -->
  13.             <!-- error_1 = unused_line_error -->
  14.             <!-- error_2 = too_few_items_per_line -->
  15.             <!-- error_3 = too_many_items_per_line -->
  16.             <!-- error_4 = inbalance_too_few_lines -->
  17.             <!-- error_5 = inbalance_too_many_lines -->
  18.             <!-- error_6 = text_missing -->
  19.             <!-- error_7 = lines_missing -->
  20.            
  21.            
  22.             comments=new Array();
  23.             comments=["Your answer (drawing) is empty ???",
  24.             "there are lines with no labels or numbers in your probability tree...",
  25.             "there are lines with not enough labels or numbers in your sketch...",
  26.             "there are lines with more than the nessecary labels and/or numbers in your drawing...",
  27.             "there are not enough lines to match the amount of labels/numbers in your answer... ",
  28.             "there are too many lines  to match the amount of labels/numbers in your answer... ",
  29.             "You have forgotten to write the numbers and names in the tree...",
  30.             "You have forgotten to draw lines in the probability tree..."];
  31.            
  32.             var remark="";
  33.             <!-- find some errorcode -->
  34.             for(p=0;p<8;p++){
  35.                 if(applet_data.indexOf("error_"+p) != -1){remark="--> "+comments[p]+"\n"+remark;}
  36.             }
  37.            
  38.             if(remark.length!=0){alert("I have some comments on Your drawing:\n"+remark);return;}
  39.        
  40.             applet_data=applet_data.split("@");
  41.             var line_analysis=applet_data[1];
  42.             var reply=applet_data[0];
  43.             if(line_analysis.length!=0){
  44.                 alert("this is the information about the drawing\n"+line_analysis);
  45.             }
  46.             alert("the applet will send to wims:\n"+reply);
  47.         }                                                                                                                                        
  48.     </script>                                                                                                                                  
  49.     <center>
  50.     <applet codebase="dist" code="KansBoom.class" archive="KansBoom.jar" width="640" height="480">
  51.         <param name="xsize" value="480">
  52.         <param name="ysize" value="480">
  53.         <param name="bgcolor" value="200,215,235">
  54.         <param name="textcolor" value="250,115,50">
  55.         <param name="drawcolor" value="50,50,150">
  56.         <param name="penthickness" value="6">
  57.         <param name="penfontsize" value="22">
  58.         <param name="penfontfamily" value="Helvetica">
  59.         <param name="penfontstyle" value="bold">
  60.         <param name="language" value="fr">
  61.         <param name="grid" value="yes"> <!-- will produce a grid -->
  62.         <param name="xmax" value="10"> <!-- will produce a grid -->
  63.         <param name="xmin" value="0"> <!-- will produce a grid -->
  64.         <param name="ymax" value="10"> <!-- will produce a grid -->
  65.         <param name="ymin" value="0"> <!-- will produce a grid -->
  66.         <param name="textlines" value="8"> <!-- number of lines in the applet: strings are bound to these lines leave blank or remove parma-tag to revert to original behaviour of the drawing applet -->
  67.         <param name="textalign" value="vertical"> <!-- probability tree orientation -->
  68.     </applet>
  69.     <input type="button" name=".....TEST......" value=".....TEST....." onclick="javascript:READTHIS();">
  70. </body>
  71. </html>
  72.  
  73.