В целях подготовки онлайн-экзамена я должен показать, сдан ли экзамен пользователю или нет. Итак, как отобразить мою фиктивную кнопку с именем completed
после завершения экзамена. но после прохождения второго теста он также показывает кнопку запуска для завершения экзамена, а не показывает завершенный.
Это код:
<?php
session_start();
extract($_POST);
extract($_GET);
extract($_SESSION);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Online Quiz - Quiz List</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="quiz.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/bootstrap.min.css"/>
<style type="text/css">
#start{
float: right;
margin: 0 auto;
padding:5px 10px;
border: 2px solid black;
background-color: white;
font-size: 16px;
cursor: pointer;
border-color: #4CAF50;
color: green;
position:relative;
display: inline-block;
}
#completed{
float: right;
margin: 0 auto;
padding:5px 10px;
border: 2px solid black;
background-color: #4CAF50;
font-size: 16px;
cursor: pointer;
border-color: #4CAF50;
color: white;
position:relative;
display: inline-block;
}
</style>
</head>
<body>
<?php
include("header.php");
include("database.php");
echo "<h1 class='text-center bg-danger'>Select Subject to Give Quiz</h1>";
$rs=mysqli_query($con,"select * from mst_subject where sub_name='Quant'");
echo "<table class='table table-striped'>";
// Quant button
while($row=mysqli_fetch_row($rs))
{
echo "<tr>
<td align=left >
<font size=4 style='padding-left:340px; margin:0 auto;'>$row[1]</font>";
?><?php
if(($used_type==$row[1])||($used_type==$row[1]&&$time=='timeup'))
{
echo "<input type='button' id='completed' value='Completed'/>";
}
else {
echo "<a href=quiz.php?subid=$row[0]&type=$row[1]><input type='button' id='start' value='Start'/></a>";
}
}
//Verbal Button
$rs=mysqli_query($con,"select * from mst_subject where sub_name='Verbal'");
while($row=mysqli_fetch_row($rs))
{
echo "<tr>
<td align=left >
<font size=4 style='padding-left:340px; margin:0 auto;'>$row[1]</font>";
?><?php
if(($used_type==$row[1])||($used_type==$row[1]&&$time=='timeup'))
{
echo "<input type='button' id='completed' value='Completed'/>";
}
else {
echo "<a href=quiz.php?subid=$row[0]&type=$row[1]><input type='button' id='start' value='Start'/></a>";
}
}
//Reasoning Button
$rs=mysqli_query($con,"select * from mst_subject where sub_name='Reasoning'");
while($row=mysqli_fetch_row($rs))
{
echo "<tr>
<td align=left >
<font size=4 style='padding-left:340px; margin:0 auto;'>$row[1]</font>";
?><?php
if(($used_type==$row[1])||($used_type==$row[1]&&$time=='timeup'))
{
echo "<input type='button' id='completed' value='Completed'/>";
}
else {
echo "<a href=quiz.php?subid=$row[0]&type=$row[1]><input type='button' id='start' value='Start'/></a>";
}
}
//Programming Button
$rs=mysqli_query($con,"select * from mst_subject where sub_name='Programming'");
while($row=mysqli_fetch_row($rs))
{
echo "<tr>
<td align=left >
<font size=4 style='padding-left:340px; margin:0 auto;'>$row[1]</font>";
?><?php
if(($used_type==$row[1])||($used_type==$row[1]&&$time=='timeup'))
{
echo "<input type='button' id='completed' value='Completed'/>";
}
else {
echo "<a href=quiz.php?subid=$row[0]&type=$row[1]><input type='button' id='start' value='Start'/></a>";
}
}
echo "</table>"
?>
</body>
</html>
здесь used_type
переменная возвращается к этому файл после завершения экзамена (он содержит данные Quant, Verbal, Reasoning, Programming) и переменную time
из таймера, когда время истекло, он пропускает строку в качестве индикатора того, что время истекло, и отображает завершенную кнопку.
Это мое представление о выборе экзамена, в котором у меня возникли проблемы:
