forked from gmp26/mathmo
/
mathmo.mobl
87 lines (74 loc) · 1.8 KB
/
mathmo.mobl
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
application mathmo
import ui
import nrichRPG::coreWorkout
import nrichRPG::questionAnswer
load nrichRPG/problems.js
load nrichRPG/helpers.js
load nrichRPG/fractions.js
load nrichRPG/polys.js
load nrichRPG/fpolys.js
load nrichRPG/complex.js
load nrichRPG/guessExact.js
load nrichRPG/stats.js
load jquery.flot.js
resource mathmoIcon.png
resource nrichIcon.png
resource english.json
var homeUrl:String = "http://nrich.maths.org";
var resourceUrl:String = "http://nrich.maths.org/7088";
control qaItem(qa:QA, number:Num) {
<span style="color:" + (qa.done ? (qa.correct ? "#480" : "#C00") : "#000") + "\"" >
html("Q" + number + ". " + topicName(qa.topic))
</span>
}
control qTab() {
header("Mathmo") {
image("mathmoIcon.png", 35, 35, style=logoStyle)
button("Clear", onclick={
clearAllQ();
hideCurrent();
}, style=delStyle, pushedStyle=delPushedStyle)
}
mMasterDetail(QA.all() order by number asc, qaItem, showQA)
}
control coreTab() {
header("Q on topic") {
image("mathmoIcon.png", 35, 35, style=logoStyle)
button("Clear", onclick={
clearAllQ();
hideCurrent();
}, style=delStyle, pushedStyle=delPushedStyle)
}
group() {
item(onclick={randomQ(5, "Core");}) {
label("Add 5 core Qs")
}
item(onclick={randomQ(5, "Further");}) {
label("Add 5 further Qs")
}
item(onclick={randomQ(5, "Stats");}) {
label("Add 5 stats Qs")
}
}
html("<section class=\"ui__section\">Core topics</section>")
addQA()
html("<section class=\"ui__section\">Further topics</section>")
addQAPlus()
html("<section class=\"ui__section\">Stats topics</section>")
addQAStats()
}
screen root() {
script {
fetchLanguageBundle("english.json");
if(QA.all().count() == 0) {
randomQ(5, "Core");
}
}
tabSet(
[
("Intro","",introduction),
("My Qs", "", qTab),
("Add", "", coreTab)
]
)
}