0% found this document useful (0 votes)
64 views

Cs Write Up

This document describes a Python-based project for automating the JNVST exam process. The project uses functions like home(), admin_login(), student(), exam(), check_results(), add_question(), and remove_student(). It allows administrators to add and remove questions, check results, and remove students. Students can take timed exams and receive results. The project aims to evaluate candidates more efficiently by automating the exam and results process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views

Cs Write Up

This document describes a Python-based project for automating the JNVST exam process. The project uses functions like home(), admin_login(), student(), exam(), check_results(), add_question(), and remove_student(). It allows administrators to add and remove questions, check results, and remove students. Students can take timed exams and receive results. The project aims to evaluate candidates more efficiently by automating the exam and results process.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

COMPUTER SCIENCE INVESTIGATORY

PROJECT ON
JNVST EXAM

name : R SHANMUKHAVARDHAN

roll no : 20611454 (25)

2022-2023
ACKNOWLEDGEMENT:-

I wish to express my deep gratitude and sincere thanks to


the Principal, M SREENIVASA RAO Sir, for his
encouragement and for all the facilities that he provided
for this project wok. I sincerely appreciate this
magnanimity by taking me into his fold for which I shall
remain indebted to him. I extend my hearty thanks to
M SRIRAJ sir, computer science teacher who guided me
to the successful completion of this project. I take this
opportunity to express my deep sense of gratitude for his
valuable guidance, constant, encouragement, immense,
motivation, which has sustained my efforts at all the
stages of this project work.

I cannot forget to offer my sincere thanks to


my classmates who helped me to carry out this project
work successfully and for their valuable advice and
support, which I received from them time to time……….
CERTIFICATE:-

This is to certify that R SHANMUKHAVARDHAN


of class XII has successfully completed the
project work titled JNVST EXAM under the
guidance of M SRIRAJ, PGT(COMPUTER SCIENCE)
DURING THE ACADEMIC YEAR 2022-2023.

Sign of External Examiner Sign of Internal Examiner

Signature of Principal
Purpose :-
The purpose of JNVST EXAM is to take test in an efficient manner and
no time wasting for checking the paper. The main objective of this project is to
efficiently evaluate the candidate thoroughly through a fully automated system
that not only saves lot of time but also gives fast results. For students they give
papers according to their convenience and time and there is no need of using
extra thing like paper, pen etc.

Introduction:
This JNVSTST exam project has been written in Python Programing language.
The project file contains a python script. This is a console based system which
is very easy to understand and use. Talking about the project, it contains the
following functions:

1. home()
2. admin_login()
3. student()
4. result()
5. remove_student()
6. exam()
7. check_results()
8. add_question()
9. remove_student()

Modules used:
1. import mysql.connector as ms
2. import os
3. from clrprint import *
4. import random
5. from tabulate import tabulate
6. import time as tt
Python Source code:
Home function:
def home():
while True:
while True:
ch=input('\n1.Admin Login\n2.Student\n3. Exit')
if ch.isdigit():
break
else:
print('Enter a valid choice')
ch=int(ch)
if ch==1:
admin_login()
elif ch==2:
student()
elif ch==3:
mycursor.close()
exit()
else:
clrprint('\nEnter valid choice\n',clr='r')

