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