private function ChoiceQuestion::getUserSettings in Quiz 6.6
1 call to ChoiceQuestion::getUserSettings()
- ChoiceQuestion::getDefaultAltSettings in question_types/
choice/ choice.classes.inc
File
- question_types/
choice/ choice.classes.inc, line 519 - The main classes for the choice question type.
Class
- ChoiceQuestion
- Implementation of QuizQuestion.
Code
private function getUserSettings() {
global $user;
$sql = 'SELECT last_nid, last_vid
FROM {quiz_choice_user_settings}
WHERE uid = %d';
$res = db_query($sql, $user->uid);
if ($obj = db_fetch_object($res)) {
$sql = 'SELECT choice_multi, choice_random, choice_boolean
FROM {quiz_choice_properties}
WHERE nid = %d AND vid = %d';
$res = db_query($sql, $obj->last_nid, $obj->last_vid);
if ($arr = db_fetch_array($res)) {
return $arr;
}
else {
return false;
}
}
else {
return false;
}
}