Skip to content
Browse files

Undid some of Julian's changes that refer to a non-existent database …

…field.
  • Loading branch information...
1 parent 65c8ff4 commit ae89234a6597cd5827b19d190936e721d9344f63 gustav_delius committed Jul 11, 2005
View
4 mod/quiz/questiontypes/multichoice/editquestion.php
@@ -6,8 +6,8 @@
$options->single = 1;
}
if (!empty($options->answers)) {
- $answersraw = get_records("quiz_answers", "question", $question->id,
- 'seq_number ASC');
+ $answersraw = get_records_list("quiz_answers", "id", $options->answers);
+
}
for ($i=0 ; $i < QUIZ_MAX_NUMBER_ANSWERS ; $i++) {
$answers[] = ""; // Make answer slots, default as blank
View
5 mod/quiz/questiontypes/multichoice/questiontype.php
@@ -26,8 +26,7 @@ function get_question_options(&$question) {
return false;
}
- if (!$question->options->answers = get_records("quiz_answers",
- 'question', $question->id, 'seq_number ASC')) {
+ if (!$question->options->answers = get_records_select('quiz_answers', 'id IN ('.$question->options->answers.')')) {
notify('Error: Missing question answers!');
return false;
}
@@ -70,7 +69,6 @@ function save_question_options($question) {
$answer->answer = $dataanswer;
$answer->fraction = $question->fraction[$key];
$answer->feedback = $question->feedback[$key];
- $answer->seq_number = $key + 1;
if (!update_record("quiz_answers", $answer)) {
$result->error = "Could not update quiz answer! (id=$answer->id)";
return $result;
@@ -81,7 +79,6 @@ function save_question_options($question) {
$answer->question = $question->id;
$answer->fraction = $question->fraction[$key];
$answer->feedback = $question->feedback[$key];
- $answer->seq_number = $key + 1;
if (!$answer->id = insert_record("quiz_answers", $answer)) {
$result->error = "Could not insert quiz answer! ";
return $result;

0 comments on commit ae89234

Please sign in to comment.
Something went wrong with that request. Please try again.