83 $this->activeId =
null;
84 $this->targetPass =
null;
85 $this->questionIds = array();
87 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionProcessLockerFactory.php';
89 $this->processLockerFactory->setAssessmentLogEnabled($isAssessmentLogEnabled);
158 $this->processLockerFactory->setUserId($this->
getUserId());
162 $this->processLockerFactory->setQuestionId($questionId);
163 $processLocker = $this->processLockerFactory->getLocker();
165 $processLocker->executeUserTestResultUpdateLockOperation(
function() use ($questionId) {
180 if( $sourcePass !==
null )
204 $res = $this->db->execute(
211 while(
$row = $this->db->fetchAssoc(
$res))
213 if($sourcePass ===
null)
215 $sourcePass =
$row[
'pass'];
217 elseif(
$row[
'pass'] < $sourcePass)
222 $solutionId = $this->db->nextId(
'tst_solutions');
235 $res = $this->db->execute(
237 array($this->
getActiveId(), $questionId, $sourcePass)
242 $resultId = $this->db->nextId(
'tst_test_result');
252 if( self::$preparedDeleteSolutionRecordsStatement ===
null )
254 self::$preparedDeleteSolutionRecordsStatement = $this->db->prepareManip(
255 "DELETE FROM tst_solutions WHERE active_fi = ? AND question_fi = ? AND pass = ?",
256 array(
'integer',
'integer',
'integer')
265 if( self::$preparedSelectSolutionRecordsStatement ===
null )
268 SELECT pass, points, value1, value2 FROM tst_solutions
269 WHERE active_fi = ? AND question_fi = ? AND pass < ? ORDER BY pass DESC
272 self::$preparedSelectSolutionRecordsStatement = $this->db->prepare(
273 $query, array(
'integer',
'integer',
'integer')
282 if( self::$preparedInsertSolutionRecordStatement ===
null )
285 INSERT INTO tst_solutions (
286 solution_id, active_fi, question_fi, pass, tstamp, points, value1, value2
288 ?, ?, ?, ?, ?, ?, ?, ?
292 self::$preparedInsertSolutionRecordStatement = $this->db->prepareManip(
293 $query, array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'text')
302 if( self::$preparedDeleteResultRecordStatement ===
null )
304 self::$preparedDeleteResultRecordStatement = $this->db->prepareManip(
305 "DELETE FROM tst_test_result WHERE active_fi = ? AND question_fi = ? AND pass = ?",
306 array(
'integer',
'integer',
'integer')
315 if( self::$preparedSelectResultRecordStatement ===
null )
318 SELECT points, manual, hint_count, hint_points, answered FROM tst_test_result
319 WHERE active_fi = ? AND question_fi = ? AND pass = ?
322 self::$preparedSelectResultRecordStatement = $this->db->prepare(
323 $query, array(
'integer',
'integer',
'integer')
332 if( self::$preparedInsertResultRecordStatement ===
null )
335 INSERT INTO tst_test_result (
336 test_result_id, active_fi, question_fi, pass, tstamp,
337 points, manual, hint_count, hint_points, answered
339 ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
343 self::$preparedInsertResultRecordStatement = $this->db->prepareManip(
344 $query, array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer')
An exception for terminatinating execution or to throw for unit testing.
__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