-
Notifications
You must be signed in to change notification settings - Fork 0
/
box2dModel.html
156 lines (149 loc) · 6.23 KB
/
box2dModel.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
<html xmlns:style="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript">
/*
* TODO: Copy this file and rename it to
*
* <new step type>.html
* e.g. quiz.html
*
* and then put the new file into the new folder
* you created for your new step type
*
* your new folder will look something like
* vlewrapper/WebContent/vle/node/<new step type>/
*
* e.g. if you are creating a quiz step it would look
* something like this
* vlewrapper/WebContent/vle/node/quiz/
*/
var box2dModel;
var eventManager;
function loadContentAfterScriptsLoad(node) {
/*
* TODO: rename Box2dModel
*
* make sure you rename Box2dModel to the object you created in
* the file when you copied and modified
*
* vlewrapper/WebContent/vle/node/box2dModel/box2dModel.js
*
* for example if you are creating a quiz step and you
* created the file
*
* vlewrapper/WebContent/vle/node/quiz/quiz.js
*
* and in that file you defined the Quiz object, you would
* change Box2dModel to Quiz
*
* TODO: rename box2dModel variable
*
* you should also rename the local var box2dModel variable to something
* appropriate. following my previous example I would rename it
* to quiz.
*/
eventManager = new EventManager();
box2dModel = new Box2dModel(node);
};
function loadContent(node) {
/*
* this loadScripts() function call will load the javascript imports
* into this html file
*
* TODO: rename box2dModel
*
* you will need to rename box2dModel to the variable name that you
* used in
*
* vlewrapper/WebContent/vle/util/scriptloader.js
*
* when you defined your script paths in the 'scripts' array
*
* for example if you are creating a quiz step and you added
* the variable named quiz to the scripts array, you would change
* 'box2dModel' to 'quiz'
*/
scriptloader.loadScripts('box2dModel', document, node.id, eventManager);
};
/*
* This is called when the student clicks on the save button below in the body
*/
function save(event) {
/*
* calls the save function in box2dModel.js
*/
if (typeof eventManager !== "undefined" && typeof box2dModel !== "undefined" && event == "save-pressed"){
eventManager.fire("save-pressed",[$('#studentResponseTextArea').val()], box2dModel);
}else if (typeof box2dModel !== "undefined"){
box2dModel.save("save-pressed");
}
}
</script>
<script src="wiseAPI.js"></script>
<script src="libs/jquery-2.1.1.min.js"></script>
<script src="libs/jquery-ui-1.10.0.custom.min.js"></script>
<script src="libs/highcharts.js"></script>
<script src="eventManager.js"></script>
<script src="box2dModel.js"></script>
<script src="content.js"></script>
<script src="libs/easel.js"></script>
<script src="libs/Box2dWeb-2.1.a.3.min.js"></script>
<script src="libs/canvas2image.js"></script>
<script src="js/GeneralObjects/Point3D.js"></script>
<script src="js/GeneralObjects/TextContainer.js"></script>
<script src="js/BuilderObjects/MaterialsMenu.js"></script>
<script src="js/BuilderObjects/BlockCompViewer.js"></script>
<script src="js/BuilderObjects/RectPrismViewer.js"></script>
<script src="js/BuilderObjects/CylinderViewer.js"></script>
<script src="js/BuilderObjects/BlockCompBuildingPanel.js"></script>
<script src="js/BuilderObjects/DataSpecsBuildingPanel.js"></script>
<script src="js/BuilderObjects/RectPrismBuildingPanel.js"></script>
<script src="js/BuilderObjects/CylinderBuildingPanel.js"></script>
<script src="js/BuilderObjects/BeakerBuildingPanel.js"></script>
<script src="js/BuilderObjects/RectBlockShape.js"></script>
<script src="js/BuilderObjects/CylinderShape.js"></script>
<script src="js/B2Objects/Myb2BuoyancyController.js"></script>
<script src="js/B2Objects/Labb2World.js"></script>
<script src="js/B2Objects/Beakerb2Actor.js"></script>
<script src="js/B2Objects/Scaleb2Actor.js"></script>
<script src="js/B2Objects/Balanceb2Actor.js"></script>
<script src="js/B2Objects/BlockCompb2Actor.js"></script>
<script src="js/B2Objects/Cylinderb2Actor.js"></script>
<script src="js/B2Objects/RectPrismb2Actor.js"></script>
<script src="js/B2Objects/skins/LabShape.js"></script>
<script src="js/B2Objects/skins/BlockCompShape.js"></script>
<script src="js/B2Objects/skins/CylinderCompShape.js"></script>
<script src="js/B2Objects/skins/RectPrismCompShape.js"></script>
<script src="js/B2Objects/skins/ContainerCompShape.js"></script>
<script src="js/B2Objects/skins/BeakerShape.js"></script>
<script src="js/B2Objects/skins/ScaleShape.js"></script>
<script src="js/B2Objects/skins/BalanceShape.js"></script>
<script src="js/FeedbackManager.js"></script>
<script src="js/box2dModelMain.js"></script>
<link rel="stylesheet" href="libs/jquery-ui-1.9.0.custom.min.css">
</head>
<body onload="loadContentAfterScriptsLoad()">
<!-- TODO create the html UI that the student will see when they visit the step -->
<div id='messageDiv'></div>
<div id='promptDiv'></div>
<div id='previousWorkDiv'></div>
<div id="builder-button-holder"></div>
<div id="library-button-holder"></div>
<div id="beaker-button-holder"></div>
<div id="scale-button-holder"></div>
<canvas width=820 height=560 id="b2canvas" ></canvas>
<div id="chartDiv"></div>
<div id="response-holder">
<div id='prompt2Div'></div>
<div id='responseDiv' style="padding:5px;"><textarea id='studentResponseTextArea' rows='10' cols='96' style='font: normal 14px verdana; border: solid 1px #ddd; border-radius: 10px 10px 10px 10px; box-shadow: 1px 1px 0 #888; color:#00a; padding: 11px 10px 2px 10px;background-color:#ffe;'></textarea></div>
<div id='saveButtonDiv' style='float: left'>
<input type='button' value='Save' onclick='save("save-pressed")' data-i18n="save" />
</div>
</div>
<div id="canvas-holder">
<canvas width=820 height=560 id="debugcanvas" ></canvas>
<canvas width=220 height=220 id="imgcanvas" ></canvas>
</div>
<div id="chartPopUp"/></body>
</body>
</html>