ILIAS  release_8 Revision v8.24
ilAssQuestionProcessLockerDb Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockerDb:
+ Collaboration diagram for ilAssQuestionProcessLockerDb:

Public Member Functions

 __construct (ilDBInterface $db)
 
 isAssessmentLogEnabled ()
 
 setAssessmentLogEnabled ($assessmentLogEnabled)
 
- Public Member Functions inherited from ilAssQuestionProcessLocker
 executePersistWorkingStateLockOperation (callable $operation)
 
 executeUserSolutionUpdateLockOperation (callable $operation)
 
 executeUserQuestionResultUpdateOperation (callable $operation)
 
 executeUserPassResultUpdateLockOperation (callable $operation)
 
 executeUserTestResultUpdateLockOperation (callable $operation)
 
 executeUserSolutionAdoptLockOperation (callable $operation)
 

Protected Member Functions

 onBeforeExecutingUserSolutionUpdateOperation ()
 {} More...
 
 onBeforeExecutingUserQuestionResultUpdateOperation ()
 {} More...
 
 onBeforeExecutingUserSolutionAdoptOperation ()
 {} More...
 
 onBeforeExecutingUserTestResultUpdateOperation ()
 {} More...
 
 executeOperation (callable $operation)
 {
Parameters
callable$operation
} More...
 
- Protected Member Functions inherited from ilAssQuestionProcessLocker
 executeOperation (callable $operation)
 
 onBeforeExecutingPersistWorkingStateOperation ()
 
 onAfterExecutingPersistWorkingStateOperation ()
 
 onBeforeExecutingUserSolutionUpdateOperation ()
 
 onAfterExecutingUserSolutionUpdateOperation ()
 
 onBeforeExecutingUserQuestionResultUpdateOperation ()
 
 onAfterExecutingUserQuestionResultUpdateOperation ()
 
 onBeforeExecutingUserPassResultUpdateOperation ()
 
 onAfterExecutingUserPassResultUpdateOperation ()
 
 onBeforeExecutingUserTestResultUpdateOperation ()
 
 onAfterExecutingUserTestResultUpdateOperation ()
 
 onBeforeExecutingUserSolutionAdoptOperation ()
 
 onAfterExecutingUserSolutionAdoptOperation ()
 

Protected Attributes

 $db
 
 $atom_query
 

Private Member Functions

 getTablesUsedDuringAssessmentLog ()
 
 getTablesUsedDuringSolutionUpdate ()
 
 getTablesUsedDuringResultUpdate ()
 

Private Attributes

 $assessmentLogEnabled = false
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionProcessLockerDb::__construct ( ilDBInterface  $db)
Parameters
ilDBInterface$db

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

References $db.

Member Function Documentation

◆ executeOperation()

ilAssQuestionProcessLockerDb::executeOperation ( callable  $operation)
protected

{

Parameters
callable$operation
}

Reimplemented from ilAssQuestionProcessLocker.

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

149 : void
150 {
151 if ($this->atom_query) {
152 $this->atom_query->addQueryCallable(function (ilDBInterface $ilDB) use ($operation) {
153 $operation();
154 });
155 $this->atom_query->run();
156 } else {
157 $operation();
158 }
159
160 $this->atom_query = null;
161 }
Interface ilDBInterface.

References $ilDB.

◆ getTablesUsedDuringAssessmentLog()

ilAssQuestionProcessLockerDb::getTablesUsedDuringAssessmentLog ( )
private
Returns
array

Definition at line 63 of file class.ilAssQuestionProcessLockerDb.php.

63 : array
64 {
65 return array(
66 array('name' => 'qpl_questions', 'sequence' => false),
67 array('name' => 'tst_tests', 'sequence' => false),
68 array('name' => 'tst_active', 'sequence' => false),
69 array('name' => 'ass_log', 'sequence' => true)
70 );
71 }

Referenced by onBeforeExecutingUserSolutionUpdateOperation().

+ Here is the caller graph for this function:

◆ getTablesUsedDuringResultUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringResultUpdate ( )
private
Returns
array

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

86 : array
87 {
88 return array(
89 array('name' => 'tst_test_result', 'sequence' => true)
90 );
91 }

Referenced by onBeforeExecutingUserQuestionResultUpdateOperation(), and onBeforeExecutingUserSolutionAdoptOperation().

+ Here is the caller graph for this function:

◆ getTablesUsedDuringSolutionUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringSolutionUpdate ( )
private
Returns
array

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

76 : array
77 {
78 return array(
79 array('name' => 'tst_solutions', 'sequence' => true)
80 );
81 }

Referenced by onBeforeExecutingUserSolutionAdoptOperation(), and onBeforeExecutingUserSolutionUpdateOperation().

+ Here is the caller graph for this function:

◆ isAssessmentLogEnabled()

ilAssQuestionProcessLockerDb::isAssessmentLogEnabled ( )

Definition at line 50 of file class.ilAssQuestionProcessLockerDb.php.

References $assessmentLogEnabled.

Referenced by onBeforeExecutingUserSolutionUpdateOperation().

+ Here is the caller graph for this function:

◆ onBeforeExecutingUserQuestionResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserQuestionResultUpdateOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

113 : void
114 {
115 $this->atom_query = $this->db->buildAtomQuery();
116 foreach ($this->getTablesUsedDuringResultUpdate() as $table) {
117 $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
118 }
119 }

References getTablesUsedDuringResultUpdate().

+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionAdoptOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionAdoptOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

Definition at line 124 of file class.ilAssQuestionProcessLockerDb.php.

124 : void
125 {
126 $this->atom_query = $this->db->buildAtomQuery();
127 foreach (array_merge(
130 ) as $table) {
131 $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
132 }
133 }

References getTablesUsedDuringResultUpdate(), and getTablesUsedDuringSolutionUpdate().

+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionUpdateOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

96 : void
97 {
98 $tables = $this->getTablesUsedDuringSolutionUpdate();
99
100 if ($this->isAssessmentLogEnabled()) {
101 $tables = array_merge($tables, $this->getTablesUsedDuringAssessmentLog());
102 }
103
104 $this->atom_query = $this->db->buildAtomQuery();
105 foreach ($tables as $table) {
106 $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
107 }
108 }

References getTablesUsedDuringAssessmentLog(), getTablesUsedDuringSolutionUpdate(), and isAssessmentLogEnabled().

+ Here is the call graph for this function:

◆ onBeforeExecutingUserTestResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserTestResultUpdateOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

Definition at line 138 of file class.ilAssQuestionProcessLockerDb.php.

138 : void
139 {
140 $this->atom_query = $this->db->buildAtomQuery();
141 $this->atom_query->addTableLock('tst_result_cache');
142 $this->atom_query->addTableLock('tst_test_result')->lockSequence(true);
143 $this->atom_query->addTableLock('tst_solutions')->lockSequence(true);
144 }

◆ setAssessmentLogEnabled()

ilAssQuestionProcessLockerDb::setAssessmentLogEnabled (   $assessmentLogEnabled)

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

55 : void
56 {
57 $this->assessmentLogEnabled = $assessmentLogEnabled;
58 }

References $assessmentLogEnabled.

Field Documentation

◆ $assessmentLogEnabled

ilAssQuestionProcessLockerDb::$assessmentLogEnabled = false
private

◆ $atom_query

ilAssQuestionProcessLockerDb::$atom_query
protected

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

◆ $db

ilAssQuestionProcessLockerDb::$db
protected

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

Referenced by __construct().


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