dmlreadexception on closing quiz attempt - how to add the solution from tracker to existing 2.1 installation

dmlreadexception on closing quiz attempt - how to add the solution from tracker to existing 2.1 installation

Joe Cape -
回帖数:2
Plugin developers的头像

I am getting the same problem as related here: http://moodle.org/mod/forum/discuss.php?d=176491 . I can see that this has been raised as a tracker issue and resolved, so new installs of Moodle won't have this problem, but I can't see how to patch my existing installation to fix the bug. I installed Moodle 2.1 on 06/07 and from what I can see here ( http://tracker.moodle.org/browse/MDL-27040?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel#issue-tabs ) , the file that is to be amended is lib/accesslib.php  and the code to be changed/added is :

if (!empty($viewallgroupsusers)) {
$wherecond[] = "($grouptest OR u.id IN (" . implode(',', array_keys($viewallgroupsusers)) . '))';
} else {
$wherecond[] = "($grouptest)";
}

around line 5010. However, when I add this (or replace the whole accesslib file, which I've also tried), I get a different error:

---------

Database transaction error

More information about this error

Debug info: This code can not be excecuted in transaction
Stack trace:
  • line 2034 of /lib/dml/moodle_database.php: dml_transaction_exception thrown
  • line 59 of /lib/messagelib.php: call to moodle_database->transactions_forbidden()
  • line 1174 of /mod/quiz/locallib.php: call to message_send()
  • line 1270 of /mod/quiz/locallib.php: call to quiz_send_notification()
  • line 1003 of /mod/quiz/attemptlib.php: call to quiz_send_notification_emails()
  • line 1113 of /mod/quiz/attemptlib.php: call to quiz_attempt->quiz_send_notification_emails()
  • line 113 of /mod/quiz/processattempt.php: call to quiz_attempt->finish_attempt()
 ----------
My DB Engine does not support transactions, but I can't see why the code I've added should require it. Any help appreciated.
回复Joe Cape

Re: dmlreadexception on closing quiz attempt - how to add the solution from tracker to existing 2.1 installation

Joe Cape -
Plugin developers的头像

http://tracker.moodle.org/browse/MDL-28166 

- So the transaction error is a separate issue. Given that there are quite a few changes needed to get this to work, is my best bet to download the most recent build of 2.1 and replace the files that Tim has included in the changeset? 

回复Joe Cape

Re: dmlreadexception on closing quiz attempt - how to add the solution from tracker to existing 2.1 installation

Joe Cape -
Plugin developers的头像