3 declare(strict_types=0);
17 $invited = self::getInvitations($a_obj_id);
18 if ($invited === []) {
34 return self::getParticipants($a_obj_id);
39 return self::getParticipants($a_obj_id,
true);
47 $survey_id = self::getSurveyId($a_obj_id);
69 "SELECT survey_id FROM svy_svy" .
70 " WHERE obj_fi = " .
$ilDB->quote($a_obj_id)
72 $row =
$ilDB->fetchAssoc($set);
73 return (
int) ($row[
"survey_id"] ?? 0);
78 bool $a_only_finished =
false 84 $survey_id = self::getSurveyId($a_obj_id);
89 $sql =
"SELECT user_fi FROM svy_finished fin" .
90 " WHERE fin.survey_fi = " .
$ilDB->quote($survey_id,
"integer");
92 if ($a_only_finished) {
93 $sql .=
" AND fin.state = " .
$ilDB->quote(1,
"integer");
96 $set =
$ilDB->query($sql);
97 while ($row =
$ilDB->fetchAssoc($set)) {
111 $db = $DIC->database();
112 $query =
'select user_id from svy_invitation si ' .
113 'join svy_svy ss on ss.survey_id = si.survey_id ' .
118 $invited[] = (
int) $row->user_id;
const LP_STATUS_COMPLETED_NUM
static _isSurveyParticipant(int $user_id, int $survey_id)
determineStatus(int $a_obj_id, int $a_usr_id, object $a_obj=null)
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.
static _getInProgress(int $a_obj_id)
const LP_STATUS_IN_PROGRESS_NUM
static _lookupFinished(int $a_obj_id, int $a_user_id=0)
get finished status
quote($value, string $type)
static getSurveyId(int $a_obj_id)
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.
static getInvitations(int $a_obj_id)
query(string $query)
Run a (read-only) Query on the database.
static _getCompleted(int $a_obj_id)
const LP_STATUS_NOT_ATTEMPTED_NUM
static getParticipants(int $a_obj_id, bool $a_only_finished=false)
static _getNotAttempted(int $a_obj_id)