-
Notifications
You must be signed in to change notification settings - Fork 10
/
example-assess.html
191 lines (158 loc) · 10.6 KB
/
example-assess.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<!DOCTYPE html>
<html><head>
<title>Assessment Environment Integration</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="viewport" content="width=device-width,initial-scale=1">
<script src="https://www.geogebra.org/apps/deployggb.js"></script>
<script src="navigation.js"></script>
</head>
<body class="">
<div class="contentBox" id="contentBox">
<h1>Assessment Environment Integration</h1>
<p class="text"><br>GeoGebra resources can be integrated into assessment environments. <br>Press the buttons below to load a new randomized question, validate your input or show the solution.</p>
<div id="ggbApplet" style="width: 800px; height: 600px;"><div class="applet_scaler ggbTransform" style="position: relative; display: block; width: 800px; height: 600px; transform: none; transform-origin: 0% 0%;"><article class="notranslate" data-param-id="ggbApplet" data-param-width="800" data-param-height="600" data-param-randomseed="1" data-param-prerelease="false" data-param-showmenubar="false" data-param-showalgebrainput="false" data-param-showtoolbar="false" data-param-showtoolbarhelp="false" data-param-showreseticon="false" data-param-errordialogsactive="false" data-param-usebrowserforjs="false" data-param-allowstylebar="false" data-param-preventfocus="false" data-param-showzoombuttons="false" data-param-capturingthreshold="3" data-param-showfullscreenbutton="false" data-param-scale="1" data-param-disableautoscale="false" data-param-allowupscale="false" data-param-clicktoload="false" data-param-appname="classic" data-param-showsuggestionbuttons="true" data-param-language="en" data-param-material_id="gebkyk2c" data-param-filename="https://www.geogebra.org/resource/chsfzcta/Zs1z7ELX3UIzgfo6/material-chsfzcta.ggb" data-param-enablelabeldrags="false" data-param-enableshiftdragzoom="true" data-param-showsplash="false" tabindex="0" id="ggbApplet0" data-scalex="1" data-scaley="1" aria-label="GeoGebra Classic" style="border-width: 0px; border-style: solid; border-image: initial; display: inline-block; outline-style: none;"><div class="GeoGebraFrame applet-unfocused jsloaded" style="width: 798px; height: 598px; border-width: 1px; border-style: solid;"><div class="gwt-SplitLayoutPanel" style="position: relative; width: 798px; height: 598px;"><div aria-hidden="true" style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;"> </div><div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;"><div class="ggbdockpanelhack" style="right: 0px; bottom: 0px; position: absolute; left: 0px; top: 0px;"><div aria-hidden="true" style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;"> </div><div style="position: absolute; overflow: hidden; left: 0px; right: 0px; bottom: 0px; height: 0px;"><div style="right: 0px; bottom: 0px; position: absolute; left: 0px; top: 0px;"></div></div><div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;"><div role="application" style="right: 0px; bottom: 0px; position: absolute; left: 0px; top: 0px;"><div class="EuclidianPanel" style="position: relative; overflow: hidden; width: 798px; height: 598px;"><canvas data-test="euclidianView" height="598" width="798" dir="ltr" tabindex="10000" role="application" aria-label="Graphics View 1" style="width: 798px; height: 598px;" class="cursor_hit">Graphics</canvas><div class="gbox" aria-hidden="true" style="position: absolute; left: 78px; top: 142px; display: none;"><div class="AutoCompleteTextFieldW FromDrawTextFieldNew" aria-hidden="true" style="display: none;"><input type="text" class="gwt-SuggestBox TextField" autocomplete="off" autocapitalize="off" style="width: 20em;"><div tabindex="0" class="gwt-ToggleButton gwt-ToggleButton-up SymbolToggleButton" role="button"><input type="text" tabindex="-1" aria-hidden="true" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;"><div class="html-face">α</div></div></div></div></div></div></div></div></div></div><div aria-hidden="true" class="DockGlassPane" style="position: relative; overflow: hidden; display: none; z-index: 5000;"><div aria-hidden="true" style="border-width: 4px; border-style: solid; border-color: gray; display: none;"></div></div></div><span class="geogebraweb-dummy-invisible" tabindex="10000"></span><div id="screenReader1" tabindex="-1" role="status" aria-live="polite" aria-atomic="true" aria-relevant="additions text" style="top: -1000px; position: absolute;"></div></article></div></div>
<div id="show">
<p>
<button class="appBtn noimage fixedSize" id="validateBtn" onclick="toggleButton(`validate`,false);">Show Validation</button>
<button class="appBtn noimage fixedSize" id="showanswerBtn" onclick="toggleButton(`showanswer`,false);">Show Answer</button>
<button class="appBtn noimage fixedSize" id="showsolutionBtn" onclick="toggleButton(`showsolution`,false);">Show Solution</button>
<button class="appBtn noimage fixedSize blue" onclick="loadNewQuestion();">New Question</button>
</p>
</div>
</div>
<script>
function toggleButton(value, isReset) {
if (!isReset) {
ggbApplet.setValue(value, !ggbApplet.getValue(value));
}
var btnLabelOn, btnLabelOff, btnID;
switch (value) {
case "validate":
btnLabelOn = "Hide Validation";
btnLabelOff = "Show Validation";
btnID = "validateBtn";
break;
case "showanswer":
btnLabelOn = "Hide Answer";
btnLabelOff = "Show Answer";
btnID = "showanswerBtn";
break;
case "showsolution":
btnLabelOn = "Hide Solution";
btnLabelOff = "Show Solution";
btnID = "showsolutionBtn";
break;
}
var btn = document.getElementById(btnID);
ggbApplet.getValue(value) ? btn.innerHTML = btnLabelOn : btn.innerHTML = btnLabelOff;
ggbApplet.getValue(value) ? btn.className = "appBtn noimage fixedSize pressed" : btn.className = "appBtn noimage fixedSize";
}
function resetButtons() {
toggleButton("validate", true);
toggleButton("showsolution", true);
toggleButton("showanswer", true);
}
function loadNewQuestion() {
ggbApplet.setValue("validate", false);
ggbApplet.setValue("showsolution", false);
ggbApplet.setValue("showanswer", false);
ggbApplet.evalCommand("UpdateConstruction()");
resetButtons();
}
var width = 600, height = 380, id = "vtuggwej", beta = false, seed = 1;
var getVars = [];
var locvartemp = ( window.location.href.indexOf( "?" ) + 1 ) ? window.location.href.substr( window.location.href.indexOf( "?" ) + 1 ) : "";
locvartemp=unescape(locvartemp);
locvartemp = locvartemp.split( "&" );
for( var x = 0; x < locvartemp.length; x++ ) {
var lvTempVar = locvartemp[x].split( "=" );
getVars[ unescape( lvTempVar[0] ) ] = unescape( lvTempVar[1] );
try {
console.log(locvartemp[x]);
eval(locvartemp[x]);
}
catch (err) {
console.log(err);
// eg cb="deploy50"
eval(lvTempVar[0] + "='" + lvTempVar[1] + "'");
}
}
if (id === undefined) {
id = prompt("Enter material id eg KdK6yXrU");
}
if (width === undefined) {
width = prompt("Enter width eg 1050");
}
if (height === undefined) {
height = prompt("Enter height eg 411");
}
function correctListener() {
console.log("correctListener " + ggbApplet.getValue("correct"));
document.getElementById("correct").innerHTML="correct = " + ((ggbApplet.getValue("correct")==0)?"false":"true");
}
//function gListener() {
//console.log("g");
//}
var parameters = {
"id": "ggbApplet",
"width":width || 1050,
"height":height || 411,
"randomSeed":seed || 1,
"prerelease":beta,
"showMenuBar":false,
"showAlgebraInput":false,
"showToolBar":false,
"showToolBarHelp":false,
"showResetIcon":false,
//"enableLabelDrags":false,
"enableShiftDragZoom":false,
//"enableRightClick":false,
"errorDialogsActive":false,
"useBrowserForJS":false,
"allowStyleBar":false,
"preventFocus":false,
"showZoomButtons":false,
"capturingThreshold":3,
// add code here to run when the applet starts
"appletOnLoad":function(api){
document.getElementById("version").innerHTML="GeoGebra version = " + api.getVersion();
api.registerObjectUpdateListener("correct", "correctListener");
//if (beta) {
//api.registerObjectUpdateListener("g", "gListener");
//}
if (ggbApplet.getObjectType("validate") != "boolean") {
document.getElementById("validate").style.display = "none";
}
if (ggbApplet.getObjectType("showanswer") != "boolean") {
document.getElementById("showanswer").style.display = "none";
}
if (ggbApplet.getObjectType("showsolution") != "boolean") {
document.getElementById("showsolution").style.display = "none";
}
},
"showFullscreenButton":false,
"scale":1,
"disableAutoScale":false,
"allowUpscale":false,
"clickToLoad":false,
"appName":"classic",
"showSuggestionButtons":true,
"language":"en",
"material_id":id || "KdK6yXrU",
};
// is3D=is 3D applet using 3D view, AV=Algebra View, SV=Spreadsheet View, CV=CAS View, EV2=Graphics View 2, CP=Construction Protocol, PC=Probability Calculator DA=Data Analysis, FI=Function Inspector, macro=Macros
var views = {'is3D': 0,'AV': 1,'SV': 0,'CV': 0,'EV2': 0,'CP': 0,'PC': 0,'DA': 0,'FI': 0,'macro': 0};
var applet = new GGBApplet(parameters, '5.0', views);
// 1 pixel preview + GeoGebra logo
applet.setPreviewImage("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAADElEQVR4nGP4//8/AAX+Av4N70a4AAAAAElFTkSuQmCC","https://www.geogebra.org/images/GeoGebra_loading.png");
if (beta) {
//applet.setHTML5Codebase("https://autotest2.geogebra.org/job/common-web-test/job/apps-1059/lastSuccessfulBuild/artifact/web/war/web3d/");
//applet.setHTML5Codebase("https://autotest2.geogebra.org/job/common-web-test/job/apps-1035-1144/lastSuccessfulBuild/artifact/web/war/web3d");
//applet.setHTML5Codebase("https://autotest2.geogebra.org/job/common-web-test/job/apps-1035/lastSuccessfulBuild/artifact/web/war/web3d");
//applet.setHTML5Codebase("https://autotest2.geogebra.org/job/common-web-test/job/master/lastSuccessfulBuild/artifact/web/war/web3d");
//applet.setHTML5Codebase("https://apps-builds.s3-eu-central-1.amazonaws.com/geogebra/branches/dev/latest/web3d");
applet.setHTML5Codebase("https://www.geogebra.org/apps/5.0.564.0/web3d/");
}
window.onload = function() {applet.inject('ggbApplet')};
</script>
<iframe id="web3d" tabindex="-1" style="position: absolute; width: 0px; height: 0px; border: none; left: -1000px; top: -1000px;" src="./example-assess_files/saved_resource.html"></iframe><div aria-hidden="true" style="position: absolute; z-index: -32767; top: -20cm; width: 10cm; height: 10cm; visibility: hidden;"> </div></body></html>