ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssQuestionProcessLockerFactory Class Reference
+ Collaboration diagram for ilAssQuestionProcessLockerFactory:

Public Member Functions

 __construct (ilSetting $settings, ilDBInterface $db)
 
 setQuestionId ($questionId)
 
 getQuestionId ()
 
 setUserId ($userId)
 
 getUserId ()
 
 setAssessmentLogEnabled ($assessmentLogEnabled)
 
 isAssessmentLogEnabled ()
 
 getLocker ()
 

Protected Attributes

 $settings
 
 $db
 
 $questionId
 
 $userId
 
 $assessmentLogEnabled
 

Private Member Functions

 getLockModeSettingValue ()
 

Detailed Description

Definition at line 25 of file class.ilAssQuestionProcessLockerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionProcessLockerFactory::__construct ( ilSetting  $settings,
ilDBInterface  $db 
)
Parameters
ilSetting$settings
ilDBInterface$db

Definition at line 56 of file class.ilAssQuestionProcessLockerFactory.php.

References $db, $settings, and ILIAS\Repository\settings().

57  {
58  $this->settings = $settings;
59  $this->db = $db;
60 
61  $this->questionId = null;
62  $this->userId = null;
63  $this->assessmentLogEnabled = false;
64  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getLocker()

ilAssQuestionProcessLockerFactory::getLocker ( )
Returns
ilAssQuestionProcessLockerDb|ilAssQuestionProcessLockerFile|ilAssQuestionProcessLockerNone

Definition at line 122 of file class.ilAssQuestionProcessLockerFactory.php.

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_DB, ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_FILE, ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, getLockModeSettingValue(), getQuestionId(), getUserId(), and isAssessmentLogEnabled().

123  {
124  switch ($this->getLockModeSettingValue()) {
126 
127  $locker = new ilAssQuestionProcessLockerNone();
128  break;
129 
131 
132  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockFileStorage.php';
133  $storage = new ilAssQuestionProcessLockFileStorage($this->getQuestionId(), $this->getUserId());
134  $storage->create();
135 
136  $locker = new ilAssQuestionProcessLockerFile($storage);
137  break;
138 
140 
141  $locker = new ilAssQuestionProcessLockerDb($this->db);
142  $locker->setAssessmentLogEnabled($this->isAssessmentLogEnabled());
143  break;
144  }
145 
146  return $locker;
147  }
+ Here is the call graph for this function:

◆ getLockModeSettingValue()

ilAssQuestionProcessLockerFactory::getLockModeSettingValue ( )
private

Definition at line 114 of file class.ilAssQuestionProcessLockerFactory.php.

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, and ILIAS\Repository\settings().

Referenced by getLocker().

114  : ?string
115  {
116  return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
117  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionId()

ilAssQuestionProcessLockerFactory::getQuestionId ( )
Returns
int

Definition at line 77 of file class.ilAssQuestionProcessLockerFactory.php.

References $questionId.

Referenced by getLocker().

+ Here is the caller graph for this function:

◆ getUserId()

ilAssQuestionProcessLockerFactory::getUserId ( )
Returns
int

Definition at line 93 of file class.ilAssQuestionProcessLockerFactory.php.

References $userId.

Referenced by getLocker().

+ Here is the caller graph for this function:

◆ isAssessmentLogEnabled()

ilAssQuestionProcessLockerFactory::isAssessmentLogEnabled ( )
Returns
bool

Definition at line 109 of file class.ilAssQuestionProcessLockerFactory.php.

References $assessmentLogEnabled.

Referenced by getLocker().

+ Here is the caller graph for this function:

◆ setAssessmentLogEnabled()

ilAssQuestionProcessLockerFactory::setAssessmentLogEnabled (   $assessmentLogEnabled)
Parameters
bool$assessmentLogEnabled

Definition at line 101 of file class.ilAssQuestionProcessLockerFactory.php.

References $assessmentLogEnabled.

101  : void
102  {
103  $this->assessmentLogEnabled = $assessmentLogEnabled;
104  }

◆ setQuestionId()

ilAssQuestionProcessLockerFactory::setQuestionId (   $questionId)
Parameters
int$questionId

Definition at line 69 of file class.ilAssQuestionProcessLockerFactory.php.

References $questionId.

69  : void
70  {
71  $this->questionId = $questionId;
72  }

◆ setUserId()

ilAssQuestionProcessLockerFactory::setUserId (   $userId)
Parameters
int$userId

Definition at line 85 of file class.ilAssQuestionProcessLockerFactory.php.

References $userId.

85  : void
86  {
87  $this->userId = $userId;
88  }

Field Documentation

◆ $assessmentLogEnabled

ilAssQuestionProcessLockerFactory::$assessmentLogEnabled
protected

◆ $db

ilAssQuestionProcessLockerFactory::$db
protected

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

Referenced by __construct().

◆ $questionId

ilAssQuestionProcessLockerFactory::$questionId
protected

Definition at line 40 of file class.ilAssQuestionProcessLockerFactory.php.

Referenced by getQuestionId(), and setQuestionId().

◆ $settings

ilAssQuestionProcessLockerFactory::$settings
protected

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

Referenced by __construct().

◆ $userId

ilAssQuestionProcessLockerFactory::$userId
protected

Definition at line 45 of file class.ilAssQuestionProcessLockerFactory.php.

Referenced by getUserId(), and setUserId().


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