ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 12 of file class.ilAssQuestionProcessLockerDb.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 32 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 137 of file class.ilAssQuestionProcessLockerDb.php.

138 {
139 if($this->atom_query)
140 {
141 $this->atom_query->addQueryCallable(function(ilDBInterface $ilDB) use ($operation) {
142 $operation();
143 });
144 $this->atom_query->run();
145 }
146 else
147 {
148 $operation();
149 }
150
151 $this->atom_query = null;
152 }
Interface ilDBInterface.
global $ilDB

References $ilDB.

◆ getTablesUsedDuringAssessmentLog()

ilAssQuestionProcessLockerDb::getTablesUsedDuringAssessmentLog ( )
private
Returns
array

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

51 {
52 return array(
53 array('name' => 'qpl_questions', 'sequence' => false),
54 array('name' => 'tst_tests', 'sequence' => false),
55 array('name' => 'tst_active', 'sequence' => false),
56 array('name' => 'ass_log', 'sequence' => true)
57 );
58 }

Referenced by onBeforeExecutingUserSolutionUpdateOperation().

+ Here is the caller graph for this function:

◆ getTablesUsedDuringResultUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringResultUpdate ( )
private
Returns
array

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

74 {
75 return array(
76 array('name' => 'tst_test_result', 'sequence' => true)
77 );
78 }

Referenced by onBeforeExecutingUserQuestionResultUpdateOperation(), and onBeforeExecutingUserSolutionAdoptOperation().

+ Here is the caller graph for this function:

◆ getTablesUsedDuringSolutionUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringSolutionUpdate ( )
private
Returns
array

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

64 {
65 return array(
66 array('name' => 'tst_solutions', 'sequence' => true)
67 );
68 }

Referenced by onBeforeExecutingUserSolutionAdoptOperation(), and onBeforeExecutingUserSolutionUpdateOperation().

+ Here is the caller graph for this function:

◆ isAssessmentLogEnabled()

ilAssQuestionProcessLockerDb::isAssessmentLogEnabled ( )

Definition at line 37 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 102 of file class.ilAssQuestionProcessLockerDb.php.

103 {
104 $this->atom_query = $this->db->buildAtomQuery();
105 foreach($this->getTablesUsedDuringResultUpdate() as $table)
106 {
107 $this->atom_query->addTableLock($table['name'])->lockSequence((bool)$table['sequence']);
108 }
109 }

References getTablesUsedDuringResultUpdate().

+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionAdoptOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionAdoptOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

115 {
116 $this->atom_query = $this->db->buildAtomQuery();
117 foreach(array_merge(
119 ) as $table)
120 {
121 $this->atom_query->addTableLock($table['name'])->lockSequence((bool)$table['sequence']);
122 }
123 }

References getTablesUsedDuringResultUpdate(), and getTablesUsedDuringSolutionUpdate().

+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionUpdateOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

84 {
85 $tables = $this->getTablesUsedDuringSolutionUpdate();
86
87 if($this->isAssessmentLogEnabled())
88 {
89 $tables = array_merge($tables, $this->getTablesUsedDuringAssessmentLog());
90 }
91
92 $this->atom_query = $this->db->buildAtomQuery();
93 foreach($tables as $table)
94 {
95 $this->atom_query->addTableLock($table['name'])->lockSequence((bool)$table['sequence']);
96 }
97 }

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

+ Here is the call graph for this function:

◆ onBeforeExecutingUserTestResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserTestResultUpdateOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

129 {
130 $this->atom_query = $this->db->buildAtomQuery();
131 $this->atom_query->addTableLock('tst_result_cache');
132 }

◆ setAssessmentLogEnabled()

ilAssQuestionProcessLockerDb::setAssessmentLogEnabled (   $assessmentLogEnabled)

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

43 {
44 $this->assessmentLogEnabled = $assessmentLogEnabled;
45 }

References $assessmentLogEnabled.

Field Documentation

◆ $assessmentLogEnabled

ilAssQuestionProcessLockerDb::$assessmentLogEnabled = false
private

◆ $atom_query

ilAssQuestionProcessLockerDb::$atom_query
protected

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

◆ $db

ilAssQuestionProcessLockerDb::$db
protected

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

Referenced by __construct().


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