This repository has been archived by the owner on Jan 19, 2024. It is now read-only.
forked from Khan/perseus
-
Notifications
You must be signed in to change notification settings - Fork 2
/
testrender.html
187 lines (167 loc) · 6.21 KB
/
testrender.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Perseus render</title>
<link rel="stylesheet" type="text/css" href="/ke/css/khan-site.css" />
<link rel="stylesheet" type="text/css" href="/ke/css/khan-exercise.css" />
<link rel="stylesheet" type="text/css" href="/lib/katex/fonts/fonts.css" />
<link rel="stylesheet/less" type="text/css" href="/lib/katex/katex.less" />
<link rel="stylesheet" type="text/css" href="/lib/mathquill/mathquill.css" />
<link rel="stylesheet/less" type="text/css" href="/stylesheets/exercise-content-package/perseus.less" />
<script src="/lib/less.js"></script>
</head>
<body>
<div id="problem-and-answer" class="framework-perseus" style="width: 797px;">
<div id="problemarea">
<div id="workarea"></div>
<div id="hintsarea"></div>
</div>
<div id="answer_area_wrap">
<div id="answer_area">
<form id="answerform">
<div id="anwsercontent">
<div id="solutionarea"></div>
</div>
</form>
</div>
</div>
<div style="clear: both;"></div>
</div>
<div id="extras">
<button id="score">Score</button>
<span id="examples-show" style="display: none;">Acceptable formats</span>
</div>
<script src="/lib/es5-shim.js"></script>
<script src="/lib/jquery.js"></script>
<script src="/lib/underscore.js"></script>
<script src="/lib/marked.js"></script>
<script src="/lib/react-with-addons.js"></script>
<script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML-full&delayStartupUntil=configured"></script>
<script src="/lib/katex/katex.js"></script>
<script src="/lib/mathquill/mathquill.js"></script>
<script src="/lib/kas.js"></script>
<script>
var KhanUtil = {
debugLog: function() {}
};
var Khan = {
Util: KhanUtil,
error: function() {},
query: {debug: ""},
imageBase: "/ke/images/",
scratchpad: {
disable: function() {},
enable: function() {}
}
};
React.initializeTouchEvents(true);
</script>
<script src="/ke/local-only/jed.js"></script>
<script src="/ke/local-only/i18n.js"></script>
<script src="/ke/local-only/jquery.qtip.js"></script>
<script src="/ke/exercises-stub.js"></script>
<script src="ke/local-only/require.js"></script>
<script>
(function() {
// Load khan-exercises modules, then perseus
require(["ke-deps.js"], function() {
// pre built
// require(["build/perseus.js"], initPerseus);
// pre built with source maps
// require(["build/perseus.debug.js"], initPerseus);
// built on demand
require(["src/perseus.js"], initPerseus);
});
$('#score').on('click', function() {
console.log(zk.scoreInput());
});
function initPerseus(Perseus) {
var seedContent = {
"hints": [
{
"content": "**Spain would fight against Britain, but only as an ally of France. The federal government would not have the power to regulate interstate commerce or to raise money through taxes until a new system of government was implemented under the Constitution in 1787.**\n\n"
},
{
"content": "By 1776, fighting between the British and the Continental Army commanded by George Washington was well underway. Congress was responsible for arming, equipping and paying the troops under Washington's command. \n\n[Watch this video to review these ideas] https://www.khanacademy.org/humanities/history/1600s-1800s/declaration-of-independence/v/background-and-introduction-to-the-united-states-declaration-of-independence"
}
],
"question": {
"content": "**Which of the following was a task that faced the Second Continental Congress in 1776?**\n",
"widgets": {
"input-number 1": {
"type": "input-number"
},
"radio 1": {
"type": "radio",
"options": {
"randomize": true,
"choices": [
{
"content": "Congress had to design a system of taxation for the nation.",
"correct": false
},
{
"content": "Congress had to determine the terms of a treaty with Spain. ",
"correct": false
},
{
"content": "Congress was responsible with providing aid and support for the army commanded by George Washington.",
"correct": true
},
{
"correct": false,
"content": "Congress had to determine trade agreements between the states. "
}
]
}
}
}
},
"answerArea": {
"type": "radio",
"options": {
"choices": [
{
"content": "Congress had to design a system of taxation for the nation.",
"correct": false
},
{
"content": "Congress had to determine the terms of a treaty with Spain. ",
"correct": false
},
{
"content": "Congress was responsible for providing aid and support for the army commanded by George Washington.",
"correct": true
},
{
"content": "Congress had to determine trade agreements between the states. ",
"correct": false
}
],
"randomize": true
}
}
};
Perseus.init({}).then(function() {
var itemMountNode = document.createElement("div");
zk = React.renderComponent(Perseus.ItemRenderer({
item: seedContent,
problemNum: Math.floor(Math.random() * 50) + 1,
initialHintsVisible: seedContent.hints.length,
enabledFeatures: {
highlight: true,
toolTipFormats: true
}
}, null), itemMountNode);
zk.focus();
}).then(function() {
console.log("all done.", +new Date/1000);
}, function(err) {
console.error(err);
});
}
})();
</script>
</body>
</html>