ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilAssQuestionProcessLockerDb.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLocker.php';
5 
13 {
17  protected $db;
18 
19  private $assessmentLogEnabled = false;
20 
24  public function __construct(ilDB $db)
25  {
26  $this->db = $db;
27  }
28 
29  public function isAssessmentLogEnabled()
30  {
32  }
33 
35  {
36  $this->assessmentLogEnabled = $assessmentLogEnabled;
37  }
38 
40  {
41  return array(
42  array('name' => 'qpl_questions', 'type' => ilDB::LOCK_WRITE),
43  array('name' => 'tst_tests', 'type' => ilDB::LOCK_WRITE),
44  array('name' => 'tst_active', 'type' => ilDB::LOCK_WRITE),
45  array('name' => 'ass_log', 'type' => ilDB::LOCK_WRITE),
46  array('name' => 'ass_log', 'type' => ilDB::LOCK_WRITE, 'sequence' => true)
47  );
48  }
49 
51  {
52  $tables = array(
53  array('name' => 'tst_solutions', 'type' => ilDB::LOCK_WRITE),
54  array('name' => 'tst_solutions', 'type' => ilDB::LOCK_WRITE, 'sequence' => true)
55  );
56 
57  if( $this->isAssessmentLogEnabled() )
58  {
59  $tables = array_merge($tables, $this->getTablesUsedDuringAssessmentLog());
60  }
61 
62  $this->db->lockTables($tables);
63  }
64 
66  {
67  $this->db->unlockTables();
68  }
69 
71  {
72  $this->db->lockTables(array(
73  array('name' => 'tst_test_result', 'type' => ilDB::LOCK_WRITE),
74  array('name' => 'tst_test_result', 'type' => ilDB::LOCK_WRITE, 'sequence' => true)
75  ));
76  }
77 
79  {
80  $this->db->unlockTables();
81  }
82 
84  {
85  // no lock neccessary, because a single replace query is used
86 
87  //$this->db->lockTables(array(
88  // array('name' => 'tst_pass_result', 'type' => ilDB::LOCK_WRITE)
89  //));
90  }
91 
93  {
94  // no lock neccessary, because a single replace query is used
95 
96  //$this->db->unlockTables();
97  }
98 
100  {
101  $this->db->lockTables(array(
102  array('name' => 'tst_result_cache', 'type' => ilDB::LOCK_WRITE)
103  ));
104  }
105 
107  {
108  $this->db->unlockTables();
109  }
110 }