<?php
include("db.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Paper</title>
<style type="text/css">
<!--
body {
	font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
	margin: 0;
	padding: 0;
	color: #000;
}
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
	padding: 0;
	margin: 0;
}
h1, h2, h3, h4, h5, h6, p {
	margin-top: 0;	 /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
	padding-right: 15px;
	padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
}
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
	border: none;
}
a:link {
	color: #414958;
	text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
}
a:visited {
	color: #4E5869;
	text-decoration: underline;
}
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
	text-decoration: none;
}
.container {
	width: 80%;
	max-width: 1260px;/* a max-width may be desirable to keep this layout from getting too wide on a large monitor. This keeps line length more readable. IE6 does not respect this declaration. */
	min-width: 780px;/* a min-width may be desirable to keep this layout from getting too narrow. This keeps line length more readable in the side columns. IE6 does not respect this declaration. */
	background-color: #FFF;
	margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout. It is not needed if you set the .container's width to 100%. */
	border: 1px solid #000;
}
.header {
	background-color: #6F7D94;
}
.content {
	padding: 10px 0;
	width: 100%;
	float: right;
}
.main {
	width: auto;
	border: #000 1px solid;
	height: 60%;
	overflow: scroll;
}
.headings {
	background: #6F7D94;
	color: #FFF;
	padding: 1%;
}
.resultfield {
	padding: 10px;
	width: 250px !important;
	display: inline-block;
}
.resulthead {
	text-align: center;
}
.resultvalue {
	padding: 10px;
}
.noseries {
	width: 5%;
	display: inline-block;
}
.papername {
}
.content ul, .content ol {
	padding: 0 15px 15px 40px; /* this padding mirrors the right padding in the headings and paragraph rule above. Padding was placed on the bottom for space between other elements on the lists and on the left to create the indention. These may be adjusted as you wish. */
}
ul.nav {
	list-style: none; /* this removes the list marker */
	border-top: 1px solid #666; /* this creates the top border for the links - all others are placed using a bottom border on the LI */
	margin-bottom: 15px; /* this creates the space between the navigation on the content below */
}
ul.nav li {
	border-bottom: 1px solid #666; /* this creates the button separation */
}
ul.nav a, ul.nav a:visited { /* grouping these selectors makes sure that your links retain their button look even after being visited */
	padding: 5px 5px 5px 15px;
	display: block; /* this gives the link block properties causing it to fill the whole LI containing it. This causes the entire area to react to a mouse click. */
	text-decoration: none;
	background-color: #8090AB;
	color: #000;
}
ul.nav a:hover, ul.nav a:active, ul.nav a:focus { /* this changes the background and text color for both mouse and keyboard navigators */
	background-color: #6F7D94;
	color: #FFF;
}
.footer {
	padding: 10px 0;
	background-color: #6F7D94;
	position: relative;/* this gives IE6 hasLayout to properly clear */
	clear: both; /* this clear property forces the .container to understand where the columns end and contain them */
}
.fltrt {  /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
	float: right;
	margin-left: 8px;
}
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
	float: left;
	margin-right: 8px;
}
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the #footer is removed or taken out of the #container */
	clear: both;
	height: 0;
	font-size: 1px;
	line-height: 0px;
}
-->
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<style>
.qus{display:none}
.active{display:block}
body {
  -webkit-user-select: none;
     -moz-user-select: -moz-none;
      -ms-user-select: none;
          user-select: none;
}
.abc{
	display:inline-block;
}
.question{
background-color:#EEEEEE;
  display:block;
  padding:5px;
}
#qus li{
border:1px solid #CCCCCC;
  padding-bottom:15px;
  list-style:none;margin-bottom: 15px;
}
#no li{list-style:none;display:block; cursor:pointer; border-bottom:1px solid #ccc;
    padding: 5px;
    box-shadow: inset 0 0 12px #4E5869;}
#no li:hover{
	box-shadow: inset 0 0 0px #4E5869;
}
a.btn {
    border-radius: 3px;
    text-decoration: none;
    border: 1px solid #ccc;
    padding: 5px;
    display: block;
    text-align: center;
    margin: 5px;
}
a#btn:hover{
    box-shadow: inset 0 0 12px #4E5869;
}
</style>
</head>
<style>
.optionspan{
 display:block;
}
.questionspan{
 display:block; width:15px; height:15px; float:left; margin:2px; border-radius:50%; text-align:center; color:#fff; font-size:10px;
}
</style>
<body>
<?php // echo $odt ?>
<span id="counttime"></span>
<div style="background-color:#FFF;color:#F00"> </div>
<div class="container">
  <div class="header"> <span style="display:inline-block" > <a href="#"><img src="<?php echo $LinksDetails["logo"] ?>" alt="Insert Logo Here" name="Insert_logo" height="90" id="Insert_logo" style="background-color: #8090AB; display:block;" /></a> </span> <a style="display:inline-block;background-color: beige;float: right;padding: 5px;margin: 15px;border: solid burlywood;" id="colpleteDetail"  href="<?php echo URL_ROOT ?>result.php" onclick="window.close();">Exit </a> 
    
    <!-- end .header --> 
  </div>
  <div class="content">
    <?php 	
  if($_REQUEST['pid']>0 )
  {

$papername=papername($_REQUEST['pid']);
	
$PPRDETAIL=$objindex->get_paper_detail($_GET['pid']);
	
	
//echo "<pre>";print_r($result);

?>
    <div style="width:100%;">
      <div>
        <h3 class="resulthead">Paper</h3>
      </div>
      <div>
        <label class="resultfield">Paper Name</label>
        <label class="resultvalue"><?php echo $papername;?></label>
      </div>
      <div>
        <label class="resultfield">Total Questions</label>
        <label class="resultvalue"><?php echo $PPRDETAIL['totalqus'];?></label>
      </div>
      <div>
        <label class="resultfield">Total Marks</label>
        <label class="resultvalue"><?php echo $PPRDETAIL['marks'];?></label>
      </div>
      <div>
        <label class="resultfield"> Marking scheme</label>
        <label class="resultvalue">
          <?php 
if($PPRDETAIL['marking_scheme']=='0')		  
{
echo "Normal";
}elseif($PPRDETAIL['marking_scheme']=='1')		  
{
echo "Negative(1/2)";
}else{ 
echo "Negative(1/4)"; 
}
?>
        </label>
      </div>

     
    </div>
    
    <div class="content" id="mygivenPaper" >
      <hr/><ul id="qus">
        <?php 
	$j=0; 
	$ques=$objindex->get_ques($_REQUEST['pid']);
//	echo "<pre>";print_r($ques);exit;
	 foreach($ques as $q)
		{$j++;
		
		?>
        <li class="qus active" id="test<?php echo $j;?>"> <span class="question"><?php echo unPOST($q['question']); ?></span> <br>
          <?php
        foreach($q["options"] as $option){
		?>
          <?php 

$ab=$q["qid"]."||".$ans_arr[$k]."||".$_REQUEST['id']."||".$_SESSION['user']['uid'] ;

?>
          <span class="optionspan">
          <input type="radio" value="<?php echo $ans_arr[$k];?>" onchange="asssignVal('<?php echo $ab;?>','<?php echo $j;?>')" name="radio||<?php echo $j."||".$q["qid"]; ?>" />
          <?php echo unPOST($option);
		?> </span>
          <?php
		$k++;
		}
		
$k=0;		
		?>
        <hr/>
        Correct Answer: <?php echo unPOST($q["answer"]) ?><br />
        </li>
        <?php				
		} 
	 
	  ?>
      </ul>
    </div>
    <?php	
  }
  ?>
  </div>
  <div class="footer"> 
    
    <!-- end .footer --> 
  </div>
  
  <!-- end .container --> 
</div>
</body>
</html>