ILIAS
trunk Revision v11.0_alpha-2662-g519ff7d528f
◀ ilDoc Overview
class.ilTestNoHintsDBUpdateSteps.php
Go to the documentation of this file.
1
<?php
2
19
declare(strict_types=1);
20
21
namespace
ILIAS\Test\Setup
;
22
23
class
ilTestNoHintsDBUpdateSteps
implements
\ilDatabaseUpdateSteps
24
{
25
protected \ilDBInterface
$db
;
26
27
public
function
prepare
(\
ilDBInterface
$db): void
28
{
29
$this->db =
$db
;
30
}
31
32
private
function
dropCols
($table, $cols): void
33
{
34
foreach
($cols as $col) {
35
if
($this->db->tableColumnExists($table, $col)) {
36
$this->db->dropTableColumn($table, $col);
37
}
38
}
39
}
40
41
public
function
step_1
(): void
42
{
43
$this->
dropCols
(
'tst_tests'
, [
44
'offer_question_hints'
,
45
'highscore_hints'
46
]);
47
}
48
49
public
function
step_2
(): void
50
{
51
$this->
dropCols
(
'tst_test_result'
, [
52
'hint_count'
,
53
'hint_points'
54
]);
55
}
56
57
public
function
step_3
(): void
58
{
59
$this->
dropCols
(
'tst_pass_result'
, [
60
'hint_count'
,
61
'hint_points'
62
]);
63
}
64
65
public
function
step_4
(): void
66
{
67
$this->
dropCols
(
'tst_result_cache'
, [
68
'hint_count'
,
69
'hint_points'
70
]);
71
}
72
73
public
function
step_5
(): void
74
{
75
if
($this->db->tableExists(
'qpl_hint_tracking'
)) {
76
$this->db->dropTable(
'qpl_hint_tracking'
);
77
}
78
if
($this->db->tableExists(
'qpl_hint_tracking_seq'
)) {
79
$this->db->dropTable(
'qpl_hint_tracking_seq'
);
80
}
81
}
82
83
public
function
step_6
(): void
84
{
85
if
($this->db->tableExists(
'qpl_hints'
)) {
86
$this->db->dropTable(
'qpl_hints'
);
87
}
88
}
89
90
public
function
step_7
(): void
91
{
92
$query =
"DELETE FROM page_object WHERE parent_type = 'qht'"
;
93
$this->db->manipulate($query);
94
}
95
96
}
ILIAS\Test\Setup
Definition:
class.ilTestNoHintsDBUpdateSteps.php:21
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\prepare
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
Definition:
class.ilTestNoHintsDBUpdateSteps.php:27
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps
Definition:
class.ilTestNoHintsDBUpdateSteps.php:23
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\dropCols
dropCols($table, $cols)
Definition:
class.ilTestNoHintsDBUpdateSteps.php:32
ilDatabaseUpdateSteps
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition:
interface.ilDatabaseUpdateSteps.php:43
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_4
step_4()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:65
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_2
step_2()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:49
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_3
step_3()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:57
ilDBInterface
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_5
step_5()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:73
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_7
step_7()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:90
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_6
step_6()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:83
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\$db
ilDBInterface $db
Definition:
class.ilTestNoHintsDBUpdateSteps.php:25
ILIAS\Test\Setup\ilTestNoHintsDBUpdateSteps\step_1
step_1()
Definition:
class.ilTestNoHintsDBUpdateSteps.php:41
components
ILIAS
Test
src
Setup
class.ilTestNoHintsDBUpdateSteps.php
Generated on Wed Sep 3 2025 23:04:05 for ILIAS by
1.8.13 (using
Doxyfile
)