upgrade_main_savepoint(true, 2012062000.01);
}
-
// Moodle v2.3.0 release upgrade line
// Put any upgrade step following this
-
if ($oldversion < 2012062500.02) {
// Drop some old backup tables, not used anymore
// Moodle v2.4.0 release upgrade line
// Put any upgrade step following this
-
if ($oldversion < 2012120300.01) {
// Make sure site-course has format='site' //MDL-36840
}
}
-
/**
* @var array of names of properties of this class that are cached in db record.
*/
}
}
-
$quizstats->cache(quiz_statistics_qubaids_condition($quizid, $currentgroup, $groupstudents, $useallattempts));
return $quizstats;
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
-
/**
* Post-install script
*/
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
-
/**
* Quiz statistics report upgrade code.
*/
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
-
/**
* Serve questiontext files in the question text when they are displayed in this report.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/mod/quiz/report/statistics/statistics_form.php');
$qubaids = quiz_statistics_qubaids_condition($quiz->id, $currentgroup, $groupstudents, $useallattempts);
-
// If recalculate was requested, handle that.
if ($recalculate && confirm_sesskey()) {
$this->clear_cached_data($qubaids);
$quizstats = $quizcalc->calculate($quiz->id, $currentgroup, $useallattempts,
$groupstudents, count($questions), $qcalc->get_sum_of_mark_variance());
-
if ($quizstats->s()) {
$this->calculate_responses_for_all_questions_and_subquestions($qubaids, $questions, $subquestionstats);
}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/formslib.php');
-
/**
* This is the settings form for the quiz statistics report.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
require_once(dirname(__FILE__) . '/../../../../config.php');
require_once($CFG->libdir . '/graphlib.php');
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir . '/tablelib.php');
-
/**
* This table shows statistics about a particular question.
*
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
require_once($CFG->libdir.'/tablelib.php');
-
/**
* This table has one row for each question in the quiz, with sub-rows when
* random questions appear. There are columns for the various statistics.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
global $CFG;
require_once($CFG->dirroot . '/mod/quiz/locallib.php');
require_once($CFG->dirroot . '/mod/quiz/report/reportlib.php');
-
/**
* Test helper subclass of question_statistics
*
public $questionid;
-
// These first fields are the final fields cached in the db and shown in reports.
// See : http://docs.moodle.org/dev/Quiz_statistics_calculations#Position_statistics .
$this->timemodified = $record->timemodified;
}
-
}
foreach ($lateststeps as $step) {
$this->secondary_steps_walker($step, $this->questionstats[$step->slot], $summarks, $summarksavg);
- if ($this->questionstats[$step->slot]->subquestion) {
+ if ($this->questionstats[$step->slot]->subquestions) {
$this->secondary_steps_walker($step, $this->subquestionstats[$step->questionid], $summarks, $summarksavg);
}
}
public function get_cached($qubaids) {
global $DB;
$timemodified = time() - self::TIME_TO_CACHE;
- $questionstatrecs = $DB->get_record_select('question_statistics', 'hashcode = ? AND timemodified > ?',
+ $questionstatrecs = $DB->get_records_select('question_statistics', 'hashcode = ? AND timemodified > ?',
array($qubaids->get_hash_code(), $timemodified));
$questionids = array();
global $DB;
$timemodified = time() - self::TIME_TO_CACHE;
- return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ?',
+ return $DB->get_field_select('question_statistics', 'timemodified', 'hashcode = ? AND timemodified > ? '.
+ 'ORDER BY timemodified DESC LIMIT 1',
array($qubaids->get_hash_code(), $timemodified));
}
$stats->negcovar = 0;
}
-
-
if ($stats->markvariance * $stats->othermarkvariance) {
$stats->discriminationindex = 100 * $stats->covariance /
sqrt($stats->markvariance * $stats->othermarkvariance);
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
-
defined('MOODLE_INTERNAL') || die();
-
/**
* Question statistics cron code. Deletes cached stats more than a certain age.
*/