ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ILIAS\Survey\Execution\RunSessionRepo Class Reference

Stores access codes of anonymous session. More...

+ Collaboration diagram for ILIAS\Survey\Execution\RunSessionRepo:

Public Member Functions

 __construct ()
 
 issetCode (int $survey_id)
 
 setCode (int $survey_id, string $code)
 
 getCode (int $survey_id)
 
 clearCode (int $survey_id)
 
 isExternalRaterValidated (int $ref_id)
 
 setExternalRaterValidation (int $ref_id, bool $valid)
 
 setPageEnter (int $time)
 
 getPageEnter ()
 
 clearPageEnter ()
 
 setPreviewData (int $survey_id, int $question_id, array $data)
 
 getPreviewData (int $survey_id, int $question_id)
 
 clearPreviewData (int $survey_id, int $question_id)
 
 clearAllPreviewData (int $survey_id)
 
 setErrors (array $errors)
 
 getErrors ()
 
 clearErrors ()
 
 setPostData (array $data)
 
 getPostData ()
 
 clearPostData ()
 

Protected Member Functions

 getAnonymKey (int $survey_id)
 
 getPreviewDataKey (int $survey_id)
 
 getAllPreviewData (int $survey_id)
 

Protected Attributes

const KEY_BASE = "svy_run_"
 
const KEY_ANONYM = self::KEY_BASE . "anonymous_id_"
 
const KEY_EXTRT = self::KEY_BASE . "extrt_"
 
const KEY_PAGE_ENTER = self::KEY_BASE . "enter_page"
 
const KEY_PREVIEW_DATA = self::KEY_BASE . "preview_data"
 
const KEY_ERRORS = self::KEY_BASE . "errors"
 
const KEY_POST_DATA = self::KEY_BASE . "post_data"
 

Detailed Description

Stores access codes of anonymous session.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 27 of file class.RunSessionRepo.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Survey\Execution\RunSessionRepo::__construct ( )

Definition at line 37 of file class.RunSessionRepo.php.

38  {
39  }

Member Function Documentation

◆ clearAllPreviewData()

ILIAS\Survey\Execution\RunSessionRepo::clearAllPreviewData ( int  $survey_id)

Definition at line 139 of file class.RunSessionRepo.php.

References ilSession\clear(), and ILIAS\Survey\Execution\RunSessionRepo\getPreviewDataKey().

139  : void
140  {
141  \ilSession::clear($this->getPreviewDataKey($survey_id));
142  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ clearCode()

ILIAS\Survey\Execution\RunSessionRepo::clearCode ( int  $survey_id)

Definition at line 68 of file class.RunSessionRepo.php.

References ilSession\clear(), and ILIAS\Survey\Execution\RunSessionRepo\getAnonymKey().

68  : void
69  {
70  \ilSession::clear($this->getAnonymKey($survey_id));
71  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ clearErrors()

ILIAS\Survey\Execution\RunSessionRepo::clearErrors ( )

Definition at line 154 of file class.RunSessionRepo.php.

References ilSession\clear().

154  : void
155  {
156  \ilSession::clear(self::KEY_ERRORS);
157  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ clearPageEnter()

ILIAS\Survey\Execution\RunSessionRepo::clearPageEnter ( )

Definition at line 96 of file class.RunSessionRepo.php.

References ilSession\clear().

96  : void
97  {
98  \ilSession::clear(self::KEY_PAGE_ENTER);
99  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ clearPostData()

ILIAS\Survey\Execution\RunSessionRepo::clearPostData ( )

Definition at line 169 of file class.RunSessionRepo.php.

References ilSession\clear().

169  : void
170  {
171  \ilSession::clear(self::KEY_POST_DATA);
172  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ clearPreviewData()

ILIAS\Survey\Execution\RunSessionRepo::clearPreviewData ( int  $survey_id,
int  $question_id 
)

Definition at line 130 of file class.RunSessionRepo.php.

References $data, ilSession\get(), ILIAS\Survey\Execution\RunSessionRepo\getPreviewDataKey(), ilSession\has(), and ilSession\set().

130  : void
131  {
132  if (\ilSession::has($this->getPreviewDataKey($survey_id))) {
133  $data = \ilSession::get($this->getPreviewDataKey($survey_id));
134  unset($data[$question_id]);
135  \ilSession::set($this->getPreviewDataKey($survey_id), $data);
136  }
137  }
static get(string $a_var)
static has($a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ getAllPreviewData()

ILIAS\Survey\Execution\RunSessionRepo::getAllPreviewData ( int  $survey_id)
protected

Definition at line 113 of file class.RunSessionRepo.php.

References ILIAS\GlobalScreen\get(), ILIAS\Survey\Execution\RunSessionRepo\getPreviewDataKey(), and ilSession\has().

Referenced by ILIAS\Survey\Execution\RunSessionRepo\setPreviewData().

113  : array
114  {
115  if (\ilSession::has($this->getPreviewDataKey($survey_id))) {
116  return \ilSession::get($this->getPreviewDataKey($survey_id));
117  }
118  return [];
119  }
get(string $class_name)
static has($a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAnonymKey()

ILIAS\Survey\Execution\RunSessionRepo::getAnonymKey ( int  $survey_id)
protected

Definition at line 41 of file class.RunSessionRepo.php.

Referenced by ILIAS\Survey\Execution\RunSessionRepo\clearCode(), ILIAS\Survey\Execution\RunSessionRepo\getCode(), ILIAS\Survey\Execution\RunSessionRepo\issetCode(), and ILIAS\Survey\Execution\RunSessionRepo\setCode().

41  : string
42  {
43  return self::KEY_ANONYM . $survey_id;
44  }
+ Here is the caller graph for this function:

◆ getCode()

ILIAS\Survey\Execution\RunSessionRepo::getCode ( int  $survey_id)

Definition at line 60 of file class.RunSessionRepo.php.

References ILIAS\GlobalScreen\get(), ILIAS\Survey\Execution\RunSessionRepo\getAnonymKey(), and ilSession\has().

Referenced by ILIAS\Survey\Execution\RunManager\initSession().

60  : string
61  {
62  if (\ilSession::has($this->getAnonymKey($survey_id))) {
63  return \ilSession::get($this->getAnonymKey($survey_id));
64  }
65  return "";
66  }
get(string $class_name)
static has($a_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getErrors()

ILIAS\Survey\Execution\RunSessionRepo::getErrors ( )

Definition at line 149 of file class.RunSessionRepo.php.

References ILIAS\GlobalScreen\get().

149  : array
150  {
151  return \ilSession::get(self::KEY_ERRORS) ?? [];
152  }
get(string $class_name)
+ Here is the call graph for this function:

◆ getPageEnter()

ILIAS\Survey\Execution\RunSessionRepo::getPageEnter ( )

Definition at line 91 of file class.RunSessionRepo.php.

References ILIAS\GlobalScreen\get().

91  : int
92  {
93  return \ilSession::get(self::KEY_PAGE_ENTER) ?? 0;
94  }
get(string $class_name)
+ Here is the call graph for this function:

◆ getPostData()

ILIAS\Survey\Execution\RunSessionRepo::getPostData ( )

Definition at line 164 of file class.RunSessionRepo.php.

References ILIAS\GlobalScreen\get().

164  : array
165  {
166  return \ilSession::get(self::KEY_POST_DATA);
167  }
get(string $class_name)
+ Here is the call graph for this function:

◆ getPreviewData()

ILIAS\Survey\Execution\RunSessionRepo::getPreviewData ( int  $survey_id,
int  $question_id 
)

Definition at line 121 of file class.RunSessionRepo.php.

References $data, ilSession\get(), ILIAS\Survey\Execution\RunSessionRepo\getPreviewDataKey(), and ilSession\has().

121  : array
122  {
123  if (\ilSession::has($this->getPreviewDataKey($survey_id))) {
124  $data = \ilSession::get($this->getPreviewDataKey($survey_id));
125  return $data[$question_id] ?? [];
126  }
127  return [];
128  }
static get(string $a_var)
static has($a_var)
+ Here is the call graph for this function:

◆ getPreviewDataKey()

ILIAS\Survey\Execution\RunSessionRepo::getPreviewDataKey ( int  $survey_id)
protected

◆ isExternalRaterValidated()

ILIAS\Survey\Execution\RunSessionRepo::isExternalRaterValidated ( int  $ref_id)

Definition at line 73 of file class.RunSessionRepo.php.

References ilSession\get(), and ilSession\has().

73  : bool
74  {
75  if (\ilSession::has(self::KEY_EXTRT . $ref_id)) {
76  return (bool) \ilSession::get(self::KEY_EXTRT . $ref_id);
77  }
78  return false;
79  }
static get(string $a_var)
$ref_id
Definition: ltiauth.php:65
static has($a_var)
+ Here is the call graph for this function:

◆ issetCode()

ILIAS\Survey\Execution\RunSessionRepo::issetCode ( int  $survey_id)

Definition at line 46 of file class.RunSessionRepo.php.

References ilSession\get(), ILIAS\Survey\Execution\RunSessionRepo\getAnonymKey(), and ilSession\has().

46  : bool
47  {
48  return (
49  \ilSession::has($this->getAnonymKey($survey_id)) &&
50  is_string(\ilSession::get($this->getAnonymKey($survey_id))) &&
51  \ilSession::get($this->getAnonymKey($survey_id)) !== ""
52  );
53  }
static get(string $a_var)
static has($a_var)
+ Here is the call graph for this function:

◆ setCode()

ILIAS\Survey\Execution\RunSessionRepo::setCode ( int  $survey_id,
string  $code 
)

Definition at line 55 of file class.RunSessionRepo.php.

References ILIAS\Survey\Execution\RunSessionRepo\getAnonymKey(), and ilSession\set().

Referenced by ILIAS\Survey\Execution\RunManager\initSession().

55  : void
56  {
57  \ilSession::set($this->getAnonymKey($survey_id), $code);
58  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setErrors()

ILIAS\Survey\Execution\RunSessionRepo::setErrors ( array  $errors)

Definition at line 144 of file class.RunSessionRepo.php.

References ilSession\set().

144  : void
145  {
146  \ilSession::set(self::KEY_ERRORS, $errors);
147  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setExternalRaterValidation()

ILIAS\Survey\Execution\RunSessionRepo::setExternalRaterValidation ( int  $ref_id,
bool  $valid 
)

Definition at line 81 of file class.RunSessionRepo.php.

References ilSession\set().

81  : void
82  {
83  \ilSession::set(self::KEY_EXTRT . $ref_id, $valid);
84  }
$valid
$ref_id
Definition: ltiauth.php:65
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setPageEnter()

ILIAS\Survey\Execution\RunSessionRepo::setPageEnter ( int  $time)

Definition at line 86 of file class.RunSessionRepo.php.

References ilSession\set().

86  : void
87  {
88  \ilSession::set(self::KEY_PAGE_ENTER, $time);
89  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setPostData()

ILIAS\Survey\Execution\RunSessionRepo::setPostData ( array  $data)

Definition at line 159 of file class.RunSessionRepo.php.

References ilSession\set().

159  : void
160  {
161  \ilSession::set(self::KEY_POST_DATA, $data);
162  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ setPreviewData()

ILIAS\Survey\Execution\RunSessionRepo::setPreviewData ( int  $survey_id,
int  $question_id,
array  $data 
)

Definition at line 106 of file class.RunSessionRepo.php.

References $data, ILIAS\Survey\Execution\RunSessionRepo\getAllPreviewData(), ILIAS\Survey\Execution\RunSessionRepo\getPreviewDataKey(), and ilSession\set().

106  : void
107  {
108  $all_data = $this->getAllPreviewData($survey_id);
109  $all_data[$question_id] = $data;
110  \ilSession::set($this->getPreviewDataKey($survey_id), $all_data);
111  }
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

Field Documentation

◆ KEY_ANONYM

const ILIAS\Survey\Execution\RunSessionRepo::KEY_ANONYM = self::KEY_BASE . "anonymous_id_"
protected

Definition at line 30 of file class.RunSessionRepo.php.

◆ KEY_BASE

const ILIAS\Survey\Execution\RunSessionRepo::KEY_BASE = "svy_run_"
protected

Definition at line 29 of file class.RunSessionRepo.php.

◆ KEY_ERRORS

const ILIAS\Survey\Execution\RunSessionRepo::KEY_ERRORS = self::KEY_BASE . "errors"
protected

Definition at line 34 of file class.RunSessionRepo.php.

◆ KEY_EXTRT

const ILIAS\Survey\Execution\RunSessionRepo::KEY_EXTRT = self::KEY_BASE . "extrt_"
protected

Definition at line 31 of file class.RunSessionRepo.php.

◆ KEY_PAGE_ENTER

const ILIAS\Survey\Execution\RunSessionRepo::KEY_PAGE_ENTER = self::KEY_BASE . "enter_page"
protected

Definition at line 32 of file class.RunSessionRepo.php.

◆ KEY_POST_DATA

const ILIAS\Survey\Execution\RunSessionRepo::KEY_POST_DATA = self::KEY_BASE . "post_data"
protected

Definition at line 35 of file class.RunSessionRepo.php.

◆ KEY_PREVIEW_DATA

const ILIAS\Survey\Execution\RunSessionRepo::KEY_PREVIEW_DATA = self::KEY_BASE . "preview_data"
protected

Definition at line 33 of file class.RunSessionRepo.php.


The documentation for this class was generated from the following file: