//---------------------------------------------------------------------------------------------- // Gimme libraries //require_once("../../config.php"); //require_once('includes/rlsmart/header.php'); //require_once('userviews_class.php'); // WORKAROUND: For the moodle module to work if (strlen($_GET['id'])) { $_GET['share_id'] = $_GET['id']; } // WORKAROUND: To avoid PHP warnings $_GET['mb_id'] = ''; $_GET['view'] = 'learner'; // Gimme user id //$mysql = new mysqlquery ( ) ; $userViewCountRating = new userviews(); $user_id = $userViewCountRating->getMemberId($_SESSION['USER']->id, $_GET['mb_id'], $_GET['view']); $rateArray = array(); $doneArray = array(); foreach ($idArray as $value) { mysql_select_db($CFG->dbname, $smart); // Gimme each success criteria $query_rs_success = "SELECT {$_SESSION['RealS_prefix']}webcells.*, {$_SESSION['RealS_prefix']}items.item_id, {$_SESSION['RealS_prefix']}rafl.*\r\n\t\t FROM {$_SESSION['RealS_prefix']}rafl\r\n\t\t INNER JOIN {$_SESSION['RealS_prefix']}items ON {$_SESSION['RealS_prefix']}rafl.rafl_item = {$_SESSION['RealS_prefix']}items.item_id\r\n\t\t INNER JOIN {$_SESSION['RealS_prefix']}webcells ON {$_SESSION['RealS_prefix']}items.item_webcell = {$_SESSION['RealS_prefix']}webcells.webcell_id\r\n\t\t WHERE item_parent_item = " . $value . "\r\n\t\t ORDER BY rafl_order ASC"; $rs_success = mysql_query($query_rs_success, $smart) or die(mysql_error()); $row_rs_success = mysql_fetch_assoc($rs_success); $totalRows_rs_success = mysql_num_rows($rs_success); $rateTotal = 0; $ratecount = 0; $done = 0; $doneTotal = 0; if ($totalRows_rs_success > 0) { do {
} echo '</th>'; echo '<th class="progress">PROGRESS</th>'; } ?> </tr> <?php // Show ALL success criteria of a task when being clicked into foreach ($successes as $success) { // WORKAROUND: To avoid PHP warnings $_GET['mb_id'] = ''; $_GET['view'] = 'learner'; // Gimme user id $userview = new userviews(); $member = $userview->getMemberId($_SESSION['USER']->id, $_GET['mb_id'], $_GET['view']); // Gimme ALL the members ratings for each success criteria in this share (cos filter the right member later in the loop) //AND webcell_member = " . $_SESSION['USER']->id . " $query_rs_result = "SELECT\r\n\t\t\t\t {$_SESSION['RealS_prefix']}items.item_id, \r\n\t\t\t\t {$_SESSION['RealS_prefix']}rafl_res.rafl_res_rate,\r\n\t\t\t\t {$_SESSION['RealS_prefix']}webcells.webcell_member,\r\n\t\t\t\t {$_SESSION['RealS_prefix']}webcells.webcell_text\r\n\t\t\t\t FROM {$_SESSION['RealS_prefix']}items\r\n\t\t\t\t INNER JOIN {$_SESSION['RealS_prefix']}webcells ON {$_SESSION['RealS_prefix']}items.item_webcell = {$_SESSION['RealS_prefix']}webcells.webcell_id\r\n\t\t\t\t INNER JOIN {$_SESSION['RealS_prefix']}rafl_res ON {$_SESSION['RealS_prefix']}items.item_id = {$_SESSION['RealS_prefix']}rafl_res.rafl_res_item\r\n\t\t\t\t WHERE {$_SESSION['RealS_prefix']}items.item_parent_item = " . $success['item_id'] . "\r\n\t\t\t\t \tAND rafl_res_share = " . GetSQLValueString($_GET['share_id'], "int") . "\r\n\t\t\t\t AND {$_SESSION['RealS_prefix']}items.item_default_type = 6"; // Debugging //echo $query_rs_result; $rs_result = mysql_query($query_rs_result, $smart) or die(mysql_error()); // Gimme the comments counter if (strlen($_SESSION['USER']->id)) { $query = "SELECT \r\n\t\t\t\t\t \tSUM((SELECT COUNT({$_SESSION['RealS_prefix']}item_view_status.item_id)\r\n\t\t\t\t\t \tFROM {$_SESSION['RealS_prefix']}item_view_status\r\n\t\t\t\t\t \tWHERE {$_SESSION['RealS_prefix']}item_view_status.item_id_comment_evidence = comments.item_id\r\n\t\t\t\t\t \tAND {$_SESSION['RealS_prefix']}item_view_status.mb_id_viewer = " . $_SESSION['USER']->id . ")) AS unread_count\r\n\t\t\t\t\t FROM {$_SESSION['RealS_prefix']}items\r\n\t\t\t\t\t \tLEFT OUTER JOIN {$_SESSION['RealS_prefix']}items AS comments ON comments.item_parent_item = {$_SESSION['RealS_prefix']}items.item_id\r\n\t\t\t\t\t WHERE {$_SESSION['RealS_prefix']}items.item_parent_item = " . $success['item_id']; $rows = mysql_query($query, $smart) or die(mysql_error()); $row = mysql_fetch_assoc($rows); $unread_count = $row['unread_count']; } else { $unread_count = 0; }