From 6f42f58f71e54ffdd89cb4d53c68e9212eb5a0ee Mon Sep 17 00:00:00 2001 From: hallgren Date: Tue, 28 Feb 2012 17:24:34 +0000 Subject: 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. --- src/www/TransQuiz/quiz_pre_start.js | 64 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 src/www/TransQuiz/quiz_pre_start.js (limited to 'src/www/TransQuiz/quiz_pre_start.js') 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); + } + -- cgit v1.2.3