Could not insert workshop assessment!

回复: Could not insert workshop assessment!

by 天 一 -
Number of replies: 0

Only recently I stumbled across the same problem and managed to find a solution. Upon turning on the debugging in Moodle, I received an explanation stating that a default value for the generalcomment (and subsequently teachercomment) field was missing. Since I was unable to set the default values in the relevant MySQL table, I added the following code to assess.php and locallib.php (in the mod/workshop folder):

$assessment->generalcomment = "";
$assessment->teachercomment = "";

The code was added before the following statement in assess.php:

if (!$assessment->id = insert_record("workshop_assessments", $assessment)) {
error("Could not insert workshop assessment!");
}

and before the statement below in locallib.php:

if (!$assessment->id = insert_record("workshop_assessments", $assessment)) {
error("List Student submissions: Could not insert workshop assessment!");
}

http://moodle.org/mod/forum/discuss.php?d=52978&parent=261469

The above worked and the workshop module does not report errors any more.

Average of ratings: Useful (1)