Skip to content
GitLab
Explore
Sign in
formatest
FormATest_QuestionSetPool
Compare revisions
dac62171f9f4b208778bdbb4996d236af1fe3adc to 381d5850e2bde24749dbdf4affb7ff3984e296ea
Expand all
Show whitespace changes
Inline
Side-by-side
classes/models/abstract.ilPluginModelList.php
View file @
381d5850
...
@@ -38,8 +38,7 @@ abstract class ilPluginModelList
...
@@ -38,8 +38,7 @@ abstract class ilPluginModelList
*/
*/
public
function
getData
()
public
function
getData
()
{
{
if
(
!
$this
->
isLoaded
())
if
(
!
$this
->
isLoaded
())
{
{
$data
=
$this
->
loadData
();
$data
=
$this
->
loadData
();
$this
->
data
=
$this
->
createObjectsFromData
(
$data
);
$this
->
data
=
$this
->
createObjectsFromData
(
$data
);
$this
->
setLoaded
(
true
);
$this
->
setLoaded
(
true
);
...
@@ -79,4 +78,3 @@ abstract class ilPluginModelList
...
@@ -79,4 +78,3 @@ abstract class ilPluginModelList
*/
*/
abstract
public
function
createObjectsFromData
(
$data
);
abstract
public
function
createObjectsFromData
(
$data
);
}
}
\ No newline at end of file
classes/models/class.ilQuestionPoolQuestionList.php
View file @
381d5850
...
@@ -34,12 +34,10 @@ class ilQuestionPoolQuestionList extends ilPluginModelList
...
@@ -34,12 +34,10 @@ class ilQuestionPoolQuestionList extends ilPluginModelList
public
function
loadData
(
$params
=
array
(),
$filter
=
array
())
public
function
loadData
(
$params
=
array
(),
$filter
=
array
())
{
{
require_once
"./Customizing/global/plugins/Services/Repository/RepositoryObject/QuestionSetPool/classes/providers/class.ilQuestionSetPoolQuestionsBrowserProvider.php"
;
require_once
"./Customizing/global/plugins/Services/Repository/RepositoryObject/QuestionSetPool/classes/providers/class.ilQuestionSetPoolQuestionsBrowserProvider.php"
;
require_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php"
;
$available_pools
=
array_keys
(
ilObjQuestionPool
::
_getAvailableQuestionpools
(
true
,
false
,
false
,
false
,
false
));
$available_pools
=
array_keys
(
ilObjQuestionPool
::
_getAvailableQuestionpools
(
true
,
false
,
false
,
false
,
false
));
if
(
is_array
(
$available_pools
)
&&
count
(
$available_pools
)
==
0
)
if
(
is_array
(
$available_pools
)
&&
count
(
$available_pools
)
==
0
)
{
{
return
null
;
return
null
;
}
}
...
@@ -62,4 +60,3 @@ class ilQuestionPoolQuestionList extends ilPluginModelList
...
@@ -62,4 +60,3 @@ class ilQuestionPoolQuestionList extends ilPluginModelList
return
$data
;
return
$data
;
}
}
}
}
\ No newline at end of file
classes/models/class.ilQuestionSetPoolJumpCondition.php
View file @
381d5850
<?php
<?php
require_once
"abstract.ilPluginModel.php"
;
require_once
"abstract.ilPluginModel.php"
;
require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php"
;
require_once
"class.ilQuestionSetPoolNode.php"
;
require_once
"class.ilQuestionSetPoolNode.php"
;
/**
/**
...
@@ -31,7 +30,7 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -31,7 +30,7 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
/**
/**
* @var int
* @var int
*/
*/
protected
$repititions
=
NULL
;
protected
$repititions
=
null
;
/**
/**
* @var int
* @var int
...
@@ -41,17 +40,17 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -41,17 +40,17 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
/**
/**
* @var string null
* @var string null
*/
*/
protected
$true_feedback
=
NULL
;
protected
$true_feedback
=
null
;
/**
/**
* @var string null
* @var string null
*/
*/
protected
$true_jump_feedback
=
NULL
;
protected
$true_jump_feedback
=
null
;
/**
/**
* @var string null
* @var string null
*/
*/
protected
$false_feedback
=
NULL
;
protected
$false_feedback
=
null
;
/**
/**
* @param string $jump_condition
* @param string $jump_condition
...
@@ -139,13 +138,11 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -139,13 +138,11 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
$ilDB
=
$DIC
->
database
();
$ilDB
=
$DIC
->
database
();
$question_id
=
null
;
$question_id
=
null
;
if
(
$this
->
getQuestion
()
!=
null
)
if
(
$this
->
getQuestion
()
!=
null
)
{
{
$question_id
=
$this
->
getQuestion
()
->
getId
();
$question_id
=
$this
->
getQuestion
()
->
getId
();
}
}
if
(
$this
->
id
>
0
)
if
(
$this
->
id
>
0
)
{
{
return
(
bool
)
$ilDB
->
update
(
return
(
bool
)
$ilDB
->
update
(
"rep_robj_xqsp_jmp_con"
,
"rep_robj_xqsp_jmp_con"
,
array
(
array
(
...
@@ -161,9 +158,7 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -161,9 +158,7 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
"id"
=>
array
(
"integer"
,
$this
->
getId
())
"id"
=>
array
(
"integer"
,
$this
->
getId
())
)
)
);
);
}
}
else
{
else
{
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_jmp_con"
));
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_jmp_con"
));
$this
->
setSorting
(
time
());
$this
->
setSorting
(
time
());
...
@@ -209,8 +204,6 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -209,8 +204,6 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
$this
->
setRepititions
(
$data
[
"repititions"
]);
$this
->
setRepititions
(
$data
[
"repititions"
]);
$this
->
setSorting
(
$data
[
"sorting"
]);
$this
->
setSorting
(
$data
[
"sorting"
]);
require_once
'Services/RTE/classes/class.ilRTE.php'
;
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'true_feedback'
],
1
));
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'true_feedback'
],
1
));
$this
->
setTrueJumpFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'true_jmp_feedback'
],
1
));
$this
->
setTrueJumpFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'true_jmp_feedback'
],
1
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'false_feedback'
],
1
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'false_feedback'
],
1
));
...
@@ -232,8 +225,7 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -232,8 +225,7 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
$clone
->
setSorting
(
$this
->
getSorting
());
$clone
->
setSorting
(
$this
->
getSorting
());
$question_id
=
null
;
$question_id
=
null
;
if
(
$this
->
getQuestion
()
!=
null
)
if
(
$this
->
getQuestion
()
!=
null
)
{
{
$question_id
=
$this
->
getQuestion
()
->
getId
();
$question_id
=
$this
->
getQuestion
()
->
getId
();
}
}
...
@@ -272,17 +264,12 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -272,17 +264,12 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
{
{
$this
->
setJumpCondition
(
$form
->
getInput
(
"jump_condition"
));
$this
->
setJumpCondition
(
$form
->
getInput
(
"jump_condition"
));
$this
->
setQuestion
(
assQuestion
::
_instanciateQuestion
(
$form
->
getInput
(
"question"
)));
$this
->
setQuestion
(
assQuestion
::
_instanciateQuestion
(
$form
->
getInput
(
"question"
)));
if
(
$form
->
getInput
(
"repititions"
)
!=
""
)
if
(
$form
->
getInput
(
"repititions"
)
!=
""
)
{
{
$this
->
setRepititions
(
$form
->
getInput
(
"repititions"
));
$this
->
setRepititions
(
$form
->
getInput
(
"repititions"
));
}
}
else
{
else
{
$this
->
setRepititions
(
null
);
$this
->
setRepititions
(
null
);
}
}
require_once
'Services/RTE/classes/class.ilRTE.php'
;
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$form
->
getInput
(
'true_feedback'
),
0
));
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$form
->
getInput
(
'true_feedback'
),
0
));
$this
->
setTrueJumpFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$form
->
getInput
(
'true_jump_feedback'
),
0
));
$this
->
setTrueJumpFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$form
->
getInput
(
'true_jump_feedback'
),
0
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$form
->
getInput
(
'false_feedback'
),
0
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$form
->
getInput
(
'false_feedback'
),
0
));
...
@@ -338,13 +325,13 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -338,13 +325,13 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
public
function
import
()
public
function
import
()
{
{
global
$DIC
;
global
$DIC
;
$ilDB
=
$DIC
->
database
();
B
;
$ilDB
=
$DIC
->
database
();
B
;
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_jmp_con"
));
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_jmp_con"
));
$question_id
=
null
;
$question_id
=
null
;
if
(
$this
->
getQuestion
()
!=
null
)
if
(
$this
->
getQuestion
()
!=
null
)
{
{
$question_id
=
$this
->
getQuestion
()
->
getId
();
$question_id
=
$this
->
getQuestion
()
->
getId
();
}
}
...
@@ -364,6 +351,4 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
...
@@ -364,6 +351,4 @@ class ilQuestionSetPoolJumpCondition extends ilPluginModel
)
)
);
);
}
}
}
}
\ No newline at end of file
classes/models/class.ilQuestionSetPoolJumpConditionList.php
View file @
381d5850
...
@@ -51,4 +51,3 @@ class ilQuestionSetPoolJumpConditionList extends ilPluginModelList
...
@@ -51,4 +51,3 @@ class ilQuestionSetPoolJumpConditionList extends ilPluginModelList
return
$data
;
return
$data
;
}
}
}
}
\ No newline at end of file
classes/models/class.ilQuestionSetPoolNode.php
View file @
381d5850
<?php
<?php
require_once
"abstract.ilPluginModel.php"
;
require_once
"abstract.ilPluginModel.php"
;
require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php"
;
/**
/**
* Class ilQuestionSetPoolNode
* Class ilQuestionSetPoolNode
...
@@ -51,17 +50,17 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -51,17 +50,17 @@ class ilQuestionSetPoolNode extends ilPluginModel
/**
/**
* @var int
* @var int
*/
*/
protected
$dominant_scoring
=
NULL
;
protected
$dominant_scoring
=
null
;
/**
/**
* @var string null
* @var string null
*/
*/
protected
$true_feedback
=
NULL
;
protected
$true_feedback
=
null
;
/**
/**
* @var string null
* @var string null
*/
*/
protected
$false_feedback
=
NULL
;
protected
$false_feedback
=
null
;
public
function
__construct
(
$id
=
0
)
public
function
__construct
(
$id
=
0
)
{
{
...
@@ -215,8 +214,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -215,8 +214,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
global
$DIC
;
global
$DIC
;
$ilDB
=
$DIC
->
database
();
$ilDB
=
$DIC
->
database
();
if
(
$this
->
id
>
0
)
if
(
$this
->
id
>
0
)
{
{
return
(
bool
)
$ilDB
->
update
(
return
(
bool
)
$ilDB
->
update
(
"rep_robj_xqsp_node"
,
"rep_robj_xqsp_node"
,
array
(
array
(
...
@@ -230,9 +228,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -230,9 +228,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
'id'
=>
array
(
"integer"
,
$this
->
getId
())
'id'
=>
array
(
"integer"
,
$this
->
getId
())
)
)
);
);
}
}
else
{
else
{
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_node"
));
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_node"
));
return
$ilDB
->
queryF
(
return
$ilDB
->
queryF
(
...
@@ -273,7 +269,6 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -273,7 +269,6 @@ class ilQuestionSetPoolNode extends ilPluginModel
$this
->
setQuestion
(
assQuestion
::
_instantiateQuestion
(
$data
[
'question_fi'
]));
$this
->
setQuestion
(
assQuestion
::
_instantiateQuestion
(
$data
[
'question_fi'
]));
$this
->
question_index
=
$data
[
"question_index"
];
$this
->
question_index
=
$data
[
"question_index"
];
require_once
'Services/RTE/classes/class.ilRTE.php'
;
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'true_feedback'
],
1
));
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'true_feedback'
],
1
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'false_feedback'
],
1
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$data
[
'false_feedback'
],
1
));
...
@@ -312,8 +307,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -312,8 +307,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
require_once
"class.ilQuestionSetPoolJumpCondition.php"
;
require_once
"class.ilQuestionSetPoolJumpCondition.php"
;
$data
=
$this
->
getJumpConditionList
()
->
getData
();
$data
=
$this
->
getJumpConditionList
()
->
getData
();
foreach
(
$data
as
$element
)
foreach
(
$data
as
$element
)
{
{
$condition
=
new
ilQuestionSetPoolJumpCondition
(
$element
[
"id"
]);
$condition
=
new
ilQuestionSetPoolJumpCondition
(
$element
[
"id"
]);
$condition
->
read
();
$condition
->
read
();
$condition
->
duplicate
(
$clone
,
$question_ids
);
$condition
->
duplicate
(
$clone
,
$question_ids
);
...
@@ -341,25 +335,19 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -341,25 +335,19 @@ class ilQuestionSetPoolNode extends ilPluginModel
*/
*/
public
function
bindForm
(
ilPropertyFormGUI
$form
)
public
function
bindForm
(
ilPropertyFormGUI
$form
)
{
{
require_once
'Services/RTE/classes/class.ilRTE.php'
;
if
((
$input
=
$form
->
getInput
(
"initial_condition"
))
!==
null
)
{
if
((
$input
=
$form
->
getInput
(
"initial_condition"
))
!==
null
)
{
$this
->
setInitialCondition
(
$input
);
$this
->
setInitialCondition
(
$input
);
}
}
if
((
$input
=
$form
->
getInput
(
"question_fi"
))
!=
null
)
if
((
$input
=
$form
->
getInput
(
"question_fi"
))
!=
null
)
{
{
$this
->
setQuestion
(
assQuestion
::
_instanciateQuestion
(
$input
));
$this
->
setQuestion
(
assQuestion
::
_instanciateQuestion
(
$input
));
}
}
if
((
$input
=
$form
->
getInput
(
"true_feedback"
))
!=
NULL
)
if
((
$input
=
$form
->
getInput
(
"true_feedback"
))
!=
null
)
{
{
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$input
,
0
));
$this
->
setTrueFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$input
,
0
));
}
}
if
((
$input
=
$form
->
getInput
(
"false_feedback"
))
!=
NULL
)
if
((
$input
=
$form
->
getInput
(
"false_feedback"
))
!=
null
)
{
{
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$input
,
0
));
$this
->
setFalseFeedback
(
ilRTE
::
_replaceMediaObjectImageSrc
(
$input
,
0
));
}
}
}
}
...
@@ -368,8 +356,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
...
@@ -368,8 +356,7 @@ class ilQuestionSetPoolNode extends ilPluginModel
{
{
require_once
"class.ilQuestionSetPoolJumpCondition.php"
;
require_once
"class.ilQuestionSetPoolJumpCondition.php"
;
$data
=
$this
->
getJumpConditionList
()
->
getData
();
$data
=
$this
->
getJumpConditionList
()
->
getData
();
foreach
(
$data
as
$element
)
foreach
(
$data
as
$element
)
{
{
$condition
=
new
ilQuestionSetPoolJumpCondition
(
$element
[
"id"
]);
$condition
=
new
ilQuestionSetPoolJumpCondition
(
$element
[
"id"
]);
$condition
->
read
();
$condition
->
read
();
$condition
->
remove
();
$condition
->
remove
();
...
...
classes/models/class.ilQuestionSetPoolNodeList.php
View file @
381d5850
...
@@ -54,7 +54,6 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
...
@@ -54,7 +54,6 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
public
function
getQuestionIds
()
public
function
getQuestionIds
()
{
{
}
}
/**
/**
...
@@ -66,10 +65,8 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
...
@@ -66,10 +65,8 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
{
{
$data
=
$this
->
getData
();
$data
=
$this
->
getData
();
foreach
(
$data
as
$item
)
foreach
(
$data
as
$item
)
{
{
if
(
$item
[
"node_index"
]
>
$current_node
->
getIndex
())
{
if
(
$item
[
"node_index"
]
>
$current_node
->
getIndex
())
{
$node
=
new
ilQuestionSetPoolNode
(
$item
[
"id"
]);
$node
=
new
ilQuestionSetPoolNode
(
$item
[
"id"
]);
$node
->
read
();
$node
->
read
();
return
$node
;
return
$node
;
...
@@ -89,10 +86,8 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
...
@@ -89,10 +86,8 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
$data
=
$this
->
getData
();
$data
=
$this
->
getData
();
$prev
=
null
;
$prev
=
null
;
foreach
(
$data
as
$item
)
foreach
(
$data
as
$item
)
{
{
if
(
$item
[
"node_index"
]
==
$current_node
->
getIndex
()
&&
$prev
!=
null
)
{
if
(
$item
[
"node_index"
]
==
$current_node
->
getIndex
()
&&
$prev
!=
null
)
{
$prev
=
new
ilQuestionSetPoolNode
(
$prev
[
"id"
]);
$prev
=
new
ilQuestionSetPoolNode
(
$prev
[
"id"
]);
$prev
->
read
();
$prev
->
read
();
return
$prev
;
return
$prev
;
...
@@ -111,10 +106,8 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
...
@@ -111,10 +106,8 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
{
{
$data
=
$this
->
getData
();
$data
=
$this
->
getData
();
foreach
(
$data
as
$item
)
foreach
(
$data
as
$item
)
{
{
if
(
$item
[
"question_fi"
]
==
$question_id
)
{
if
(
$item
[
"question_fi"
]
==
$question_id
)
{
$node
=
new
ilQuestionSetPoolNode
(
$item
[
"id"
]);
$node
=
new
ilQuestionSetPoolNode
(
$item
[
"id"
]);
$node
->
read
();
$node
->
read
();
return
$node
;
return
$node
;
...
@@ -132,8 +125,7 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
...
@@ -132,8 +125,7 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
{
{
require_once
"class.ilQuestionSetPoolJumpConditionList.php"
;
require_once
"class.ilQuestionSetPoolJumpConditionList.php"
;
require_once
"class.ilQuestionSetPoolNode.php"
;
require_once
"class.ilQuestionSetPoolNode.php"
;
foreach
(
$data
as
$key
=>
$element
)
foreach
(
$data
as
$key
=>
$element
)
{
{
$node
=
new
ilQuestionSetPoolNode
(
$element
[
"id"
]);
$node
=
new
ilQuestionSetPoolNode
(
$element
[
"id"
]);
$node
->
read
();
$node
->
read
();
...
@@ -144,4 +136,3 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
...
@@ -144,4 +136,3 @@ class ilQuestionSetPoolNodeList extends ilPluginModelList
return
$data
;
return
$data
;
}
}
}
}
\ No newline at end of file
classes/models/class.ilQuestionSetPoolPath.php
View file @
381d5850
...
@@ -130,10 +130,8 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -130,10 +130,8 @@ class ilQuestionSetPoolPath extends ilPluginModel
public
function
isQuestionInPath
(
$question_id
)
public
function
isQuestionInPath
(
$question_id
)
{
{
$data
=
$this
->
getNodes
()
->
getData
();
$data
=
$this
->
getNodes
()
->
getData
();
foreach
(
$data
as
$item
)
foreach
(
$data
as
$item
)
{
{
if
(
$item
[
"question_fi"
]
==
$question_id
)
{
if
(
$item
[
"question_fi"
]
==
$question_id
)
{
return
true
;
return
true
;
}
}
}
}
...
@@ -164,16 +162,13 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -164,16 +162,13 @@ class ilQuestionSetPoolPath extends ilPluginModel
global
$DIC
;
global
$DIC
;
$ilDB
=
$DIC
->
database
();
$ilDB
=
$DIC
->
database
();
if
(
$this
->
id
>
0
)
if
(
$this
->
id
>
0
)
{
{
$ilDB
->
update
(
$ilDB
->
update
(
"rep_robj_xqsp_path"
,
"rep_robj_xqsp_path"
,
array
(
"title"
=>
array
(
"text"
,
$this
->
getTitle
())),
array
(
"title"
=>
array
(
"text"
,
$this
->
getTitle
())),
array
(
"id"
=>
array
(
"integer"
,
$this
->
getId
()))
array
(
"id"
=>
array
(
"integer"
,
$this
->
getId
()))
);
);
}
}
else
{
else
{
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_path"
));
$this
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_path"
));
$success
=
$ilDB
->
queryF
(
$success
=
$ilDB
->
queryF
(
"INSERT INTO rep_robj_xqsp_path (id, title, questionset_fi, path_index)
"INSERT INTO rep_robj_xqsp_path (id, title, questionset_fi, path_index)
...
@@ -262,8 +257,7 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -262,8 +257,7 @@ class ilQuestionSetPoolPath extends ilPluginModel
$clone
=
clone
$this
;
$clone
=
clone
$this
;
$clone
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_path"
));
$clone
->
setId
(
$ilDB
->
nextId
(
"rep_robj_xqsp_path"
));
if
(
$title
!=
""
)
if
(
$title
!=
""
)
{
{
$clone
->
setTitle
(
$title
);
$clone
->
setTitle
(
$title
);
}
}
...
@@ -281,8 +275,7 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -281,8 +275,7 @@ class ilQuestionSetPoolPath extends ilPluginModel
require_once
"class.ilQuestionSetPoolNode.php"
;
require_once
"class.ilQuestionSetPoolNode.php"
;
$data
=
$this
->
getNodes
()
->
getData
();
$data
=
$this
->
getNodes
()
->
getData
();
foreach
(
$data
as
$element
)
foreach
(
$data
as
$element
)
{
{
$node
=
new
ilQuestionSetPoolNode
(
$element
[
"id"
]);
$node
=
new
ilQuestionSetPoolNode
(
$element
[
"id"
]);
$node
->
read
();
$node
->
read
();
$node
->
duplicate
(
$clone
,
$question_ids
);
$node
->
duplicate
(
$clone
,
$question_ids
);
...
@@ -320,8 +313,7 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -320,8 +313,7 @@ class ilQuestionSetPoolPath extends ilPluginModel
);
);
$data
=
array
();
$data
=
array
();
while
((
$row
=
$ilDB
->
fetchAssoc
(
$result
))
!=
null
)
while
((
$row
=
$ilDB
->
fetchAssoc
(
$result
))
!=
null
)
{
{
$data
[]
=
$row
;
$data
[]
=
$row
;
}
}
return
$data
;
return
$data
;
...
@@ -338,12 +330,10 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -338,12 +330,10 @@ class ilQuestionSetPoolPath extends ilPluginModel
$current_nodes
=
$this
->
getNodes
()
->
getData
();
$current_nodes
=
$this
->
getNodes
()
->
getData
();
$compate_nodes
=
$path
->
getNodes
()
->
getData
();
$compate_nodes
=
$path
->
getNodes
()
->
getData
();
for
(
$i
=
0
;
$i
<
$index
;
$i
++
)
for
(
$i
=
0
;
$i
<
$index
;
$i
++
)
{
{
if
(
if
(
$current_nodes
[
$i
][
"question_index"
]
!=
$compate_nodes
[
$i
][
"question_index"
]
$current_nodes
[
$i
][
"question_index"
]
!=
$compate_nodes
[
$i
][
"question_index"
]
)
)
{
{
return
false
;
return
false
;
}
}
}
}
...
@@ -364,12 +354,10 @@ class ilQuestionSetPoolPath extends ilPluginModel
...
@@ -364,12 +354,10 @@ class ilQuestionSetPoolPath extends ilPluginModel
require_once
"class.ilQuestionSetPoolNode.php"
;
require_once
"class.ilQuestionSetPoolNode.php"
;
$data
=
$this
->
getNodes
()
->
getData
();
$data
=
$this
->
getNodes
()
->
getData
();
foreach
(
$data
as
$element
)
foreach
(
$data
as
$element
)
{
{
$node
=
new
ilQuestionSetPoolNode
(
$element
[
"id"
]);
$node
=
new
ilQuestionSetPoolNode
(
$element
[
"id"
]);
$node
->
read
();
$node
->
read
();
$node
->
remove
();
$node
->
remove
();
}
}
}
}
}
}
\ No newline at end of file
classes/models/class.ilQuestionSetPoolPathList.php
View file @
381d5850
...
@@ -55,10 +55,8 @@ class ilQuestionSetPoolPathList extends ilPluginModelList
...
@@ -55,10 +55,8 @@ class ilQuestionSetPoolPathList extends ilPluginModelList
{
{
$data
=
$this
->
getData
();
$data
=
$this
->
getData
();
foreach
(
$data
as
$item
)
foreach
(
$data
as
$item
)
{
{
if
(
$item
->
getId
()
==
$id
)
{
if
(
$item
->
getId
()
==
$id
)
{
return
$item
;
return
$item
;
}
}
}
}
...
...
classes/models/class.ilQuestionSetPoolSet.php
View file @
381d5850
This diff is collapsed.
Click to expand it.
classes/models/class.ilQuestionSetPoolSetList.php
View file @
381d5850
This diff is collapsed.
Click to expand it.
classes/models/class.ilQuestionSetPoolSetQuestionList.php
View file @
381d5850
This diff is collapsed.
Click to expand it.
classes/models/interface.ilPluginModelInterface.php
View file @
381d5850
...
@@ -7,8 +7,8 @@
...
@@ -7,8 +7,8 @@
* @author Thomas Joußen <tjoussen@databay.de>
* @author Thomas Joußen <tjoussen@databay.de>
*/
*/
interface
ilPluginModelInterface
{
interface
ilPluginModelInterface
{
public
function
update
();
public
function
update
();
public
function
read
();
public
function
read
();
...
...
classes/providers/abstract.ilPluginTableDatabaseDataProvider.php
View file @
381d5850
This diff is collapsed.
Click to expand it.
classes/providers/class.ilParserQuestionProvider.php
View file @
381d5850
...
@@ -9,8 +9,8 @@
...
@@ -9,8 +9,8 @@
*
*
* @todo MAYBE CHANGE THE LOCATION OF THIS CLASS
* @todo MAYBE CHANGE THE LOCATION OF THIS CLASS
*/
*/
class
ilParserQuestionProvider
{
class
ilParserQuestionProvider
{
protected
$set_id
;
protected
$set_id
;
public
function
__construct
(
$set_id
)
public
function
__construct
(
$set_id
)
...
@@ -36,9 +36,6 @@ class ilParserQuestionProvider {
...
@@ -36,9 +36,6 @@ class ilParserQuestionProvider {
$data
=
$ilDB
->
fetchAssoc
(
$result
);
$data
=
$ilDB
->
fetchAssoc
(
$result
);
require_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php"
;
return
assQuestion
::
_instanciateQuestion
(
$data
[
'question_fi'
]);
return
assQuestion
::
_instanciateQuestion
(
$data
[
'question_fi'
]);
}
}
}
}
\ No newline at end of file
classes/providers/class.ilQuestionSetPoolJumpConditionsProvider.php
View file @
381d5850
...
@@ -78,4 +78,3 @@ class ilQuestionSetPoolJumpConditionsProvider extends ilPluginTableDatabaseDataP
...
@@ -78,4 +78,3 @@ class ilQuestionSetPoolJumpConditionsProvider extends ilPluginTableDatabaseDataP
return
"con.sorting ASC"
;
return
"con.sorting ASC"
;
}
}
}
}
\ No newline at end of file
classes/providers/class.ilQuestionSetPoolNodeProvider.php
View file @
381d5850
...
@@ -89,4 +89,3 @@ class ilQuestionSetPoolNodeProvider extends ilPluginTableDatabaseDataProvider
...
@@ -89,4 +89,3 @@ class ilQuestionSetPoolNodeProvider extends ilPluginTableDatabaseDataProvider
return
"rep_robj_xqsp_node.node_index ASC"
;
return
"rep_robj_xqsp_node.node_index ASC"
;
}
}
}
}
\ No newline at end of file
classes/providers/class.ilQuestionSetPoolPathProvider.php
View file @
381d5850
...
@@ -74,4 +74,3 @@ class ilQuestionSetPoolPathProvider extends ilPluginTableDatabaseDataProvider
...
@@ -74,4 +74,3 @@ class ilQuestionSetPoolPathProvider extends ilPluginTableDatabaseDataProvider
return
"rep_robj_xqsp_path.path_index ASC"
;
return
"rep_robj_xqsp_path.path_index ASC"
;
}
}
}
}
\ No newline at end of file
classes/providers/class.ilQuestionSetPoolQuestionsBrowserProvider.php
View file @
381d5850
This diff is collapsed.
Click to expand it.
classes/providers/class.ilQuestionSetPoolSetQuestionsProvider.php
View file @
381d5850
...
@@ -97,4 +97,3 @@ class ilQuestionSetPoolSetQuestionsProvider extends ilPluginTableDatabaseDataPro
...
@@ -97,4 +97,3 @@ class ilQuestionSetPoolSetQuestionsProvider extends ilPluginTableDatabaseDataPro
return
""
;
return
""
;
}
}
}
}
\ No newline at end of file
classes/providers/class.ilQuestionSetPoolSetsProvider.php
View file @
381d5850
Prev
1
2
3
4
5
6
7
Next