Service class for tests.
More...
|
static | isManScoringDone ($activeId) |
| reads the flag wether manscoring is done for the given test active or not from the global settings (scope: assessment / key: manscoring_done_<activeId>) More...
|
|
static | setManScoringDone ($activeId, $manScoringDone) |
| stores the flag wether manscoring is done for the given test active or not within the global settings (scope: assessment / key: manscoring_done_<activeId>) More...
|
|
Service class for tests.
- Author
- Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
- Version
- $Id$
Definition at line 12 of file class.ilTestService.php.
◆ __construct()
ilTestService::__construct |
( |
ilObjTest |
$a_object | ) |
|
◆ buildVirtualSequence()
ilTestService::buildVirtualSequence |
( |
ilTestSession |
$testSession | ) |
|
Definition at line 180 of file class.ilTestService.php.
References $DIC, $ilDB, $lng, and ilTestSession\getActiveId().
183 $ilDB = $DIC[
'ilDB'];
185 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
187 require_once
'Modules/Test/classes/class.ilTestVirtualSequence.php';
190 if ($this->object->isRandomTest()) {
191 require_once
'Modules/Test/classes/class.ilTestVirtualSequenceRandomQuestionSet.php';
194 require_once
'Modules/Test/classes/class.ilTestVirtualSequence.php';
198 $virtualSequence->setActiveId($testSession->
getActiveId());
200 $virtualSequence->init();
202 return $virtualSequence;
◆ getManScoringQuestionGuiList()
ilTestService::getManScoringQuestionGuiList |
( |
|
$activeId, |
|
|
|
$pass |
|
) |
| |
Returns the list of answers of a users test pass and offers a scoring option.
public
- Parameters
-
integer | $active_id | Active ID of the active user |
integer | $pass | Test pass |
- Returns
- string HTML code of the list of answers
Definition at line 120 of file class.ilTestService.php.
References $pass, and ilObjAssessmentFolder\_getManualScoring().
122 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
125 $testResultData = $this->
object->getTestResult($activeId,
$pass);
127 $manScoringQuestionGuiList = array();
129 foreach ($testResultData as $questionData) {
130 if (!isset($questionData[
'qid'])) {
134 if (!isset($questionData[
'type'])) {
138 $questionGUI = $this->
object->createQuestionGUI(
"", $questionData[
'qid']);
140 if (!in_array($questionGUI->object->getQuestionTypeID(), $manScoringQuestionTypes)) {
144 $manScoringQuestionGuiList[ $questionData[
'qid'] ] = $questionGUI;
147 return $manScoringQuestionGuiList;
Base Exception for all Exceptions relating to Modules/Test.
static _getManualScoring()
Retrieve the manual scoring settings.
◆ getPassOverviewData()
ilTestService::getPassOverviewData |
( |
|
$active_id, |
|
|
|
$short = false |
|
) |
| |
public ilObjUser $ilUser
- Parameters
-
integer | $active_id | |
boolean | $short | |
- Returns
- array $passOverwiewData
Definition at line 36 of file class.ilTestService.php.
References $DIC, $ilUser, $pass, ilObjTest\_getPass(), and ilObjTest\lookupPassResultsUpdateTimestamp().
38 $passOverwiewData = array();
43 $scoredPass = $this->
object->_getResultPass($active_id);
47 $testReachedPoints = 0;
53 if ($passFinishDate <= 0) {
58 $resultData = &$this->
object->getTestResult($active_id,
$pass);
60 if (!$resultData[
"pass"][
"total_max_points"]) {
63 $passPercentage = ($resultData[
"pass"][
"total_reached_points"] / $resultData[
"pass"][
"total_max_points"]) * 100;
66 $passMaxPoints = $resultData[
"pass"][
"total_max_points"];
67 $passReachedPoints = $resultData[
"pass"][
"total_reached_points"];
69 $passAnsweredQuestions = $this->
object->getAnsweredQuestionCount($active_id,
$pass);
70 $passTotalQuestions = count($resultData) - 2;
72 if (
$pass == $scoredPass) {
75 if (!$resultData[
"test"][
"total_max_points"]) {
78 $testPercentage = ($resultData[
"test"][
"total_reached_points"] / $resultData[
"test"][
"total_max_points"]) * 100;
81 $testMaxPoints = $resultData[
"test"][
"total_max_points"];
82 $testReachedPoints = $resultData[
"test"][
"total_reached_points"];
84 $passOverwiewData[
'test'] = array(
85 'active_id' => $active_id,
86 'scored_pass' => $scoredPass,
87 'max_points' => $testMaxPoints,
88 'reached_points' => $testReachedPoints,
89 'percentage' => $testPercentage
92 $isScoredPass =
false;
95 $passOverwiewData[
'passes'][] = array(
96 'active_id' => $active_id,
98 'finishdate' => $passFinishDate,
99 'max_points' => $passMaxPoints,
100 'reached_points' => $passReachedPoints,
101 'percentage' => $passPercentage,
102 'answered_questions' => $passAnsweredQuestions,
103 'total_questions' => $passTotalQuestions,
104 'is_scored_pass' => $isScoredPass
109 return $passOverwiewData;
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
static lookupPassResultsUpdateTimestamp($active_id, $pass)
◆ getQuestionSummaryData()
- Parameters
-
- Returns
- array
Definition at line 245 of file class.ilTestService.php.
References $data, $description, $key, ilObjTest\_getSolvedQuestions(), ilTestSequenceSummaryProvider\getActiveId(), and ilTestSequenceSummaryProvider\getSequenceSummary().
249 $marked_questions = array();
251 if ($this->object->getShowMarker()) {
252 include_once
"./Modules/Test/classes/class.ilObjTest.php";
257 $firstQuestion =
true;
259 foreach ($result_array as
$key => $value) {
261 $this->
object->isFollowupQuestionAnswerFixationEnabled()
262 && !$value[
'presented'] && !$firstQuestion
266 if ($this->object->getListOfQuestionsDescription()) {
271 if (!$this->object->getTitleOutput()) {
272 $points = $value[
"points"];
276 if (count($marked_questions)) {
277 if (array_key_exists($value[
"qid"], $marked_questions)) {
278 $obj = $marked_questions[$value[
"qid"]];
279 if ($obj[
"solved"] == 1) {
287 'order' => $value[
"nr"],
288 'title' => $this->object->getQuestionTitle($value[
"title"], $value[
"nr"]),
290 'disabled' => $disableLink,
291 'worked_through' => $value[
"worked_through"],
292 'postponed' => $value[
"postponed"],
295 'sequence' => $value[
"sequence"],
296 'obligatory' => $value[
'obligatory'],
297 'isAnswered' => $value[
'isAnswered']
300 $firstQuestion =
false;
getSequenceSummary($obligationsFilterEnabled=false)
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions
◆ getVirtualSequenceUserResults()
◆ isManScoringDone()
static ilTestService::isManScoringDone |
( |
|
$activeId | ) |
|
|
static |
reads the flag wether manscoring is done for the given test active or not from the global settings (scope: assessment / key: manscoring_done_<activeId>)
public
- Parameters
-
- Returns
- boolean $manScoringDone
Definition at line 159 of file class.ilTestService.php.
Referenced by ilTestScoringGUI\saveReturnManScoringParticipantScreen().
161 $assessmentSetting =
new ilSetting(
"assessment");
162 return $assessmentSetting->get(
"manscoring_done_" . $activeId,
false);
◆ setManScoringDone()
static ilTestService::setManScoringDone |
( |
|
$activeId, |
|
|
|
$manScoringDone |
|
) |
| |
|
static |
stores the flag wether manscoring is done for the given test active or not within the global settings (scope: assessment / key: manscoring_done_<activeId>)
public
- Parameters
-
integer | $activeId | |
boolean | $manScoringDone | |
Definition at line 174 of file class.ilTestService.php.
Referenced by ilTestScoringGUI\saveManScoringParticipantScreen().
176 $assessmentSetting =
new ilSetting(
"assessment");
177 $assessmentSetting->set(
"manscoring_done_" . $activeId, (
bool) $manScoringDone);
◆ $object
ilTestService::$object = null |
|
protected |
The documentation for this class was generated from the following file: