[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/mod/quiz/report/statistics/ -> report.php (summary)

Quiz statistics report class.

Author: James Pratt <me@jamiep.org>
Copyright: 2014 Open University
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 895 lines (41 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

quiz_statistics_report:: (17 methods):
  display()
  output_individual_question_data()
  render_question_text()
  output_individual_question_response_analysis()
  output_quiz_structure_analysis_table()
  output_quiz_info_table()
  download_quiz_info_table()
  output_statistics_graph()
  get_all_stats_and_analysis()
  get_progress_trace_instance()
  analyse_responses_for_all_questions_and_subquestions()
  analyse_responses_for_questions()
  everything_download_options()
  output_caching_info()
  clear_cached_data()
  load_and_initialise_questions_for_calculations()
  output_all_question_response_analysis()


Class: quiz_statistics_report  - X-Ref

The quiz statistics report provides summary information about each question in
a quiz, compared to the whole quiz. It also provides a drill-down to more
detailed information about each question.

display($quiz, $cm, $course)   X-Ref
Display the report.


output_individual_question_data($quiz, $questionstat)   X-Ref
Display the statistical and introductory information about a question.
Only called when not downloading.

param: object                                         $quiz         the quiz settings.
param: \core_question\statistics\questions\calculated $questionstat the question to report on.

render_question_text($question)   X-Ref
Output question text in a box with urls appropriate for a preview of the question.

param: object $question question data.
return: string HTML of question text, ready for display.

output_individual_question_response_analysis($question, $variantno, $s, $reporturl, $qubaids,$whichtries = question_attempt::LAST_TRY)   X-Ref
Display the response analysis for a question.

param: object           $question  the question to report on.
param: int|null         $variantno the variant
param: int              $s
param: moodle_url       $reporturl the URL to redisplay this report.
param: qubaid_condition $qubaids
param: string           $whichtries

output_quiz_structure_analysis_table($questionstats)   X-Ref
Output the table that lists all the questions in the quiz with their statistics.

param: \core_question\statistics\questions\all_calculated_for_qubaid_condition $questionstats the stats for all questions in

output_quiz_info_table($quizinfo)   X-Ref
Return HTML for table of overall quiz statistics.

param: array $quizinfo as returned by {@link get_formatted_quiz_info_data()}.
return: string the HTML.

download_quiz_info_table($quizinfo)   X-Ref
Download the table of overall quiz statistics.

param: array $quizinfo as returned by {@link get_formatted_quiz_info_data()}.

output_statistics_graph($quizorid, $currentgroup, $whichattempts)   X-Ref
Output the HTML needed to show the statistics graph.

param: int|object $quizorid The quiz, or its ID.
param: int $currentgroup The current group.
param: string $whichattempts Which attempts constant.

get_all_stats_and_analysis($quiz, $whichattempts, $whichtries, $groupstudents, $questions, $progress = null)   X-Ref
Get the quiz and question statistics, either by loading the cached results,
or by recomputing them.

param: object $quiz               the quiz settings.
param: string $whichattempts      which attempts to use, represented internally as one of the constants as used in
param: string $whichtries         which tries to analyse for response analysis. Will be one of
param: array  $groupstudents      students in this group.
param: array  $questions          full question data.
param: \core\progress\base|null   $progress
return: array with 2 elements:    - $quizstats The statistics for overall attempt scores.

get_progress_trace_instance()   X-Ref
Appropriate instance depending if we want html output for the user or not.

return: \core\progress\base child of \core\progress\base to handle the display (or not) of task progress.

analyse_responses_for_all_questions_and_subquestions($questions, $subquestions, $qubaids,$whichtries, $progress = null)   X-Ref
Analyse responses for all questions and sub questions in this quiz.

param: object[] $questions as returned by self::load_and_initialise_questions_for_calculations
param: object[] $subquestions full question objects.
param: qubaid_condition $qubaids the question usages whose responses to analyse.
param: string $whichtries which tries to analyse \question_attempt::FIRST_TRY, LAST_TRY or ALL_TRIES.
param: null|\core\progress\base $progress Used to indicate progress of task.

analyse_responses_for_questions($questions, $qubaids, $whichtries, $progress = null, $done = array()   X-Ref
Analyse responses for an array of questions or sub questions.

param: object[] $questions  as returned by self::load_and_initialise_questions_for_calculations.
param: qubaid_condition $qubaids the question usages whose responses to analyse.
param: string $whichtries which tries to analyse \question_attempt::FIRST_TRY, LAST_TRY or ALL_TRIES.
param: null|\core\progress\base $progress Used to indicate progress of task.
param: int[] $done array keys are ids of questions that have been analysed before calling method.
return: array array keys are ids of questions that were analysed after this method call.

everything_download_options()   X-Ref
Return a little form for the user to request to download the full report, including quiz stats and response analysis for
all questions and sub-questions.

return: string HTML.

output_caching_info($lastcachetime, $quizid, $groupstudents, $whichattempts, $reporturl)   X-Ref
Return HTML for a message that says when the stats were last calculated and a 'recalculate now' button.

param: int    $lastcachetime  the time the stats were last cached.
param: int    $quizid         the quiz id.
param: array  $groupstudents  ids of students in the group or empty array if groups not used.
param: string $whichattempts which attempts to use, represented internally as one of the constants as used in
param: moodle_url $reporturl url for this report
return: string HTML.

clear_cached_data($qubaids)   X-Ref
Clear the cached data for a particular report configuration. This will trigger a re-computation the next time the report
is displayed.

param: $qubaids qubaid_condition

load_and_initialise_questions_for_calculations($quiz)   X-Ref
Load the questions in this quiz and add some properties to the objects needed in the reports.

param: object $quiz the quiz.
return: array of questions for this quiz.

output_all_question_response_analysis($qubaids,$questions,$questionstats,$reporturl,$whichtries = question_attempt::LAST_TRY)   X-Ref
Output all response analysis for all questions, sub-questions and variants. For download in a number of formats.

param: $qubaids
param: $questions
param: $questionstats
param: $reporturl
param: $whichtries string



Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1