ILIAS  release_7 Revision v7.30-3-g800a261c036
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 136 of file class.ilAssQuestionProcessLockerDb.php.

137 {
138 if ($this->atom_query) {
139 $this->atom_query->addQueryCallable(function (ilDBInterface $ilDB) use ($operation) {
140 $operation();
141 });
142 $this->atom_query->run();
143 } else {
144 $operation();
145 }
146
147 $this->atom_query = null;
148 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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 100 of file class.ilAssQuestionProcessLockerDb.php.

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

References getTablesUsedDuringResultUpdate().

+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionAdoptOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionAdoptOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

112 {
113 $this->atom_query = $this->db->buildAtomQuery();
114 foreach (array_merge(
117 ) as $table) {
118 $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
119 }
120 }

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 $tables = array_merge($tables, $this->getTablesUsedDuringAssessmentLog());
89 }
90
91 $this->atom_query = $this->db->buildAtomQuery();
92 foreach ($tables as $table) {
93 $this->atom_query->addTableLock($table['name'])->lockSequence((bool) $table['sequence']);
94 }
95 }

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

+ Here is the call graph for this function:

◆ onBeforeExecutingUserTestResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserTestResultUpdateOperation ( )
protected

{}

Reimplemented from ilAssQuestionProcessLocker.

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

126 {
127 $this->atom_query = $this->db->buildAtomQuery();
128 $this->atom_query->addTableLock('tst_result_cache');
129 $this->atom_query->addTableLock('tst_test_result')->lockSequence(true);
130 $this->atom_query->addTableLock('tst_solutions')->lockSequence(true);
131 }

◆ 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: