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

Major Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Major Project

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 114

DYNAMIC QUESTION GENERATION BASED ON

USER PERFORMANCE IN ADAPTIVE EXAMS

A PROJECT REPORT

Submitted by

AKHASH ARAVIND P (953620104003)

IJAAS AHAMED M (953620104016)

KARTHIKEYAN B (953620104023)

VINO A (953620104059)

In partial fulfillment for the award of the degree

of

BACHELOR OF ENGINEERING

in

COMPUTER SCIENCE AND ENGINEERING

RAMCO INSTITUTE OF TECHNOLOGY, RAJAPALAYAM

ANNA UNIVERSITY: CHENNAI 600 025

MAY 2024

i
ANNA UNIVERSITY: CHENNAI 600 025

BONAFIDE CERTIFICATE

Certified that this project report titled “DYNAMIC QUESTION GENERATION


BASED ON USER PERFORMANCE IN ADAPTIVE EXAMS” is the
bonafide work of "AKHASH ARAVIND P (953620104003), IJAAS AHAMED M
(953620104016), KARTHIKEYAN B (953620104028) and VINO A
(953620104056)" who carried out the project work under my supervision.

SIGNATURE SIGNATURE

Dr.K. Vijayalakshmi M.E., Mrs.K. Jeyakarthika

Ph.D., HEAD OF THE M.Tech., Faculty In-charge

DEPARTMENT
Assistant Professor
Department of Computer
Professor & Head, Department of Science and Engineering
Computer Science and Engineering Ramco Institute of
Ramco Institute of Technology Technology North
North Venganallur Village
Venganallur Village
Rajapalayam – 626117
Rajapalayam– 626117

Submitted for Anna University Project Viva-Voce Examination held at Ramco


Institute of Technology, Rajapalayam on _

ii
INTERNAL EXAMINER EXTERNAL EXAMINER

ii
ACKNOWLEDGEMENT

I am highly indebted to our beloved Chairman Shri.P.R.VENKETRAMA


RAJA for providing excellent facilities and encouragement to enhance our skills
with world-class education by pursuing online courses which helped me greatly to
carry out the project work successfully.
I sincerely thank our Principal Dr.L.GANESAN, for his continuous support
and advice. I would like to express my sincere gratitude to
Dr.K.VIJAYALAKSHMI, Professor and Head, Department of Computer Science
and Engineering for her support and encouragement for the completion of this
project work.
I am grateful to my project guide Mrs. K. JEYAKARTHIKA Assistant
Professor, Department of Computer Science and Engineering for his insightful
comments and valuable suggestions which helped me to complete this project work
successfully.
I like to thank my project coordinators, Dr.R.VENKATESH Associate
Professor, Mr.C.A.YOGARAJA Assistant Professor (Senior Grade) and
Ms.G.SAKTHI PRIYA Assistant Professor, Department of Computer Science
and Engineering for their support and suggestions. Our sincere thanks go to
revered faculty members and Technical Staff members for their help during this
project work.
Last but not least, I extend my indebtedness towards my beloved parents for
their support which made this project a successful one.

AKHASH ARAVIND P (953620104003),


IJAAS AHAMED M (953620104016),
KARTHIKEYAN B (953620104023),
VINO A (953620104059)

iv
ABSTRACT

The aim of the project is to develop a Dynamic Question Generation (DQG)


system by evaluating user performance that customizes the questions that are
provided to examinees in terms of both difficulty and topic. This system utilizes
advanced algorithms to adjust to each user's competence level in real-time, with the
goal of maximizing assessment accuracy and engagement. The system works by
uploading a pdf, generates a summary by analyzing the text completely. The
process works by Natural Language Processing (NLP) techniques that involves
condensing a larger piece of text into a shorter, more coherent version while
retaining the key information and meaning. Then a machine learning model is
implemented to generate distractors which generates MCQs as resultant output.
Furthermore, the system enables the generation of questions across a wide range of
topics and domains, ensuring comprehensive coverage of learning objectives and
facilitating formative and summative assessments in diverse subject area.

v
TABLE OF CONTENTS

CHAPTE TITTL PAG


R NO E E
NO
ABSTRACT iv
v
LIST OF FIGURES
i
LIST OF ABBREVIATIONS i
i
i
x
01 INTRODUCTION 1

1.1 Objective of the Work 1

1.2 Scope of the Project 3

1.3 Dynamic Question Generation 4

1.3.1 Application of Dynamic Question 5

Generation
1.4 Machine Learning 5

1.4.1 Supervised Learning 6

1.4.2 Unsupervised Learning 6

1.4.3 Reinforcement Learning 6

1.5 Organization of the Project 6

02 LITRATURE SURVEY 8

2.1 Generation of Multiple Choice Questions 8

from Textbook Contents of School Level


9
Subjects

2.2 Automatic Multiple Choice


Question Generation from Text 10
2.3 Diverse Distractor Generation for Constructing

vi
High-Quality Multiple Choice Questions

vi
2.4 Learning to Reuse Distractors to 11
Support Multiple-Choice Question
Generation in Education
2.5 Question Generation in Education 12
2.6 Multi-Hop Reasoning Question Generation
14
and Its application

03 BACKGROUND 16
3.1 Technology Used 16
3.1.1 PyPdf2 16
3.1.2 Spacy 16
3.1.2.1 Similarity 17
3.1.3 Natural Language Processing 17
3.1.4 Torch 17
3.1.5 T5 Transformers 18
3.1.6 Gensim 18
3.1.6.1 GloVe 18
3.1.7 Textstat 19
3.1.7.1 Automatic Readability Index 19
04 PROPOSED WORD 20

4.1 Proposed Work 20

4.1.1 Work Flow 20

4.1.1.1 Input Document 20

4.1.1.2 Text Extraction 21

4.1.1.3 Syntactic Analyze 22

4.1.1.4 Statistical Analyze 22

4.1.1.5 Summarization 23

4.1.1.6 Key Generation 23

4.1.1.7 Question Generation 23

4.1.1.8 Distractor Generation 24

vi
ix
4.1.1.9 Difficulty Level for Question 25
4.1.1.10 Difficulty Level for Distractor 25
4.1.2 Work Flow of Web Application 26
4.1.2.1 Faculty 26
4.1.2.1.1 Faculty Register 27
4.1.2.1.2 Faculty Login 27
4.1.2.1.3 Test Posting 27
4.1.2.1.4 Faculty Dashboard 28
4.1.2.2 Student 28
4.1.2.2.1 Student Registration 28
4.1.2.2.2 Student Login 28
4.1.2.2.3 Assessment Login 29
4.1.2.2.4 Assessment 29
4.1.2.2.5 Student Dashboard 30
05 RESULT AND DISCUSSION 31

5.1 Question Generation 31

5.2 Initial Posting and PDF Documentation 32


33
5.3 Test Attendance phase
35
5.4 Visualization of the results in dashboard
06 CONCLUSION AND FUTURE SCOPE 39
6.1 Conclusion 39
6.2 Future Scope 40

07 PUBLICAATION DETAILS 41

APPENDIX I -SOFTWARE SPECIFICATIONS 45

APPENDIX II -CODING 46
REFERENCES 71

x
LIST OF FIGURES

FIGURE TIT PAGE


NO LE NO
4.1 Workflow for MCQ Generation 21

4.2 Workflow for Web Application 26

5.1 T5 model for Question Generation 31

5.2 Final Set of Question 32

5.3 Test Creation 33


5.4 Starting Test 34
5.5 MCQ 35
5.6 Student Dashboard 36
5.7 Faculty Dashboard 37
5.8 Student Result 37

xi
LIST OF ABBREVIATIONS

ABBREVIATIO EXPANSION
NS

DQG DYNAMIC QUESTION GENERATION

PDF PORTABLE DOCUMENT FILE

MCQ MULTIPLE CHOICE QUESTION

NLP NATURAL LANGUAGE


PROCESSING
ML MACHINE LEARNING

POS PARTS OF SPEECH

LSTM LONG SHORT-TERM MEMORY

NER NAMED ENTITY RECOGNITION

DG DISTRACTOR GENERATION

SLR SEMANTIC ROLE LABELING


GLOBAL VECTOR FOR
GLOVE
WORD REPRESENTATION

i
CHAPTER 1
INTRODUCTION
In the era of the computerized world, the demand for customized learning
experiences is more crucial in the current educational environment. Adaptive tests,
which modify their level of difficulty according to the user's performance, provide
a promising approach to meet the unique learning requirements of individuals.
Dynamic Question Generation (DQG) is a crucial aspect of adaptive tests, since it
involves creating questions that are specifically designed to align with the student's
degree of skill and progress in learning.
As a greater number of students exist in a school or in an organization, it is
subsequently difficult for the teachers to evaluate and track students’ academic
performance via offline examinations. Hence the need for developing applications
for assessing students' performance has risen substantially. Because of the need to
bring education into the digital age, internet tests have become more important in
recent years. Online tests make it possible for students to take them from anywhere
with internet access, removing geographical obstacles and making learning more
open to everyone. In terms of scheduling, this flexibility means that students can
pick test times that work best for them, reducing scheduling conflicts and making
things easier. They are also clearly more cost-effective than traditional ones
because they don't require actual testing centers, printed materials, or manual
grading. With the help of technology, these tests make grading easier, giving
students feedback right away and giving teachers more time to focus on teaching.
Even though there are worries about security, improvements in technology have
made online exams more trustworthy, making sure that tests stay valid and
dependable. Multiple Choice Questions (MCQs) are a great example of how
assessment methods have changed over the years in modern education. They can
be changed to fit different question types and large groups of students, meeting the
needs of both students and schools.

1
1.1 OBJECTIVE OF THE WORK
The objective in designing the Dynamic Question Generation based on user
performance in Adaptive Exams involves fundamental objectives aimed at
ensuring accuracy, reliability, user-friendliness, and affordability. The main
objective of the Dynamic Question Generation is providing customized learning
experience to test takers. It will provide personalized experience to attend the test
for test takers or users. The dynamic question generation will provide personalized
growth that will support the academic growth.
The overall objective of the Dynamic question generation system is to create a
personalized and adaptive assessment experience for learners. By dynamically
generating questions based on various factors such as the learner's performance,
preferences, and learning objectives, this system aims to enhance engagement,
promote deeper understanding, and optimize learning outcomes. Key objectives
include Personalization that involves tailoring questions to each learner's
proficiency level, learning style, and prior knowledge fosters a more relevant and
engaging learning experience, leading to improved comprehension and retention. It
ensures adaptability in which the system dynamically adjusts the difficulty and
complexity of questions in response to the learner's progress, ensuring that
assessments remain challenging yet achievable, thereby maximizing learning
effectiveness. To ensure efficiency by automating the question generation process,
the system saves educators time and resources, allowing them to focus on more
strategic aspects of teaching and learning and providing timely and constructive
feedback based on the learner's responses helps identify areas of strength and
weakness, guiding further study and facilitating continuous improvement for the
students. and to enhance the overall diversity in generating questions across a
range of formats (e.g., topics related to science, social science) that promotes a
comprehensive understanding of the subject matter and encourages critical
thinking and problem-solving skills.

2
The major objectives of the proposed system are,
❖ To provide customized testing approach to user or test takers
❖ To develop an adaptive exam system that dynamically generates questions based
on individual student performance to provide personalized learning experiences.
❖ To set the difficulty level of questions which are dynamically adjusted based on
the user's performance.

1.2 SCOPE OF THE PROJECT


The project scope is extending to design customized testing approach to users.
Unlike the traditional testing system, it will lead to develop dynamic testing
approach to the test takers. The project's scope extends to analyze students'
performance. The need for Dynamic question arises from the critical importance of
evaluating students' individual performance. The ability to generate questions
based on how well a user does includes many different ways to customize and
change an assessment. Basically, this scope is about using data about how well
users are doing to make questions that are perfectly suited to each learner's wants,
skills, and progress. The system can change the difficulty, format, and content of
questions in real time by looking at things like past test scores, answer patterns,
and learning paths. This flexible method makes sure that tests stay challenging
enough to keep students thinking and help them have valuable learning
experiences. It also includes giving people targeted feedback and help based on
their performance, showing them where they need to improve and building on their
strengths. In addition to personalized learning paths, the scope includes flexibility,
which lets the system work with a wide range of users and educational settings.
The ultimate goal of dynamic question generation based on user performance is to
improve the reliability of assessments, improve learning results, and create a
supportive and welcoming learning space that is tailored to each student's specific
needs and skills. Developing a user-friendly interface for the mobile application is
essential, allowing users to take up assessments, and assigning questions at

3
different levels based on their answering

4
capacity. The interface should be intuitive and accessible to teachers as well as
students of varying technical backgrounds.
Furthermore, the project encompasses the development of interfaces and
platforms to deliver these dynamically generated questions seamlessly to learners,
educators, and assessment systems. These interfaces should be adaptive and
scalable to accommodate various educational settings, including traditional test
practices, online assessments, and personalized learning environments.

1.2DYNAMIC QUESTION GENERATION


The Dynamic Question Generation project encompasses various aspects aimed
at enhancing efficiency and user experience while taking up assessments. At its
core, the project involves developing an adaptive system for MCQ’s where the
difficulty level of questions is dynamically adjusted based on each student's
individual performance that integrates various aspects for estimating students'
performance. It will dynamically adjust the question content based on user
performance. Additionally, the project focuses on developing dynamic question
generation by using sophisticated algorithms and NLP techniques for adjusting the
difficulty level of questions. Moreover, dynamic question generation facilitates
personalized learning experiences by customizing questions based on learners'
strengths, weaknesses, and learning styles, thereby enhancing engagement and
knowledge retention.
User-friendliness is also an essential consideration in the project, with the
development of an intuitive web application interface for the students to take up
assessments as well as the examiner allowing them to set and monitor assessments
and evaluate the students’ performance based on the assessment criteria assigned,
in the adaptive exam system. There are several phases implemented in the system.
These phases involve extracting the text from the input PDF and from the text it
generates question, answer, distractor and difficulty level for both question and
answer.

5
Furthermore, the scalability of the system ensures that it can accommodate
varying needs and preferences. Users have the flexibility to access the contents
displayed in the adaptive testing system.

1.2.1 APPLICATIONS OF DYNAMIC QUESTION GENERATION


The dynamic question generation application is used to provide efficient testing
approach to users. This application is used to continuously assess students’
progress and provide timely feedback to the students. This application can be
utilized in college entrance exams and placement exams to accurately assess
applications knowledge and skill. A dynamic question generation application
represents an innovative solution tailored to modern educational needs, facilitating
the creation and dissemination of customized assessments. This application
streamlines the process of generating questions tailored to specific learning
objectives, student proficiency levels, and curriculum requirements. Moreover, the
application incorporates intelligent assessment features, such as automatic
difficulty level adjustment and personalized question sequencing, to optimize the
learning experience for individual students.
Furthermore, the dynamic question generation application fosters a
collaborative learning environment by facilitating seamless communication
between educators and students. Through interactive feedback mechanisms and
adaptive learning pathways, students receive targeted guidance and support to
enhance their understanding and mastery of key concepts. Additionally, the
application promotes engagement and motivation through gamified elements, real-
time progress tracking, and interactive learning resources.

1.3 MACHINE LEARNING


Machine learning is a branch of artificial intelligence focused on creating
algorithms that learn from data. These algorithms enable computers to make
predictions or decisions without being explicitly programmed.ML is one of the
most exciting technologies that one would have ever come across. it gives the

6
computer

7
that makes it more similar to humans. The ability to learn. There are three main
types of machine learning: supervised learning, unsupervised learning, and
reinforcement learning.

1.3.1 SUPERVISED LEARNING


In supervised learning, sample labeled data are provided to the machine
learning system for training, and the system then predicts the output based on the
training data. The system uses labeled data to build a model that understands the
datasets and learns about each one. After the training and processing are done, we
test the model with sample data to see if it can accurately predict the output.

1.3.2 UNSUPERVISED LEARNING


Unsupervised learning is a learning method in which a machine learns without
any supervision. The training is provided to the machine with the set of data that
has not been labeled, classified, or categorized, and the algorithm needs to act on
that data without any supervision. The goal of unsupervised learning is to
restructure the input data into new features or a group of objects with similar
patterns.

1.3.3 REINFORCEMENT LEARNING


Reinforcement learning is a feedback-based learning method, in which a
learning agent gets a reward for each right action and gets a penalty for each wrong
action. The agent learns automatically with these feedbacks and improves its
performance. In reinforcement learning, the agent interacts with the environment
and explores it. The goal of an agent is to get the most reward points, and hence, it
improves its performance.

1.4 ORGANIZATION OF PROJECT REPORT


Chapter1 gives an introduction and overview about the dynamic question
generation system and introduction about the machine learning concepts. The
various existing techniques to generate question were surveyed in chapter 2. In the
chapter 3 the various technology used to develop this system is described. The
8
proposed word and workflow of the dynamic question generation is discussed in
chapter 4. In the chapter 5 the results and analysis of the proposed system is
described. Conclusion of the project work and future work were discussed in the
chapter 6.

9
CHAPTER 2
LITERATURE SURVEY
Overviews of different approaches for Dynamic Question Generation Project
are discussed in this chapter.

2.1 GENERATION OF MULTIPLE-CHOICE QUESTION FROM


TEXTBOOK CONTENTS OF SCHOOL-LEVEL SUBJECT
Generation of Multiple-Choice Questions from Textbook Contents of School
Level Subjects [1] is designed to generate a question from the school level
subjects. plays a significant role in educational assessment. Automatic MCQ
generation has been an active research area for years, and many systems have been
developed for MCQ generation. Still, we could not find any system that generates
accurate MCQs from school-level textbook contents that are useful in real
examinations.
MCQs have many advantages, including quick evaluation, less testing time,
consistent scoring, higher validity. Many examinations use MCQ-based question
papers through a computerized environment. However, manual MCQ generation is
time-consuming and requires understanding the corresponding concept or
textbook. The evaluation process will become easier and faster if the MCQs can be
generated automatically from school textbooks However, the system also has its
limitations and disadvantages.
The strategies we adopted for developing the system for automatic MCQ
generation are discussed here. The system focuses on preparing questions from
school-level subjects. So it takes a chapter of a textbook as input to generate
MCQs. The proposed system contains four core modules, namely, preprocessing,
sentence selection, key selection, and distractor generation, the preprocessing
module performs text extraction, text normalization, lexical analysis, linguistic,
syntactic, and semantic processing on the input text, and makes the input ready for
the The pdf version of the textbook is taken as input to the system. The text
preprocessing module first converts the pdf document into a readable text format

1
and cleans the

1
text. A set of further processing is done. Tokenization divides long strings of text
into basic units or tokens. The input is separated into chapters, sections,
paragraphs, and other relevant tags in the text using structural analysis. The next
phase removes unnecessary content from the text and converts the text into the
required format unifying the character shapes by converting all the text into either
lower or uppercase, removing numbers, punctuation, and stop words, stemming,
and lemmatization. POS tagging assigns POS to each word of a given text. POS
tagging is used for getting more granular information about the words. We applied
word frequency in distractor generation and TF(term-frequency) *IDF (Inverse
Document Frequency) in the key selection phase.
Next sentence selection phases all the sentences in a text do not contain factual
information. This step aims to identify the sentences that can act as the basis of
question formation. To find the importance of the sentence. Sentence
Normalization, semantic and PAS analysis, Semantic play role is underlying
relationship that a which word is a main verb in the sentence to find the meaning of
the sentence. Distractor generation is play very crucial role in MCQ generation
because by generating quality distractor is it can able easily confuse the people
those who attending the MCQ. Generate distractor by build in modules like GloVe,
WordNet, Fast words.
In conclusion the automatically generating MCQ questions from school
textbooks. Automatic question generation it has Manual evaluation results. The
individual modules are also efficient. Furthermore, the number of MCQs generated
by the system is quite high. A high recall is necessary for the system to utilize it in
a real application scenario. Although the system contains some domain specific
features and resources, it can be ported to other domains (or subjects) with minor
effort. We have checked this by utilizing the system for other subjects.

1
2.2 AUTOMATED MULTIPLE-CHOICE QUESTION GENERATION
FROM TEXT:
The automated Multiple-Choice question generation from text [2]. This is used
to generate MCQ from Text content. It will be worked based on the six steps. The
First step is Pre-Processing the text for relevant question generation. It will remove
un relevant data from text that is removing topic, Chapter, Table of contents and
etc. It also divides sentence into individual word that is known as Tokenization.
The Preprocessing step also have syntactic and statistical analyze. The next step is
sentence selection, in this step they can identify the sentence length, word
frequency and parts of speech tagging that is known as Parsing.
The next step is Key selection. In this step they have identify the relevant key
that is known as answer. The key will identify by using parts of speech, parse info.
The next step is Question formation. The Question is generated by using some
methodology that is identifies the relevant WH -word selection, SVO relation,
Knowledge in sentence. The next step is identifying the Distractor. The distractor
generation is worked by using some model that is WordNet, Domain Ontology,
Distributional Hypothesis. The Final step is post-preprocessing. In this step contain
Question post editing, Question Filtering, Ranking. By using those steps, they can
generate MCQ from text. The Primary advantage of this system is generating the
MCQ from the text. It will generate question from text contents. The disadvantage
of this system is didn’t generate question from larger texts and it takes more time
to generate question from text.

2.3 DIVERSE DISTRACTOR GENERATION FOR


CONSTRUCTING HIGH-QUALITY MULTIPLE-CHOICE
QUESTIONS
The Diverse Distractor Generation for Constructing High-Quality Multiple
Choice Questions [3] aims at generating distractors which are incorrect options
from an article Existing methods for this task often utilize a standard encoder-

1
decoder framework. In this paper, a multi-selector generation network (MSG-Net)
is

1
proposed that generates distractors with rich semantics based on different sentences
in an article. MSG-Net adopts a multi-selector mechanism to select multiple
different sentences in an article that are useful to generate diverse distractors. Here,
a question-aware and answer-aware mechanism are introduced to assist in selecting
useful key sentences, where each key sentence is logical with the question and not
equivalent to the answer. MSG-Net can generate diverse distractors based on each
selected key sentence with different semantics.
The proposed methodology involves the process consisting of three layers: (i)
expression at the sentence level (ii) a layer for choosing different key phrases, and
(iii) a layer for making things. In the first layer, article lines are represented by a
system that is both question- and answer-aware. This article sentence
representation shows how each sentence relates to the question and answer. The
representation can help the second layer pick out the key words that make sense
with the question but aren't the same as the answer. The second layer uses a
selector to match a key line with a latent variable for each distractor. This makes
the distractions more varied. the multi-selector mechanism which is used can pick
out different key sentences based on how the sentences are represented and the
latent factors. To make distractions, the third layer uses a text-to-text transfer
transformer model. The T5 model is given a number of key lines with different
meanings, so the distractors it makes are also varied and are diverse. However, one
drawback of this mechanism is these methods often tend to generate semantically
similar distractors. Multiple generated distractors with similar semantics are
considered equivalent. Because the correct answer is unique, students can eliminate
these distractors even without reading the article. And also, this proposed system is
developed to generate MCQ’s only for an article or a paragraph. Therefore, the
future work of the system extends to generate questions for larger files such as
PDF.

1
2.4 LEARNING TO REUSE DISTRACTORS TO SUPPORT MULTIPLE-
CHOICE QUESTION GENERATION IN EDUCATION
Learning to reuse distractors to support multiple choice question generation in
education [4]. proposed system studies how a large existing set of manually created
answers and distractors for questions over a variety of domains, subjects, and
languages can be leveraged to help teachers in creating new MCQs, by the smart
reuse of existing distractors. In this article, it primarily focusses on such context-
aware models called transformers which provide rich representations, for many
tasks in NLP, such as question answering, machine translation, and text
summarization. The proposed model was evaluated by conducting user test with
teachers.
A transformer was used to detect every part of the input sequence in how they
are related to all other. The proposed system combines Bidirectional encoder
representations from transformers (BERT) which is the pre-trained masked
language model and has been widely used in many downstream tasks such as
question answering and generation, machine reading comprehension, and machine
translation, by fine-tuning it using a labeled dataset that provides supervision
signal. This paper introduced and evaluated multilingual context- aware distractor
retrieval models for reusing distractors for teachers who can help with the task of
making MCQs.
The system generated context-aware multilingual distractor retrieval models to
reuse distractor candidates that can speed up the process of creating multiple-
choice questions. The result obtained as three distractors out of the ten shown to
teachers were rated as high-quality distractors. It’s Future work is to extend the
current work to a multimodal system that considers other sources of information,
e.g., images that accompany MCQs in digital learning tools.

1
2.5 QUESTION GENERATION IN EDUCATION
Question generation in education [5]. This project focuses on Natural
Language Processing (NLP), aims to implement AI applications for the education
purpose, and look forward to the benefits of emerging AI technologies that can
bring into education. The system is aimed at generating short answer questions
automatically to reduce the time for teachers to write exam questions. In addition,
the main reason to implement this on short answer is that many studies had proven
that short answer exercises can enhance student’s long-term memory, thereby
improving their learning performance. Here an automatic question generation
(AQG) system is proposed that combines syntax-based and semantics-based
improve Question Generation(QG) processes to improve student’s learning
performance. The proposed system implements short answer AQG technology to
solve creating a large number of exercises and questions, these questions can be
used for assignments or quizzes in programming courses.
The project methodology combines syntax-based and semantic-based methods
for automatic question generation This interface allows teachers to view and
modify machine generated questions and allows students to answer questions. The
main purpose of semantic analysis is to enable machines to understand the content
of textbooks and extract important keywords from it. Here, the system uses BERT
analysis to extract (Bidirectional Encoder Representations from Transformers)
keywords from textbooks and use a large amount of unlabeled data to train the
model through unsupervised learning and transfer learning methods, using transfer
learning to train a language model. This brings some added advantages in the
proposed system: (1) no need to mark training data, (2) the language model can
understand the grammatical structure, interpret the semantics, and, in addition to
semantic analysis, the purpose of syntax analysis is to extract sentences that
contain keywords. A Stanford Core NLP tool developed by Stanford University is
used here to perform syntactic analysis on the extracted sentences. The result will
be displayed in the parse tree to find the complete sentence containing the subject,

1
verb and target. Since

1
syntax analysis can only output declarative sentences containing keywords, The T5
is used in the system to convert declarative sentences into interrogative sentences,
T5 is a text-to-text framework that combines encoder and decoder transformer
architecture. It treats each NLP question as “text-to-text”, which means using text
as input and generating new text as output. Therefore, the system inputs descriptive
sentences containing keywords into the T5 model and use the T5 model to
transform the descriptive sentences into interrogative sentences beginning with
WH questions. The result obtained in the proposed model has good performance in
terms of the quality of the generated questions.
However, a few limitations exist in the proposed model, in generating question
types, the system only generates WH questions. In the future, the work extends to
develop assessments for multiple-choice questions.

2.6 MULTI-HOP REASONING QUESTION GENERATION AND ITS


APPLICATION
Multi-Hop reasoning question generation and its application [6]. The proposed
project is about multi-hop question generation (QG), which tries to make questions
that need multi-hop reasoning skills by fully understanding the meaning of the text
given. The system focuses on generating questions that uses correct grammar, but
as well as for the answers. For achieving this, the system proposes a simple QG
model based on the sequence-to-sequence framework. The system uses a few
methods used to normalize the model's output to make the results' syntax better.
multi-hop question generation on answering questions that require the ability to
gather information from multiple sources and generate a comprehensive answer.
The methodology involves analyzing the structure of the text, and the logical
connections between the ideas. The system uses QG framework known as the
Machine reading comprehension (MRC-QA) requires the machine to answer
questions after reading the text with some relevant sentences with two components,
including the contents extractor and question generator. To determine what to ask,

1
first extract the reasoning chain, an answer, and supporting sentences from the
given text, then view them as the reasoning contents for a specific question. Based
on the extracted contents, it yields the multi-hop result.
The system generated questions from multiple sources of information The
MCQ’s produced are from the provided text. Existing QG methods are mainly used
to generate the simple questions with a single sentence. However, this system
works on the multi-hop questions that require reasoning skills to answer from
multiple sources of information. The future scope extends to generate high value of
these customized techniques on solving the challenges in the QG process,
including repetition, consistency, relevance, etc. In the future, that can help to
generate the results with correct syntax and semantics.

2
CHAPTER 3
BACKGROUND
In this chapter, the background of the proposed system is explained. Hardware
components and the technology used in this project is discussed in this chapter.

3.1 TECHNOLOGY USED


3.1.1 PyPdf2:
PyPDF2 is a Python library used for handling PDF files. It provides
functionalities to read, write, and manipulate PDF documents programmatically. It
is used to convert the pdf into text format. This module is allowing to read the pdf
file and extract the relevant text from the pdf files. This Pypdf2 model is also
allow to write and manipulating such as rotating pages, splitting or merging
documents, or encrypting them with passwords from the existing pdf files. By
using this we can create new PDF files or modify existing ones using PyPDF2.
This can involve tasks like adding text, images, or even merging multiple PDFs
together.

3.1.2 SpaCy:
SpaCy is a highly regarded open-source library for natural language processing
(NLP) in Python. SpaCy works by a pipeline-based architecture to process natural
language text efficiently. It offers NLP tasks like tokenization, part-of-speech
tagging, named entity recognition, and dependency parsing, enabling extraction of
meaningful insights from text data. With pre-trained models available for multiple
languages. SpaCy allows for easy extension with custom components and
pipelines. Users can customize and extend its functionality to suit their specific
needs or integrate it into existing NLP workflows. Additionally, SpaCy provides
pre-trained statistical models for various languages and domains, allowing users to
perform NLP tasks without needing to train models from scratch.

3.1.2.1 Similarity
In SpaCy, similarity refers to the measure of similarity between two pieces of

2
text, typically represented as vectors in a high-dimensional space. SpaCy provides

2
a built-in method to compute the similarity between documents, spans, or tokens
based on their word embedding’s. SpaCy’s models are trained with word
embedding’s, which represent words as dense vectors in a continuous space. These
vectors capture semantic similarities between words, with similar words having
vectors closer to each other in the embedding space. SpaCy provides similarity ()
method to compute the similarity score between two objects (documents, spans, or
tokens). By calling this method on two objects, you can obtain their similarity
score.

3.1.3 Natural Language Processing:


NLP, or Natural Language Processing, is like a helpful assistant for computers
when it comes to understanding and working with human language. It's super
smart and can-do things like read and understand text, just like we do. It figures
out what words, sentences, and whole documents mean. One cool thing it does is it
helps extract important info from text, like the main ideas or important facts. By
analyzing text, it can identify key info that forms the basis for making meaningful
questions. So, NLP is like the secret sauce behind generating questions that make
sense and are really useful.

3.1.4 Torch
Torch module, an integral component of the PyTorch library, stands as a
cornerstone in the field of deep learning and scientific computing. PyTorch, built
upon the Torch framework, offers a versatile and intuitive platform for developing,
training, and deploying state-of-the-art machine learning models. At its core lies
the torch. Tensor data structure, facilitating seamless handling of multi-
dimensional arrays and enabling efficient computation on both CPUs and GPUs.
With its dynamic computational graph feature, PyTorch empowers users to
construct complex neural network architectures with ease, facilitating
experimentation and rapid prototyping. PyTorch's seamless integration with
NVIDIA CUDA facilitates high-performance computing, enabling significant

2
speedups for computationally intensive tasks

2
3.1.5 T5 Transformers:
The T5 Transformer, short for "Text-To-Text Transfer Transformer," is a state-
of-the-art neural network architecture introduced by researchers at Google. It uses
a special structure called the Transformer, which is great at understanding how
words relate to each other in a sentence. This helps the model process and create
text very effectively. In simple terms, it's like having a smart assistant that
understands language well, making it useful for tasks like summarizing text,
answering questions, and translating languages. it used in real-time applications,
question generation, Chabot creation. Its ability to understand and manipulate
language allows it to analyze the content of a passage and generate contextually
relevant questions. T5 can generate questions across various difficulty levels and
question types, including factual, inferential, and evaluative questions, catering to
different educational and assessment needs.

3.1.6 Gensim
Gensim is an open-source Python library designed for topic modelling,
document indexing, and similarity retrieval with large corpora. It is primarily used
for unsupervised learning on text data. It provides efficient implementations of
various algorithms for natural language processing (NLP) tasks, particularly
focusing on techniques like topic modelling and word embedding’s.

3.1.6.1 GloVe
GloVe, short for Global Vectors for Word Representation, is an unsupervised
learning algorithm for obtaining vector representations of words. These
representations, also known as word embedding’s, capture semantic relationships
between words based on their co-occurrence statistics in a corpus of text. Glove
embedding’s are commonly used in distractor generation tasks in natural language
processing (NLP). Distractors are incorrect or misleading options provided
alongside a correct answer in multiple-choice questions or other assessment
formats. GloVe embedding encode semantic relationships between words,

2
allowing for the

2
identification of words that are similar in meaning. This enables the generation of
distractors that are contextually relevant to the correct answer but differ in
meaning.

3.1.7 Textstat
Textstat is a Python library used for computing various statistics from text. It
offers a range of functionalities that help analyse and understand text data more
effectively. textstat provides functions to compute readability scores, such as the
Flesch-Kincaid Grade Level, Coleman-Liau Index, Automated Readability Index
(ARI), and others.

3.1.7.1 Automatic Readability Index


These scores indicate the readability or difficulty level of a piece of text, which
is useful for assigning the complexity of text. It takes the text as input and returns
the ARI score. The score typically corresponds to a grade level, indicating the
minimum level of education required to understand the text. The output will be the
ARI score for the given text. Lower scores indicate easier readability, while higher
scores indicate more complex text.

2
CHAPTER 4
PROPOSED WORK
In this chapter, the design of the proposed system is explained. Further, the
methodology to develop automated question generation.

4.1 PROPOSED WORK


The proposed work integrates several components to develop dynamic
question generation is contain several components. The dynamic question
generation is used to generate the dynamic question from the text. It will
dynamically change the question based on the performance of the user or test
takers. The question will generate from text by using machine learning techniques.
The faculty will provide question ID to test taker. The system will generate
question ID in automated manner by importing the pdf into machine learning
techniques. The user will attend the test by using the Question Id. Based on the
attending time of question and choosing the correct answer it will change the
question dynamically. Based on the performance they get score.

4.1.1 WORK FLOW FOR MCQ GENERATION


The workflow of this system contains several steps that is shown in the figure
4.1 It represents the overall workflow of Dynamic Question Generation.

4.1.1.1 INPUT DOCUMENT


The input document serves as the foundation for providing data to the machine
learning model. It acts as the primary source of information from which the model
derives insights, makes predictions, or performs other tasks based on its trained
algorithms. In the context specified, the input document is expected to be in PDF
format, indicating that the machine learning model is designed to process and
analyze PDF files exclusively. PDFs, renowned for their universal compatibility
and structured format, ensure consistency and reliability in data representation
across platforms.

2
Figure 4.1 Workflow for MCQ Generation
The Figure 4.1 show the work of the entire question generation process from
starting to end

4.1.1.2 TEXT EXTRACTION


Text extraction is a crucial process in question generation, as it forms the
cornerstone for deriving meaningful content from textual sources. This essential
step involves the removal of irrelevant information from text, thereby refining the
data to facilitate the creation of high-quality questions. By eliminating irrelevant
details, such as headers, footers, page numbers, and tables of contents, text
extraction ensures that the resulting content is concise, relevant, and conducive to
effective question formulation. Leveraging the PYPDF2 module in Python, the
conversion of PDF documents into text is seamlessly executed laying the
groundwork for the subsequent question generation process. The efficacy of text
extraction lies in its ability to transform unstructured data into structured,
actionable information, enabling the model to generate questions that align closely
with the core content of the document. As a foundational component of the
question

2
generation pipeline, text extraction plays a pivotal role in ensuring the quality and

3
relevance of the generated questions, thereby enhancing the overall effectiveness of
the model in facilitating learning and assessment.

4.1.1.3 SYNTACTIC ANALYZE


Syntactic analysis, a crucial step in question generation, involves dissecting
sentences to comprehend their grammatical structure and relationships. Also
known as parsing, this process encompasses four essential models: word
tokenization, stop word removal, punctuation removal, and parts of speech
tagging. Leveraging Natural Language Processing (NLP) techniques, syntactic
analysis aids in understanding the roles and connections between words within
sentences. Word tokenization breaks down sentences into individual words,
facilitating the tallying of word frequencies for question formulation. Stop word
and punctuation removal further refine the analysis, identifying the significance of
certain words and their relationships within the text. By eliminating extraneous
elements, such as common words and punctuation marks, syntactic analysis
enhances the summarization process. Parts of speech tagging further enhances
comprehension by identifying verbs, nouns, and their associated relationships
within sentences. Notably, the identification of noun chunks serves to extract
keywords crucial for generating questions. Overall, syntactic analysis serves as a
cornerstone in the question generation process, enabling a deeper understanding of
text structure and facilitating the extraction of pertinent information for effective
question formulation.

4.1.1.4 STATISTICAL ANALYZE


Statistical analysis is key in question generation. It counts how often words
appear, giving a basis for summarizing text. By tallying word frequency, it helps
in understanding the text better. This technique, common in NLP, identifies the
most used words, aiding in grasping the vocabulary and content of the text
statistical techniques can be applied to analyze the co-occurrence of words within
the text, revealing semantic relationships and associations between terms. By

3
delving into these linguistic features, statistical analysis enriches the understanding

3
of the text's content and context, laying a robust foundation for question generation
and summarization.

4.1.1.5 SUMMARIZATION
Summarization plays a vital role in condensing lengthy paragraphs into
concise versions, addressing the challenge of generating questions from extensive
text. By reducing the paragraph's length, summarization enhances efficiency in
question generation, as processing shorter texts is quicker and more manageable.
This process relies on assigning scores to sentences based on their word frequency
counts, with higher scores indicating greater relevance and importance.
Leveraging the N-Largest () package, summarization selects the top N sentences
with the highest scores, typically around 30 sentences, to form the summarized
version. This approach ensures that the essential information is retained while
discarding unnecessary details, thus streamlining the question generation process
and improving its effectiveness.

4.1.1.6 KEY GENERATION


Key generation serves as a cornerstone in the question generation process,
pivotal for identifying essential keywords that shape the questions' content. These
keywords play a crucial role as they often form the basis for generating answers.
The key generation process revolves around identifying noun chunks within
sentences, extracting meaningful phrases or terms from the text. These noun
chunks serve as the focal points around which questions are crafted, ensuring
relevance and coherence. By inputting these keywords into the question generation
model, questions are systematically generated, leveraging the identified keywords
to structure inquiries that probe deeper into the text's content. Thus, key generation
not only facilitates question formulation but also enhances the overall
effectiveness and relevance of the generated questions.

4.1.1.7 QUESTION GENERATION


Question generation stands as a pivotal component within our dynamic question

3
generation system, serving as the primary mechanism for generating relevant
question from summarized content. This process plays a central role in facilitating
learning and assessment by crafting questions tailored to the context of the
summarized paragraph. Leveraging keywords extracted from the text, the question
generation process is seamlessly executed using the T5 model. This powerful
model utilizes the provided keywords to generate questions, effectively
transforming them into inquiries that delve deeper into the content's essence. By
incorporating the identified keywords, the generated questions maintain relevance
and coherence, ensuring they align closely with the context of the summarized
paragraph. Thus, question generation not only enhances the comprehensiveness of
the learning experience but also contributes significantly to the effectiveness and
adaptability of our dynamic question generation system.

4.1.1.8 DISTRACTOR GENERATION


Distractor generation stands as a critical aspect within our dynamic question
generation system, aimed at enhancing the depth and complexity of multiple-
choice questions (MCQs). Distractors, often referred to as incorrect or misleading
options, play a crucial role in challenging test-takers and assessing their
understanding of the material. These distractors are strategically generated based
on keywords extracted from the text, ensuring alignment with the context of the
question. Leveraging the GloVe model, which utilizes pre-trained word
embedding’s, the system generates diverse and plausible distractors that closely
resemble potential misconceptions or alternative interpretations. By providing
three distractors alongside the correct answer, the MCQs present a comprehensive
set of options, compelling test-takers to critically evaluate their understanding and
select the most appropriate response. Through effective distractor generation, our
system fosters deeper engagement, stimulates critical thinking, and enhances the
overall effectiveness of assessments in evaluating students' knowledge and
comprehension.

3
4.1.1.9 DIFFICULTY LEVEL FOR QUESTION
Setting the difficulty level for questions is a pivotal aspect in optimizing the
effectiveness of adaptive exams within our dynamic testing system. By tailoring
the difficulty level to each individual's proficiency and comprehension abilities,
we ensure a personalized and engaging testing experience. This dynamic approach
allows us to adjust the complexity of questions in real-time, accommodating the
diverse learning needs and skill levels of test-takers. Utilizing the Automated
Readability Index (ARI), we gauge the reading complexity of sentences and
categorize questions into easy, medium, or hard difficulty levels accordingly. This
classification enables us to present questions that challenge and stimulate critical
thinking while remaining accessible and fair to all participants. By dynamically
adjusting the difficulty level, our system promotes deeper engagement, fosters skill
development, and provides a more accurate assessment of learners' knowledge and
capabilities. Thus, integrating difficulty level settings into our adaptive testing
framework enhances its adaptability, efficacy, and overall impact on the learning
process.

4.1.1.10 DIFFICULTY LEVEL FOR DISTRACTOR


In our dynamic question generation system, establishing the difficulty level for
distractors is a critical component that significantly enhances the system's
efficiency and effectiveness. By accurately gauging the difficulty level of
distractors, we ensure that multiple-choice questions (MCQs) present a balanced
and challenging set of options to test-takers. This approach promotes deeper
engagement and critical thinking by compelling examinees to carefully evaluate
each option. The difficulty level for distractors is determined by assessing the
similarity between words, a process facilitated by the similarity module in Python.
By analyzing the semantic relationships between words, we can categorize
distractors into varying levels of difficulty, ranging from easy to challenging. This
classification enables us to craft distractors that are plausible yet sufficiently
distinct from the correct answer,

3
thereby enhancing the rigor and reliability of the assessment. Moreover, aligning
the difficulty level of distractors with the proficiency and comprehension levels of
test-takers ensures a fair and equitable testing experience for all participants.
Overall, integrating difficulty level settings for distractors into our dynamic
question generation system enhances its adaptability, precision, and overall
effectiveness in evaluating learners’ skills.

4.1.2 WORK FLOW OF WEB APPLICATION


The following Figure 4.2 the workflow for our system web application. This
work flow contains several steps that will be explained in further.

Figure 4.2 Workflow for Web Application


The Figure 4.2 show the work of the web applications

4.1.2.1 FACULTY
The faculty plays the crucial role in our system. They can monitor the whole

3
student database and generate question by providing relevant documents. They can
able to create test for students.

4.1.2.1.1 FACULTY REGISTER


The faculty registration is really important for our system. It's like signing up
for an account online. Faculty members go to a registration page and enter their
mail, username and password, and say what subjects they teach. We check to make
sure their email and username are not already taken and keep their password safe.
Once everything checks out, all their info is stored securely. This helps keep things
organized and makes sure everyone can communicate easily.

