summaryrefslogtreecommitdiff
path: root/src/www/TransQuiz/quiz_pre_start.js
blob: 81a8697dad29aa17f860201eb2c478794059cc09 (plain)
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
// 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);  
     }