ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ 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
public
function
setId
(
$id
)
59
{
60
$this->
id
=
$id
;
61
}
62
63
public
function
getId
()
64
{
65
return
$this->id
;
66
}
67
68
public
function
setUnit
(
$unit
)
69
{
70
$this->unit =
$unit
;
71
}
72
73
public
function
getUnit
()
74
{
75
return
$this->unit
;
76
}
77
78
public
function
setSequence
(
$sequence
)
79
{
80
$this->sequence =
$sequence
;
81
}
82
83
public
function
getSequence
()
84
{
85
return
$this->sequence
;
86
}
87
88
public
function
setFactor
(
$factor
)
89
{
90
$this->factor =
$factor
;
91
}
92
93
public
function
getFactor
()
94
{
95
return
$this->factor
;
96
}
97
98
public
function
setBaseUnit
(
$baseunit
)
99
{
100
if
(is_numeric(
$baseunit
) &&
$baseunit
> 0) {
101
$this->baseunit =
$baseunit
;
102
}
else
{
103
$this->baseunit = null;
104
}
105
}
106
107
public
function
getBaseUnit
()
108
{
109
if
(is_numeric($this->baseunit) && $this->baseunit > 0) {
110
return
$this->baseunit
;
111
}
else
{
112
return
$this->id
;
113
}
114
}
115
116
public
function
setCategory
(
$category
)
117
{
118
$this->category =
$category
;
119
}
120
121
public
function
getCategory
()
122
{
123
return
$this->category
;
124
}
125
126
public
function
getDisplayString()
127
{
131
global
$DIC
;
132
$lng
= $DIC[
'lng'
];
133
134
$unit
= $this->
getUnit
();
135
if
(strcmp(
'-qpl_qst_formulaquestion_'
.
$unit
.
'-'
,
$lng
->txt(
'qpl_qst_formulaquestion_'
.
$unit
)) != 0) {
136
$unit
=
$lng
->txt(
'qpl_qst_formulaquestion_'
.
$unit
);
137
}
138
return
$unit
;
139
}
140
145
public
static
function
lookupUnitFactor
($a_unit_id)
146
{
147
global
$DIC
;
148
$ilDB
= $DIC[
'ilDB'
];
149
150
$res
=
$ilDB
->queryF(
151
'SELECT factor FROM il_qpl_qst_fq_unit WHERE unit_id = %s'
,
152
array(
'integer'
),
153
array($a_unit_id)
154
);
155
156
$row
=
$ilDB
->fetchAssoc(
$res
);
157
158
return
$row
[
'factor'
];
159
}
160
}
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
$DIC
global $DIC
Definition:
saml.php:7
assFormulaQuestionUnit\lookupUnitFactor
static lookupUnitFactor($a_unit_id)
Definition:
class.assFormulaQuestionUnit.php:145
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:107
assFormulaQuestionUnit\getId
getId()
Definition:
class.assFormulaQuestionUnit.php:63
$res
foreach($_POST as $key=> $value) $res
Definition:
save_question_post_data.php:15
assFormulaQuestionUnit\setCategory
setCategory($category)
Definition:
class.assFormulaQuestionUnit.php:116
$lng
$lng
Definition:
save_question_post_data.php:23
assFormulaQuestionUnit\getCategory
getCategory()
Definition:
class.assFormulaQuestionUnit.php:121
assFormulaQuestionUnit\setBaseUnit
setBaseUnit($baseunit)
Definition:
class.assFormulaQuestionUnit.php:98
$row
$row
Definition:
migrateto20.php:360
$ilDB
global $ilDB
Definition:
storeScorm2004.php:16
assFormulaQuestionUnit\setSequence
setSequence($sequence)
Definition:
class.assFormulaQuestionUnit.php:78
php
assFormulaQuestionUnit\setBaseunitTitle
setBaseunitTitle($baseunit_title)
Definition:
class.assFormulaQuestionUnit.php:45
$data
$data
Definition:
bench.php:6
Modules
TestQuestionPool
classes
class.assFormulaQuestionUnit.php
Generated on Thu Jan 16 2025 19:02:12 for ILIAS by
1.8.13 (using
Doxyfile
)