Esempio n. 1
0
/**
 * Updates the question objects with question type specific
 * information by calling {@link get_question_options()}
 *
 * Can be called either with an array of question objects or with a single
 * question object.
 *
 * @param mixed $questions Either an array of question objects to be updated
 *         or just a single question object
 * @return bool Indicates success or failure.
 */
function get_question_options(&$questions)
{
    if (is_array($questions)) {
        // deal with an array of questions
        foreach ($questions as $i => $notused) {
            if (!_tidy_question($questions[$i])) {
                return false;
            }
        }
        return true;
    } else {
        // deal with single question
        return _tidy_question($questions);
    }
}
/**
 * Updates the question objects with question type specific
 * information by calling {@link get_question_options()}
 *
 * Can be called either with an array of question objects or with a single
 * question object.
 *
 * @param mixed $questions Either an array of question objects to be updated
 *         or just a single question object
 * @param boolean $loadtags load the question tags from the tags table. Optional, default false.
 * @return bool Indicates success or failure.
 */
function get_question_options(&$questions, $loadtags = false)
{
    if (is_array($questions)) {
        // deal with an array of questions
        foreach ($questions as $i => $notused) {
            _tidy_question($questions[$i], $loadtags);
        }
    } else {
        // deal with single question
        _tidy_question($questions, $loadtags);
    }
    return true;
}