From cc5b0eed57f233cf864ae13ad01a65891fa0c4ff Mon Sep 17 00:00:00 2001 From: sreebhattacharyya <56808654+sreebhattacharyya@users.noreply.github.com> Date: Mon, 25 Nov 2019 16:20:38 +0530 Subject: [PATCH] Add files via upload --- MakeNewQp.php | 35 ++++++++++ README.md | 10 ++- addqref.html | 21 ++++++ destroy_sess.php | 6 ++ exam.php | 65 +++++++++++++++++++ index.php | 165 ++++++++--------------------------------------- nextQ.php | 9 +++ nextqref.php | 18 ++++++ plan.txt | 42 ++++++++++++ prevQ.php | 8 +++ qbank.json | 94 +++++++++++++++++++++++++++ qbank.sql | 161 +++++++++++++++++++++++++++++++++++++++++++++ qpapernew.html | 21 ++++++ qpapers.json | 16 +++++ qpapers.sql | 84 ++++++++++++++++++++++++ saveQ.php | 8 +++ starttest.php | 29 +++++++++ submit.php | 48 ++++++++++++++ submitqref.php | 19 ++++++ 19 files changed, 721 insertions(+), 138 deletions(-) create mode 100644 MakeNewQp.php create mode 100644 addqref.html create mode 100644 destroy_sess.php create mode 100644 exam.php create mode 100644 nextQ.php create mode 100644 nextqref.php create mode 100644 plan.txt create mode 100644 prevQ.php create mode 100644 qbank.json create mode 100644 qbank.sql create mode 100644 qpapernew.html create mode 100644 qpapers.json create mode 100644 qpapers.sql create mode 100644 saveQ.php create mode 100644 starttest.php create mode 100644 submit.php create mode 100644 submitqref.php diff --git a/MakeNewQp.php b/MakeNewQp.php new file mode 100644 index 0000000..4810d13 --- /dev/null +++ b/MakeNewQp.php @@ -0,0 +1,35 @@ + + + + + + + diff --git a/README.md b/README.md index 1caf733..cabb2b2 100644 --- a/README.md +++ b/README.md @@ -1 +1,9 @@ -# MiniProject2019 \ No newline at end of file +# miniproj2 +This is my second attempt on the project. It uses php for backend and no javascript. + +# Important +please import the databases in phpmyadmin and make sure that WAMP server is running before trying to run the website in netbeans. + +The databases to be imported are provide in JSON format. +-> qbank.json +-> qpapers.json diff --git a/addqref.html b/addqref.html new file mode 100644 index 0000000..260d3db --- /dev/null +++ b/addqref.html @@ -0,0 +1,21 @@ + + + + + + Add Question Reference + + + +
+ Please enter question reference number:

+
+ + +
+ + diff --git a/destroy_sess.php b/destroy_sess.php new file mode 100644 index 0000000..02c7309 --- /dev/null +++ b/destroy_sess.php @@ -0,0 +1,6 @@ + diff --git a/exam.php b/exam.php new file mode 100644 index 0000000..c721777 --- /dev/null +++ b/exam.php @@ -0,0 +1,65 @@ + + + + + + <?php echo $_SESSION['testname'];?> + + + + +
+
+
+ "; + readfile($qfile); + //echo "question no:".$qno."\nqref".$qref."\ntestname=".$_SESSION['testname']; + ?> +
+
+ interaction buttons should appear here +
+ Option '.$i.'
'; + else + echo 'Option '.$i.'
'; + } + ?> + + + + +
+
+
+
+ + + diff --git a/index.php b/index.php index f170ced..79bfb9d 100644 --- a/index.php +++ b/index.php @@ -1,145 +1,36 @@ + + - + + + Qbank2 - - - - - - - Sign Up - - - - -
-

Sign Up to SHIKSHA

-

Please fill this form to create an account.

