ILIAS  release_4-4 Revision
ilAssQuestionProcessLockerFactory Class Reference
+ Collaboration diagram for ilAssQuestionProcessLockerFactory:

Public Member Functions

 __construct (ilSetting $settings, ilDB $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,
ilDB  $db 
)
Parameters
ilSetting$settings
ilDB$db

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

References $db, 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  }

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() )
116  {
118 
119  $locker = new ilAssQuestionProcessLockerNone();
120  break;
121 
123 
124  require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockFileStorage.php';
125  $storage = new ilAssQuestionProcessLockFileStorage($this->getQuestionId(), $this->getUserId());
126  $storage->create();
127 
128  $locker = new ilAssQuestionProcessLockerFile($storage);
129  break;
130 
132 
133  $locker = new ilAssQuestionProcessLockerDb($this->db);
134  $locker->setAssessmentLogEnabled($this->isAssessmentLogEnabled());
135  break;
136  }
137 
138  return $locker;
139  }
+ 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.

Referenced by getLocker().

106  {
107  return $this->settings->get('ass_process_lock_mode', ilObjAssessmentFolder::ASS_PROC_LOCK_MODE_NONE);
108  }
+ 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: