function save_question_options($question) {
// Get old versions of the objects
- if (!$oldanswers = get_records("question_answers", "question", $question->id)) {
+ if (!$oldanswers = get_records('question_answers', 'question', $question->id, 'id ASC')) {
$oldanswers = array();
}
- if (!$oldoptions = get_records("question_numerical", "question", $question->id)) {
+ if (!$oldoptions = get_records('question_numerical', 'question', $question->id, 'answer ASC')) {
$oldoptions = array();
}
}
function save_numerical_units($question) {
- if (!$oldunits = get_records("question_numerical_units", "question", $question->id)) {
+ if (!$oldunits = get_records('question_numerical_units', 'question', $question->id, 'id ASC')) {
$oldunits = array();
}
$status = true;
- $numericals = get_records("question_numerical","question",$question,"id");
+ $numericals = get_records('question_numerical', 'question', $question, 'id ASC');
//If there are numericals
if ($numericals) {
//Iterate over each numerical
$options->usecase = 0;
}
if (!empty($options->answers)) {
- $answersraw = get_records_list("question_answers", "id", $options->answers);
+ $answersraw = get_records_list('question_answers', 'id', $options->answers, 'id ASC');
}
$answers = array();
function save_question_options($question) {
$result = new stdClass;
- if (!$oldanswers = get_records("question_answers", "question", $question->id, "id ASC")) {
+ if (!$oldanswers = get_records('question_answers', 'question', $question->id, 'id ASC')) {
$oldanswers = array();
}
$status = true;
- $shortanswers = get_records("question_shortanswer","question",$question,"id");
+ $shortanswers = get_records('question_shortanswer', 'question', $question, 'id ASC');
//If there are shortanswers
if ($shortanswers) {
//Iterate over each shortanswer