-
" method="post"> -
- - - -
-
- - - -
-
- - - -
-
- - -
-

Already have an account? Login here.

+ + + + +
+
+ Click here to create new question paper!
-
- + - - - - - \ No newline at end of file diff --git a/nextQ.php b/nextQ.php new file mode 100644 index 0000000..5ee460f --- /dev/null +++ b/nextQ.php @@ -0,0 +1,9 @@ +$_SESSION['max_rows']) + $_SESSION['qno']=1; +header("location:exam.php"); +?> + diff --git a/nextqref.php b/nextqref.php new file mode 100644 index 0000000..0665dba --- /dev/null +++ b/nextqref.php @@ -0,0 +1,18 @@ + diff --git a/plan.txt b/plan.txt new file mode 100644 index 0000000..12f0d1d --- /dev/null +++ b/plan.txt @@ -0,0 +1,42 @@ +starttest.php +{ + terms and conditions +button to start test. +} + + + + +exam.php +{ +get[qno]=question number; +display question +{ +get qstn reference from qpaper table +find qstion in qstn table +read file and output +} + +change qno buttons +{ +redirect to the same page with diff qno +} + +record ans +{ +record the ans in table +} + +there will be a submit button --links to submit.php --submits the name of the qpaper table in post method +} + + + + + + +submit.php +{ +check answers and display results +delete table +} \ No newline at end of file diff --git a/prevQ.php b/prevQ.php new file mode 100644 index 0000000..99d819f --- /dev/null +++ b/prevQ.php @@ -0,0 +1,8 @@ + \ No newline at end of file diff --git a/qbank.json b/qbank.json new file mode 100644 index 0000000..c2160c2 --- /dev/null +++ b/qbank.json @@ -0,0 +1,94 @@ +[ +{"type":"header","version":"4.8.5","comment":"Export to JSON plugin for PHPMyAdmin"}, +{"type":"database","name":"qbank"}, +{"type":"table","name":"q&a","database":"qbank","data": +[ +{"Q. No.":"Q.1","Question&Options":"The lengths of the two sides of a Triangle, forming a right angle, are 3 and 4 units, respectively. What is the length of the third side?","Correct Answer":"Q1_3","SUBJECT":"MATHS","Type":"Geometry","Sub-Topic":"Triangle","Objective":"U","Reference":"None","Difficulty Level":"E","Estimated Time to Solve(in min)":"1\/2"}, +{"Q. No.":"Q4_4","Question&Options":"","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q1_1","Question&Options":"4","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q1_2","Question&Options":"7","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q1_3","Question&Options":"5","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q1_4","Question&Options":"2","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q2","Question&Options":"The answer to this is option (1)","Correct Answer":"Q2_1","SUBJECT":"MATHS","Type":"Geometry","Sub-Topic":"Circles","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q2_1","Question&Options":"","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q2_2","Question&Options":"","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q2_3","Question&Options":"","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q3","Question&Options":"What is 3+3?","Correct Answer":"Q3_1","SUBJECT":"MATHS","Type":"Algebra","Sub-Topic":"Numbers","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q3_1","Question&Options":"6","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q3_2","Question&Options":"7","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q3_3","Question&Options":"2","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q3_4","Question&Options":"1","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q4","Question&Options":"Who discovered proton?","Correct Answer":"Q4_2","SUBJECT":"CHEMISTRY","Type":"Atoms","Sub-Topic":"Electronic Structure","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q4_1","Question&Options":"x","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q4_2","Question&Options":"y","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q4_3","Question&Options":"z","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q5","Question&Options":"How many colors are there in rainbow?","Correct Answer":"Q5_2","SUBJECT":"PHYSICS","Type":"Physical world","Sub-Topic":"Light","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q5_1","Question&Options":"6","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q5_2","Question&Options":"7","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q5_3","Question&Options":"5","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q5_4","Question&Options":"8","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q6","Question&Options":"What is chemical symbol of water?","Correct Answer":"Q6_1","SUBJECT":"CHEMISTRY","Type":"Chemical Bond","Sub-Topic":"Chemical Symbols","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q6_1","Question&Options":"H2O","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q6_2","Question&Options":"HO2","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q6_3","Question&Options":"H3O","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q6_4","Question&Options":"O","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q7","Question&Options":"What is the color sequence of rainbow?","Correct Answer":"Q7_3","SUBJECT":"PHYSICS","Type":"Physical World","Sub-Topic":"Light","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q7_1","Question&Options":"VIBYOGR","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q7_2","Question&Options":"BVIGYOR","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q7_3","Question&Options":"VIBGYOR","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q7_4","Question&Options":"ROYGVIB","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q8","Question&Options":"What is chemical symbol of Oxygen?","Correct Answer":"Q8_3","SUBJECT":"CHEMISTRY","Type":"Chemical Bonds","Sub-Topic":"Chemical Symbols","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q8_1","Question&Options":"OX","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q8_2","Question&Options":"OXY","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q8_3","Question&Options":"O","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q8_4","Question&Options":"None of the above","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q9","Question&Options":"Which one of the following are sides of an equilateral triangle?","Correct Answer":"Q9_4","SUBJECT":"MATHS","Type":"Geometry","Sub-Topic":"Triangles","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q9_1","Question&Options":"2,2,2","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q9_2","Question&Options":"3,3,3","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q9_3","Question&Options":"4,4,4","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q9_4","Question&Options":"All of the above","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q10","Question&Options":"Who discovered neutron?","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q10_1","Question&Options":"CHADWICK","Correct Answer":"Q10_1","SUBJECT":"CHEMISTRY","Type":"Atoms","Sub-Topic":"ELectronic Structure","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q10_2","Question&Options":"b","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q10_3","Question&Options":"c","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q10_4","Question&Options":"d ","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q11","Question&Options":"Who did Milikan Oil Drop experiment?","Correct Answer":"Q11_3","SUBJECT":"CHEMISTRY","Type":"Atoms","Sub-Topic":"Electronic Structure","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q11_1","Question&Options":"Einstein","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q11_2","Question&Options":"Newton","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q11_3","Question&Options":"R.Milikan","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q11_4","Question&Options":"Giraffe","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q12","Question&Options":"Is 5=10?","Correct Answer":"Q12_1","SUBJECT":"MATHS","Type":"Algebra","Sub-Topic":"Numbers","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q12_1","Question&Options":"No","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q12_2","Question&Options":"Yes","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q12_3","Question&Options":"None ","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q12_4","Question&Options":"All","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q13","Question&Options":"What is speed of sound in air?","Correct Answer":"Q13_1","SUBJECT":"PHYSICS","Type":"Physical Phenomena","Sub-Topic":"Sound","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q13_1","Question&Options":"340 m\/s","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q13_2","Question&Options":"200 m\/s","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q13_3","Question&Options":"300 m\/s","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q13_4","Question&Options":"390 m\/s","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q14","Question&Options":"What is refractive index of air?","Correct Answer":"Q4_1","SUBJECT":"PHYSICS","Type":"Physical Phenomena","Sub-Topic":"Light","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q14_1","Question&Options":"1","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q14_2","Question&Options":"1\/2","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q14_3","Question&Options":"1\/3","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q14_4","Question&Options":"1\/4","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q15","Question&Options":"8*9=?","Correct Answer":"Q15_2","SUBJECT":"MATHS","Type":"Algebra","Sub-Topic":"Numbers","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q15_1","Question&Options":"64","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q15_2","Question&Options":"72","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q15_3","Question&Options":"37","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""}, +{"Q. No.":"Q15_4","Question&Options":"8","Correct Answer":"","SUBJECT":"","Type":"","Sub-Topic":"","Objective":"","Reference":"","Difficulty Level":"","Estimated Time to Solve(in min)":""} +] +} +,{"type":"table","name":"qstn","database":"qbank","data": +[ +{"id":"1","subject":"Maths","time":"00:03:00","difficulty":"medium","content":"this this a question, ans is opt 1","correct_option":"1","options":"1.a 2.b 3.c"}, +{"id":"2","subject":"Maths","time":"00:03:00","difficulty":"medium","content":"this is a  math qstn, answer is 2","correct_option":"2","options":"1. opt1\r\n2. opt2\r\n3. opt3"}, +{"id":"3","subject":"Maths","time":"00:03:00","difficulty":"medium","content":"2+2=?","correct_option":"3","options":"1. 1\r\n2. 0\r\n3. 4"}, +{"id":"4","subject":"Maths","time":"00:03:00","difficulty":"medium","content":"7+2=?","correct_option":"1","options":"1. 9\r\n2. 4\r\n3. 4"}, +{"id":"5","subject":"Physics","time":null,"difficulty":"easy","content":"Data\/q1.txt","correct_option":"1","options":"3"}, +{"id":"6","subject":"Physics","time":null,"difficulty":"medium","content":"Data\/q2.txt","correct_option":"2","options":"4"}, +{"id":"7","subject":"Physics","time":null,"difficulty":"easy","content":"Data\/q3.txt","correct_option":"1","options":"2"}, +{"id":"8","subject":"Physics","time":null,"difficulty":"medium","content":"Data\/q4.txt","correct_option":"2","options":"6"} +] +} +] diff --git a/qbank.sql b/qbank.sql new file mode 100644 index 0000000..6403c38 --- /dev/null +++ b/qbank.sql @@ -0,0 +1,161 @@ +-- phpMyAdmin SQL Dump +-- version 4.8.5 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1:3306 +-- Generation Time: Nov 09, 2019 at 06:11 AM +-- Server version: 5.7.26 +-- PHP Version: 7.2.18 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `qbank` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `q&a` +-- + +DROP TABLE IF EXISTS `q&a`; +CREATE TABLE IF NOT EXISTS `q&a` ( + `Q. No.` varchar(6) NOT NULL, + `Question&Options` text NOT NULL, + `Correct Answer` varchar(6) NOT NULL, + `SUBJECT` varchar(15) NOT NULL, + `Type` text NOT NULL, + `Sub-Topic` text NOT NULL, + `Objective` varchar(1) NOT NULL, + `Reference` varchar(100) NOT NULL, + `Difficulty Level` text NOT NULL, + `Estimated Time to Solve(in min)` varchar(5) NOT NULL, + PRIMARY KEY (`Q. No.`) +) ENGINE=MyISAM DEFAULT CHARSET=hp8; + +-- +-- Dumping data for table `q&a` +-- + +INSERT INTO `q&a` (`Q. No.`, `Question&Options`, `Correct Answer`, `SUBJECT`, `Type`, `Sub-Topic`, `Objective`, `Reference`, `Difficulty Level`, `Estimated Time to Solve(in min)`) VALUES +('Q.1', 'The lengths of the two sides of a Triangle, forming a right angle, are 3 and 4 units, respectively. What is the length of the third side?', 'Q1_3', 'MATHS', 'Geometry', 'Triangle', 'U', 'None', 'E', '1/2'), +('Q4_4', '', '', '', '', '', '', '', '', ''), +('Q1_1', '4', '', '', '', '', '', '', '', ''), +('Q1_2', '7', '', '', '', '', '', '', '', ''), +('Q1_3', '5', '', '', '', '', '', '', '', ''), +('Q1_4', '2', '', '', '', '', '', '', '', ''), +('Q2', 'The answer to this is option (1)', 'Q2_1', 'MATHS', 'Geometry', 'Circles', '', '', '', ''), +('Q2_1', '', '', '', '', '', '', '', '', ''), +('Q2_2', '', '', '', '', '', '', '', '', ''), +('Q2_3', '', '', '', '', '', '', '', '', ''), +('Q3', 'What is 3+3?', 'Q3_1', 'MATHS', 'Algebra', 'Numbers', '', '', '', ''), +('Q3_1', '6', '', '', '', '', '', '', '', ''), +('Q3_2', '7', '', '', '', '', '', '', '', ''), +('Q3_3', '2', '', '', '', '', '', '', '', ''), +('Q3_4', '1', '', '', '', '', '', '', '', ''), +('Q4', 'Who discovered proton?', 'Q4_2', 'CHEMISTRY', 'Atoms', 'Electronic Structure', '', '', '', ''), +('Q4_1', 'x', '', '', '', '', '', '', '', ''), +('Q4_2', 'y', '', '', '', '', '', '', '', ''), +('Q4_3', 'z', '', '', '', '', '', '', '', ''), +('Q5', 'How many colors are there in rainbow?', 'Q5_2', 'PHYSICS', 'Physical world', 'Light', '', '', '', ''), +('Q5_1', '6', '', '', '', '', '', '', '', ''), +('Q5_2', '7', '', '', '', '', '', '', '', ''), +('Q5_3', '5', '', '', '', '', '', '', '', ''), +('Q5_4', '8', '', '', '', '', '', '', '', ''), +('Q6', 'What is chemical symbol of water?', 'Q6_1', 'CHEMISTRY', 'Chemical Bond', 'Chemical Symbols', '', '', '', ''), +('Q6_1', 'H2O', '', '', '', '', '', '', '', ''), +('Q6_2', 'HO2', '', '', '', '', '', '', '', ''), +('Q6_3', 'H3O', '', '', '', '', '', '', '', ''), +('Q6_4', 'O', '', '', '', '', '', '', '', ''), +('Q7', 'What is the color sequence of rainbow?', 'Q7_3', 'PHYSICS', 'Physical World', 'Light', '', '', '', ''), +('Q7_1', 'VIBYOGR', '', '', '', '', '', '', '', ''), +('Q7_2', 'BVIGYOR', '', '', '', '', '', '', '', ''), +('Q7_3', 'VIBGYOR', '', '', '', '', '', '', '', ''), +('Q7_4', 'ROYGVIB', '', '', '', '', '', '', '', ''), +('Q8', 'What is chemical symbol of Oxygen?', 'Q8_3', 'CHEMISTRY', 'Chemical Bonds', 'Chemical Symbols', '', '', '', ''), +('Q8_1', 'OX', '', '', '', '', '', '', '', ''), +('Q8_2', 'OXY', '', '', '', '', '', '', '', ''), +('Q8_3', 'O', '', '', '', '', '', '', '', ''), +('Q8_4', 'None of the above', '', '', '', '', '', '', '', ''), +('Q9', 'Which one of the following are sides of an equilateral triangle?', 'Q9_4', 'MATHS', 'Geometry', 'Triangles', '', '', '', ''), +('Q9_1', '2,2,2', '', '', '', '', '', '', '', ''), +('Q9_2', '3,3,3', '', '', '', '', '', '', '', ''), +('Q9_3', '4,4,4', '', '', '', '', '', '', '', ''), +('Q9_4', 'All of the above', '', '', '', '', '', '', '', ''), +('Q10', 'Who discovered neutron?', '', '', '', '', '', '', '', ''), +('Q10_1', 'CHADWICK', 'Q10_1', 'CHEMISTRY', 'Atoms', 'ELectronic Structure', '', '', '', ''), +('Q10_2', 'b', '', '', '', '', '', '', '', ''), +('Q10_3', 'c', '', '', '', '', '', '', '', ''), +('Q10_4', 'd ', '', '', '', '', '', '', '', ''), +('Q11', 'Who did Milikan Oil Drop experiment?', 'Q11_3', 'CHEMISTRY', 'Atoms', 'Electronic Structure', '', '', '', ''), +('Q11_1', 'Einstein', '', '', '', '', '', '', '', ''), +('Q11_2', 'Newton', '', '', '', '', '', '', '', ''), +('Q11_3', 'R.Milikan', '', '', '', '', '', '', '', ''), +('Q11_4', 'Giraffe', '', '', '', '', '', '', '', ''), +('Q12', 'Is 5=10?', 'Q12_1', 'MATHS', 'Algebra', 'Numbers', '', '', '', ''), +('Q12_1', 'No', '', '', '', '', '', '', '', ''), +('Q12_2', 'Yes', '', '', '', '', '', '', '', ''), +('Q12_3', 'None ', '', '', '', '', '', '', '', ''), +('Q12_4', 'All', '', '', '', '', '', '', '', ''), +('Q13', 'What is speed of sound in air?', 'Q13_1', 'PHYSICS', 'Physical Phenomena', 'Sound', '', '', '', ''), +('Q13_1', '340 m/s', '', '', '', '', '', '', '', ''), +('Q13_2', '200 m/s', '', '', '', '', '', '', '', ''), +('Q13_3', '300 m/s', '', '', '', '', '', '', '', ''), +('Q13_4', '390 m/s', '', '', '', '', '', '', '', ''), +('Q14', 'What is refractive index of air?', 'Q4_1', 'PHYSICS', 'Physical Phenomena', 'Light', '', '', '', ''), +('Q14_1', '1', '', '', '', '', '', '', '', ''), +('Q14_2', '1/2', '', '', '', '', '', '', '', ''), +('Q14_3', '1/3', '', '', '', '', '', '', '', ''), +('Q14_4', '1/4', '', '', '', '', '', '', '', ''), +('Q15', '8*9=?', 'Q15_2', 'MATHS', 'Algebra', 'Numbers', '', '', '', ''), +('Q15_1', '64', '', '', '', '', '', '', '', ''), +('Q15_2', '72', '', '', '', '', '', '', '', ''), +('Q15_3', '37', '', '', '', '', '', '', '', ''), +('Q15_4', '8', '', '', '', '', '', '', '', ''); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `qstn` +-- + +DROP TABLE IF EXISTS `qstn`; +CREATE TABLE IF NOT EXISTS `qstn` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `subject` varchar(100) DEFAULT NULL, + `time` time DEFAULT NULL, + `difficulty` enum('easy','medium','hard') DEFAULT NULL, + `content` varchar(200) DEFAULT NULL, + `correct_option` int(11) DEFAULT NULL, + `options` varchar(200) DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `qstn` +-- + +INSERT INTO `qstn` (`id`, `subject`, `time`, `difficulty`, `content`, `correct_option`, `options`) VALUES +(1, 'Maths', '00:03:00', 'medium', 'this this a question, ans is opt 1', 1, '1.a 2.b 3.c'), +(2, 'Maths', '00:03:00', 'medium', 'this is a  math qstn, answer is 2', 2, '1. opt1\r\n2. opt2\r\n3. opt3'), +(3, 'Maths', '00:03:00', 'medium', '2+2=?', 3, '1. 1\r\n2. 0\r\n3. 4'), +(4, 'Maths', '00:03:00', 'medium', '7+2=?', 1, '1. 9\r\n2. 4\r\n3. 4'), +(5, 'Physics', NULL, 'easy', 'Data/q1.txt', 1, '3'), +(6, 'Physics', NULL, 'medium', 'Data/q2.txt', 2, '4'), +(7, 'Physics', NULL, 'easy', 'Data/q3.txt', 1, '2'), +(8, 'Physics', NULL, 'medium', 'Data/q4.txt', 2, '6'); +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/qpapernew.html b/qpapernew.html new file mode 100644 index 0000000..6d45afe --- /dev/null +++ b/qpapernew.html @@ -0,0 +1,21 @@ + + + + + + Add New Qpaper + + + +
+ Please enter name of new question paper:

+

+ Please enter name of author:

+

+ +
+
+
+ //code to add question paper references + + diff --git a/qpapers.json b/qpapers.json new file mode 100644 index 0000000..a463d19 --- /dev/null +++ b/qpapers.json @@ -0,0 +1,16 @@ +[ +{"type":"header","version":"4.8.5","comment":"Export to JSON plugin for PHPMyAdmin"}, +{"type":"database","name":"qpapers"}, +{"type":"table","name":"exqp1","database":"qpapers","data": +[ +{"id":"1","qref":"5","response":"1"}, +{"id":"2","qref":"6","response":null}, +{"id":"3","qref":"8","response":null} +] +} +,{"type":"table","name":"reg_qpaper","database":"qpapers","data": +[ +{"id":"1","name":"exqp1","auth":"Amor"} +] +} +] diff --git a/qpapers.sql b/qpapers.sql new file mode 100644 index 0000000..80c897a --- /dev/null +++ b/qpapers.sql @@ -0,0 +1,84 @@ +-- phpMyAdmin SQL Dump +-- version 4.8.5 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1:3306 +-- Generation Time: Nov 09, 2019 at 06:21 AM +-- Server version: 5.7.26 +-- PHP Version: 7.2.18 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET AUTOCOMMIT = 0; +START TRANSACTION; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; + +-- +-- Database: `qpapers` +-- + +-- -------------------------------------------------------- + +-- +-- Table structure for table `exqp1` +-- + +DROP TABLE IF EXISTS `exqp1`; +CREATE TABLE IF NOT EXISTS `exqp1` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `qref` int(11) NOT NULL, + `response` int(11) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `question_ref` (`qref`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `exqp1` +-- + +INSERT INTO `exqp1` (`id`, `qref`, `response`) VALUES +(1, 5, 1), +(2, 6, NULL), +(3, 8, NULL); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `reg_qpaper` +-- + +DROP TABLE IF EXISTS `reg_qpaper`; +CREATE TABLE IF NOT EXISTS `reg_qpaper` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `name` varchar(100) DEFAULT NULL, + `auth` varchar(100) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1; + +-- +-- Dumping data for table `reg_qpaper` +-- + +INSERT INTO `reg_qpaper` (`id`, `name`, `auth`) VALUES +(1, 'exqp1', 'Amor'); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `exqp1` +-- +ALTER TABLE `exqp1` + ADD CONSTRAINT `question_ref` FOREIGN KEY (`qref`) REFERENCES `qbank`.`qstn` (`id`); +COMMIT; + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/saveQ.php b/saveQ.php new file mode 100644 index 0000000..6aa5b6b --- /dev/null +++ b/saveQ.php @@ -0,0 +1,8 @@ +$_SESSION['max_rows']) + $_SESSION['qno']=1; +header("location:exam.php"); +?> \ No newline at end of file diff --git a/starttest.php b/starttest.php new file mode 100644 index 0000000..4904c31 --- /dev/null +++ b/starttest.php @@ -0,0 +1,29 @@ + + + + + + + + <?php echo $_SESSION['testname'];?> + + + + +
+
+ This is a dummy test named +
+ + +
+
+ +
+ + + diff --git a/submit.php b/submit.php new file mode 100644 index 0000000..3a0190a --- /dev/null +++ b/submit.php @@ -0,0 +1,48 @@ + + + + + + + <?php echo $_SESSION['testname'];?> + + + + +
+
+
+
    +
  • Total no of questions=
  • +
  • Correct answers=
  • +
+
+ +
+ +
+ + + diff --git a/submitqref.php b/submitqref.php new file mode 100644 index 0000000..fd14911 --- /dev/null +++ b/submitqref.php @@ -0,0 +1,19 @@ + +