0

how we can match the ans with database ans in online test and score wil be increment if the ans is correct

4
Contributors
4
Replies
42
Views
4 Years
Discussion Span
Last Post by krishnadaspc
0
You can get the user submitted value by $_POST['value']. Here value refers to the name of the form element. Then compare it with the corresponding database element. If a match is found then increment the count by one.
for ex:
<?php

$value=$_POST['value'];

$query="SELECT answer FROM table_name";//select appropriates filed names in the database
$result=mysql_query($query);
while(mysql_fetch_row($result))
{
if($row['answer']==$value)
{
$count++;
}
}
?>

Edited by krishnadaspc: correction needed.

0

if you have any knowledge about cyrptography then please use md5 hashing to improve security

0

how we can match the ans with database ans in online test and score wil be increment if the ans is correct

Show your code so far, otherwise we'd just be guessing and spend precious time offering suggestions that do not match your needs.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.