You are here

private function MultichoiceQuestion::getUserSettings in Quiz 7

Same name and namespace in other branches
  1. 6.4 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getUserSettings()
  2. 7.6 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getUserSettings()
  3. 7.4 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getUserSettings()
  4. 7.5 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getUserSettings()

Fetches the users default settings for the creation form

Return value

The users default node settings

1 call to MultichoiceQuestion::getUserSettings()
MultichoiceQuestion::getDefaultAltSettings in question_types/multichoice/multichoice.classes.inc
Helper function provding the default settings for the creation form.

File

question_types/multichoice/multichoice.classes.inc, line 703
The main classes for the multichoice question type.

Class

MultichoiceQuestion
Extension of QuizQuestion.

Code

private function getUserSettings() {
  global $user;
  $res = db_query('SELECT choice_multi, choice_boolean, choice_random
            FROM {quiz_multichoice_user_settings}
            WHERE uid = :uid', array(
    ':uid' => $user->uid,
  ))
    ->fetchAssoc();
  if ($res) {
    return $res;
  }
  else {
    return FALSE;
  }
}