ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 16 of file class.ilAssQuestionProcessLockerFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

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

References $db, $settings, and settings().

48  {
49  $this->settings = $settings;
50  $this->db = $db;
51 
52  $this->questionId = null;
53  $this->userId = null;
54  $this->assessmentLogEnabled = false;
55  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:

Member Function Documentation

◆ getLocker()

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

Definition at line 113 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().

114  {
115  switch ($this->getLockModeSettingValue()) {
117 
118  $locker = new ilAssQuestionProcessLockerNone();
119  break;
120 
122 
123  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockFileStorage.php';
124  $storage = new ilAssQuestionProcessLockFileStorage($this->getQuestionId(), $this->getUserId());
125  $storage->create();
126 
127  $locker = new ilAssQuestionProcessLockerFile($storage);
128  break;
129 
131 
132  $locker = new ilAssQuestionProcessLockerDb($this->db);
133  $locker->setAssessmentLogEnabled($this->isAssessmentLogEnabled());
134  break;
135  }
136 
137  return $locker;
138  }
+ Here is the call graph for this function:

◆ getLockModeSettingValue()

ilAssQuestionProcessLockerFactory::getLockModeSettingValue ( )
private

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

References ilObjAssessmentFolder\ASS_PROC_LOCK_MODE_NONE, and settings().

Referenced by getLocker().

106  {
107  return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
108  }
settings()
Definition: settings.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getQuestionId()

ilAssQuestionProcessLockerFactory::getQuestionId ( )
Returns
int

Definition at line 68 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 84 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 100 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 92 of file class.ilAssQuestionProcessLockerFactory.php.

References $assessmentLogEnabled.

93  {
94  $this->assessmentLogEnabled = $assessmentLogEnabled;
95  }

◆ setQuestionId()

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

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

References $questionId.

◆ setUserId()

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

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

References $userId.

Field Documentation

◆ $assessmentLogEnabled

ilAssQuestionProcessLockerFactory::$assessmentLogEnabled
protected

◆ $db

ilAssQuestionProcessLockerFactory::$db
protected

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

Referenced by __construct().

◆ $questionId

ilAssQuestionProcessLockerFactory::$questionId
protected

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

Referenced by getQuestionId(), and setQuestionId().

◆ $settings

ilAssQuestionProcessLockerFactory::$settings
protected

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

Referenced by __construct().

◆ $userId

ilAssQuestionProcessLockerFactory::$userId
protected

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

Referenced by getUserId(), and setUserId().


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