require_once '../include/errors.inc';
require_once '../include/demo_replace.inc';
require_once '../include/calculate_marks.inc';
require_once '../classes/paperproperties.class.php';
require_once '../classes/results_cache.class.php';
$paperID = check_var('paperID', 'GET', true, false, true);
$userID = check_var('userID', 'GET', true, false, true);
// Get some paper properties
$propertyObj = PaperProperties::get_paper_properties_by_id($paperID, $mysqli, $string);
$log_type = $propertyObj->get_paper_type();
if ($log_type != '2' and $log_type != '4' and $log_type != '5') {
    // Exit if wrong type of paper
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
$results_cache = new ResultsCache($mysqli);
$medians = $results_cache->get_median_question_marks_by_paper($paperID);
$student_marks = $results_cache->get_student_question_marks_by_paper($userID, $log_type, $paperID);
if (count($student_marks) == 0) {
    // Exit if the student does not have any marks
    $msg = sprintf($string['furtherassistance'], $configObject->get('support_email'), $configObject->get('support_email'));
    $notice->display_notice_and_exit($mysqli, $string['pagenotfound'], $msg, $string['pagenotfound'], '../artwork/page_not_found.png', '#C00000', true, true);
}
$old_q_id = 0;
$old_display_pos = -1;
$old_q_type = '';
$old_option_text = array();
$old_correct = array();
$old_display_method = '';
$old_score_method = '';
$old_marks = 0;
Esempio n. 2
0
$report->sort_results();
$user_results = array_csort($user_results, $sortby, $ordering);
$completed_no = 0;
$total_score = 0;
$classifications = array('' => '', 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 'ERROR' => 0);
for ($i = 0; $i < $user_no; $i++) {
    if ($user_results[$i]['metadataID'] != '') {
        // No attendance
        $classifications[$user_results[$i]['rating']]++;
        $total_score += $user_results[$i]['mark'];
        $completed_no++;
    }
}
$stats = $report->get_stats();
// Generate the main statistics
$results_cache = new ResultsCache($mysqli);
if ($results_cache->should_cache($propertyObj, $percent, $absent)) {
    $results_cache->save_paper_cache($paperID, $stats);
    // Cache general paper stats
    $results_cache->save_student_mark_cache($paperID, $user_results);
    // Cache student/paper marks
    $results_cache->save_median_question_marks($paperID, $q_medians);
    // Cache the question/paper medians
}
rating_num_text($user_results, $user_no, $propertyObj, $string);
?>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta http-equiv="content-type" content="text/html;charset=<?php 
Esempio n. 3
0
	<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript" src="../js/staff_help.js"></script>
  <script type="text/javascript" src="../js/toprightmenu.js"></script>
</head>
<body>
<?php 
require '../include/toprightmenu.inc';
echo draw_toprightmenu();
?>
<div id="content">
<form action="<?php 
echo $_SERVER['PHP_SELF'] . '?paperID=' . $paperID;
?>
" method="post">
<?php 
$results_cache = new ResultsCache($mysqli);
$marks = array_values($results_cache->get_paper_marks_by_paper($paperID, true));
$stats = array_values($results_cache->get_paper_cache($paperID));
echo "<div class=\"head_title\">\n";
echo "<div><img src=\"../artwork/toprightmenu.gif\" id=\"toprightmenu_icon\" /></div>\n";
echo '<div class="breadcrumb"><a href="../index.php">' . $string['home'] . '</a>';
if (isset($_GET['folder']) and $_GET['folder'] != '') {
    echo '<img src="../artwork/breadcrumb_arrow.png" class="breadcrumb_arrow" alt="-" /><a href="../folder/index.php?folder=' . $_GET['folder'] . '">' . folder_utils::get_folder_name($_GET['folder'], $mysqli) . '</a>';
} elseif (isset($_GET['module']) and $_GET['module'] != '') {
    echo '<img src="../artwork/breadcrumb_arrow.png" class="breadcrumb_arrow" alt="-" /><a href="../module/index.php?module=' . $_GET['module'] . '">' . module_utils::get_moduleid_from_id($_GET['module'], $mysqli) . '</a>';
}
echo '<img src="../artwork/breadcrumb_arrow.png" class="breadcrumb_arrow" alt="-" /><a href="../paper/details.php?paperID=' . $_GET['paperID'] . '">' . $properties->get_paper_title() . '</a><img src="../artwork/breadcrumb_arrow.png" class="breadcrumb_arrow" alt="-" /><a href="index.php?paperID=' . $paperID . '&module=&folder=">' . $string['standardssetting'] . '</a></div>';
echo "<div class=\"page_title\">" . $string['hofstee'] . "</div>";
echo "</div>\n";
echo "<table style=\"margin:10px\">";
echo "<tr><td style=\"min-width:150px\">" . $string['cohortsize'] . "</td><td>" . count($marks) . "</td></tr>\n";
Esempio n. 4
0
/**
 * Gets a list of papers for which feadback is available for.
 * @param int $userID - The ID of the user to display the plots for. Usually the current student user but could be a member of staff viewing a student.
 * @param object $db	- Mysqli database link.
 * @return array			- List of papers that the user has sat and have been released.
 */
function get_taken_papers($userID, $db)
{
    $papers = array();
    $i = 0;
    // Query for Summative and Offline papers
    $result = $db->prepare("SELECT DISTINCT log_metadata.id, paperID, paper_title, paper_type, pass_mark, calendar_year, started, crypt_name, idfeedback_release, type FROM log_metadata, properties LEFT JOIN feedback_release ON properties.property_id = feedback_release.paper_id WHERE log_metadata.paperID = properties.property_id AND paper_type IN ('2', '5') AND userID = ? AND feedback_release.type = 'cohort_performance' ORDER BY calendar_year DESC");
    $result->bind_param('i', $userID);
    $result->execute();
    $result->store_result();
    $result->bind_result($metadataID, $paperID, $paper_title, $paper_type, $pass_mark, $calendar_year, $started, $crypt_name, $idfeedback_release, $feedback_type);
    while ($result->fetch()) {
        $papers[$i]['metadataID'] = $metadataID;
        $papers[$i]['paperID'] = $paperID;
        $papers[$i]['paper_title'] = $paper_title;
        $papers[$i]['paper_type'] = $paper_type;
        $papers[$i]['calendar_year'] = $calendar_year;
        $papers[$i]['started'] = $started;
        $papers[$i]['crypt_name'] = $crypt_name;
        $papers[$i]['pass_mark'] = $pass_mark;
        $results_cache = new ResultsCache($db);
        $papers[$i]['stats'] = $results_cache->get_paper_cache($paperID);
        $papers[$i]['idfeedback_release'] = $idfeedback_release;
        $papers[$i]['feedback_type'] = $feedback_type;
        $i++;
    }
    $result->close();
    // Query for OSCE stations
    $result = $db->prepare("SELECT DISTINCT log4_overall.id, q_paper, paper_title, paper_type, pass_mark, calendar_year, started, crypt_name, idfeedback_release, type FROM log4_overall, properties LEFT JOIN feedback_release ON properties.property_id = feedback_release.paper_id WHERE log4_overall.q_paper = properties.property_id AND paper_type IN ('4') AND userID = ? AND feedback_release.type = 'cohort_performance' ORDER BY calendar_year DESC");
    $result->bind_param('i', $userID);
    $result->execute();
    $result->store_result();
    $result->bind_result($metadataID, $paperID, $paper_title, $paper_type, $pass_mark, $calendar_year, $started, $crypt_name, $idfeedback_release, $feedback_type);
    while ($result->fetch()) {
        $papers[$i]['metadataID'] = $metadataID;
        $papers[$i]['paperID'] = $paperID;
        $papers[$i]['paper_title'] = $paper_title;
        $papers[$i]['paper_type'] = $paper_type;
        $papers[$i]['calendar_year'] = $calendar_year;
        $papers[$i]['started'] = $started;
        $papers[$i]['crypt_name'] = $crypt_name;
        $papers[$i]['pass_mark'] = $pass_mark;
        $results_cache = new ResultsCache($db);
        $papers[$i]['stats'] = $results_cache->get_paper_cache($paperID);
        $papers[$i]['idfeedback_release'] = $idfeedback_release;
        $papers[$i]['feedback_type'] = $feedback_type;
        $i++;
    }
    $result->close();
    $sortby = 'calendar_year';
    $ordering = 'desc';
    $papers = array_csort($papers, $sortby, $ordering);
    return $papers;
}
Esempio n. 5
0
 /**
  * Initiates the building of the main Class Totals report.
  * @param bool $recache - True = will force paper caches to be updated.
  * @param bool $review - If true we are reviewing so should not cache.
  */
 public function compile_report($recache, $review = false)
 {
     $results_cache = new ResultsCache($this->db);
     if (!$review and ($recache or $results_cache->should_cache($this->propertyObj, $this->percent, $this->absent))) {
         $this->recache = true;
     } else {
         $this->recache = false;
     }
     $moduleID = Paper_utils::get_modules($this->paperID, $this->db);
     $this->moduleID_in = implode(',', array_keys($moduleID));
     $this->exclusions->load();
     // Get any questions to exclude.
     $this->load_answers();
     $this->set_log_late();
     $this->load_absent();
     $this->find_users();
     // Get all the users on the module(s) the paper is on.
     $this->load_metadata();
     // Query for metadata
     $this->load_overrides();
     // Load marking overrides (e.g. Calculation question).
     $this->load_results();
     // Load the student data
     $this->adjust_marks();
     // Scale marks (random marks or standards setting)
     $this->add_rank();
     // Add in rank data.
     $this->convert_moduleIDs();
     // Convert Module IDs into codes
     $this->flag_subpart();
     // Used to flag subsets of the cohort (i.e. top 33%)
     $this->add_absent_students();
     // Add any absent students into main dataset
     $this->generate_stats();
     // Generate the main statistics
     $this->add_deciles();
     // Add in deciles per student
     $this->sort_results();
     // Sort the whole array by the right column
     $this->load_special_needs();
     // Load which users have special needs
     if ($this->recache) {
         $results_cache->save_paper_cache($this->paperID, $this->stats);
         // Cache general paper stats
         $results_cache->save_student_mark_cache($this->paperID, $this->user_results);
         // Cache student/paper marks
         $results_cache->save_median_question_marks($this->paperID, $this->q_medians);
         // Cache the question/paper medians
         // Unset the re-caching flag now we have just cached the marks.
         $this->propertyObj->set_recache_marks(0);
         $this->propertyObj->save();
     }
 }