mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Fix whitespace problems and Eclipse warnings in Item Analysis quiz report.
This commit is contained in:
parent
f77192322f
commit
c48ca9308f
1 changed files with 107 additions and 105 deletions
|
@ -1,10 +1,8 @@
|
|||
<?php // $Id$
|
||||
/// Item analysis displays a table of quiz questions and their performance
|
||||
|
||||
require_once($CFG->libdir.'/tablelib.php');
|
||||
|
||||
/// Item analysis displays a table of quiz questions and their performance
|
||||
|
||||
class quiz_report extends quiz_default_report {
|
||||
|
||||
function display($quiz, $cm, $course) { /// This function just displays the report
|
||||
|
@ -87,6 +85,7 @@ class quiz_report extends quiz_default_report {
|
|||
' AND ( qa.sumgrades >= '.$scorelimit.' ) ';
|
||||
// ^^^^^^ es posible seleccionar aqu<71> TODOS los quizzes, como quiere Jussi,
|
||||
// pero habr<62>a que llevar la cuenta ed cada quiz para restaura las preguntas (quizquestions, states)
|
||||
|
||||
/// Fetch the attempts
|
||||
$attempts = get_records_sql($sql);
|
||||
|
||||
|
@ -174,6 +173,7 @@ class quiz_report extends quiz_default_report {
|
|||
if ($key = array_search($resp, $questions[$qid]['responses'])) {
|
||||
$questions[$qid]['rcounts'][$key]++;
|
||||
} else {
|
||||
$test = new stdClass;
|
||||
$test->responses = $QTYPES[$quizquestions[$i]->qtype]->get_correct_responses($quizquestions[$i], $states[$i]);
|
||||
if ($key = $QTYPES[$quizquestions[$i]->qtype]->check_response($quizquestions[$i], $states[$i], $test)) {
|
||||
$questions[$qid]['rcounts'][$key]++;
|
||||
|
@ -311,11 +311,12 @@ class quiz_report extends quiz_default_report {
|
|||
$qtext = format_text($question->questiontext, $question->questiontextformat, NULL, $quiz->course);
|
||||
$qquestion = $qname."\n".$qtext."\n";
|
||||
|
||||
$format_options = new stdClass;
|
||||
$format_options->para = false;
|
||||
$format_options->newlines = false;
|
||||
unset($responses);
|
||||
foreach ($q['responses'] as $aid=>$resp){
|
||||
unset($response);
|
||||
$response = new stdClass;
|
||||
if ($q['credits'][$aid] <= 0) {
|
||||
$qclass = 'uncorrect';
|
||||
} elseif ($q['credits'][$aid] == 1) {
|
||||
|
@ -660,6 +661,7 @@ class quiz_report extends quiz_default_report {
|
|||
$qid = $q['id'];
|
||||
$question = get_record('question', 'id', $qid);
|
||||
|
||||
$options = new stdClass;
|
||||
$options->para = false;
|
||||
$options->newlines = false;
|
||||
|
||||
|
@ -668,9 +670,9 @@ class quiz_report extends quiz_default_report {
|
|||
$qname = format_text($question->name, FORMAT_MOODLE, $options);
|
||||
$qtext = format_text($question->questiontext, FORMAT_MOODLE, $options);
|
||||
|
||||
unset($responses);
|
||||
$responses = array();
|
||||
foreach ($q['responses'] as $aid=>$resp){
|
||||
unset($response);
|
||||
$response = new stdClass;
|
||||
if ($q['credits'][$aid] <= 0) {
|
||||
$qclass = 'uncorrect';
|
||||
} elseif ($q['credits'][$aid] == 1) {
|
||||
|
@ -691,7 +693,7 @@ class quiz_report extends quiz_default_report {
|
|||
$di = format_float($q['disc_index'],3);
|
||||
$dc = format_float($q['disc_coeff'],3);
|
||||
|
||||
unset($result);
|
||||
$result = array();
|
||||
$response = array_shift($responses);
|
||||
$result[] = array($qid, $qtype, $qname, $qtext, $response->text, $response->credit, $response->rcount, $response->rpercent, $count, $facility, $qsd, $di, $dc);
|
||||
foreach($responses as $response){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue