ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilSurveyLP.php
Go to the documentation of this file.
1<?php
2
25{
26 public static function getDefaultModes(bool $lp_active): array
27 {
28 return array(
31 );
32 }
33
34 public function getDefaultMode(): int
35 {
37 }
38
39 public function getValidModes(): array
40 {
41 return array(
44 );
45 }
46
47 public function isAnonymized(): bool
48 {
49 return ilObjSurveyAccess::_lookupAnonymize($this->obj_id);
50 }
51
52 protected static function isLPMember(array &$res, int $usr_id, array $obj_ids): bool
53 {
54 global $DIC;
55
56 $ilDB = $DIC->database();
57
58 // if active id
59 $set = $ilDB->query("SELECT ss.obj_fi" .
60 " FROM svy_finished sf" .
61 " JOIN svy_svy ss ON (ss.survey_id = sf.survey_fi)" .
62 " WHERE " . $ilDB->in("ss.obj_fi", $obj_ids, "", "integer") .
63 " AND sf.user_fi = " . $ilDB->quote($usr_id, "integer"));
64 while ($row = $ilDB->fetchAssoc($set)) {
65 $res[(int) $row["obj_fi"]] = true;
66 }
67 $set = $ilDB->query(
68 $q = 'select obj_fi from svy_invitation si ' .
69 'join svy_svy ss on ss.survey_id = si.survey_id ' .
70 'where ' . $ilDB->in('ss.obj_fi', $obj_ids, false, ilDBConstants::T_INTEGER) .
71 'and user_id = ' . $ilDB->quote($usr_id, ilDBConstants::T_INTEGER)
72 );
73 while ($row = $set->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
74 $res[(int) $row->obj_fi] = true;
75 }
76 return true;
77 }
78}
static _lookupAnonymize(int $a_obj_id)
Base class for object lp connectors.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getDefaultModes(bool $lp_active)
Get available type-specific default modes (no administration needed)
static isLPMember(array &$res, int $usr_id, array $obj_ids)
Find (lp-relevant) members for given object ids.
$res
Definition: ltiservices.php:69
global $DIC
Definition: shib_login.php:26
$q
Definition: shib_logout.php:23