Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
88 lines (74 sloc) 1.8 KB
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)
]
)
}