### Eclipse Workspace Patch 1.0 #P moodle19 Index: mod/lesson/locallib.php =================================================================== RCS file: /cvsroot/moodle/moodle/mod/lesson/locallib.php,v retrieving revision 1.71.2.5 diff -u -r1.71.2.5 locallib.php --- mod/lesson/locallib.php 17 Mar 2009 16:24:47 -0000 1.71.2.5 +++ mod/lesson/locallib.php 17 Sep 2010 14:44:38 -0000 @@ -797,8 +797,25 @@ case LESSON_MATCHING: + // Joseph REZEAU :: inserted 2 bogus pairs for correct & incorrect feedback messages $subquestions = array(); - + for($i = 0; $i <= 1; $i++) { + $answer = new stdClass; + $answer->lessonid = $question->lessonid; + $answer->pageid = $question->id; + $answer->timecreated = $timenow; + if ($i==0) { + $answer->answer = get_string('correctresponse', 'lesson'); + } else { + $answer->answer = get_string('wrongresponse','lesson'); + } + //$answer->response = NULL; + if (!$subquestion->id = insert_record("lesson_answers", $answer)) { + $result->error = "Could not insert quiz match subquestion!"; + return $result; + } + } + $i = 0; // Insert all the new question+answer pairs foreach ($question->subquestions as $key => $questiontext) {