Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.6.2
-
Fix Version/s: 1.9
-
Component/s: Question type: Rendered match
-
Labels:None
-
Environment:ALL.
-
Database:Any
-
Affected Branches:MOODLE_16_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
The rendered match question type isn't restored. I have renderedmatch installed on moodle 1.6.2 but they wouldn't restore.
here is a fix.
open question/restorelib.php
go to function restore_questions
after this ..
//If the question exists, only record its id
if ($question_exists) {
$newid = $question_exists->id;
$creatingnewquestion = false;
//Else, create a new question
} else {
//The structure is equal to the db, so insert the question
$newid = insert_record ("question",$question);
$creatingnewquestion = true;
}
ADD THIS...
/new stuff/
if($question->qtype=='renderedmatch'||$question->qtype=="13")
{
$x=0;
$test=1;
$question_renderedmatch_sub->question=$newid;
$question_renderedmatch->question=$newid;
while($test!=2)
{
if(!empty($que_info'#'['RENDEREDS']['0']'#'['RENDERED'][$x]))
else
{ $test=2; }$x=$x+1;
}
$question_renderedmatch->subquestions=implode(",",$subquest);
insert_record("question_renderedmatch",$question_renderedmatch);
}
/new stuff ends/
not pretty but it works...
Attachments
Issue Links
| This issue has a non-specific relationship to: | ||||
| MDL-10380 | Moodle question import doesn't properly handle BB matching type |
|
|
|
Sure Tim is more able here....