ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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)
 {} 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

{}

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

References $ilDB.

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  }
Interface ilDBInterface.
global $ilDB

◆ getTablesUsedDuringAssessmentLog()

ilAssQuestionProcessLockerDb::getTablesUsedDuringAssessmentLog ( )
private
Returns
array

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

References array.

Referenced by onBeforeExecutingUserSolutionUpdateOperation().

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  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getTablesUsedDuringResultUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringResultUpdate ( )
private
Returns
array

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

References array.

Referenced by onBeforeExecutingUserQuestionResultUpdateOperation(), and onBeforeExecutingUserSolutionAdoptOperation().

74  {
75  return array(
76  array('name' => 'tst_test_result', 'sequence' => true)
77  );
78  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getTablesUsedDuringSolutionUpdate()

ilAssQuestionProcessLockerDb::getTablesUsedDuringSolutionUpdate ( )
private
Returns
array

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

References array.

Referenced by onBeforeExecutingUserSolutionAdoptOperation(), and onBeforeExecutingUserSolutionUpdateOperation().

64  {
65  return array(
66  array('name' => 'tst_solutions', 'sequence' => true)
67  );
68  }
Create styles array
The data for the language used.
+ 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

{}

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

References $table, and getTablesUsedDuringResultUpdate().

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  }
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionAdoptOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionAdoptOperation ( )
protected

{}

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

References $table, getTablesUsedDuringResultUpdate(), and getTablesUsedDuringSolutionUpdate().

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  }
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ onBeforeExecutingUserSolutionUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserSolutionUpdateOperation ( )
protected

{}

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

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

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  }
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ onBeforeExecutingUserTestResultUpdateOperation()

ilAssQuestionProcessLockerDb::onBeforeExecutingUserTestResultUpdateOperation ( )
protected

{}

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.

References $assessmentLogEnabled.

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

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: