79 $this->activeId =
null;
80 $this->targetPass =
null;
81 $this->questionIds = array();
83 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
85 $this->processLockerFactory->setAssessmentLogEnabled($isAssessmentLogEnabled);
154 $this->processLockerFactory->setUserId($this->
getUserId());
157 $this->processLockerFactory->setQuestionId($questionId);
158 $processLocker = $this->processLockerFactory->getLocker();
160 $processLocker->executeUserTestResultUpdateLockOperation(
function () use ($questionId) {
173 if ($sourcePass !==
null) {
196 $res = $this->db->execute(
203 while ($row = $this->db->fetchAssoc(
$res)) {
204 if ($sourcePass ===
null) {
205 $sourcePass = $row[
'pass'];
206 } elseif ($row[
'pass'] < $sourcePass) {
210 $solutionId = $this->db->nextId(
'tst_solutions');
214 $row[
'points'], $row[
'value1'], $row[
'value2']
223 $res = $this->db->execute(
225 array($this->
getActiveId(), $questionId, $sourcePass)
228 $row = $this->db->fetchAssoc(
$res);
230 $resultId = $this->db->nextId(
'tst_test_result');
234 $row[
'points'], $row[
'manual'], $row[
'hint_count'], $row[
'hint_points'], $row[
'answered']
240 if (self::$preparedDeleteSolutionRecordsStatement ===
null) {
241 self::$preparedDeleteSolutionRecordsStatement = $this->db->prepareManip(
242 "DELETE FROM tst_solutions WHERE active_fi = ? AND question_fi = ? AND pass = ?",
243 array(
'integer',
'integer',
'integer')
252 if (self::$preparedSelectSolutionRecordsStatement ===
null) {
254 SELECT pass, points, value1, value2 FROM tst_solutions
255 WHERE active_fi = ? AND question_fi = ? AND pass < ? ORDER BY pass DESC
258 self::$preparedSelectSolutionRecordsStatement = $this->db->prepare(
260 array(
'integer',
'integer',
'integer')
269 if (self::$preparedInsertSolutionRecordStatement ===
null) {
271 INSERT INTO tst_solutions (
272 solution_id, active_fi, question_fi, pass, tstamp, points, value1, value2
274 ?, ?, ?, ?, ?, ?, ?, ?
278 self::$preparedInsertSolutionRecordStatement = $this->db->prepareManip(
280 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'text')
289 if (self::$preparedDeleteResultRecordStatement ===
null) {
290 self::$preparedDeleteResultRecordStatement = $this->db->prepareManip(
291 "DELETE FROM tst_test_result WHERE active_fi = ? AND question_fi = ? AND pass = ?",
292 array(
'integer',
'integer',
'integer')
301 if (self::$preparedSelectResultRecordStatement ===
null) {
303 SELECT points, manual, hint_count, hint_points, answered FROM tst_test_result
304 WHERE active_fi = ? AND question_fi = ? AND pass = ?
307 self::$preparedSelectResultRecordStatement = $this->db->prepare(
309 array(
'integer',
'integer',
'integer')
318 if (self::$preparedInsertResultRecordStatement ===
null) {
320 INSERT INTO tst_test_result (
321 test_result_id, active_fi, question_fi, pass, tstamp,
322 points, manual, hint_count, hint_points, answered
324 ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
328 self::$preparedInsertResultRecordStatement = $this->db->prepareManip(
330 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer')
__construct(ilDBInterface $db, ilSetting $assSettings, $isAssessmentLogEnabled)
static $preparedSelectResultRecordStatement
static $preparedInsertSolutionRecordStatement
static $preparedSelectSolutionRecordsStatement
static $preparedDeleteResultRecordStatement
adoptSourceResult($questionId, $sourcePass)
resetTargetSolution($questionId)
getPreparedInsertSolutionRecordStatement()
adoptSourceSolution($questionId)
getPreparedSelectResultRecordStatement()
getPreparedDeleteResultRecordStatement()
getPreparedInsertResultRecordStatement()
getPreparedSelectSolutionRecordsStatement()
setQuestionIds($questionIds)
static $preparedInsertResultRecordStatement
getPreparedDeleteSolutionRecordsStatement()
setTargetPass($targetPass)
adoptQuestionAnswer($questionId)
resetTargetResult($questionId)
static $preparedDeleteSolutionRecordsStatement
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...