4.1.2.1.2 FACULTY LOGIN


Faculty members log into the system using their email and password, which are
already stored in the database. Each faculty member has their own unique login
details. When they enter their email and password, the system checks if the entered
information matches what's stored in the database. If it's correct, they're granted
access to the system. If not, they're prompted to register by providing the necessary
details like email, username, password, and subject teaching. This process ensures
that only authorized faculty members can access the system and allows new faculty
members to easily register if they're not already in the database.

4.1.2.1.3 TEST POSTING


In our system, a key feature is the ability for faculty to generate questions or
tests. Faculty members upload a PDF document. This system will generate MCQ
from the pdf that is explained in section 4.1.1. Along with the document, they
specify details such as the test's starting time, ending time, duration, and the
number of questions to post. Importantly, the starting and ending times must be set
after the current day, ensuring future scheduling. The duration is also validated to
ensure it falls within the time interval specified between the starting and ending
times. After the questions are processed, the system assigns a special ID known as
the Question ID. This ID is essential for students attending the test, providing a

3
unique identifier

3
for each set of questions.

4.1.2.1.4 FACULTY DASHBOARD


In our system, faculty members are provided with individual dashboards.
These dashboards display faculty details including their email, username, and the
subjects they teach. Additionally, test details such as the starting time, ending time,
duration, and Question ID are visible within the dashboard. This allows faculty to
manage and track their tests effectively. Furthermore, student details such as email,
username, associated Question ID, and marks obtained are also displayed in the
dashboard. This comprehensive view enables faculty members to monitor student
progress and performance efficiently, facilitating effective teaching and assessment
practices within the system.

4.1.2.2 STUDENT
The Students plays another important role in our system. The Student is the
one who going to attend the exam. The exam questions posted by the faculty. The
student has a dashboard to see all it score and previous attended test.

4.1.2.2.1 STUDENT REGISTRATION


When a student attempts to log in, the system first checks if they have an
existing account. If not, the student is redirected to the registration page where they
are prompted to provide their name, email, department, password, and confirm
password. The registration form includes validations to ensure data integrity, such
as verifying that the email follows a valid email format, the name field only
accepts alphabetic characters, and the password meets security criteria. Once the
student submits the registration form, the system stores the provided information in
the database. Upon successful registration, the student is redirected to the login
page. At the login page, the student enters their registered email and password. The
system verifies these credentials against the stored data in the database. If the login
credentials are correct, the student is redirected to their dashboard where they can
access relevant information and resources.

3
4.1.2.2.2 STUDENT LOGIN
For the student login feature, users must first register with valid credentials.
Upon attempting to log in, the system verifies the entered email against the
registered emails database. If the email is not found or is invalid, an error message
prompts the user to provide a valid email address. Subsequently, if the email is
valid, the system compares the entered password with the password associated with
the email in the database. If the password matches the email, the user is
successfully logged in. Otherwise, an error message indicates that the password is
incorrect.

4.1.2.2.3 ASSESSMENT LOGIN


Once successfully logged in, the student is directed to the dashboard, which is
divided into two columns. In the first column, the student's personal information,
such as their name, email, and department, is displayed. This section provides an
overview of the student's profile within the system. The second column of the
dashboard provides a detailed overview of the student's exam performance,
offering insights into past tests. It showcases the student's total score across all
attended exams, the total number of questions attempted, and a breakdown of
question attempts by difficulty level (easy, medium, hard). Additionally, the
dashboard calculates and displays the score percentage, indicating the proportion of
the total achievable score obtained by the student. This comprehensive presentation
enables students to monitor their progress, identify areas for improvement, and
compare their performance with peers.

4.1.2.2.4 ASSESSMENT
Upon entering the credentials, the test begins with the presentation of the first
question, which is of medium difficulty. Subsequent questions adapt dynamically
based on the user's responses: correct answers lead to more challenging questions,
while incorrect responses result in easier questions. This adaptive process
continues until the maximum number of required questions is reached.

4
Additionally, a timer is initiated, ensuring that the test duration is limited. For
example, if the timer is set to

4
30 minutes, users must complete the test within this time frame. Upon reaching the
maximum time limit, the test automatically submits.

4.1.2.2.5 STUDENT DASHBOARD


Once successfully logged in, the student is directed to the dashboard, which is
divided into two columns. In the first column, the student's personal information,
such as their name, email, and department, is displayed. This section provides an
overview of the student's profile within the system. The second column of the
dashboard provides a detailed overview of the student's exam performance,
offering insights into past tests. It showcases the student's total score across all
attended exams, the total number of questions attempted, and a breakdown of
question attempts by difficulty level (easy, medium, hard). Additionally, the
dashboard calculates and displays the score percentage, indicating the proportion
of the total achievable score obtained by the student. This comprehensive
presentation enables students to monitor their progress, identify areas for
improvement, and compare their performance with peers.

4
CHAPTER 5
RESULTS AND DISCUSSION

The results of the implemented system are discussed in this chapter. The section
5.1 is discussed about the question generation. The section 5.2 described Initial
Posting and PDF Documentation, section 5.3 shows the Test Attendance phase and
section 5.4 Visualize the results in dashboard.

5.1 QUESTION GENERATION


The section details the question generation from the pdf as text.

Figure 5.1 T5 model for Question Generation


Figure 5.1 picturizes the T5 model for Question Generation process.
In the Question Generation Context, the T5 model is important thing. It is used
to generate the Question from the text. This is the pre-trained model for question
generation process. The text will be pre-processed before given into the T5 model.
Before we given the text into T5 model the syntactic, semantic analyze and key
generation will take a place and the text will be summarized for generate question
in timely manner. Based on the summarization the keywords are generated. This
keyword is fundamental thing in question generation process/This model will take
the keywords as base for question generation. Based on the keywords it will
generate the question from pdf content.

4
Figure 5.2 Final Set of Question

The finalized set of questions and answers, as depicted in Figure 5.2, will be
integrated into our web application for system testing.
This collection incorporates a range of difficulty levels determined through the
Automated Readability Index (ARI) and similarity technology, as discussed
previously. Each question-answer pair is accompanied by its respective difficulty
value, crucial for implementing a dynamic testing approach. To ensure efficient
storage and retrieval, this dataset will be stored in MongoDB, a robust database
management system. Accurate categorization of difficulty levels facilitates
effective testing, enhancing the overall performance and adaptability of our
system.

5.2 INITIAL POSTING AND PDF DOCUMENTATION


The development of an automated question generation system tailored for
extracting questions from PDF documents. The system takes input parameters
including the PDF file, starting time (set to 30 minutes ahead of the current time),
test duration, and the desired number of questions. It validates input parameters to
ensure the starting time aligns with the current time plus 30 minutes and that the
test duration doesn't exceed the ending time. Utilizing Python and relevant libraries
like PyPDF2 and NLTK, the system conducts PDF content analysis to extract
pertinent information and concepts, subsequently generating questions based on
the extracted content through natural language processing techniques. Efficiency

4
checks assess the richness of the PDF content to determine the feasibility of
generating the desire

4
number of questions. then at last before storing the questions in database it
generates a random value by 8-character (Capital letters + numbers) example:
MST3DJS1.
The Figure 5.3 shows the test posting page. In this page the faculty will provide
the pdf and relevant information for generating the question and answers.

Figure 5.3 Test creation

5.3 TEST ATTENDANCE PHASE


In the test attendance phase, users input their credentials (email, password) the
email and password are must be correct before starting the test and select a course
(e.g., AI, Crypto), followed by the last question ID they encountered. The system
retrieves the questions that question contain the same question ID stored in the
database. That questions data contain question as well as the answer and distractor.
The Figure 5.4 the shows the login credentials page for taking test. It will available
to the test takers. The test takers are put relevant information for taking
test.

4
Figure 5.4 Starting test
The First question will come after centering the credentials. It initiates with a
medium difficulty question, adapting subsequent questions based on the user's
responses: correct answers advance to harder difficulty questions, while incorrect it
goes to difficulty level of easy question. This dynamic process continues until the
maximum number of questions required is reached, the timer will be going until
the maximum time you reached example: 00:30 means the attending duration only
within the time after the time exist the test will automatically submit. ensuring
personalized learning experiences tailored to users' abilities and needs within the
chosen course.
The Figure 5.5 shows the test attending page. From the final set of questions,
the question and answer are retrieved and rendered to this page. By answering the
correct answer, it will dynamically change the question.

4
Figure 5.5 MCQ

5.4 VISUALIZATION OF THE RESULTS IN DASHBOARD


The final phase of the system involves visualizing test results in a dashboard
accessible to both faculty and students. The dashboard displays crucial data,
including the total score achieved out of the total marks available. The marking
system is structured such that easy questions carry a maximum of 4 marks, medium
questions 7 marks, and hard questions 10 marks. For example, if a user attends a
test comprising 10 questions (3 easy, 3 medium, 4 hard), and correctly answers all
3 easy questions, they score 12 marks. However, if one question is answered
incorrectly, the score decreases accordingly, such as to 8 marks. The key metric for
assessment is the percentage of questions attended and the number of correct
answers chosen, which determines the final score. This percentage-based
calculation provides a comprehensive evaluation of the user's performance,
facilitating meaningful insights for both faculty and students alike.

4
Figure 5.6 Student Dashboard
The Figure 5.6 visualize the student dashboard. By using this the students can
view their results.
The faculty dashboard features comprehensive data on tests created, including
details such as the starting time, ending time, duration, and a unique question ID
for each test, facilitated with a copy icon for convenient duplication. The
information is structured in a tabular format, enabling easy access and navigation.
Upon selecting a specific test row, the dashboard dynamically populates with data
on student attendance, showcasing student names, emails, departments, courses,
total questions attended, and individual scores. This interface empowers faculty
members to efficiently monitor test participation and assess student performance,
facilitating informed decision-making and targeted intervention where necessary.
Additionally, the faculty dashboard provides comprehensive insights into faculty
data, showcasing details such as the faculty member's name, email, department of
employment, and the subjects they teach. This comprehensive overview allows
faculty members to track their own involvement in test creation and management,
fostering transparency and accountability within the educational institution.

4
Figure 5.7 Faculty dashboard
The Figure 5.7 shows the data about the questions posted before and also the
details of the faculty who use this.
This is the dashboard of faculty how has the data of the student by attending
his test. This interface empowers faculty members to efficiently monitor test
participation and assess student performance.

Figure 5.8 Student Result


The Figure 5.8 shows Student result who many students attended the test
and there score.
In the provided figure, the faculty dashboard exhibits detailed student
information for effective monitoring and evaluation. Each row corresponds to a
student, displaying essential details such as the student's name, email, department,
and the course they are enrolled in. Additionally, the dashboard presents statistics

5
on the student's test participation, including the total number of questions
attempted and their respective scores. This comprehensive overview equips faculty
members with the necessary insights to assess student performance and provide
targeted support where needed.

5
CHAPTER 6
CONCLUSION AND FUTURE WORK
6.1 CONCLUSION

In conclusion, the development of a dynamic question generation system marks


a significant leap forward in personalized learning experiences. By leveraging
various methodologies and techniques, the system generates questions, answers,
and distractor dynamically from PDF text contents. This adaptive approach ensures
that assessments are tailored to each user's unique abilities and needs, fostering a
more engaging and effective learning environment.
The system's ability to adjust question difficulty based on user performance is a
key feature that enhances its effectiveness. As users progress through the
assessment, the system analyzes their responses and adapts the complexity of the
questions accordingly. This real-time adjustment ensures that users are consistently
challenged at an appropriate level, promoting continuous growth and mastery over
time.
Furthermore, the provision of customized assessments supports academic and
professional advancement by aligning questions with users' knowledge levels and
learning objectives. This personalized approach empowers users to identify areas
for improvement and focus their efforts accordingly, leading to enhanced learning
outcomes and increased confidence.
The adaptive nature of the exam system enables real-time feedback and
performance tracking, allowing users to monitor their progress and identify areas
of strength and weakness. This valuable insight informs individual study strategies
and enables educators to tailor instructional interventions to better meet the diverse
needs of learners.
In essence, the development of an adaptive exam system represents a significant
step towards democratizing education and fostering lifelong learning. By
harnessing technology to deliver personalized assessments and support, the system
empowers individuals to achieve their full potential and thrive in educational

5
landscape.

5
6.2 FUTURE WORK
In our project's future endeavors, we aim to expand its capabilities to
generate questions in quick manner. This advancement will enable users to extract
questions from more extensive documents, broadening its applications across
educational materials, research papers, and technical manuals. Additionally, we
plan to enhance the system's ability to generate distractors specifically for technical
terms and concepts, thus improving the quality and effectiveness of the questions
generated. Furthermore, our project's scope extends to extracting relevant
information from images and tables, allowing for the generation of questions,
answers, and distractors based on this data. This evolution will diversify the
system's utility, accommodating a wider array of content types and catering to
various learning materials and domains.

5
PUBLICATION DETAILS

5
5
5
5
APPENDIX I
SOFTWARE SPECIFICATIONS

Programming Languages : Python, JavaScript


Tools : Visual Studio Code, Colab
Python Modules : Flask, Pymongo, Jwt
Database : MongoDB compass
Operating System : Windows 10 or above

5
APPEN
DIX II
Import Packages SAMPLE
From flask import Flask CODING

from flask import Flask, jsonify, make_response, request


from flask_jwt_extended import JWTManager
from flask_cors import CORS
from pymongo import MongoClient
import logging
import string
import re
from datetime import datetime,timedelta
import textstat
import errno

from collections import Counter


from schema.schema import faculty_schema, student_schema
from Authendication import GeneratedToken
from Authendication import auth_bp;
from src.Conversion import Conversion as StartGenerate;
import os
import nltk

from nltk.tokenize import sent_tokenize, word_tokenize


import spacy
from spacy.lang.en.stop_words import STOP_WORDS
from string import punctuation
from nltk.corpus import stopwords
from transformers import T5ForConditionalGeneration, T5Tokenizer
import torch

6
from heapq import nlargest

6
import random
import numpy as np;
from ChooseQue import RandomQue, ChooseCrtQues;

PDF TO TEXT CONVERTER


import os
from PyPDF2 import PdfReader
def Conversion(file_name, save_file_name):
current_directory = os.getcwd();
parent_dir = os.path.dirname(current_directory);

file_path = os.path.join(current_directory, 'Pdf', file_name);


desc_file_path = os.path.join(current_directory, 'Data', save_file_name)
print(current_directory, file_path, desc_file_path)
extracted_text = "";
with open(file_path, "rb") as pdf_file:
pdf_reader = PdfReader(pdf_file);
for page in pdf_reader.pages:
extracted_text += page.extract_text();
with open(desc_file_path, "w", encoding="utf-8") as text_file:
text_file.write(extracted_text)
return extracted_text;

TEXT EXTRACTION
def Start(text):
def remove_page(text):
pattern = r'\bPage\s+N\d{2}\b'
c_text=re.sub(pattern,'',text)
c_text=c_text.replace('\n','')
return c_text
c_text=remove_page(text=text)

6
text=c_text

SYNTACTIC ANALYZE
word_token = word_tokenize(text)
doc=nlp(text)
sentence_tokens = [sent for sent in doc.sents]
para=""
count=0;
para_list=[]
for x in sentence_tokens:
if count>30:
para_list.append(para)
para=""
count=0
else:
para=para+str(x)
count=count+1;
if para!="":
para_list.append(para)
text_list=[[paragraph] for paragraph in para_list]
capitalized_paragraphs = []
for paragraph in text_list:
paragraph_text = paragraph[0]
doc = nlp(paragraph_text)
capitalized_text = '. '.join([sent.capitalize() for sent in paragraph_text.split('.')])
capitalized_paragraphs.append([capitalized_text])
text_list = capitalized_paragraphs;

STATISTICAL ANALYZE
word_freq_list = []

6
for text in text_list:
word_freq = Counter()
for sentence in text:
words = sentence.split()

words = [word.lower() for word in words if word.lower() not in stop and


word.lower() not in punctuation]
word_freq.update(words)
word_freq_list.append(word_freq)
max_frequencies = []

for word_freq in word_freq_list:


max_frequency = max(word_freq.values(), default=0)
max_frequencies.append(max_frequency)
for idx, word_freq in enumerate(word_freq_list, 1):
max_frequency = max(word_freq.values(), default=1)
for word in word_freq.keys():
word_freq[word] /= max_frequencies[idx - 1]

SUMMARIZATION
def tokenize_sentences_regex(text_list):
pattern = r'(?<!\w\.\w.)(?<![A-Z][a-z]\.)(?<=\.|\?|\!)\s'
long_sentences = []
for paragraph in text_list:
tot_sentence = []
sentences = re.split(pattern, paragraph[0])
for sentence in sentences:
if len(sentence) > 10:
tot_sentence.append(sentence)
long_sentences.append(tot_sentence)
return long_sentences

6
long_sentences= tokenize_sentences_regex(text_list)
sentence_scores = []
for sublist, word_freq in zip(long_sentences, word_freq_list):
nested_dict = {}
for sentence in sublist:
score = sum(word_freq.get(word.lower(), 0) for word in sentence.split())
nested_dict[sentence] = score
sentence_scores.append(nested_dict)
def generate_summary(sentence_scores):
summary = nlargest(3, sentence_scores, key=lambda x: sentence_scores[x])
summary_sentences = [sentence for sentence in summary]
return summary_sentences
summaries = []
for sentence_scores in sentence_scores:

summary = generate_summary(sentence_scores)
summaries.append(summary)
text_doc = []
for i in text_list:
para = []
for j in i:
para.append(nlp(str(j)))
text_doc.append(para)
summary_doc = []
for i in summaries:
summary = []
for j in i:
summary.append(nlp(str(j)))
summary_doc.append(summary)

6
KEY GENERATION
keys = []
for doc in text_doc:
k1 = []
for sentence in doc:
doc_sentence = nlp(str(sentence))
for word in doc_sentence.noun_chunks:
if word.text.lower() not in stop:
k1.append(word.text)
keys.append(k1)
keywords = []

for doc in summary_doc:


k1 = []
for sentence in doc:

doc_sentence = nlp(str(sentence))
for word in doc_sentence.noun_chunks:
if word.text.lower() not in stop:
k1.append(word.text)
keywords.append(k1)
common_keywords = []
for keys_list, keywords_list in zip(keys, keywords):
keys_set = set(keys_list)
keywords_set = set(keywords_list)
common = keys_set.intersection(keywords_set)
common_keywords.append(list(common))

QUESTION GENEARTION
question_tokenizer = T5Tokenizer.from_pretrained('t5-large',legacy=False)
question_model = T5ForConditionalGeneration.from_pretrained('Parth/result')

6
device = 'cuda' if torch.cuda.is_available() else 'cpu'
question_model = question_model.to(device)
def get_question(context, answer, model, tokenizer):

text = "context: {} answer: {}".format(context, answer)


encoding = tokenizer.encode_plus(text, max_length=384,
pad_to_max_length=False, truncation=True, return_tensors="pt").to(device)
input_ids, attention_mask = encoding["input_ids"], encoding["attention_mask"]
outs = model.generate(input_ids=input_ids,
attention_mask=attention_mask,
early_stopping=True,
num_beams=5,
num_return_sequences=1,
no_repeat_ngram_size=2,
max_length=72 )
dec = [tokenizer.decode(ids, skip_special_tokens=True) for ids in outs]
Question = dec[0].replace("question:", "")
Question = Question.strip()
return Question
def generate_questions(summaries, keywords, model, tokenizer):
que_pair = []
for i, summary in enumerate(summaries):
keys = keywords[i]
for answer in keys:
ques = get_question(summary, answer, model, tokenizer)
que_pair.append((ques, answer.capitalize()))
return que_pair
questions = generate_questions(summaries, common_keywords, question_model,
question_tokenizer)
def remove_words(input_string, words_to_remove):

6
Removed_n = input_string.replace("\n", "");
words = input_string.split()
cleaned_words = [word for word in words if word.lower() not in
words_to_remove]
return ' '.join(cleaned_words)

DISTRACTOR GENERATOR
def generate_distractors(target_word, num_distractors=5, glove_model=None):
target_words = target_word.split()
try:

target_vectors = [glove_model.get_vector(word) for word in target_words]


target_vector = np.mean(target_vectors, axis=0)
similarity_scores = np.dot(glove_model.vectors, target_vector) /
( np.linalg.norm(glove_model.vectors, axis=1) *
np.linalg.norm(target_vector)

)
most_similar_indices = np.argsort(similarity_scores)
distractors = [glove_model.index_to_key[idx] for idx in
most_similar_indices if glove_model.index_to_key[idx] not in target_words]
return distractors[:num_distractors] except Exception as e:
print("Error occurred:", e)
return []
current_Answer_list = []
Proper_QA = [];
RemoveWords = ["its", "a", "the", "this", "page n01", "n01"];
i = 1;

DIFFICULTY LEVEL SET


for index, (question, answer) in enumerate(questions, start = 1):
similarity = []

6
difficulty = []
que_diff = ""
ans = remove_words(answer, RemoveWords);
target_word = ans.lower()
ansnlp = nlp(target_word);
distractors = generate_distractors(target_word, glove_model=glove_model)
if distractors == []:
continue;
else:
current_Answer_list = random.sample(distractors, min(3, len(distractors)))
if current_Answer_list != []:
current_Answer_list.append(target_word)
random.shuffle(current_Answer_list)
for similaritys in current_Answer_list:
doc = nlp(similaritys);
val = ansnlp.similarity(doc);
similarity.append(val);
for value in similarity:
if value == 1.0:
difficulty.append(10)
elif 0.7 <= value < 1.0:
difficulty.append(7)
elif 0.4 <= value < 0.7:
difficulty.append(4)
else:

