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->requestUserSolutionAdoptLock();
167 $processLocker->releaseUserSolutionAdoptLock();
178 if( $sourcePass !== null )
202 $res = $this->db->execute(
209 while(
$row = $this->db->fetchAssoc(
$res))
211 if($sourcePass === null)
213 $sourcePass =
$row[
'pass'];
215 elseif(
$row[
'pass'] < $sourcePass)
220 $solutionId = $this->db->nextId(
'tst_solutions');
233 $res = $this->db->execute(
235 array($this->
getActiveId(), $questionId, $sourcePass)
240 $resultId = $this->db->nextId(
'tst_test_result');
250 if( self::$preparedDeleteSolutionRecordsStatement === null )
252 self::$preparedDeleteSolutionRecordsStatement = $this->db->prepareManip(
253 "DELETE FROM tst_solutions WHERE active_fi = ? AND question_fi = ? AND pass = ?",
254 array(
'integer',
'integer',
'integer')
258 return self::$preparedDeleteSolutionRecordsStatement;
263 if( self::$preparedSelectSolutionRecordsStatement === null )
266 SELECT pass, points, value1, value2 FROM tst_solutions 267 WHERE active_fi = ? AND question_fi = ? AND pass < ? ORDER BY pass DESC 270 self::$preparedSelectSolutionRecordsStatement = $this->db->prepare(
271 $query, array(
'integer',
'integer',
'integer')
275 return self::$preparedSelectSolutionRecordsStatement;
280 if( self::$preparedInsertSolutionRecordStatement === null )
283 INSERT INTO tst_solutions ( 284 solution_id, active_fi, question_fi, pass, tstamp, points, value1, value2 286 ?, ?, ?, ?, ?, ?, ?, ? 290 self::$preparedInsertSolutionRecordStatement = $this->db->prepareManip(
291 $query, array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'text')
295 return self::$preparedInsertSolutionRecordStatement;
300 if( self::$preparedDeleteResultRecordStatement === null )
302 self::$preparedDeleteResultRecordStatement = $this->db->prepareManip(
303 "DELETE FROM tst_test_result WHERE active_fi = ? AND question_fi = ? AND pass = ?",
304 array(
'integer',
'integer',
'integer')
308 return self::$preparedDeleteResultRecordStatement;
313 if( self::$preparedSelectResultRecordStatement === null )
316 SELECT points, manual, hint_count, hint_points, answered FROM tst_test_result 317 WHERE active_fi = ? AND question_fi = ? AND pass = ? 320 self::$preparedSelectResultRecordStatement = $this->db->prepare(
321 $query, array(
'integer',
'integer',
'integer')
325 return self::$preparedSelectResultRecordStatement;
330 if( self::$preparedInsertResultRecordStatement === null )
333 INSERT INTO tst_test_result ( 334 test_result_id, active_fi, question_fi, pass, tstamp, 335 points, manual, hint_count, hint_points, answered 337 ?, ?, ?, ?, ?, ?, ?, ?, ?, ? 341 self::$preparedInsertResultRecordStatement = $this->db->prepareManip(
342 $query, array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer')
346 return self::$preparedInsertResultRecordStatement;
setQuestionIds($questionIds)
getPreparedInsertSolutionRecordStatement()
adoptSourceSolution($questionId)
getPreparedInsertResultRecordStatement()
getPreparedSelectResultRecordStatement()
adoptSourceResult($questionId, $sourcePass)
static $preparedInsertResultRecordStatement
static $preparedSelectResultRecordStatement
static $preparedDeleteResultRecordStatement
adoptQuestionAnswer($questionId)
resetTargetResult($questionId)
__construct(ilDB $db, ilSetting $assSettings, $isAssessmentLogEnabled)
static $preparedDeleteSolutionRecordsStatement
static $preparedSelectSolutionRecordsStatement
setTargetPass($targetPass)
getPreparedDeleteResultRecordStatement()
static $preparedInsertSolutionRecordStatement
getPreparedDeleteSolutionRecordsStatement()
getPreparedSelectSolutionRecordsStatement()
resetTargetSolution($questionId)