Moodle  2.2.1
http://www.collinsharper.com
quiz_statistics_report Class Reference
Inheritance diagram for quiz_statistics_report:
Collaboration diagram for quiz_statistics_report:

Public Member Functions

 display ($quiz, $cm, $course)
 format_text ($text, $format, $qa, $component, $filearea, $itemid, $clean=false)
 format_questiontext ($qa)

Data Fields

const TIME_TO_CACHE_STATS = 900

Protected Member Functions

 output_individual_question_data ($quiz, $question)
 render_question_text ($question)
 output_individual_question_response_analysis ($question, $reporturl, $quizstats)
 output_quiz_structure_analysis_table ($s, $questions, $subquestions)
 get_formatted_quiz_info_data ($course, $cm, $quiz, $quizstats)
 output_quiz_info_table ($quizinfo)
 download_quiz_info_table ($quizinfo)
 output_statistics_graph ($quizstatsid, $s)
 get_emtpy_stats ($questions, $firstattemptscount=0, $allattemptscount=0)
 compute_stats ($quizid, $currentgroup, $nostudentsingroup, $useallattempts, $groupstudents, $questions)
 try_loading_cached_stats ($quiz, $currentgroup, $nostudentsingroup, $useallattempts, $groupstudents, $questions)
 cache_stats ($quizid, $currentgroup, $quizstats, $questions, $subquestions)
 get_quiz_and_questions_stats ($quiz, $currentgroup, $nostudentsingroup, $useallattempts, $groupstudents, $questions)
 analyse_responses ($quizstatisticsid, $quizid, $currentgroup, $nostudentsingroup, $useallattempts, $groupstudents, $questions, $subquestions)
 everything_download_options ()
 output_caching_info ($quizstats, $quizid, $currentgroup, $groupstudents, $useallattempts, $reporturl)
 clear_cached_data ($quizid, $currentgroup, $useallattempts)
 using_attempts_string ($useallattempts)

Protected Attributes

 $table

Detailed Description

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.

Definition at line 44 of file report.php.


Member Function Documentation

analyse_responses ( quizstatisticsid,
quizid,
currentgroup,
nostudentsingroup,
useallattempts,
groupstudents,
questions,
subquestions 
) [protected]

Definition at line 935 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

cache_stats ( quizid,
currentgroup,
quizstats,
questions,
subquestions 
) [protected]

Store the statistics in the cache tables in the database.

Parameters:
object$quizidthe quiz id.
int$currentgroupthe current group. 0 for none.
bool$useallattemptsuse all attempts, or just first attempts.
object$quizstatsThe statistics for overall attempt scores.
array$questionsThe questions, with an additional _stats field.
array$subquestionsThe subquestions, if any, with an additional _stats field.

Definition at line 859 of file report.php.

Here is the caller graph for this function:

clear_cached_data ( quizid,
currentgroup,
useallattempts 
) [protected]

Clear the cached data for a particular report configuration. This will trigger a re-computation the next time the report is displayed.

Parameters:
int$quizidthe quiz id.
int$currentgroupa group id, or 0.
bool$useallattemptswhether all attempts, or just first attempts are included.

Definition at line 1042 of file report.php.

Here is the caller graph for this function:

compute_stats ( quizid,
currentgroup,
nostudentsingroup,
useallattempts,
groupstudents,
questions 
) [protected]

Compute the quiz statistics.

Parameters:
object$quizidthe quiz id.
int$currentgroupthe current group. 0 for none.
bool$nostudentsingrouptrue if there a no students.
bool$useallattemptsuse all attempts, or just first attempts.
array$groupstudentsstudents in this group.
array$questionsquestion definitions.
Returns:
array with three elements:
  • integer $s Number of attempts included in the stats.
  • array $quizstats The statistics for overall attempt scores.
  • array $qstats The statistics for each question.

Definition at line 637 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

display ( quiz,
cm,
course 
)

Display the report.

Reimplemented from quiz_default_report.

Definition at line 54 of file report.php.

Here is the call graph for this function:

download_quiz_info_table ( quizinfo) [protected]

Download the table of overall quiz statistics.

Parameters:
array$quizinfoas returned by get_formatted_quiz_info_data().

Definition at line 553 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

everything_download_options ( ) [protected]
Returns:
string HTML snipped for the Download full report as UI.

Definition at line 969 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
the result of applying format_text() to the question text.

Definition at line 333 of file report.php.

Here is the call graph for this function:

format_text ( text,
format,
qa,
component,
filearea,
itemid,
clean = false 
)

Definition at line 323 of file report.php.

Here is the caller graph for this function:

get_emtpy_stats ( questions,
firstattemptscount = 0,
allattemptscount = 0 
) [protected]

Return the stats data for when there are no stats to show.

Parameters:
array$questionsquestion definitions.
int$firstattemptscountnumber of first attempts (optional).
int$firstattemptscounttotal number of attempts (optional).
Returns:
array with three elements:
  • integer $s Number of attempts included in the stats (0).
  • array $quizstats The statistics for overall attempt scores.
  • array $qstats The statistics for each question.

Definition at line 609 of file report.php.

Here is the caller graph for this function:

get_formatted_quiz_info_data ( course,
cm,
quiz,
quizstats 
) [protected]

Definition at line 462 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

get_quiz_and_questions_stats ( quiz,
currentgroup,
nostudentsingroup,
useallattempts,
groupstudents,
questions 
) [protected]

Get the quiz and question statistics, either by loading the cached results, or by recomputing them.

Parameters:
object$quizthe quiz settings.
int$currentgroupthe current group. 0 for none.
bool$nostudentsingrouptrue if there a no students.
bool$useallattemptsuse all attempts, or just first attempts.
array$groupstudentsstudents in this group.
array$questionsquestion definitions.
Returns:
array with 4 elements:
  • $quizstats The statistics for overall attempt scores.
  • $questions The questions, with an additional _stats field.
  • $subquestions The subquestions, if any, with an additional _stats field.
  • $s Number of attempts included in the stats.

Definition at line 908 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

output_caching_info ( quizstats,
quizid,
currentgroup,
groupstudents,
useallattempts,
reporturl 
) [protected]

Generate the snipped of HTML that says when the stats were last caculated, with a recalcuate now button.

Parameters:
object$quizstatsthe overall quiz statistics.
int$quizidthe quiz id.
int$currentgroupthe id of the currently selected group, or 0.
array$groupstudentsids of students in the group.
bool$useallattemptswhether to use all attempts, instead of just first attempts.
Returns:
string a HTML snipped saying when the stats were last computed, or blank if that is not appropriate.

Definition at line 996 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

output_individual_question_data ( quiz,
question 
) [protected]

Display the statistical and introductory information about a question. Only called when not downloading.

Parameters:
object$quizthe quiz settings.
object$questionthe question to report on.
moodle_url$reporturlthe URL to resisplay this report.
object$quizstatsHolds the quiz statistics.

Definition at line 266 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

output_individual_question_response_analysis ( question,
reporturl,
quizstats 
) [protected]

Display the response analysis for a question.

Parameters:
object$questionthe question to report on.
moodle_url$reporturlthe URL to resisplay this report.
object$quizstatsHolds the quiz statistics.

Definition at line 359 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

output_quiz_info_table ( quizinfo) [protected]

Output the table of overall quiz statistics.

Parameters:
array$quizinfoas returned by get_formatted_quiz_info_data().
Returns:
string the HTML.

Definition at line 534 of file report.php.

Here is the caller graph for this function:

output_quiz_structure_analysis_table ( s,
questions,
subquestions 
) [protected]

Output the table that lists all the questions in the quiz with their statistics.

Parameters:
int$snumber of attempts.
array$questionsthe questions in the quiz.
array$subquestionsthe subquestions of any random questions.

Definition at line 438 of file report.php.

Here is the caller graph for this function:

output_statistics_graph ( quizstatsid,
s 
) [protected]

Output the HTML needed to show the statistics graph.

Parameters:
int$quizstatsidthe id of the statistics to show in the graph.

Definition at line 583 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

render_question_text ( question) [protected]
Parameters:
object$questionquestion data.
Returns:
string HTML of question text, ready for display.

Definition at line 342 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

try_loading_cached_stats ( quiz,
currentgroup,
nostudentsingroup,
useallattempts,
groupstudents,
questions 
) [protected]

Load the cached statistics from the database.

Parameters:
object$quizthe quiz settings
int$currentgroupthe current group. 0 for none.
bool$nostudentsingrouptrue if there a no students.
bool$useallattemptsuse all attempts, or just first attempts.
array$groupstudentsstudents in this group.
array$questionsquestion definitions.
Returns:
array with 4 elements:
  • $quizstats The statistics for overall attempt scores.
  • $questions The questions, with an additional _stats field.
  • $subquestions The subquestions, if any, with an additional _stats field.
  • $s Number of attempts included in the stats. If there is no cached data in the database, returns an array of four nulls.

Definition at line 804 of file report.php.

Here is the call graph for this function:

Here is the caller graph for this function:

using_attempts_string ( useallattempts) [protected]
Parameters:
bool$useallattemptswhether we are using all attempts.
Returns:
the appropriate lang string to describe this option.

Definition at line 1066 of file report.php.

Here is the caller graph for this function:


Field Documentation

$table [protected]

Definition at line 49 of file report.php.

const TIME_TO_CACHE_STATS = 900

Definition at line 46 of file report.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations