ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
◀ ilDoc Overview
class.assFormulaQuestionUnit.php
Go to the documentation of this file.
1
<?
php
2
/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
11
class
assFormulaQuestionUnit
12
{
13
private
$unit
=
''
;
14
private
$factor
= 0.0;
15
private
$baseunit
= 0;
16
private
$baseunit_title
=
''
;
17
private
$id
= 0;
18
private
$category
= 0;
19
private
$sequence
= 0;
20
24
public
function
__construct
()
25
{
26
}
27
31
public
function
initFormArray
(
array
$data
)
32
{
33
$this->
id
= $data[
'unit_id'
];
34
$this->unit = $data[
'unit'
];
35
$this->factor = $data[
'factor'
];
36
$this->baseunit = $data[
'baseunit_fi'
];
37
$this->baseunit_title = $data[
'baseunit_title'
];
38
$this->category = $data[
'category'
];
39
$this->sequence = $data[
'sequence'
];
40
}
41
45
public
function
setBaseunitTitle
(
$baseunit_title
)
46
{
47
$this->baseunit_title =
$baseunit_title
;
48
}
49
53
public
function
getBaseunitTitle
()
54
{
55
return
$this->baseunit_title
;
56
}
57
58
function
setId
(
$id
)
59
{
60
$this->
id
=
$id
;
61
}
62
63
function
getId
()
64
{
65
return
$this->id
;
66
}
67
68
function
setUnit
(
$unit
)
69
{
70
$this->unit =
$unit
;
71
}
72
73
function
getUnit
()
74
{
75
return
$this->unit
;
76
}
77
78
function
setSequence
(
$sequence
)
79
{
80
$this->sequence =
$sequence
;
81
}
82
83
function
getSequence
()
84
{
85
return
$this->sequence
;
86
}
87
88
function
setFactor
(
$factor
)
89
{
90
$this->factor =
$factor
;
91
}
92
93
function
getFactor
()
94
{
95
return
$this->factor
;
96
}
97
98
function
setBaseUnit
(
$baseunit
)
99
{
100
if
(is_numeric(
$baseunit
) &&
$baseunit
> 0)
101
{
102
$this->baseunit =
$baseunit
;
103
}
104
else
105
{
106
$this->baseunit = null;
107
}
108
}
109
110
function
getBaseUnit
()
111
{
112
if
(is_numeric($this->baseunit) && $this->baseunit > 0)
113
{
114
return
$this->baseunit
;
115
}
116
else
117
{
118
return
$this->id
;
119
}
120
}
121
122
function
setCategory
(
$category
)
123
{
124
$this->category =
$category
;
125
}
126
127
function
getCategory
()
128
{
129
return
$this->category
;
130
}
131
132
function
getDisplayString()
133
{
137
global
$lng
;
138
139
$unit
= $this->
getUnit
();
140
if
(strcmp(
'-qpl_qst_formulaquestion_'
.
$unit
.
'-'
, $lng->txt(
'qpl_qst_formulaquestion_'
.
$unit
)) != 0)
141
{
142
$unit
= $lng->txt(
'qpl_qst_formulaquestion_'
.
$unit
);
143
}
144
return
$unit
;
145
}
146
151
public
static
function
lookupUnitFactor
($a_unit_id)
152
{
153
global
$ilDB
;
154
155
$res
= $ilDB->queryF(
'SELECT factor FROM il_qpl_qst_fq_unit WHERE unit_id = %s'
,
156
array
(
'integer'
),
array
($a_unit_id));
157
158
$row
= $ilDB->fetchAssoc(
$res
);
159
160
return
$row
[
'factor'
];
161
}
162
}
assFormulaQuestionUnit\getUnit
getUnit()
Definition:
class.assFormulaQuestionUnit.php:73
assFormulaQuestionUnit\$baseunit_title
$baseunit_title
Definition:
class.assFormulaQuestionUnit.php:16
assFormulaQuestionUnit\getBaseunitTitle
getBaseunitTitle()
Definition:
class.assFormulaQuestionUnit.php:53
assFormulaQuestionUnit\getSequence
getSequence()
Definition:
class.assFormulaQuestionUnit.php:83
assFormulaQuestionUnit\setUnit
setUnit($unit)
Definition:
class.assFormulaQuestionUnit.php:68
assFormulaQuestionUnit
Formula Question Unit.
Definition:
class.assFormulaQuestionUnit.php:11
assFormulaQuestionUnit\$sequence
$sequence
Definition:
class.assFormulaQuestionUnit.php:19
assFormulaQuestionUnit\setFactor
setFactor($factor)
Definition:
class.assFormulaQuestionUnit.php:88
assFormulaQuestionUnit\getFactor
getFactor()
Definition:
class.assFormulaQuestionUnit.php:93
assFormulaQuestionUnit\$id
$id
Definition:
class.assFormulaQuestionUnit.php:17
assFormulaQuestionUnit\$factor
$factor
Definition:
class.assFormulaQuestionUnit.php:14
$res
$res
Definition:
examplelayouts.sql.php:25
assFormulaQuestionUnit\lookupUnitFactor
static lookupUnitFactor($a_unit_id)
Definition:
class.assFormulaQuestionUnit.php:151
assFormulaQuestionUnit\__construct
__construct()
Definition:
class.assFormulaQuestionUnit.php:24
assFormulaQuestionUnit\setId
setId($id)
Definition:
class.assFormulaQuestionUnit.php:58
assFormulaQuestionUnit\$category
$category
Definition:
class.assFormulaQuestionUnit.php:18
assFormulaQuestionUnit\$baseunit
$baseunit
Definition:
class.assFormulaQuestionUnit.php:15
assFormulaQuestionUnit\$unit
$unit
Definition:
class.assFormulaQuestionUnit.php:13
assFormulaQuestionUnit\initFormArray
initFormArray(array $data)
Definition:
class.assFormulaQuestionUnit.php:31
assFormulaQuestionUnit\getBaseUnit
getBaseUnit()
Definition:
class.assFormulaQuestionUnit.php:110
assFormulaQuestionUnit\getId
getId()
Definition:
class.assFormulaQuestionUnit.php:63
assFormulaQuestionUnit\setCategory
setCategory($category)
Definition:
class.assFormulaQuestionUnit.php:122
assFormulaQuestionUnit\getCategory
getCategory()
Definition:
class.assFormulaQuestionUnit.php:127
$data
$data
Definition:
test-settings.sample.php:14
assFormulaQuestionUnit\setBaseUnit
setBaseUnit($baseunit)
Definition:
class.assFormulaQuestionUnit.php:98
array
Create styles array
The data for the language used.
Definition:
40duplicateStyle.php:19
$lng
global $lng
Definition:
privfeed.php:17
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
assFormulaQuestionUnit\setSequence
setSequence($sequence)
Definition:
class.assFormulaQuestionUnit.php:78
php
$row
$row
Definition:
10autofilter-selection-1.php:74
assFormulaQuestionUnit\setBaseunitTitle
setBaseunitTitle($baseunit_title)
Definition:
class.assFormulaQuestionUnit.php:45
Modules
TestQuestionPool
classes
class.assFormulaQuestionUnit.php
Generated on Fri Jan 17 2025 19:01:04 for ILIAS by
1.8.13 (using
Doxyfile
)