Quiz Report
Quiz Report
Thank You
Candidate's Declaration
I hereby declare that the project work, which is being
presented in the Project Report, entitled,QUIZ publican partial
fulfillment for the award of Degree of " Bachelor of Computer
Application" in Deptt. of Information Technology, JECRC
University is a record of my own investigations carried under
the guidance of Miss Shefali Sharma. I have not submitted the
matter presented in this Project Report anywhere for the award
of any other Degree.
IT & CA
Constraints:
Problem analysis
Creating a quiz game involves analyzing various aspects:
Feasibility
Existing system
Technology used
Creating a quiz website involves a multi-layered tech stack for
both frontend and backend development. Here's a
comprehensive breakdown:
Frontend Technologies:
Backend Technologies:
Cloud Services: AWS, Azure, Google Cloud, etc., for hosting and
deploying the application.
Security Measures:
*4. Database:*
- *Database Management System (DBMS):* Choose a suitable
DBMS (MySQL, PostgreSQL, MongoDB) based on data
requirements.
- *Schema Design:* Design a database schema to store
information about users, quizzes, questions, and results.
*8. Security:*
- *HTTPS:* Ensure secure data transmission between the
client and server.
- *Input Validation:* Implement input validation and
sanitization to prevent common security vulnerabilities.
*9. Testing:*
- *Unit Testing:* Test individual components and functions.
- *Integration Testing:* Ensure proper interaction between
frontend and backend.
- *Load Testing:* Assess system performance under various
loads.
*10. Deployment:*
- *Cloud Hosting:* Deploy the application on cloud platforms
like AWS, Azure, or Google Cloud.
- *Containerization (Optional):* Consider containerizing the
application using Docker for easier deployment and scaling.
E-R diagram
Certainly! Here's a simplified Entity-Relationship (E-R) diagram
for a quiz website:
Database design
*Tables:*
1. *Users Table:*
- UserID (Primary Key)
- Username
- Email
- Password (Hashed)
- Other User Details
2. *Quizzes Table:*
- QuizID (Primary Key)
- UserID (Foreign Key referencing Users.UserID)
- QuizName
- Description
- Other Quiz Details
3. *Questions Table:*
- QuestionID (Primary Key)
- QuizID (Foreign Key referencing Quizzes.QuizID)
- QuestionText
- Other Question Details
4. *Answers Table:*
- AnswerID (Primary Key)
- QuestionID (Foreign Key referencing Questions.QuestionID)
- AnswerText
- IsCorrect (Boolean)
5. *UserQuizAttempts Table:*
- AttemptID (Primary Key)
- UserID (Foreign Key referencing Users.UserID)
- QuizID (Foreign Key referencing Quizzes.QuizID)
- Score
- AttemptDate
- Other Attempt Details
*Relationships:*
- *One-to-Many (1:N) Relationship between Users and
Quizzes:*
- One user can create multiple quizzes, but each quiz is
associated with only one user.
Testing
Testing a quiz website involves various types of testing to
ensure its functionality, performance, and security. Here are
the key types of testing for a quiz website:
1. *Unit Testing:*
- *Purpose:* Test individual units or components (functions,
methods) of the code.
- *Examples:* Test functions that calculate scores, validate
user inputs, or handle authentication.
2. *Integration Testing:*
- *Purpose:* Verify interactions between different
components/modules.
- *Examples:* Test how frontend components interact with
backend APIs, validate data flow between different layers.
4. *Functionality Testing:*
- *Purpose:* Verify if all features and functionalities work as
expected.
- *Examples:* Test quiz creation, question addition, answer
submission, result calculation, and display.
5. *Performance Testing:*
- *Purpose:* Evaluate the website's performance under
different conditions.
- *Examples:* Load testing (simulate multiple users taking
quizzes simultaneously), assess response times, and server
resource usage.
6. *Security Testing:*
- *Purpose:* Identify and mitigate potential security
vulnerabilities.
- *Examples:* Test for SQL injection, XSS (Cross-Site Scripting),
input validation, secure data transmission (HTTPS).
7. *Compatibility Testing:*
- *Purpose:* Ensure the website works across different
browsers and devices.
- *Examples:* Test on various browsers (Chrome, Firefox,
Safari, Edge) and different devices (desktop, mobile, tablet).
8. *User Acceptance Testing (UAT):*
- *Purpose:* Have actual users test the website to verify if it
meets their needs and expectations.
- *Examples:* Engage target users to navigate the website,
take quizzes, and provide feedback.
9. *Accessibility Testing:*
- *Purpose:* Ensure the website is accessible to users with
disabilities.
- *Examples:* Test screen reader compatibility, keyboard
navigation, and color contrast.
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-
scale=1.0">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/lib
s/font-awesome/6.4.0/css/all.min.css"
integrity="sha512-iecdLmaskl7CVkqkXNQ/ZH/XL
lvWZOJyj7Yy7tcenmpD1ypASozpmT/
E0iPtmFIB46ZmdtAc9eNBvH0H/ZpiBw=="
crossorigin="anonymous" referrerpolicy="no-
referrer" />
<title>Question & Answers</title>
<link rel="stylesheet"
href="../Question&Answer/index.css">
</head>
<body>
<div id="container">
<button id="btn1">START
QUIZ</button>
<div id="box" class="display-hide">
<div class="questions">
<div
class="question"></div>
<div id="timer"></div>
<div class="option">
<div>
<button class="btn"
type="submit"></button>
<button class="btn"
type="submit"></button>
</div>
<div>
<button class="btn"
type="submit"></button>
<button class="btn"
type="submit"></button>
</div>
</div>
</div>
<h1 class="display-
hide">Loading Answer
<i class="fa-solid fa-
circle display-hide"></i>
<i class="fa-solid fa-
circle display-hide"></i>
<i class="fa-solid fa-
circle display-hide"></i>
<i class="fa-solid fa-
circle display-hide"></i>
</h1>
<h2 class="display-hide"></h2>
</div>
</div>
<script src="index.js"></script>
</body>
</html>
CSS:-
*{
padding: 0%;
margin: 0%;
box-sizing: border-box;
}
body{
background-image: linear-gradient(to
right,rgb(192, 133, 243),rgb(165, 255,
255));
}
#container{
text-align: center;
margin-top:20%;
}
#btn1{
border: 2px solid black;
background-color: white;
padding: 10px 15px;
border-radius: 10px;
font-weight: bolder;
font-size:1.2rem;
}
#btn1:hover{
background-color: black;
color: white;
cursor: pointer;
}
#btn1:active{
border: 4px solid white;
}
/* Questions CSS */
.questions{
border: 2px solid black;
font-size: 1.3rem;
font-weight: bolder;
position: relative;
background-color: white;
padding: 10px 0 20px 0;
width: 70%;
margin: 0 auto;
border-radius: 10px;
}
.question{
padding: 5px 0;
}
#timer{
position: absolute;
border: 2px solid black;
padding-top: 6px;
border-radius: 50%;
right: 30px;
top: 10px;
height: 40px;
width: 40px;
}
.btn{
width: 400px;
height: 30px;
background-color: rgb(48, 250, 146);
margin: 5px 10px;
border-radius: 10px;
border: 0;
font-weight: bolder;
transition: 0.1s all;
}
.btn-temp{
width: 400px;
height: 30px;
background-color: rgb(48, 250, 146);
margin: 5px 10px;
border-radius: 10px;
border: 0;
font-weight: bolder;
transition: 0.1s all;
}
.btn-temp{
cursor: not-allowed;
}
.btn:hover{
cursor: pointer;
background-color: black;
color: white;
}
.btn:active{
background-color: white;
color: black;
border: 3px solid black;
}
.btn-click{
background-color: rgb(0, 87, 0);
}
h1{
font-size: 2rem;
margin-top: 40px;
}
h1 i{
font-size: 0.6rem;
}
.display-hide{
display: none;
}
h2{
margin: 40px auto 0 auto;
width: 20%;
font-size: 2rem;
background-color: rgba(37, 190, 180,
0.326);
padding: 10px;
border: 2px solid;
border-image: linear-gradient(to right,
rgb(255, 255, 255), rgb(81, 81, 81)) 1;
}
JAVASCRIPT:-
let questions = [
{
question: "2+2",
answer: 4,
options: [2, 4, 6, 8]
},
{
question: "2+2+2",
answer: 6,
options: [1, 4, 6, 7]
},
{
question: "2+2+2+2",
answer: 8,
options: [2, 5, 6, 8]
},
{
question: "2+2+2+2+2",
answer: 10,
options: [10, 4, 6, 8]
},
];
let que =
document.querySelector(".question");
let btn =
document.querySelectorAll(".btn");
let tik =
document.querySelector("#timer");
let x = 0, y = 5, z = 0, i, j = 0;
tik.innerHTML=y;
let ans = [];
let clock = setInterval(() => {
if (y == 0) {
y = 5;
z++;
if (z == 4) {
clearInterval(clock);
}
}
tik.innerHTML = y;
y--;
}, 950);
function showQuestion(index) {
StoreUserAnswers();
que.innerHTML =
questions[index].question;
btn.forEach((btn, i) => {
btn.innerHTML =
questions[index].options[i];
btn.value =
questions[index].options[i];
});
}
showQuestion(x);
value.setAttribute("disabled", "");
value.classList.remove("btn");
value.classList.add("btn-
temp");
})
CheckUserAnswer();
}
else {
NormalBtn();
StoreUserAnswers();
x++;
que.innerHTML =
questions[x].question;
btn.forEach((l, index) => {
l.innerHTML =
questions[x].options[index];
l.value =
questions[x].options[index];
})
}
}, 5000)
function ChangeBtn(i) {
btn.forEach((bt) => {
bt.setAttribute("disabled",
"");
bt.classList.remove("btn");
bt.classList.add("btn-temp");
})
btn[i].classList.add("btn-click")
}
function NormalBtn() {
btn.forEach((bt1) => {
bt1.removeAttribute("disabled",
"");
bt1.classList.remove("btn-
temp");
bt1.classList.add("btn");
bt1.classList.remove("btn-
click");
})
}
function StoreUserAnswers() {
for (let i = 0; i < 4; i++) {
btn[i].onclick = (event) => {
ChangeBtn(i);
ans.push(event.target.value); // Capture
the value of the selected button and push
it to the array
console.log(ans);
btn.forEach((btn) => {
btn.onclick = null; //
Remove the event listener to prevent
multiple answers from being stored
});
};
}
}
function CheckUserAnswer() {
let score = 0;
ans.forEach((answer, index) => {
if (Number(answer) ==
questions[index].answer) {
score++;
}
});
let heading1 =
document.querySelector("h1");
let fontIcons =
document.querySelectorAll(".fa-solid.fa-
circle");
heading1.classList.remove("display-
hide");
let toggleCount = 4;
let k = 0;
j = 0;
let load = setInterval(() => {
if (j == 4) {
j = 0;
k++;
if (k === toggleCount) {
heading1.classList.add("display-hide");
fontIcons[0].classList.toggle("display-
hide");
clearInterval(load);
RevelAnswer(score);
}
}
fontIcons[j].classList.toggle("display-
hide");
j++;
}, 500);
}
function RevelAnswer(score) {
let revel =
document.querySelector("h2");
revel.classList.remove("display-
hide");
revel.innerHTML = "Correct Guesses
Are " + score + " Out Of 4 Questions";
}
}
Conclusion
In conclusion, the development and testing of a quiz website
involve a multifaceted approach, encompassing various
technologies, design considerations, and testing
methodologies. Here are key takeaways:
1. *Technology Stack:*
- Leveraging frontend technologies (HTML, CSS, JavaScript)
and frameworks (React, Angular, Vue.js) enhances user
interface interactivity and responsiveness.
- Backend technologies (Node.js, Python, PHP) with
frameworks (Express.js, Django, Laravel) manage server-side
operations, data storage, and business logic.
- Databases (MySQL, PostgreSQL, MongoDB) store user
information, quiz data, questions, and results.
2. *System Design:*
- A well-structured system design is crucial, encompassing
user authentication, quiz creation, question management, real-
time updates (if required), and result display.
3. *Database Design:*
- A relational database design, with tables for users, quizzes,
questions, answers, and user attempts, ensures efficient data
storage and retrieval.
4. *Testing:*
- Thorough testing, including unit testing, integration testing,
UI testing, functionality testing, performance testing, security
testing, compatibility testing, user acceptance testing, and
regression testing, is essential to ensure the website's reliability
and user satisfaction.
5. *Security Measures:*
- Implementing HTTPS, input validation, and secure
authentication are critical for protecting user data and ensuring
a secure user experience.
7. *User Experience:*
- A user-friendly interface, intuitive navigation, and
accessibility features contribute to a positive user experience.
8. *Continuous Improvement:*
- Regular updates, feature enhancements, and bug fixes based
on user feedback and evolving requirements contribute to the
long-term success of the quiz website.
Bibliography