private function ScaleQuestion::setPreset in Quiz 6.6
Same name and namespace in other branches
- 8.6 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::setPreset()
- 8.5 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::setPreset()
- 6.4 question_types/scale/scale.classes.inc \ScaleQuestion::setPreset()
- 7.6 question_types/scale/scale.classes.inc \ScaleQuestion::setPreset()
- 7 question_types/scale/scale.classes.inc \ScaleQuestion::setPreset()
- 7.4 question_types/scale/scale.classes.inc \ScaleQuestion::setPreset()
- 7.5 question_types/scale/scale.classes.inc \ScaleQuestion::setPreset()
Add a preset for the current user.
Parameters
$col_id - answer collection id of the collection this user wants to have as a preset:
2 calls to ScaleQuestion::setPreset()
- ScaleQuestion::save in question_types/
scale/ scale.classes.inc - Implementation of save
- ScaleQuestion::saveAnswerCollection in question_types/
scale/ scale.classes.inc - Stores the answer collection to the database, or reuses an excisting collection.
File
- question_types/
scale/ scale.classes.inc, line 90 - The main classes for the scale question type.
Class
- ScaleQuestion
- Implementation of QuizQuestion.
Code
private function setPreset($col_id) {
global $user;
$sql = 'INSERT IGNORE INTO {quiz_scale_user}
(uid, answer_collection_id)
VALUES (%d, %d)';
db_query($sql, $user->uid, $col_id);
}