difficulty.append(0)
var = textstat.automated_readability_index(question)
if var < 6 :
que_diff = "easy"

6
elif 6 <= var < 9:
que_diff = "medium"
else :

que_diff = "hard"
from Format import Format
question_dict = Format(question, ans, que_diff, current_Answer_list,
similarity, difficulty, QuestionId, FacId, var)
Proper_QA.append(question_dict)
i+=1;
return Proper_QA

WEB
APPLI
MCQ PAGE CATI
ON
CODE
FRON
TEND

import { useEffect, useState } from “react”;


import TestPage from “../faculty/time”;
import { toast } from “react-toastify”;
import { useNavigate } from “react-router-dom”;
const Mcq = () => {
const [answer, setAnswer] = useState(‘’);
const [change, setChange] = useState(false);
const [time, setTime] = useState(0);
const navigate = useNavigate();
const [QuestionGen, setQuestionGen] =
useState(JSON.parse(localStorage.getItem(“currentque”)));

7
const duration = localStorage.getItem(‘duration’);
const testToken = localStorage.getItem(‘TestToken’);
useEffect(() => {
const intervalId = setInterval(() => {

7
setTime(sec => sec + 1);
console.log(time)
}, 1000);

return () => clearInterval(intervalId);


}, [change]);
const HandleChange = () => {
fetch(‘http://localhost:5000/getquestion’, {
method: “POST”,
headers: {
“content-Type”: “application/json” },
body: JSON.stringify({ answer, testToken, duration, queobjid:
QuestionGen.Questionobjid })
}).then((res) => res.json())

.then(res => {
if (res.message)
{ toast.success(res.message);
navigate(‘/StudentDashboard’);
} else if (res.error)
{ toast.error(res.error);
} else {
setQuestionGen(res.questionStructure);
localStorage.setItem(“currentque”,
JSON.stringify(res.questionStructure.Questionobjid));
setAnswer(‘’);
setChange(!change, () =>
{ setTime(0); // Reset time to 0
}); }

}).catch(error => {

7
console.error(‘Error fetching question:’, error);

7
// Handle error (e.g., display an error message)
});
};
const handleOptionChange = (event) => {
setAnswer(event.target.value);
};

const resetTime = () => {


setTime(0); // Reset time to 0 when Next button is clicked
};
return (
<div className=”back bg-white h-[100vh] font-sans”>
<div className=”b1 h-[300px]”>
<label className=”du”>Duration : {<TestPage sec={duration}
/>}</label> </div>
<div className=”h-[60%] w-[100%] flex justify-center items-center”>
<div className=”b2 h-[500px] w-[60%]”>
<h1 className=”que”>{QuestionGen.Question}</h1>
<div className=”line h-[1px] w-[100%] mt-[80px] bg-black”>
</div> <div> <div className=”op1”>
<label className=”text-black text-3xl”>
<input type=”radio” value={QuestionGen.Distractors[0]}
checked={answer === QuestionGen.Distractors[0]}
onChange={handleOptionChange} className=”ra1” name=”option” />
{QuestionGen.Distractors[0]}
</label> </div> <div className=”op1”>
<label className=”text-black text-3xl”>
<input type=”radio” value={QuestionGen.Distractors[1]}
checked={answer === QuestionGen.Distractors[1]}
onChange={handleOptionChange} className=”ra1” name=”option” />

7
{QuestionGen.Distractors[1]}</label></div>
<div className=”op1”>
<label className=”text-black text-3xl”>
<input type=”radio” value={QuestionGen.Distractors[2]}
checked={answer === QuestionGen.Distractors[2]}
onChange={handleOptionChange}
className=”ra1” name=”option” /> {QuestionGen.Distractors[2]}
</label> </div>
<div className=”op1 cursor-pointer”>

<label className=”text-black text-3xl”>


<input type=”radio” value={QuestionGen.Distractors[3]}
checked={answer === QuestionGen.Distractors[3]}
onChange={handleOptionChange} className=”ra1” name=”option” />
{QuestionGen.Distractors[3]} </label> </div>
<div className=”flex justify-center”> <div className=”next”>
<button onClick={() => { HandleChange();
resetTime();}}>Next</button></div>
</div></div> </div> </div>

</div>)};
export default Mcq;

FACULTY DASHBOARD
import Panel from “../../assets/panel1.png”
import { FiCopy } from ‘react-icons/fi’
const DashBoard = () => {
const Navigate = useNavigate();
const [Loaded, setLoaded] = useState(false)
const [FacultyData, setFacultyData] =
useState(); const [Questions, setQuestions] =

7
useState(); const [copied, setCopied] =
useState(false);

7
useEffect(() => {
let FacultyId = localStorage.getItem(“userId”);
if(FacultyId == null) {
return Navigate(‘/FacultyLogin’); }
console.log(FacultyId)
const Type = “faculty”;
if (FacultyId) {
fetch(‘http://localhost:5000/GetUserData/’ + Type + ‘/’ + FacultyId)

.then(res =>
{ return
res.json();
}).then(res =>
{ console.log(re
s)
setFacultyData(res.FacultyData)
setQuestions(res.questionsData)
setTimeout(() =>
{ console.log(“wait”)
setLoaded(true)
}, 2000)
}) }
else {
Navigate(‘/FacultyLogin’);
} }, [])
const studExamData = (id) =>
{ console.log(id)
localStorage.setItem(‘currentstudid’, id);
Navigate(‘/Data’) }

7
const copyToClipboard = (questionId) =>
{ navigator.clipboard.writeText(questionId);

7
setCopied(questionId);
setTimeout(() =>
{ setCopied(false);
}, 1000); // Reset copied state after 2 seconds

};
return ( <>
{
Loaded ? (
<div className=”dashboard p-0 m-0 w-[100vw] h-[100vh] “>
<Navbar1 /> <div className=”dash ml-[70px] mt-[40px] p-[25px] w-
[90vw] rounded-xl flex “>
<h1 className=”text-white text-3xl”>Publisher DashBoard</h1> </div>
<div className=” absolute w-[100%] p-[50px] h-[100%]”>
<div className=”w-[98%] flex justify-between h-[370px] max-h-[500px]
m-[20px]”>
<div className=”dash basis-[50%] p-[30px] rounded-3xl duration-[0.5s]
text-2xl text-white”>
<div className=”mb-[40px]”>
<h1>Publisher Details</h1> </div> <div className=”text-lg”>
<div className=”s”> <label>Faculty Name :
{FacultyData.faculty_name}</label>
</div> <hr></hr> <div className=”s”>
<label>Faculty Email : {FacultyData.faculty_email}</label>
</div> <hr></hr> <div className=”s”>
<label>Faculty Department : {FacultyData.faculty_dept}</label>
</div> <hr></hr> <div className=”s”>
<label>Faculty Taught : {FacultyData.faculty_taught}</label>
</div> </div></div>
<div className=”dash basis-[45%] p-[30px] rounded-3xl duration-[0.5s]

7
items-center “>
<img src={Panel} className=” h-[400px] w-[500px] ml-[60px] mt-[-
30px]” /> </div> </div>
<div className=”dash h-[380px] my-[70px] rounded-xl p-6 overflow-auto”
style={{ maxHeight: “400px” }}> <div ><div className=”flex”> <div>
<h1 className=”text-2xl text-white mb-4”>Posted
Questions Information</h1> </div> <div>
<Link to=’/Exam’>

<button className=”but ml-[800px] h-[40px] w-[150px] text-white


font-bold rounded”>Create+</button> /Link> </div> </div><br></br>
<div className=”overflow-x-auto”>

{Questions.length > 0 ? (
<table className=”table-auto w-full relative text-white font-bold text-[15px]”>
<thead>
<tr>
<th className=”px-4 py-2”>Test Posted Date</th>
<th className=”px-4 py-2”>Test Ended Date</th>
<th className=”px4 py2”>Duration</th>
<th className=”px4 py2”>Que Count</th>
<th className=”px4 py2”>Question ID</th>
</tr> </thead> <tbody>
{Questions.map((item, index) => (
<tr key={index} id={item.QuestionId} onClick={() =>
studExamData(item.QuestionId)}>
<td className=”border px-4 py-2 hover cursor-
pointer”>{item.StartingTime}</td>
<td className=”border px-4 py-2 hover cursor-
pointer”>{item.EndingTime}</td>

8
<td className=”border px-4 py-2 hover cursor-

8
pointer”>{item.Duration}</td>
<td className=”border px-4 py-2 hover cursor-
pointer”>{item.quecount}</td>
<td className=”border relative px-4 py-2 hover cursor-pointer”>{item.QuestionId}

<button
className=”absolute right-2 top-1/2 transform -translate-y-1/2
bg-transparent border-none focus:outline-none”
onClick={(e) =>
{ e.stopPropagation();
copyToClipboard(item.QuestionId);
}} >

<FiCopy />
</button>
{copied === item.QuestionId && <span className=”text-green-
500 ml-2”>Copied!</span>}
</td> </tr> ))}

</tbody> </table>
):(
<div className=”absolute bottom-[-6%] left-[45%]”>
<p className=”text-3xl”>🥲<span className=”text-center text-
xl”>There is no data</span></p>
</div> )}
</div> </div> </div></div> </div> ) : (
<div className={`flex w-[100%] h-[100vh] justify-center items-
center text-white`} style={{}}>
<div className=”w-[300px] bg-blue-900 h-[100px] rounded-xl flex items-
center justify-center”>
<img src={Images.Loading} alt=”Loading” className=”w-[35px]”

8
/><span className=”ml-[20px] text-xl”>Loading Please Wait</span>

8
</div> </div> )} </>)}
export default DashBoard;
CREATING QUESTION
const Exam = () => {

const [select, setSelect] = useState(null);


const [loaded, setLoaded] = useState(false);
const navigate=useNavigate();
const success = (msg) =>
toast.success(msg) const error = (msg) =>
toast.error(msg) const handleUpload = () =>
{
setLoaded(true);

let FacultyId = localStorage.getItem(‘userId’);


const formData = new FormData();
formData.append(‘file’, select);
formData.append(‘facultyId’, FacultyId);
const startingTime = document.getElementById(‘startingTime’).value;
const endingTime = document.getElementById(‘endingTime’).value;
const duration = document.getElementById(‘duration’).value;
const que_count = document.getElementById(‘que’).value;
formData.append(‘startingTime’, startingTime);
formData.append(‘endingTime’, endingTime);
formData.append(‘duration’, duration);
formData.append(‘que_count’,que_count);
fetch(‘http://localhost:5000/upload’, {
method: ‘POST’,
body: formData
})

8
.then(response => response.json())
.then((res) => {

8
console.log(res);
if(res.message) {
success(res.message)
setLoaded(false)
navigate(‘/PublisherDashboard’)
}

else{
error(res.error)
} })
.catch(error =>
{ console.error(‘Error:’,
error); error(error) });
};
return (
<section>
<div className=”main bg-white h-[100vh]”>
<div className=”m1 h-[100vh] flex justify-center items-center”>
<div className=”m2 bg-slate-300 h-[70%] w-[30%] justify-center
rounded-3xl”> <div className=”head w-[100%]”>
<h1 className=”he text-[35px] text-neutral-700 font-bold text-
center “>Test</h1> </div>
<div className=”m3 text-slate-900”>

<div>
<label className=”lab mt-[30px] ml-[40px] text-[20px] font-
bold”>Input File</label>
<input type=”file” className=”lab mt-[30px] ml-[40px] font-
bold” required onChange={(e) => setSelect(e.target.files[0])} />
</div> <br></br>

8
<label className=”lab mt-[30px] ml-[40px] text-[22px] font-

8
bold”>Starting Time</label>
<input type=”datetime-local” id=”startingTime”
className=”inp h-10 w-half ml-[30px] mt-[30px] font-bold” required
/><br></br>
<label className=”lab mt-[30px] ml-[40px] text-[22px] font-
bold”>Ending Time</label>
<input type=”datetime-local” id=”endingTime”
className=”inp h-10 w-half ml-[40px] mt-[30px] font-bold” required
/><br></br>
<label className=”lab mt-[30px] ml-[40px] text-[22px] font-
bold”>Total Que</label>
<input type=”number” id=”que” className=”inp h-10 w-half
ml-[60px] mt-[30px] font-bold” required /><br></br>
<label className=”lab mt-[30px] ml-[40px] text-[20px] font-
bold”>Duration</label>
<input type=”time” id=”duration” className=”inp h-10 w-
[210px] ml-[70px] mt-[30px] font-bold” required /><br></br>
<button className=”sub1 ml-[180px] font-bold”
onClick={handleUpload} disabled={loaded}>
{loaded ? ‘Uploading…’ : ‘Submit’}
</button> </div> </div></div> </div> </section>
);};
export default Exam;

BACKEND CODE
DASHBOARD
from bson.objectid import ObjectId
@app.route('/GetUserData/<Type>/<id>')
def GetData(Type,id):
print(Type, id)

8
if Type == "faculty":
ids = ObjectId(id)

8
FacultyData = db['faculty'].find_one({"_id": ids}, {"_id":0});
Questions = list(db['questionstiming'].find({"FacultyId":id}, {"_id":0}));
if FacultyData is not None:
return jsonify({"message": "Retrieved Successful", "FacultyData":
FacultyData, "questionsData": Questions});
else:

return jsonify({"error": "Not available"})


elif Type == "studentexamdata":
Studentexam = list(db['studentattended'].find({"QueId": id}, {"_id": 0}));
for s in range(0, len(Studentexam)):
ch = db['studentReg'].find_one({"student_email":
Studentexam[s]['email']})
Studentexam[s]['name'] = ch['student_name'];
Studentexam[s]['dept'] = ch['student_dept'];
print(Studentexam)
return jsonify({ "Studentexam": Studentexam })
else:
ids = ObjectId(id)
Userinfo=db['studentReg'].find_one({"_id":ids},{"_id":0});
Attended = list(db['studentattended'].find({ "email":
Userinfo['student_email'] }, { "_id": 0}))
if Userinfo is not None:
return jsonify({
"message": "Retrieved Successful",
"Userinfo": Userinfo,
"Attended": Attended if Attended else "No Data"
})
else:
return jsonify({"error": "Not Available "})

9
GENERATE QUESTIONS
easy = [];
medium = [];
hard = [];
@app.route('/getquestion', methods=['POST'])
def GenerateNQ():
global Userdata;
data = request.json
testToken = str(data['testToken'])
if testToken == "":
email,password, Id, queid, course =
( str(data['email']),
str(data['pass']),

str(data['Id']),
str(data['queid']),
str(data['Dept'])
)
e = db['studentReg'].find_one({'student_email': email})
realUser = db['studentReg'].find_one({"_id": ObjectId(Id)});
if e is not None:
if str(e['student_email']) != str(realUser['student_email']):
return jsonify({"error": "It not exact user Email"});
if password != e['student_pass']:
return jsonify({"error": "Password incorrect"})
quesid = db['questionstiming'].find_one({"QuestionId": queid})
Questions = list(db['questions'].find({"QuestionID": quesid['QuestionId']},
{"Id": 0}))
for que in Questions:
print(que['Que_Difficulty'])

9
'
Q
u
e
_
D
i
f
f

queid}) i
if c
que['Que_Diffi u
culty'] == l
"easy": t

easy.append(qu y

e) '

elif ]

que['Que_Diffi
=
culty'] ==
=
"medium":
medium.appen
"
d(que)
h
eli
a
f
r
d
q
"
u
:
e
[
h

9
a t
r
d N
. o
a n
p e
p :
e
n T
d o
( k
q e
u n
e
) =
i
f G
e
q n
u e
e r
s a
i t
d e
d
i T
s o
k
n e
o

9
n t
( a
e ;
m
a i
i f
l
) u

userData = s
db['studentattended'].find_one({"email": e
email, "QueId": r
D

U a

s t

e a

r
i
d
s
a
t
N
a
o
n
=
e

u :

s da

e t

r a

D s

a
=

9
u
{ r
s
"
e
e
,
m
a "
i Q
l u
" e
: I
d
e
"
m
:
a
i
q
l
u
,
e
"
i
c
d
o
,
u
r "
s E
e a
" s
: y
"
c
:
o

9
0 "score": 0,
, "percent": 0,
"Medium": 0, "Questionsattented": 0
"Hard": 0,
}
res = db['studentattended'].insert_one(datas)
checkQue =
db['questionstiming'].find_one({"QuestionId":userData['QueId']}, {"quecount":1})
print(int(userData['Questionsattented']) == int(checkQue['quecount']));
if int(userData['Questionsattented']) == int(checkQue['quecount']):
return jsonify({"error": "Already Attended the Test"});

9
QueGen =
RandomQue(medium)
questionStructure = {
"Questionobjid": str(QueGen['_id']),
"Question": QueGen['Question'],
"Distractors": QueGen['Distractors'],
}

return jsonify({"message": "Let's Start the Test", "startTest": Token,


"questionStructure": questionStructure, "duration": quesid['Duration']}), 200
else:

return jsonify({"error": "Invalid Question Id"})


else:
return jsonify({"error": "Invalid email"})
else:
duration, queobjid, answer =
( str(data['duration']),
str(data['queobjid']),

str(data['answer'])
)
if answer == "":
return jsonify({"error": "Enter any answer"})
checkQue =
db['questionstiming'].find_one({"QuestionId":Userdata['QueId']}, {"quecount":1})
UpdateduserData = db['studentattended'].find_one_and_update(
{"_id": Userdata["_id"]},

{"$inc":
{"Questionsattented": 1}
},return_document=True

9
)
QueGen = ChooseCrtQues(

9
user=UpdateduserData
, db=db,
easy=easy,
medium=medium,
hard=hard,
duration=duration,
answer=answer.lower(),
id=queobjid,
score=UpdateduserData['score']

)
if int(checkQue['quecount']) == (UpdateduserData['Questionsattented']):
users = db['studentattended'].find_one({"_id": Userdata["_id"]})
easyattent, mediumattent, hardattent = users['Easy'] * 4, users['Medium'] *
7, users['Hard'] * 10

per = f"{(users['score'] / (easyattent + mediumattent + hardattent)) *


100
:.2f}"
up = db['studentattended'].find_one_and_update({"_id": Userdata['_id']},
{"$set": {"percent": per}}, return_document=True);
easy.clear()
medium.clear()
hard.clear()
print(len(easy),len(medium), len(hard));
return jsonify({"message": "Completed"});
questionStructure =
{ "Questionobjid":
str(QueGen['_id']), "Question":
QueGen['Question'],
"Distractors": QueGen['Distractors'], }

9
return jsonify({"questionStructure": questionStructure})

1
REFERENCES

[1] T. Goto, T. Kojiri, T. Watanabe, T. Iwata, and T. Yamada, “Automatic


generation system of multiple-choice cloze questions and its evaluation,” Knowl.
Manage. E-Learn. Int. J., vol. 2, no. 3, pp. 210–224, 2010.
[2] A. Hoshino and H. Nakagawa, “Assisting cloze test making with a web
application,” Technol. Teacher Educ. Annu., vol. 18, no. 5, pp. 2807– 2814, 2007.
[3] R. Mitkov, L. A. Ha, A. Varga, and L. Rello, “Semantic similarity of dis-
tractors in multiple-choice tests: Extrinsic evaluation,” in Proc. Work- shop
Geometrical Models Natural Lang. Semantics, 2009, pp. 49–56.
[4] I. Aldabe, M. Maritxalar, and E. Martinez, “Evaluating and improving the
distractor-generating heuristics,” in Proc. Workshop NLP Educ. Resour., 2007,
pp. 7–13.
[5] C. Liang, Y. Xiao, D. Neisarg, W. Drew, P. Bartl, and G. C. Lee, “Distractor
generation for multiple choice questions using learning to rank,” in Proc. 13th
Workshop Innov. Use NLP Building Educ. Appl., 2018, pp. 284–290.
[6] T. Barnickel, J. Weston, R. Collobert, H.-W. Mewes, and V. Stumpflen,
“Large scale application of neural network based semantic role labeling for
automated relation extraction from biomedical texts,” PLoS One, vol. 4, no. 7,
2009, Art. no. e6393.
[7] Y. Liu, C. Sun, L. Lin, X. Wang, and Y. Zhao, “Computing semantic text
similarity using rich features,” in Proc. 29th Pacific Asia Conf. Lang. Inf.
Computation, 2015, pp. 44–52.
[8] L. Meng, R. Huang, and J. Gu, “A review of semantic similarity meas- ures in
WordNet,” Int. J. Hybrid Inf. Technol., vol. 6, no. 1, pp. 1–12, 2013.
[9] M. Abadi et al., “TensorFlow: A system for large-scale machine learning,” in
Proc. 12th USENIX Conf. Oper. Syst. Implementation, 2016,
[10] T. E. Payne and T. E. Payne, Describing Morphosyntax: A Guide for Field
Linguists. Cambridge, U.K.: Cambridge Univ. Press, 1997.

1
[11] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural
Compute. vol. 9, no. 8, pp. 1735–1780, 1997.
[12] A. S. Bhatia, M. Kirti, and S. K. Saha, “Automatic generation of multi- ple
choice questions using Wikipedia,” in Proc. Int. Conf. Pattern Rec- ognit. Mach.
Intell., 2013, pp. 733–738.
[13] Santhanavijayan, S. Balasundaram, S. H. Narayanan, S. V. Kumar, and V.
V. Prasad, “Automatic generation of multiple choice questions for e-assessment,”
Int.
J. Signal Imag. Syst. Eng., vol. 10, no. 1/2, pp. 54–62, 2017.

[14] A. Conneau, D. Kiela, H. Schwenk, L. Barrault, A. Bordes, “Supervised


learning of universal sentence representations from natural language inference
data,” in Proc. Conf. Emp. Methods Natural Lang. Process.,

You might also like