$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 echo $configObject->get('cfg_page_charset'); ?> " />
/** * 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(); } }