· 8 years ago · Dec 11, 2017, 12:46 PM
1SQL For Database
2
3 CREATE TABLE IF NOT EXISTS `users` (
4 `id` int(11) NOT NULL AUTO_INCREMENT,
5 `category_id` int(11) NOT NULL,
6 `user_name` varchar(60) NOT NULL,
7 `reg_no` varchar(50) NOT NULL,
8 PRIMARY KEY (`id`)
9 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=17 ;
10
11 --
12 -- Dumping data for table `users`
13 --
14
15 INSERT INTO `users` (`id`, `category_id`, `user_name`, `reg_no`) VALUES
16 (1, 1, 'DANIEL FLORENCE NSE', '16/STV/033'),
17 (2, 1, 'DOLTINO MARY BASSEY', '16/STV/034'),
18 (3, 1, 'EDET ESTHER EFFIONG', '16/STV/035'),
19 (4, 1, 'EFFIOM OFFIONG CHARLES ', '16/STV/036'),
20 (5, 1, 'EFFIONG QUEENETH DOMINC ', '16/STV/037'),
21 (6, 1, 'EFFIONG JOANNA OKON', '16/STV/038'),
22 (7, 1, 'EJUKWA FELICITY EJOGHA', '16/STV/039'),
23 (8, 1, 'EKONG THELMA MFON', '16/STV/040'),
24 (9, 1, 'EKPE PRAISE WILFRED', '16/STV/041'),
25 (10, 1, 'ETTAH GENEVIEVE HODO', '16/STV/042'),
26 (11, 1, 'EYO ESTHER RICHARD', '16/STV/043');
27
28
29
30 CREATE TABLE IF NOT EXISTS `questions` (
31 `id` int(11) NOT NULL AUTO_INCREMENT,
32 `question_name` text NOT NULL,
33 `answer1` varchar(250) NOT NULL,
34 `answer2` varchar(250) NOT NULL,
35 `answer3` varchar(250) NOT NULL,
36 `answer4` varchar(250) NOT NULL,
37 `answer` varchar(250) NOT NULL,
38 `category_id` int(11) NOT NULL,
39 PRIMARY KEY (`id`)
40 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
41
42 --
43 -- Dumping data for table `questions`
44 --
45
46 INSERT INTO `questions` (`id`, `question_name`, `answer1`, `answer2`, `answer3`, `answer4`, `answer`, `category_id`) VALUES
47 (1, 'Where did India play its 1st one day international match?', 'Lords', 'Headingley', 'Taunton', 'The Oval', '2', 1),
48 (2, 'Who was the 1st ODI captain for India?rn', 'Ajit Wadekar ', 'Bishen Singh Bedi', 'Nawab Pataudi', 'Vinoo Mankad ', '1', 1),
49 (3, 'Who has made the Fastest Test century in Test Cricket ?rnrnrnrn', 'Sachin Tendulkar', ' Sahid Afridi', ' Virender Sehwag', 'Vivian Richards', '4', 1),
50 (4, 'Which Bowler had the Best figures in a Test Match ?rnrnrnrnrn', 'Muttiah Muralitharan', 'Bob Massie', 'Jim Laker', 'George Lohmann', '3', 1),
51 (5, 'Which team has the Largest successful run chase record in ODIs ?rnrnrnrnrn', 'England', 'South Africa', 'Australia', 'India', '2', 2),
52 (6, 'What does HTML stand for?rnrn rn rn ', 'Hyper Text Markup Language', 'Hyperlinks and Text Markup Language', 'Home Tool Markup Language', 'Highly Text Markup Language', '1', 1),
53 (7, 'Who is making the Web standards?rnrn rn rn rn rn', 'Microsoft', 'Google', 'The World Wide Web Consortium', 'Mozilla', '3', 2),
54 (8, 'What is the correct HTML for creating a hyperlink?rnrn rn rn rn ', '<a name="http://maxil.net">Smart Tutorials</a>', '<a>http://maxil.net</a>', '<a url="http://maxil.net">Smart Tutorials</a>', '<a href="http://maxil.net">Smart Tutorials</a>', '4', 1),
55 (9, 'What is the HTML element to bold a text?rnrnrnrnrn', '<b>', '<bold>', '<wide>', '<big>', '1', 2),
56 (10, 'What is the HTML tag for a link?rnrnrnrnrn', '<link>', '<ref>', '<a>', '<hper>', '3', 2),
57 (11, 'What does CSS stand for?rnrn rn rn rn ', 'Creative Style Sheets', 'Colorful Style Sheets', 'Computer Style Sheets', 'Cascading Style Sheets', '4', 3),
58 (12, 'Where in an HTML document is the correct place to refer to an external style sheet?rnrn rn rn rn ', 'In the <body> section ', 'At the end of the document', 'At the top of the document', 'In the <head> section ', '4', 1),
59 (13, 'Which HTML tag is used to define an internal style sheet?rnrn rn rn ', '<script>', '<css>', '<style>', '<link>', '3', 3),
60 (14, 'Which is the correct CSS syntax?rnrn rn rn rn ', 'body:color=black;', '{body;color:black;}', 'body {color: black;}', '{body:color=black;}', '3', 3),
61 (15, 'Which property is used to change the background color?rnrn rn rn ', 'background-color', 'color', 'bgcolor', 'bg-color', '1', 4),
62 (16, 'What does PHP stand for?rnrn rn rn ', ' PHP: Hypertext Preprocessor', 'Personal Hypertext Processor', 'Personal Home Page', 'Private Home Page', '1', 4),
63 (17, 'PHP server scripts are surrounded by delimiters, which?rnrn rn rn rn ', '<?php>...</?>', '<?php ... ?>', '<script>...</script>', '<&>...</&>', '2', 4),
64 (18, 'How do you write "Hello World" in PHPrnrn rn rn ', '"Hello World"', 'echo "Hello World"', 'Document.Write("Hello World");', 'print_f("Hello World");', '2', 1),
65 (19, ' Which of the following is the way to create comments in PHP?rnrnrn rn rn ', '// commented code to end of line', '/* commented code here */', '# commented code to end of line', 'all of the above - correct', '4', 4),
66 (20, 'What is the correct way to end a PHP statement?rnrn rn rn rn ', '</php>', '.', ';', 'New line', '3', 1);
67
68 ------------------------------------------------------------------
69
70dash.php
71
72 <?php
73 session_start();
74 ?>
75
76 <?php
77 require 'config.php';
78 $category= "";
79 if(!empty($_POST['name'])){
80 $name=$_POST['name'];
81
82 $_SESSION['name']= $name;
83 $_SESSION['id'] = mysql_insert_id();
84 }
85 if(!empty($_SESSION['name'])){
86 ?>
87 <!DOCTYPE html>
88 <html>
89 <head>
90 <title>ExamsLTE</title>
91 <meta name="viewport" content="width=device-width, initial-scale=1.0">
92 <!-- Bootstrap -->
93 <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
94 <link href="css/style.css" rel="stylesheet" media="screen">
95
96 <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
97 <!--[if lt IE 9]>
98 <script src="../../assets/js/html5shiv.js"></script>
99 <script src="../../assets/js/respond.min.js"></script>
100 <![endif]-->
101
102 <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
103 <script src="js/jquery-1.10.2.min.js"></script>
104 <!-- Include all compiled plugins (below), or include individual files as needed -->
105 <script src="js/bootstrap.min.js"></script>
106 <script src="js/jquery.validate.min.js"></script>
107 <script src="js/countdown.js"></script>
108 <style>
109 .container {
110 margin-top: 110px;
111 }
112 .error {
113 color: #B94A48;
114 }
115 .form-horizontal {
116 margin-bottom: 0px;
117 }
118 .hide{display: none;}
119 </style>
120 </head>
121 <body>
122 <header>
123 <p class="text-center">
124 Welcome : <?php if(!empty($_SESSION['name'])){echo $_SESSION['name'];}?>
125 </p>
126 </header>
127
128
129 <div class="container question">
130 <div class="col-xs-12 col-sm-8 col-md-8 col-xs-offset-4 col-sm-offset-3 col-md-offset-3">
131 <p>
132
133 </p>
134 <hr>
135 <form class="form-horizontal" role="form" id='login' method="post" action="questions.php">
136 <div class="checked-group">
137
138 <input type="checkbox" value="1" name="mts">Mathematics
139
140 <br />
141
142 <input type="checkbox" value="2" name="eng">English Language
143
144 <br />
145
146 <input type="checkbox" value="3" name="bio"> Biology
147
148 <br />
149
150 <input type="checkbox" value="4" name="phy">Physics
151
152 <br />
153
154 <input type="checkbox" value="5" name="chm">Chemistry
155
156 <br />
157
158 <input type="checkbox" value="6" name="agc">Agricultural Science
159
160 <br />
161
162 <input type="checkbox" value="7" name="ecs">Economics
163
164 <br />
165
166 <input type="checkbox" value="8" name="cmc">Commerce
167
168 <br />
169
170 <input type="checkbox" value="9" name="com">Computer Studies
171
172 <br>
173 <button class="btn btn-success btn-block" type="submit"><!-- 0n click go to Quest -->
174 Submit
175 </button>
176
177 </div>
178
179 </form>
180 </div>
181 </div>
182 <footer>
183 <p class="text-center" id="foot">
184 © <a href="#" target="_blank">CSB ICT</a> 2014 - 2018
185 </p>
186 </footer>
187
188
189
190
191 </body>
192 </html>
193 <?php }else{
194
195 header( 'Location: index.php' ) ;
196
197 }
198 ?>