You are on page 1of 10

Page |0

DATE : __/__/____

$$ DAA Lab Project $$


----------------------------------------------------------------------------------------------------------------------------------------------

 Name : DASARI TARUN


 Registration No : 16331A0539
 Email-id : dasaritharun7@gmail.com
 Contact No : 8317643091
 Duration Of The Project:

Design and Analysis of Algorithms 16331A0539


Page |1
DATE : __/__/____

ONLINE QUIZ
 PROBLEM STATEMENT:
 To develop an Online Quiz system by implementing DAA concepts.

 ABSTRACT:
 It is good source of interactivities among students and between the teacher and students. It is
done in order to improve student‘s comprehension levels and learning motivation. As one
of their tools, online test tools are quite effective. However, in order to use the online test
tool, a teacher is generally required a great deal of labor.

 For example, a teacher needs to create quizzes and input them in the online test tool
.
 In order to solve these problems, we have developed a Web-based online test system which
can create quizzes competitively and collaboratively by students for the purpose of reducing
the load required for a teacher and promoting interactions among students and between the
teacher and students.

 INTRODUCTION:

 ABOUT THE PROJECT


 The ONLINE QUIZ is a web application for to take online test in an efficient manner and no time wasting for
checking the paper. The main objective of ONLINE QUIZ is to efficiently evaluate the candidate thoroughly
through a fully automated system that not only saves lot of time but also gives fast results. For students they
give papers according to their convenience and time and there is no need of using extra thing like paper, pen
etc. This can be used in educational institutions as well as in corporate world. Can be used anywhere any time
as it is a web based application(user location doesn’t matter). No restriction that examiner has to be present
when the candidate takes the test.
 It is good source of interactivities among students and between the teacher and students. It is done in order to
improve student‘s comprehension levels and learning motivation . As one of their tools, online test tools are
quite effective. However, in order to use the online test tool, a teacher is generally required a great deal of
labor.
 For example, a teacher needs to create quizzes and input them in the online test tool.
 In order to solve these problems, we have developed a Web-based online test system which can create quizzes
competitively and collaboratively by students for the purpose of reducing the load required for a teacher and
promoting interactions among students and between the teacher and students.

Design and Analysis of Algorithms 16331A0539


Page |2
DATE : __/__/____
 RULES:
 Here are the ten rules :
 Rule #1: Test comprehension and critical thinking, not just recall
Multiple choice questions are criticized for testing the superficial recall of knowledge. You can go beyond this by
asking learners to interpret facts, evaluate situations, explain cause and effect, make inferences, and predict
results.

 Rule #2: Use simple sentence structure and precise wording


Write test questions in a simple structure that is easy to understand. And try to be as accurate as possible in your
word choices. Words can have many meanings depending on colloquial usage and context.

 Rule #3: Place most of the words in the question stem


If you’re using a question stem, rather than an entire question, ensure that most of the words are in the stem.
This way, the answer options can be short, making them less confusing and more legible.

 Rule #4: Make all distracters plausible


All of the wrong answer choices should be completely reasonable. This can be very hard to accomplish, but avoid
throwing in those give-away distracters as it detracts from the test’s validity. If you’re really stuck, get help from
your friendly SME. (BTW, this word can also be spelled as “distracter.”)

 Rule #5: Keep all answer choices the same length


This can be difficult to achieve, but expert test-takers can use answer length as a hint to the correct answer. Often
the longest answer is the correct one. When I can’t get all four answers to the same length, I use two short and
two long.

 Rule #6: Avoid double negatives


No big news here, right? Don’t use combinations of these words in the same question: not, no, nor, the -un prefix,
etc. For example, this type of question could confuse test-takers: ‘Which of the following comments would NOT
be unwelcome in a work situation?’ Flip it around and write it in the positive form: ‘Which of the following
comments are acceptable in a work situation?’

 Rule #7: Mix up the order of the correct answers


Make sure that most of your correct answers aren’t in the “b” and “c” positions, which can often happen. Keep
correct answers in random positions and don’t let them fall into a pattern that can be detected. When your test is
written, go through and reorder where the correct answers are placed, if necessary.

 Rule #8: Keep the number of options consistent


Did you ever have to convince a SME that he or she can’t have answer choices that go to ‘h’ in one question and
‘c’ in the next? It’s something of a user interface issue. Making the number of options consistent from question to
question helps learners know what to expect. Research doesn’t seem to agree on whether 3 or 4 or 5 options is
best. Personally, I like to use 4 options. It feels fair.

 Rule #9: Avoid tricking test-takers


As faulty as they are, tests exist to measure knowledge. Never use questions or answer options that could trick a
learner. If a question or its options can be interpreted in two ways or if the difference between options is too
subtle, then find a way to rewrite it.

Design and Analysis of Algorithms 16331A0539


Page |3
DATE : __/__/____
 Rule #10: Use ‘All of the Above’ and ‘None of the Above’ with caution
I hate this rule because when you run out of distracters, all of the Above and None of the Above can come in
handy. But they may not promote good instruction. Here’s why. All of the above can be an obvious give-away
answer when it’s not used consistently. Also, the All of the above option can encourage guessing if the learner
thinks one or two answers are correct. In addition, the downside to none of the above is that you can’t tell if the
learner really knew the correct answer.

 ALGORITHMS USED IN THE PROJECT:


i. Arrays(in PHP)
ii. Binary Search
iii. Merge Sort
iv. 0/1 Knapsack problem (Dynamic Programming)

 PSEUDO CODE:
 How to retrieve Database values into an Array in PHP?
Here is the answer for it…

 Store1.php :
<?php

// 1. Enter Database details

$dbhost = 'localhost';

$dbuser = 'tarun';

$dbpass =' ';

$dbname = 'quizdbase';

// 2. Create a database connection

$connection = mysql_connect($dbhost,$dbuser,$dbpass);

if (!$connection) {

die("Database connection failed: " . mysql_error());

// 3. Select a database to use

$db_select = mysql_select_db($dbname,$connection);

if (!$db_select) {

die("Database selection failed: " . mysql_error());

Design and Analysis of Algorithms 16331A0539


Page |4
DATE : __/__/____
}

$query = mysql_query("SELECT * FROM user WHERE name = 'TARUN' ");

while ($rows = mysql_fetch_array($query)) {

$uid = $rows['Uid'];

$username = $rows['Username'];

$totalques= $rows['Totalques'];

$answerscorrect= $rows['Answerscorrect'];

echo "$uid<br>$username<br>$totalques<br>$answerscorrect<br><br>";

?>

 Pseudo code of Merge Sort algorithm can be written as follows:

PROCEDURE function mergeSort

FOR each element of the master list indexed by i

if ( i <= 1 ) return a

var left = a[0] to a[i/2]

var right = a[i/2+1] to a[i]

left = mergeSort( left )

right = mergeSort( right )

return merge( left,right )

END FOR

END PROCEDURE

PROCEDURE function mergeSort

WHILE length(left) > 0 and length(right) > 0

if first(left) < first(right)

append first(left) to result

left = rest(left)

else

append first(right) to result

Design and Analysis of Algorithms 16331A0539


Page |5
DATE : __/__/____
right = rest(right)

IF length(left) > 0

append left to result

END IF

IF length(right) > 0

append right to result

END IF

return result

END PROCEDURE

 Pseudo code of Binary Search algorithm can be written as follows:


function binarySearch(a, value, left, right)

if right < left

return not found

mid := floor((right-left)/2)+left

if a[mid] = value

return mid

if value < a[mid]

return binarySearch(a, value, left, mid-1)

else

return binarySearch(a, value, mid+1, right)

 Pseudo code for Printing Items in 0/1 knapsack can be written as follows:

<?php
// PHP code for Dynamic Programming based
// solution for 0-1 Knapsack problem
// Prints the items which are kept in
// a knapsack of capacity W
function printknapSack($W, &$wt, &$val, $n)
{
$K = array_fill(0, $n + 1,
array_fill(0, $W + 1, NULL));
// Build table K[][] in bottom up manner

Design and Analysis of Algorithms 16331A0539


Page |6
DATE : __/__/____
for ($i = 0; $i <= $n; $i++) {

for ($w = 0; $w <= $W; $w++)


{
if ($i == 0 || $w == 0)
$K[$i][$w] = 0;
else if ($wt[$i - 1] <= $w)
$K[$i][$w] = max($val[$i - 1] +
$K[$i - 1][$w - $wt[$i - 1]],
$K[$i - 1][$w]);
else
$K[$i][$w] = $K[$i - 1][$w];
}
}
// stores the result of Knapsack
$res = $K[$n][$W];
echo $res . "\n" ;
echo"<br><br><br>";
$w = $W;
for ($i = $n; $i > 0 && $res > 0; $i--)
{
// either the result comes from the top
// (K[i-1][w]) or from (val[i-1] + K[i-1]
// [w-wt[i-1]]) as in Knapsack table. If
// it comes from the latter one/ it means
// the item is included.
if ($res == $K[$i - 1][$w])
continue;
else
{
// This item is included.
echo $wt[$i - 1] . " ";
// Since this weight is included
// its value is deducted
$res = $res - $val[$i - 1];

$w = $w - $wt[$i - 1];
}
}
}
// Driver code
$val = array(60, 100, 120);
$wt = array(10, 20, 30);
$W = 50;
$n = sizeof($val);
echo"<br>";
printknapSack($W, $wt, $val, $n); ?>
//////////////////////////////////////////// THE END //////////////////////////////////////////////////

Design and Analysis of Algorithms 16331A0539


Page |7
DATE : __/__/____
 INPUT:-
 INPUT’s FROM DATABASE TO Knapsack.php :

Design and Analysis of Algorithms 16331A0539


Page |8
DATE : __/__/____
 INPUT FOR msort.php :

 INPUT FOR binarysearch.php :

 INPUT FOR knapsacknew.php :

 OUTPUT:
 OUTPUT FOR msort.php :

Design and Analysis of Algorithms 16331A0539


Page |9
DATE : __/__/____
 OUTPUT FOR binarysearch.php :

 OUTPUT FOR knapsacknew.php :

 CONCLUSION:

 WORK DONE:
 The project was successfully designed and is tested for accuracy and quality.
 During this project I have accomplished all the objectives and this project meets the needs of the
organization .
 The developed will be used in searching , retrieving and generating information
for the concerned requests.

 GOALS :

 Reduced entry work.


 Easy retrieval of information
 Reduced errors due to human intervention
 Portable and flexible for further enhancement
 Web enabled.
 Fast finding of information requested

Design and Analysis of Algorithms 16331A0539

You might also like