<div class="sideCnt"> <div class="sideData"> <div class="sideDataType">Current Rank : <span class="sideDataValue"><?php echo $rank = Proquiz::getRank($db, $_SESSION['STATS']['DETAILS']['percentage'], $_SESSION['STATS']['DETAILS']['time_used'] / $_SESSION['STATS']['DETAILS']['total_qstn']); ?> </span></div> </div> <div class="sideData"> <div class="sideDataType">Percentage : <span class="sideDataValue"><?php echo $_SESSION['STATS']['DETAILS']['percentage']; ?> %</span></div> </div> <div class="sideData"> <div class="sideDataType">Current Percentile : <span class="sideDataValue"><?php echo Proquiz::getPercentile($rank); ?> </span></div> </div> <div class="sideData"> <div class="sideDataType">Total Question : <span class="sideDataValue"><?php echo $_SESSION['STATS']['DETAILS']['total_qstn']; ?> </span></div> </div> <div class="sideData"> <div class="sideDataType">Total Correct Answers : <span class="sideDataValue"><?php echo $_SESSION['STATS']['DETAILS']['total_correct']; ?> </span></div> </div>
function getRank($db, $p, $avg_time) { //(database,persentage,average time / question) $sql = "SELECT `percentage` FROM " . QUIZDB . " WHERE `created_by` = 'system' ORDER BY `percentage` DESC"; $per = $db->query($sql); $rank = 0; $offset = 0; Proquiz::$total_cont = mysql_num_rows($per); while ($per_s = $db->fetch_array($per)) { if ($p == $per_s['percentage']) { $offset = Proquiz::getRankOffset($db, $p, $avg_time); break; } $rank++; } return $rank + $offset + 1; }
include_once 'mail/class.phpmailer.php'; include_once 'upload.class.php'; // include modules foreach ($modules as $mod) { include_once $mod; } // include results modules foreach ($modulesR as $mod) { include_once $mod; } // create the $db object $db = new Database(DB_SERVER, DB_USER, DB_PASS, DB_DATABASE); //connect to the server $db->connect(); //Create Quiz Object $pq = new Proquiz(); // Mail Class $mail = new PHPMailer(); // create login object $auth = new userAuth(TABLE_USERS, true); if (isset($_POST['action']) || isset($_GET['action'])) { // Login Init With Captcha if ($_POST['action'] == 'login') { if ($_SESSION['LCNT'] >= 5) { if ($auth->checkCaptcha($_POST['captcha_code'])) { loginBase($auth, $db); } else { $_SESSION['ERROR']['type'] = 'Error'; $_SESSION['ERROR']['reason'] = "Entered Captcha is Incorrect , Please Try Again."; } } else {