Merged changes from 1.5

This commit is contained in:
mindforge 2005-09-16 09:25:42 +00:00
parent cdf4e40668
commit e8d2c01660

View File

@ -7,18 +7,22 @@
}
}
if (empty($subquestions) and empty($subanswers)) {
for ($i=0 ; $i < QUIZ_MAX_NUMBER_ANSWERS ; $i++) {
$subquestions = array();
$subanswers = array();
if (!empty($oldsubquestions)) {
foreach ($oldsubquestions as $oldsubquestion) {
$subquestions[] = $oldsubquestion->questiontext; // insert questions into slots
$subanswers[] = $oldsubquestion->answertext; // insert answers into slots
}
}
$i = count($subquestions);
$limit = QUIZ_MAX_NUMBER_ANSWERS;
$limit = $limit <= $i ? $i+1 : $limit;
for (; $i < $limit; $i++) {
$subquestions[] = ""; // Make question slots, default as blank
$subanswers[] = ""; // Make answer slots, default as blank
}
if (!empty($oldsubquestions)) {
$i=0;
foreach ($oldsubquestions as $oldsubquestion) {
$subquestions[$i] = $oldsubquestion->questiontext; // insert questions into slots
$subanswers[$i] = $oldsubquestion->answertext; // insert answers into slots
$i++;
}
}
}
print_heading_with_help(get_string("editingmatch", "quiz"), "match", "quiz");
require("$CFG->dirroot/mod/quiz/questiontypes/match/match.html");