Admin function:
def admin_login():
while True:
password=input('\nEnter password')
if password=='@jnv':
while True:
while True:
ch=input('\n1. ADD QUESTION\n2. REMOVE QUESTION\n3. REMOVE A
STUDENT\n4. CHECK RESULTS\n5. LOG OUT')
if ch.isdigit():
break
else:
print('enter a valid choice')
ch=int(ch)
if ch==2:
remove_question()
elif ch==1:
add_question()
elif ch==4:
check_results()
elif ch==5:
break
elif ch==3:
remove_student()
else:
clrprint('\n Enter a valid choice\n',clr='r')
else:
clrprint('Entered password is incorrect\n Better Luck Next Time',clr='r')
break

Student function:
def student():
global htn
htn=input('ENTER HALL TICKET NUMBER')
while True:
ch=input('DO YOU WANT TO START EXAM (Y/N)')
if ch.upper()=='Y' or ch.upper()=='YES':
exam()
sc=result(htn)
break
elif ch.upper()=='N' or ch.upper()=='NO':
break
else:
clrprint('\nEnter a valid choice',clr='r')

Result function:
def result(htn):
sc=(score/c)*100
mycursor.execute('insert into results values("{h}",{s});'.format(h=htn,s=sc))
mydb.commit()
clrprint('\n ..............................Your test has been
completed.................................',clr='g')

Remove student function():


def remove_student():
st='select hall_ticket_no from results'
mycursor.execute(st)
data=mycursor.fetchall()
lst=[]
for i in data:
lst.append(i[0])
while True:
no=input('enter hall ticket no to remove')
if no in lst:
st='delete from results where hall_ticket_no="{n}"'.format(n=no)
mycursor.execute(st)
mydb.commit()
print("Student removed succesfully")
break
else:
ch=input('1. Try Again\n2.exit')
if ch=='2':
break

Exam function:
def exam():
def check_answer(answer):
global score
if answer == correct_answer:
score += 1
global correct_answer
global c
papers=['maths_paper','mental_ability_paper','maths_paper']
clrprint('\n........................................................................WELCOME TO JNVST
EXAM.........................................................................',clr='g')
while True:
while True:
choice=input('\nFirst you wanna Start with\n1. Maths \n2. Mental Ability')
if choice.isdigit():
break
else:
clrprint('\nEnter a valid choice',clr='r')
if choice=='1' or choice=='2':
break
else:
clrprint('\nEnter a valid choice',clr='r')
choice=int(choice)
for i in range(2):
clrprint('\n',papers[choice-1].upper(),'Paper',clr='b')
mycursor.execute('select * from {p};'.format(p=papers[choice-1]))
questions = mycursor.fetchall()
q = []
for i in questions:
q.append(i[0])
m=max(q)
question=()
for i in range(len(questions)):
while True:
r=random.randint(0,m)
if r in q:
break
for i in questions:
if i[0]==r:
question=i
break
print('\n \n QUESTION ',c+1)
print(question[1],'\nA) ',question[2],'\nB) ', question[3],'\nC) ',
question[4],'\nD)',question[5])
correct_answer=question[6]
while True:
answer=input('ENTER YOUR OPTION\n')
if answer.upper() in ['A','B','C','D']:
break
else:
clrprint('Enter a valid Option',clr='r')
c+=1
q.remove(r)
check_answer(answer.upper())
questions.remove(i)
while True:
if len(questions)>0:
ci=input('1. Continue to next Question\n2. End Test')
if ci=='2':
sc=result(htn)
home()
elif ci=='1':
break
else:
clrprint('\nEnter a valid choice',clr='r')
else:
break
print(papers[choice-1],'paper complted\n ')
tt.sleep(5)
choice+=1
Check_results function:
def check_results():
mycursor.execute('select * from results')
data=mycursor.fetchall()
result=tabulate(data,headers=['Hall-Ticket-Number','Marks'])
print(result)

add_question function:
def add_question():
papers = ['maths_paper', 'mental_ability_paper', 'maths_paper']
while True:
choice = input('\nAdd question to which paper\n1. Maths \n2. Mental Ability')
if choice.isdigit():
if choice == '1' or choice == '2':
choice = int(choice)
break
else:
clrprint('\nEnter a valid choice', clr='r')
else:
clrprint('\nEnter a valid choice',clr='r')
while True:
n=input("Enter number of question you want to enter")
if n.isdigit()==True:
n=int(n)
break
else:
print('enter a valid choice')
for i in range(n):
question=input('Enter Question')
opa=input('enter option A')
opb = input('enter option B')
opc = input('enter option C')
opd = input('enter option D')
answer=input('Enter Answer')
st='insert into {p}(question,A,B,C,D,answer)
values("{q}","{a}","{b}","{c}","{d}","{ans}")'
st=st.format(p=papers[choice-
1],q=question,a=opa,b=opb,c=opc,d=opd,ans=answer.upper())
mycursor.execute(st)
mydb.commit()
print('\n .......Question added succesfully........')
remove_question function:
def remove_student():
st='select hall_ticket_no from results'
mycursor.execute(st)
data=mycursor.fetchall()
lst=[]
for i in data:
lst.append(i[0])
while True:
no=input('enter hall ticket no to remove')
if no in lst:
st='delete from results where hall_ticket_no="{n}"'.format(n=no)
mycursor.execute(st)
mydb.commit()
print("Student removed succesfully")
break
else:
ch=input('1. Try Again\n2.exit')
if ch=='2':
break
Outputs:
Student taking exam:
Admin login:

Admin adding new question:


Removing a question:

Admin checking results:

Removing student:
Conclusion:
The JNVST EXAM is developed using python and sql fully meets the objectives of the system
for which it has been developed. The system has reached a steady state where all bugs have
been eliminated. The system is operated at a high level of efficiency and all the teachers and
user associated with the system understands its advantage. The system solves the problem.

Bibliography:
1. www.python.org
2. www.geeksforgeeks.org
3. www.github.com
4. https://docs.python.org

You might also like