我已经编辑了三个不同的NotePad文档,用于即将到来的学年将要使用的测验。这方面的主要用途是当测试人员按下按钮时,测试人员会回答按照测验结束时百分比显示的单选按钮,并在底部进行更新。在第一个注释中,它根据应用的选择百分比百分比制作了一个带有五个尖峰的星形图(每个图形的齿数至少为2%)。当我运行自己创建图形的代码时,它工作正常,但是当我将制作图表的部分复制到测验代码中时,它所记录的注释中会出现错误。 " clarkquiz"把事情粘贴在" Quiztaker"有一个运行" jsgl-min"和" Quiztaker"单独工作,但" clarkquiz"没有。它会说" jsgl_min"那不是。现在它应该制作两个五边形 - 一个比另一个小,在较大的一个内。
/* This is the part i want to paste */
var tinypolygon = myPanel.createPolygon();
/* for(b=0;b<360;b=b+360/5){
tinypolygon.addPointXY(50*Math.cos(b*3.14159/180)+320,50*Math.sin(b*3.14159/180)+240);
}
polygon = myPanel.createPolygon();
for(a=0;a<360;a=a+360/5){
polygon.addPointXY(200*Math.cos(a*3.14159/180)+320,200*Math.sin(a*3.14159/180)+240);
}
tinypolygon.getStroke().setWeight(2);
tinypolygon.getStroke().setColor("rgb(0,0,150)");
tinypolygon.getFill().setColor("rgb(0,500,0)");
tinypolygon.getFill().setOpacity(0.2);
myPanel.addElement(tinypolygon);
polygon.getStroke().setWeight(2);
polygon.getStroke().setColor("rgb(0,0,255)");
polygon.getFill().setColor("rgb(0,255,0)");
polygon.getFill().setOpacity(0.2);*/
myPanel.addElement(tinypolygon);
/*This part is what is causing the problem*/
var teamAvg = Math.round(Math.mean(habit3Percent,habit9Percent,habit15Percent));
var createAvg = Math.round(Math.mean(habit11Percent,habit4Percent));
var reflectAvg = Math.round(Math.mean(habit5Percent,habit2Percent,habit12Percent,habit8Percent));
var critAvg = Math.round(Math.mean(habit7Percent,habit6Percent));
var exploAvg = Math.round(Math.mean(habit13Percent,habit10Percent,habit16Percent));
</script>
</body>
</html>
var teamAvg = Math.round((habit3Percent+habit9Percent+habit15Percent)/3);
var createAvg = Math.round((habit11Percent+habit4Percent)/2);
var reflectAvg = Math.round((habit5Percent+habit2Percent+habit12Percent+habit8Percent)/4);
var critAvg = Math.round((habit7Percent+habit6Percent)/2);
var exploAvg = Math.round((habit13Percent+habit10Percent+habit16Percent)/3);
var makeButtons = function(questionID,buttonName){
document.getElementById(questionID).innerHTML="Most of the time<input type='radio' name='"+buttonName+"' value=3><br>Some of the time<input type='radio' name='"+buttonName+"' value=2><br>Rarely<input type='radio' name='"+buttonName+"' value=1><br>Never<input type='radio' name='"+buttonName+"' value=0 checked><br><br><br>";
}
</html>