function get_question_options(&$question) {
$question->options = get_record('question_match', 'question', $question->id);
- $question->options->subquestions = get_records("question_match_sub", "question", $question->id, "id ASC" );
+ $question->options->subquestions = get_records('question_match_sub', 'question', $question->id, 'id ASC');
return true;
}
}
function create_session_and_responses(&$question, &$state, $cmoptions, $attempt) {
- if (!$state->options->subquestions = get_records('question_match_sub',
- 'question', $question->id)) {
+ if (!$state->options->subquestions = get_records('question_match_sub', 'question', $question->id, 'id ASC')) {
notify('Error: Missing subquestions!');
return false;
}
$responses = array_map(create_function('$val',
'return explode("-", $val);'), $responses);
- if (!$questions = get_records('question_match_sub',
- 'question', $question->id)) {
+ if (!$questions = get_records('question_match_sub', 'question', $question->id, 'id ASC')) {
notify('Error: Missing subquestions!');
return false;
}
$status = true;
- $matchs = get_records("question_match_sub","question",$question,"id");
+ $matchs = get_records('question_match_sub', 'question', $question, 'id ASC');
//If there are matchs
if ($matchs) {
$status = fwrite ($bf,start_tag("MATCHS",6,true));
return false;
}
- $wrappedquestions = get_records_list('question', 'id', $sequence);
+ $wrappedquestions = get_records_list('question', 'id', $sequence, 'id ASC');
// We want an array with question ids as index and the positions as values
$sequence = array_flip(explode(',', $sequence));
$question->options = new object;
}
// The default implementation attaches all answers for this question
- $question->options->answers = get_records('question_answers', 'question',
- $question->id);
+ $question->options->answers = get_records('question_answers', 'question', $question->id, 'id ASC');
return true;
}
if ($types) {
foreach ($types as $type) {
- if (!$servers = get_records('question_rqp_servers', 'typeid', $type->id)) {
+ if (!$servers = get_records('question_rqp_servers', 'typeid', $type->id, 'id ASC')) {
delete_records('question_rqp_types', 'id', $type->id);
} else {
foreach ($servers as $server) {