summaryrefslogtreecommitdiff
path: root/src/www/TransQuiz/quiz_pre_start.js
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2012-02-28 17:24:34 +0000
committerhallgren <hallgren@chalmers.se>2012-02-28 17:24:34 +0000
commit6f42f58f71e54ffdd89cb4d53c68e9212eb5a0ee (patch)
tree46b183fac486510a8212eb9e4846b3a857b58f48 /src/www/TransQuiz/quiz_pre_start.js
parentc1c1a73dc3db1f1ae8b298f836dfa7a2a17f2638 (diff)
gfse: Translation Quiz integration
Also moved the translation quiz from demos/TransQuiz to src/www/TransQuiz so that it will be installed by 'cabal install' along with the other files that are installed for use by gf -server mode.
Diffstat (limited to 'src/www/TransQuiz/quiz_pre_start.js')
-rw-r--r--src/www/TransQuiz/quiz_pre_start.js64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/www/TransQuiz/quiz_pre_start.js b/src/www/TransQuiz/quiz_pre_start.js
new file mode 100644
index 000000000..81a8697da
--- /dev/null
+++ b/src/www/TransQuiz/quiz_pre_start.js
@@ -0,0 +1,64 @@
+// Copyright © Elnaz Abolahrar, 2011
+
+// pre_start: runs on load time before evrything else to prepare the quiz
+
+function pre_start()
+{
+ hide_element('history_part');
+ hide_element('toggle_show');
+
+ default_values();
+
+ var quiz_mode=empty_id("select","quiz_mode");
+
+ //adds the "Quiz Mode" and "Restart Quiz" and "End Quiz" and "Start Quiz"
+ appendChildren(minibar.quizbar,
+ [text(" Quiz Mode: "), quiz_mode,
+ button("Restart Quiz","restart_quiz()","R"),
+ button("End Quiz","end_quiz(true)","E"),
+ button("Start Quiz","start_quiz()","S")]);
+
+
+ //adds the "Next Question" and "Previous Question" and "Hint" and "Check Answer" buttons
+ var buttons_bar=element("buttons_bar");
+ appendChildren(buttons_bar,
+ [button("< Previous Question","previous_question_quiz()","B", "previous_question"),
+ button("Next Question >","generate_question()","N", "next_question"),
+ button("Hint","show_hint()","H", "hint"),
+ submit_button("Check Answer", "check_answer")]);
+
+ disable_all();
+
+ //hide the minibar word magnets
+ hide_element('minibar_contin');
+
+ //hide the delete and clear buttons
+ hide_element('minibar_buttons');
+
+ mode_options(quiz_mode);
+}
+
+
+function mode_options(quiz_mode)
+ {
+ var opt=empty("option");
+ opt.setAttribute("value","Easy Study Mode");
+ opt.innerHTML="Easy Study Mode";
+ quiz_mode.appendChild(opt);
+
+ var opt=empty("option");
+ opt.setAttribute("value","Medium Study Mode");
+ opt.innerHTML="Medium Study Mode";
+ quiz_mode.appendChild(opt);
+
+ var opt=empty("option");
+ opt.setAttribute("value","Hard Study Mode");
+ opt.innerHTML="Hard Study Mode";
+ quiz_mode.appendChild(opt);
+
+ var opt=empty("option");
+ opt.setAttribute("value","Exam Mode");
+ opt.innerHTML="Exam Mode";
+ quiz_mode.appendChild(opt);
+ }
+