19declare(strict_types=0);
31 if ($invited === []) {
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 ' .
128 $res = $db->query($query);
131 $invited[] = (
int) $row->user_id;
static getInvitations(int $a_obj_id)
static _getCompleted(int $a_obj_id)
static _getInProgress(int $a_obj_id)
static _getNotAttempted(int $a_obj_id)
static getParticipants(int $a_obj_id, bool $a_only_finished=false)
determineStatus(int $a_obj_id, int $a_usr_id, ?object $a_obj=null)
static getSurveyId(int $a_obj_id)
static _getInProgress(int $a_obj_id)
Static function to read users who have the status 'in_progress'.
static _getCompleted(int $a_obj_id)
Static function to read the users who have the status 'completed'.
Abstract class ilLPStatus for all learning progress modes E.g ilLPStatusManual, ilLPStatusObjectives ...
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
static _lookupFinished(int $a_obj_id, int $a_user_id=0)
get finished status
static _isSurveyParticipant(int $user_id, int $survey_id)