-// {{{ class SurveyPersonal extends SurveyQuestion : allows easy and verified access to user's personal data (promotion, name...)
-// actually this type of question should be suppressed (non anonymous surveys are possible with survey modes)
-// and anyway it is not finished (checkAnswer implementation) : currently it does not store anything when a user votes
-class SurveyPersonal extends SurveyQuestion
-{
- private $perm;
-
- public function update($args)
- {
- $args['question'] = "Informations personnelles";
- parent::update($args);
- $this->perm['promo'] = isset($args['promo'])? 1 : 0;
- $this->perm['name'] = isset($args['name'])? 1 : 0;
- }
-
- public function checkAnswer($ans)
- {
- if (intval($ans) == 1) {
- // requete mysql qvb
- return null;
- } else {
- return null;
- }
- }
-
- protected function getQuestionType()
- {
- return "personal";
- }
-
- public function toArray()
- {
- $a = parent::toArray();
- $a['promo'] = $this->perm['promo'];
- $a['name'] = $this->perm['name'];
- return $a;
- }
-}
-// }}}
-