The next drawing details can be retreived: The three applets public_functions to communicate with javascript :
  1. getConstruction() retreives the xml-construction string [original Zirkel]
  2. getDrawing("object","name_of_object");
    or with multiple occurances of an object:getDrawing("object","name1,name2,name3,name4,...");
    All objects must be named correctly by the student
    Multiple Objects of the same type but non-requested name will be ignored.
    If an object/name combination is not present, the student will receive an browser alert message.
  3. getAllObjects(); this function retreives all objects drawn in the construction,
    except object with prefix "my_"...like in "my_circle1".

These example javascript code could be used to produce a working WIMS-exercises:

 
	    function ReadApplet_I(){
		<!-- this array should be produced using WIMS variables... -->;
		var list_of_objects=["freehand_drawing,"noname"","point,p1,p2,p3","line,l1,l2","function","area,poly1","angle,a1","circle","fixedcircle","segment"];
		var count=0;var reply=new Array();var data;var tmp;
		for(var p=0;p<list_of_objects.length;p++){
		    tmp=list_of_objects[p].split(',');
		    if(tmp[0].length>0){
			for(var s=1;s<tmp.length;s++){
			    data=document.applets[0].getDrawing(tmp[0],tmp[s]);
			    if(data.indexOf("error")!=-1){
				alert("Your answer will not be send...\nthe next object could not be detected in your drawing...\n\n:"+data); return;
			    }
			    else
			    {
				reply[count]=data;
				count++;
			    }
			}
		    }
		}
	    }
	
function ReadApplet_II(){ <!-- this function retreives all construction details --> <!-- excluded objects with name prefix "my_" --> var data=document.getElementById("CaR").getAllObjects().split(','); var cnt=0;var reply=new Array(); for(var p=0;p<data.length;p++){ reply[cnt]=data[p].toString(); cnt++; } alert("the reply is:\n"+reply); }
Get all objects in the drawing:

or ... Get the xml-string from the original public function:

or ...
  1. Draw 3 points named p1,p2,p3
  2. Draw 2 lines named l1,l2
  3. Draw an area named poly1
  4. Draw an angel named a1

No java