When you are editing a quiz, well editing a question in a quiz, and the question is a renderedmatch question the subquestions and subanswers don't show up in the text field. The implementation of question/question.php gets data from teh question table, but doesn't take data from the question_renderedmatch_sub table, which is where the subquestions and subanswers are stored. I have fixed this by adding code at line 55 in question/question.php . In the "if($id)" branch
right after $qtype=$question->qtype I have added this code:
$qtype = $question->qtype;
/beginning of new code/
if($qtype=="renderedmatch")
{
if (! $subs = get_records("question_renderedmatch_sub", "question", $id))
{
error("This question doesn't exist");
}
foreach($subs as $subquestion)
{
$subquestions[]=$subquestion->questiontext;
$subanswers[]=$subquestion->answertext;
}
}
/end of new code/
The variables are named subquestion[] and subanswers[] since question/type/renderedmatch/editsubquestion.php trys to insert $subquestion[$i] and $subanswer[$i] into the text fields, and it only needs teh questiontext and the answertext. When you edit these questions though I still thought something would need to be added to ensure that the sub(questions and answers) were changed in the database, but after testing the database is changed. So it would appear that $question = $QTYPES[$qtype]->save_question($question, $form, $course); saves the renderedmatch sub information. If this is the case then this code should be fine.