PageRenderTime 41ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/ans_code_response.php

https://bitbucket.org/krishna2793/aces
PHP | 138 lines | 111 code | 27 blank | 0 comment | 4 complexity | 3c74016f1b9a95deeeeff52c55b10885 MD5 | raw file
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>ACES : HOME</title>
  5. <!-- Include the bootstrap stylesheets -->
  6. <link rel="stylesheet" href="bootstrapnew.css"/>
  7. </head>
  8. <body>
  9. <!-- Navbar
  10. ================================================== -->
  11. <div class="navbar navbar-fixed-top">
  12. <div class="navbar-inner">
  13. <div class="container">
  14. <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
  15. <span class="icon-bar"></span>
  16. <span class="icon-bar"></span>
  17. <span class="icon-bar"></span>
  18. </a>
  19. <a class="brand" href="http://www.amrita.edu/">AMRITA</a>
  20. <div class="nav-collapse" id="main-menu">
  21. <ul class="drop" id="main-menu-left">
  22. <li><a onclick="pageTracker._link(this.href); return false;" href="http://news.bootswatch.com">News</a></li>
  23. <li class="dropdown" id="score-menu">
  24. <a class="dropdown-toggle" data-toggle="" href="#">View Scores<b class="caret"></b></a>
  25. <ul id="take_test" class="dropdown-toggle" >
  26. <li><a href="/code_score.php">Code</a></li>
  27. <li><a href="/stu_score.php">MCQs</a></li>
  28. <li><a href="/query_score.php">Query</a></li>
  29. </ul>
  30. </li>
  31. <li class="dropdown" id="test-menu">
  32. <a class="dropdown-toggle" data-toggle="" href="#">Test Offered <b class="caret"></b></a>
  33. <ul id="take_test" class="dropdown-toggle" >
  34. <li><a href="/take_test_code.php">Test Code</a></li>
  35. <li><a href="/select_test.php">MCQs</a></li>
  36. <li><a href="/take_test_sql.php">Test Query</a></li>
  37. </ul>
  38. </li>
  39. </ul>
  40. </li>
  41. </ul>
  42. <ul class="nav pull-right" id="main-menu-right">
  43. <li><a rel="tooltip" href="#"><?php echo date("d.m.Y") ;?> <i class="icon-share-alt"></i></a></li>
  44. <li><a rel="tooltip" href="#">Welcome<?php echo $_SESSION['name'] ;?> <i class="icon-share-alt"></i></a></li>
  45. <li><a rel="tooltip" href="/logout_stu.php">Logout <i class="icon-share-alt"></i></a></li>
  46. </ul>
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="container">
  52. <div class="container">
  53. <p> </p>
  54. <h1 style="font-size:46px" align="center" >&nbsp;</h1>
  55. <h1 style="font-size:46px" align="center" >&nbsp;</h1>
  56. <h1 style="font-size:46px" align="center" >ACES</h1>
  57. <h4 align="center"> Automated Code Evaluation System</h4>
  58. <p></p>
  59. <h6 align="left">AMRITA SCHOOL OF ENGINEERING</h6>
  60. <h6 align="left" >COIMBATORE <small></h6>
  61. <!-- Forms
  62. ================================================== -->
  63. <section id="forms">
  64. <div class="page-header">
  65. <h1>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Tests Available</h1>
  66. </div>
  67. <div class="row">
  68. <div class="span10 offset1">
  69. <form class="form-horizontal well" action="ans_code.php" method="post" enctype="multipart/form-data">
  70. <?php session_start();
  71. $con = mysql_connect('localhost','root','mysql');
  72. if (!$con)
  73. {
  74. die('Could not connect: ' . mysql_error());
  75. }
  76. mysql_select_db("aces", $con) or die('db con faild');
  77. if(isset($_POST['submit']))
  78. {
  79. include 'f_resp1_bk.php';
  80. if(($_SESSION['iter']+1)==$_SESSION['no_of_ques'])
  81. {
  82. $scores_fetch=mysql_query("select score from each_prob_score where test_id='$_SESSION[test_id]' and stu_id='$_SESSION[user_id]'");
  83. while($score = mysql_fetch_array ($scores_fetch))
  84. {
  85. $score_avg += $score['score'];
  86. }
  87. $score_avg = $score_avg/$_SESSION['no_of_ques'];
  88. mysql_query("update user_gradebook_code set score_percentage='$score_avg' where test_id='$_SESSION[test_id]' and stu_id='$_SESSION[user_id]' ");
  89. }
  90. }
  91. if(($_SESSION['iter']+1)<$_SESSION['no_of_ques'])
  92. {
  93. echo '
  94. <input type="submit" class="btn" name="next" value="Next" />';
  95. }
  96. ?>
  97. </form>
  98. </div>
  99. </div>
  100. </section>
  101. <!-- Footer
  102. ================================================== -->
  103. <hr>
  104. <footer id="footer">
  105. <p class="pull-right"><a href="boot.html">Back to top</a></p>
  106. <div class="links"></div>
  107. Made by <a href="http://www.amrita.edu">Amrita</a>. Contact him <a href="mailto:amrita.edu">hello@admin_asec</a>.<br/>
  108. Based on <a target="_blank" href="http://twitter.github.com/bootstrap/">Bootstrap</a>. Icons from <a target="_blank" href="http://glyphicons.com/">Glyphicons</a>. Web fonts from <a target="_blank" href="http://www.google.com/webfonts">Google</a>.</p>
  109. </footer>
  110. </body>
  111. </html>