MDL-11213 - Quiz preview attempts show up in item analysis. Fix thanks to Jean-Michel Vedrine.

This commit is contained in:
tjhunt
2007-09-13 16:24:50 +00:00
parent 7d0ffb0fe6
commit 0498a4d517
+6 -3
View File
@@ -70,7 +70,10 @@ class quiz_report extends quiz_default_report {
}
if ($attemptselection != QUIZ_ALLATTEMPTS) {
$sql = 'SELECT qa.userid '.$limit.'FROM '.$CFG->prefix.'user u LEFT JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid '. 'WHERE ( qa.quiz = '.$quiz->id.') '.$group;
$sql = 'SELECT qa.userid '.$limit.
'FROM '.$CFG->prefix.'user u LEFT JOIN '.$CFG->prefix.'quiz_attempts qa ON u.id = qa.userid '.
'WHERE qa.quiz = '.$quiz->id.' AND qa.preview = 0 '.
$group;
$usermax = get_records_sql_menu($sql);
}
@@ -84,7 +87,7 @@ class quiz_report extends quiz_default_report {
}
$sql = 'SELECT qa.* FROM '.$CFG->prefix.'quiz_attempts qa, '.$CFG->prefix.'user u '.$groupmembers.
'WHERE u.id = qa.userid AND qa.quiz = '.$quiz->id.' AND ( qa.sumgrades >= '.$scorelimit.' ) '.$groupwhere;
'WHERE u.id = qa.userid AND qa.quiz = '.$quiz->id.' AND qa.preview = 0 AND ( qa.sumgrades >= '.$scorelimit.' ) '.$groupwhere;
// ^^^^^^ es posible seleccionar aqu� TODOS los quizzes, como quiere Jussi,
// pero habr�a que llevar la cuenta ed cada quiz para restaura las preguntas (quizquestions, states)
@@ -93,7 +96,7 @@ class quiz_report extends quiz_default_report {
$attempts = get_records_sql($sql);
if(empty($attempts)) {
($strnoattempts);
print_heading(get_string('nothingtodisplay'));
$this->print_options_form($quiz, $cm, $attemptselection, $lowmarklimit, $pagesize);
return true;
}