19 declare(strict_types=0);
30 $invited = self::getInvitations($a_obj_id);
31 if ($invited === []) {
47 return self::getParticipants($a_obj_id);
52 return self::getParticipants($a_obj_id,
true);
60 $survey_id = self::getSurveyId($a_obj_id);
82 "SELECT survey_id FROM svy_svy" .
83 " WHERE obj_fi = " .
$ilDB->quote($a_obj_id)
85 $row =
$ilDB->fetchAssoc($set);
86 return (
int) ($row[
"survey_id"] ?? 0);
91 bool $a_only_finished =
false 97 $survey_id = self::getSurveyId($a_obj_id);
102 $sql =
"SELECT user_fi FROM svy_finished fin" .
103 " WHERE fin.survey_fi = " .
$ilDB->quote($survey_id,
"integer");
105 if ($a_only_finished) {
106 $sql .=
" AND fin.state = " .
$ilDB->quote(1,
"integer");
109 $set =
$ilDB->query($sql);
110 while ($row =
$ilDB->fetchAssoc($set)) {
111 $res[] = (
int) $row[
"user_fi"];
124 $db = $DIC->database();
125 $query =
'select user_id from svy_invitation si ' .
126 'join svy_svy ss on ss.survey_id = si.survey_id ' .
131 $invited[] = (
int) $row->user_id;
const LP_STATUS_COMPLETED_NUM
static _isSurveyParticipant(int $user_id, int $survey_id)
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'.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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)
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)