Moodle

Re-calculate can lead to errors

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Not a bug
  • Affects Version/s: 2.0
  • Fix Version/s: None
  • Component/s: Quiz
  • Labels:
    None
  • Affected Branches:
    MOODLE_20_STABLE

Description

OU Moodle with September 2008 Quiz Reports

1 Created a Quiz.

2 Ran a student through it

3 As a member of staff observed the Results tab, Statistics link.
4 All OK.

5 Now ran a second student through the quiz.

6 Again viewed the reports as a member of staff. Results tab, Statistics link
7 And hit the Recalculate button

and observed

ERROR: relation "dev_quiz_question_response_stats" does not exist

DELETE FROM dev_quiz_question_response_stats WHERE quizstatisticsid IN (47,51)

  • line 1537 of lib/dmllib.php: call to debugging()
  • line 87 of mod/quiz/report/statistics/report.php: call to delete_records_select()
  • line 118 of mod/quiz/report.php: call to quiz_statistics_report->display()

[and in a red box] Error deleting old quiz_question_response_stats records.

Activity

Hide
Jamie Pratt added a comment -

I can't reproduce this error. Can you check in your db does the table 'quiz_question_response_stats' exist??

Show
Jamie Pratt added a comment - I can't reproduce this error. Can you check in your db does the table 'quiz_question_response_stats' exist??
Hide
Jamie Pratt added a comment -

Checked out this bug again. I'm testing on postgresql 8.3 and do what I might cannot trigger a similar error.

Show
Jamie Pratt added a comment - Checked out this bug again. I'm testing on postgresql 8.3 and do what I might cannot trigger a similar error.
Hide
Jamie Pratt added a comment -

The output from the print_object you (by you I mean the OU and more specifically Sarah) sent when trying to diagnose MDL-16681 indicates that data IS being stored in dev_quiz_question_response_stats, it is odd that you are having problems deleting this data from the db.

Show
Jamie Pratt added a comment - The output from the print_object you (by you I mean the OU and more specifically Sarah) sent when trying to diagnose MDL-16681 indicates that data IS being stored in dev_quiz_question_response_stats, it is odd that you are having problems deleting this data from the db.
Hide
Jamie Pratt added a comment -

I put the following code in my ou code base directory mod/quiz/report/statistics/test.php :

<?php
require_once('../../../../config.php');
if (!$out = delete_records_select('quiz_question_response_stats', "quizstatisticsid IN (47,51)")){
print_error('errordeleting', 'quiz_statistics', '', 'quiz_question_response_stats');
}
print_object($out);
?>

And ran it and got :

ADORecordSet_empty Object
(
[dataProvider] => empty
[databaseType] =>
[EOF] => 1
[_numOfRows] => 0
[fields] =>
[connection] =>
)

My db is postgresql 8.3.

The records I am trying to delete don't exist (there are no records with quizstatisticsid IN (47,51)) but this as expected does not trigger an error. The error is caused by some other db related problem.

Show
Jamie Pratt added a comment - I put the following code in my ou code base directory mod/quiz/report/statistics/test.php : <?php require_once('../../../../config.php'); if (!$out = delete_records_select('quiz_question_response_stats', "quizstatisticsid IN (47,51)")){ print_error('errordeleting', 'quiz_statistics', '', 'quiz_question_response_stats'); } print_object($out); ?> And ran it and got : ADORecordSet_empty Object ( [dataProvider] => empty [databaseType] => [EOF] => 1 [_numOfRows] => 0 [fields] => [connection] => ) My db is postgresql 8.3. The records I am trying to delete don't exist (there are no records with quizstatisticsid IN (47,51)) but this as expected does not trigger an error. The error is caused by some other db related problem.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: