- Deprecated:
- 11; Result/EvaluationData will be refined.
Definition at line 26 of file class.ilTestEvaluationFactory.php.
◆ __construct()
◆ addMarksToParticipants()
Definition at line 376 of file class.ilTestEvaluationFactory.php.
References ilTestEvaluationData\getParticipant(), ilTestEvaluationData\getParticipantIds(), and null.
Referenced by getEvaluationData().
378 $mark_schema = $this->test_obj->getMarkSchema();
383 $mark = $mark_schema->getMatchingMark(
384 $user_eval_data->getReachedPointsInPercent()
387 if ($mark ===
null) {
391 $user_eval_data->setMark($mark);
392 for ($i = 0; $i < $user_eval_data->getPassCount(); $i++) {
393 $pass_data = $user_eval_data->getPass($i);
394 if ($pass_data ===
null) {
397 $mark = $mark_schema->getMatchingMark(
398 $pass_data->getReachedPointsInPercent()
400 if ($mark !==
null) {
401 $pass_data->setMark($mark);
406 return $evaluation_data;
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getParticipant(int $active_id)
◆ addPointsAndQuestionCountToAttempt()
◆ addQuestionsToParticipantPasses()
◆ addQuestionToAttempt()
Definition at line 230 of file class.ilTestEvaluationFactory.php.
References ilTestEvaluationPassData\addAnsweredQuestion(), and null.
Referenced by getCorrectionsEvaluationData(), and getEvaluationData().
234 if ($row[
'question_fi'] ===
null) {
240 $row[
"qpl_maxpoints"],
241 $row[
"result_points"],
242 (
bool) $row[
'answered'],
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
addAnsweredQuestion(int $question_id, float $max_points, float $reached_points, bool $is_answered, ?int $sequence=null, int $manual=0)
◆ addVisitingTimeToUserEvalData()
◆ buildBasicAttemptEvaluationDataFromDB()
ilTestEvaluationFactory::buildBasicAttemptEvaluationDataFromDB |
( |
array |
$row | ) |
|
|
private |
Definition at line 191 of file class.ilTestEvaluationFactory.php.
Referenced by getCorrectionsEvaluationData(), and getEvaluationData().
193 $attempt = new \ilTestEvaluationPassData();
194 $attempt->setPass($row[
'pass']);
195 $attempt->setReachedPoints($row[
'points']);
196 $attempt->setNrOfAnsweredQuestions($row[
'answeredquestions']);
197 $attempt->setWorkingTime($row[
'workingtime']);
198 $attempt->setExamId((
string) $row[
'exam_id']);
◆ buildBasicUserEvaluationDataFromDB()
ilTestEvaluationFactory::buildBasicUserEvaluationDataFromDB |
( |
array |
$row | ) |
|
|
private |
◆ getAccessFilteredActiveIds()
ilTestEvaluationFactory::getAccessFilteredActiveIds |
( |
| ) |
|
|
private |
◆ getAllActivesPasses()
ilTestEvaluationFactory::getAllActivesPasses |
( |
| ) |
|
Definition at line 409 of file class.ilTestEvaluationFactory.php.
References $res.
412 SELECT active_fi, pass 413 FROM tst_active actives 414 INNER JOIN tst_pass_result passes 415 ON active_fi = active_id 419 $res = $this->db->queryF($query, [
'integer'], [$this->test_obj->getTestId()]);
422 while ($row = $this->db->fetchAssoc(
$res)) {
423 if (!isset($passes[$row[
'active_fi']])) {
424 $passes[$row[
'active_fi']] = [];
427 $passes[$row[
'active_fi']][] = $row[
'pass'];
◆ getCorrectionsEvaluationData()
ilTestEvaluationFactory::getCorrectionsEvaluationData |
( |
| ) |
|
◆ getEvaluationData()
ilTestEvaluationFactory::getEvaluationData |
( |
| ) |
|
Definition at line 125 of file class.ilTestEvaluationFactory.php.
References addMarksToParticipants(), addPointsAndQuestionCountToAttempt(), addQuestionsToParticipantPasses(), addQuestionToAttempt(), addVisitingTimeToUserEvalData(), buildBasicAttemptEvaluationDataFromDB(), buildBasicUserEvaluationDataFromDB(), getAccessFilteredActiveIds(), getFirstVisitForActiveIdAndAttempt(), null, and retrieveEvaluationData().
129 $current_user =
null;
130 $current_attempt =
null;
132 foreach ($eval_data_rows as $row) {
133 if ($row[
'pass'] ===
null) {
137 if ($current_user !== $row[
'active_id']) {
138 $current_user = $row[
'active_id'];
139 $current_attempt =
null;
146 if ($row[
'pass'] !==
null && $current_attempt !== $row[
'pass']) {
147 $current_attempt = $row[
'pass'];
154 if ($start_time !==
null) {
155 $attempt->setStartTime($start_time);
157 $attempt->setStatusOfAttempt(
158 StatusOfAttempt::build($current_attempt, $row[
'last_finished_pass'], $row[
'finalized_by'])
163 $participants[$row[
'active_id']] = $user_eval_data;
retrieveEvaluationData(array $active_ids)
addPointsAndQuestionCountToAttempt(ilTestEvaluationPassData $attempt, array $row)
addQuestionsToParticipantPasses(ilTestEvaluationData $evaluation_data)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
buildBasicUserEvaluationDataFromDB(array $row)
getFirstVisitForActiveIdAndAttempt(int $active_id, int $attempt)
buildBasicAttemptEvaluationDataFromDB(array $row)
addVisitingTimeToUserEvalData(ilTestEvaluationUserData $user_data, int $active_id)
addMarksToParticipants(ilTestEvaluationData $evaluation_data)
addQuestionToAttempt(ilTestEvaluationPassData $attempt, array $row)
getAccessFilteredActiveIds()
◆ getFirstVisitForActiveIdAndAttempt()
ilTestEvaluationFactory::getFirstVisitForActiveIdAndAttempt |
( |
int |
$active_id, |
|
|
int |
$attempt |
|
) |
| |
Definition at line 433 of file class.ilTestEvaluationFactory.php.
Referenced by getEvaluationData().
435 $times = $this->db->fetchAssoc(
437 'SELECT MIN(started) AS first_access ' 438 .
'FROM tst_times WHERE active_fi = %s AND pass = %s',
439 [
'integer',
'integer'],
440 [$active_id, $attempt]
444 return $times[
'first_access'];
◆ retrieveEvaluationData()
ilTestEvaluationFactory::retrieveEvaluationData |
( |
array |
$active_ids | ) |
|
|
private |
- Parameters
-
Definition at line 48 of file class.ilTestEvaluationFactory.php.
Referenced by getCorrectionsEvaluationData(), and getEvaluationData().
51 SELECT tst_test_result.question_fi, 52 tst_test_result.points result_points, 53 tst_test_result.answered, 54 tst_test_result.manual, 56 qpl_questions.original_id, 57 qpl_questions.title questiontitle, 58 qpl_questions.points qpl_maxpoints, 62 tst_active.last_finished_pass, 73 LEFT JOIN tst_pass_result ON tst_active.active_id = tst_pass_result.active_fi 74 LEFT JOIN tst_test_result ON tst_active.active_id = tst_test_result.active_fi AND tst_test_result.pass = tst_pass_result.pass 75 LEFT JOIN qpl_questions ON qpl_questions.question_id = tst_test_result.question_fi 76 LEFT JOIN usr_data ON tst_active.user_fi = usr_data.usr_id 78 WHERE tst_active.test_fi = %s 81 ORDER BY tst_active.active_id ASC, tst_pass_result.pass ASC, tst_test_result.tstamp DESC 85 $result = $this->db->query(
88 $this->db->quote($this->test_obj->getTestId(),
'integer'),
89 $this->db->in(
'tst_active.active_id', $active_ids,
false,
'integer'),
92 while ($row = $this->db->fetchAssoc($result)) {
◆ retrieveQuestionsForParticipantPassesForRandomTests()
ilTestEvaluationFactory::retrieveQuestionsForParticipantPassesForRandomTests |
( |
int |
$active_id, |
|
|
ilTestEvaluationUserData |
$user_eval_data, |
|
|
int |
$question_count |
|
) |
| |
|
private |
Definition at line 275 of file class.ilTestEvaluationFactory.php.
References ilTestEvaluationUserData\getLastPass(), and ILIAS\Repository\int().
Referenced by addQuestionsToParticipantPasses().
281 for ($testpass = 0; $testpass <= $user_eval_data->
getLastPass(); $testpass++) {
282 $this->db->setLimit($question_count, 0);
284 SELECT tst_test_rnd_qst.sequence, tst_test_rnd_qst.question_fi, qpl_questions.original_id, 285 tst_test_rnd_qst.pass, qpl_questions.points, qpl_questions.title 286 FROM tst_test_rnd_qst, qpl_questions 287 WHERE tst_test_rnd_qst.question_fi = qpl_questions.question_id 288 AND tst_test_rnd_qst.pass = %s 289 AND tst_test_rnd_qst.active_fi = %s ORDER BY tst_test_rnd_qst.sequence 292 $result = $this->db->queryF(
294 [
'integer',
'integer'],
295 [$testpass, $active_id]
298 if ($result->numRows()) {
299 while ($row = $this->db->fetchAssoc($result)) {
300 $tpass = array_key_exists(
'pass', $row) ? $row[
'pass'] : 0;
303 !isset($row[
'question_fi'], $row[
'points'], $row[
'sequence']) ||
304 !is_numeric($row[
'question_fi']) || !is_numeric($row[
'points']) || !is_numeric($row[
'sequence'])
310 'original_id' => (
int) $row[
'original_id'],
311 'question_id' => (
int) $row[
'question_fi'],
312 'max_points' => (float) $row[
'points'],
313 'sequence' => (
int) $row[
'sequence'],
315 'title' => $row[
'title']
◆ retrieveQuestionsForParticipantPassesForSequencedTests()
ilTestEvaluationFactory::retrieveQuestionsForParticipantPassesForSequencedTests |
( |
int |
$active_id | ) |
|
|
private |
Definition at line 323 of file class.ilTestEvaluationFactory.php.
Referenced by addQuestionsToParticipantPasses().
329 SELECT tst_test_question.sequence, tst_test_question.question_fi, 330 qpl_questions.points, qpl_questions.title, qpl_questions.original_id 331 FROM tst_test_question, tst_active, qpl_questions 332 WHERE tst_test_question.question_fi = qpl_questions.question_id 333 AND tst_active.active_id = %s 334 AND tst_active.test_fi = tst_test_question.test_fi 335 ORDER BY tst_test_question.sequence 338 $result = $this->db->queryF(
344 if ($result->numRows()) {
345 $questionsbysequence = [];
346 while ($row = $this->db->fetchAssoc($result)) {
347 $questionsbysequence[$row[
'sequence']] = $row;
350 $seqresult = $this->db->queryF(
351 'SELECT * FROM tst_sequence WHERE active_fi = %s',
356 while ($seqrow = $this->db->fetchAssoc($seqresult)) {
357 $questionsequence = unserialize($seqrow[
"sequence"]);
358 foreach ($questionsequence as $sidx => $seq) {
359 if (!isset($questionsbysequence[$seq])) {
363 'original_id' => $questionsbysequence[$seq][
'original_id'] ?? 0,
364 'question_id' => $questionsbysequence[$seq][
'question_fi'],
365 'max_points' => $questionsbysequence[$seq][
'points'],
366 'sequence' => $sidx + 1,
367 'pass' => $seqrow[
'pass'],
368 'title' => $questionsbysequence[$seq][
"title"]
The documentation for this class was generated from the following file: