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 192 of file class.ilTestService.php.
References $ilDB, $lng, ilTestSession\getActiveId(), and object.
196 require_once
'Modules/Test/classes/class.ilTestVirtualSequence.php';
199 if( $this->
object->isRandomTest() )
201 require_once
'Modules/Test/classes/class.ilTestVirtualSequenceRandomQuestionSet.php';
206 require_once
'Modules/Test/classes/class.ilTestVirtualSequence.php';
210 $virtualSequence->setActiveId($testSession->
getActiveId());
212 $virtualSequence->init();
214 return $virtualSequence;
Create new PHPExcel object
obj_idprivate
◆ 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 128 of file class.ilTestService.php.
References $pass, ilObjAssessmentFolder\_getManualScoring(), and array.
130 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
133 $testResultData = $this->
object->getTestResult($activeId,
$pass);
135 $manScoringQuestionGuiList =
array();
137 foreach($testResultData as $questionData)
139 if( !isset($questionData[
'qid']) )
144 if( !isset($questionData[
'type']) )
149 $questionGUI = $this->
object->createQuestionGUI(
"", $questionData[
'qid']);
151 if( !in_array($questionGUI->object->getQuestionTypeID(), $manScoringQuestionTypes) )
156 $manScoringQuestionGuiList[ $questionData[
'qid'] ] = $questionGUI;
159 return $manScoringQuestionGuiList;
Base Exception for all Exceptions relating to Modules/Test.
Create styles array
The data for the language used.
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 $ilUser, $pass, ilObjTest\_getPass(), and array.
38 $passOverwiewData =
array();
42 $scoredPass = $this->
object->_getResultPass($active_id);
46 $testReachedPoints = 0;
51 $passFinishDate = $this->
object->getPassFinishDate($active_id,
$pass);
53 if( $passFinishDate <= 0 )
60 $resultData =& $this->
object->getTestResult($active_id,
$pass);
62 if (!$resultData[
"pass"][
"total_max_points"])
68 $passPercentage = ($resultData[
"pass"][
"total_reached_points"]/$resultData[
"pass"][
"total_max_points"])*100;
71 $passMaxPoints = $resultData[
"pass"][
"total_max_points"];
72 $passReachedPoints = $resultData[
"pass"][
"total_reached_points"];
74 $passAnsweredQuestions = $this->
object->getAnsweredQuestionCount($active_id,
$pass);
75 $passTotalQuestions = count($resultData) - 2;
77 if(
$pass == $scoredPass )
81 if (!$resultData[
"test"][
"total_max_points"])
87 $testPercentage = ($resultData[
"test"][
"total_reached_points"]/$resultData[
"test"][
"total_max_points"])*100;
90 $testMaxPoints = $resultData[
"test"][
"total_max_points"];
91 $testReachedPoints = $resultData[
"test"][
"total_reached_points"];
93 $passOverwiewData[
'test'] =
array(
94 'active_id' => $active_id,
95 'scored_pass' => $scoredPass,
96 'max_points' => $testMaxPoints,
97 'reached_points' => $testReachedPoints,
98 'percentage' => $testPercentage
101 else $isScoredPass =
false;
103 $passOverwiewData[
'passes'][] =
array(
104 'active_id' => $active_id,
106 'finishdate' => $passFinishDate,
107 'max_points' => $passMaxPoints,
108 'reached_points' => $passReachedPoints,
109 'percentage' => $passPercentage,
110 'answered_questions' => $passAnsweredQuestions,
111 'total_questions' => $passTotalQuestions,
112 'is_scored_pass' => $isScoredPass
117 return $passOverwiewData;
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
Create styles array
The data for the language used.
◆ getQuestionSummaryData()
- Parameters
-
- Returns
- array
Definition at line 258 of file class.ilTestService.php.
References $data, ilObjTest\_getSolvedQuestions(), array, ilTestSequenceSummaryProvider\getActiveId(), ilTestSequenceSummaryProvider\getSequenceSummary(), and object.
262 $marked_questions =
array();
264 if($this->
object->getShowMarker())
266 include_once
"./Modules/Test/classes/class.ilObjTest.php";
272 foreach($result_array as $key => $value)
275 if($this->
object->getListOfQuestionsDescription())
277 $description = $value[
"description"];
281 if(!$this->
object->getTitleOutput())
283 $points = $value[
"points"];
287 if(count($marked_questions))
289 if(array_key_exists($value[
"qid"], $marked_questions))
291 $obj = $marked_questions[$value[
"qid"]];
292 if($obj[
"solved"] == 1)
300 $data[] =
array(
'order' => $value[
"nr"],
'title' => $this->
object->getQuestionTitle($value[
"title"], $value[
"nr"]),
'description' => $description,
'worked_through' => $value[
"worked_through"],
'postponed' => $value[
"postponed"],
'points' => $points,
'marked' => $marked,
'sequence' => $value[
"sequence"],
'obligatory' => $value[
'obligatory'],
'isAnswered' => $value[
'isAnswered']);
getSequenceSummary($obligationsFilterEnabled=false)
static _getSolvedQuestions($active_id, $question_fi=null)
get solved questions
Create styles array
The data for the language used.
Create new PHPExcel object
obj_idprivate
◆ 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 171 of file class.ilTestService.php.
Referenced by ilTestScoringGUI\buildManScoringParticipantForm().
173 $assessmentSetting =
new ilSetting(
"assessment");
174 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 186 of file class.ilTestService.php.
Referenced by ilTestScoringGUI\saveManScoringParticipantScreen().
188 $assessmentSetting =
new ilSetting(
"assessment");
189 $assessmentSetting->set(
"manscoring_done_" . $activeId, (
bool)$manScoringDone);
◆ $object
ilTestService::$object = null |
|
protected |
The documentation for this class was generated from the following file: