ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilSurveyLP.php
Go to the documentation of this file.
1 <?php
2 
24 class ilSurveyLP extends ilObjectLP
25 {
26  public static function getDefaultModes(bool $lp_active): array
27  {
28  return array(
31  );
32  }
33 
34  public function getDefaultMode(): int
35  {
36  return ilLPObjSettings::LP_MODE_DEACTIVATED; // :TODO:
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 }
$res
Definition: ltiservices.php:66
static getDefaultModes(bool $lp_active)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupAnonymize(int $a_obj_id)
global $DIC
Definition: shib_login.php:22
$q
Definition: shib_logout.php:21
static isLPMember(array &$res, int $usr_id, array $obj_ids)