mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-23 22:09:29 +00:00
Updated surveys structure
This commit is contained in:
parent
3cfe5df2a7
commit
1318e54d62
@ -81,17 +81,17 @@ class Survey {
|
|||||||
$survey = array();
|
$survey = array();
|
||||||
|
|
||||||
//Get informations about the survey
|
//Get informations about the survey
|
||||||
$survey['infos'] = $this->get_survey_infos($postID);
|
$survey = $this->get_survey_infos($postID);
|
||||||
|
|
||||||
//Check for errors
|
//Check for errors
|
||||||
if(count($survey['infos']) == 0)
|
if(count($survey) == 0)
|
||||||
return array();
|
return array();
|
||||||
|
|
||||||
//Get the choices of the survey
|
|
||||||
$survey['choices'] = $this->get_survey_choices($survey['infos']['ID']);
|
|
||||||
|
|
||||||
//Get the choice of the user
|
//Get the choice of the user
|
||||||
$survey['user_choice'] = user_signed_in() ? $this->get_user_choice($survey['infos']['ID'], userID) : 0;
|
$survey['user_choice'] = user_signed_in() ? $this->get_user_choice($survey['ID'], userID) : 0;
|
||||||
|
|
||||||
|
//Get the choices of the survey
|
||||||
|
$survey['choices'] = $this->get_survey_choices($survey['ID']);
|
||||||
|
|
||||||
return $survey;
|
return $survey;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user