ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilSurveyLP.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once "Services/Object/classes/class.ilObjectLP.php";
5
14{
15 public static function getDefaultModes($a_lp_active)
16 {
17 return array(
20 );
21 }
22
23 public function getDefaultMode()
24 {
26 }
27
28 public function getValidModes()
29 {
30 return array(
33 );
34 }
35
36 public function isAnonymized()
37 {
38 include_once './Modules/Survey/classes/class.ilObjSurveyAccess.php';
39 return (bool) ilObjSurveyAccess::_lookupAnonymize($this->obj_id);
40 }
41
42 protected static function isLPMember(array &$a_res, $a_usr_id, $a_obj_ids)
43 {
44 global $DIC;
45
46 $ilDB = $DIC->database();
47
48 // if active id
49 $set = $ilDB->query("SELECT ss.obj_fi" .
50 " FROM svy_finished sf" .
51 " JOIN svy_svy ss ON (ss.survey_id = sf.survey_fi)" .
52 " WHERE " . $ilDB->in("ss.obj_fi", $a_obj_ids, "", "integer") .
53 " AND sf.user_fi = " . $ilDB->quote($a_usr_id, "integer"));
54 while ($row = $ilDB->fetchAssoc($set)) {
55 $a_res[$row["obj_fi"]] = true;
56 }
57
58 return true;
59 }
60}
An exception for terminatinating execution or to throw for unit testing.
static _lookupAnonymize($a_obj_id)
static getDefaultModes($a_lp_active)
Get available type-specific default modes (no administration needed)
static isLPMember(array &$a_res, $a_usr_id, $a_obj_ids)
Find (lp-relevant) members for given object ids.
global $DIC
Definition: saml.php:7
global $ilDB