79 $this->activeId = null;
80 $this->targetPass = null;
81 $this->questionIds = array();
84 $this->processLockerFactory->setAssessmentLogEnabled($isAssessmentLogEnabled);
153 $this->processLockerFactory->setUserId($this->
getUserId());
156 $this->processLockerFactory->setQuestionId($questionId);
157 $processLocker = $this->processLockerFactory->getLocker();
159 $processLocker->executeUserTestResultUpdateLockOperation(
function () use ($questionId) {
172 if ($sourcePass !== null) {
195 $res = $this->db->execute(
202 while ($row = $this->db->fetchAssoc(
$res)) {
203 if ($sourcePass === null) {
204 $sourcePass = $row[
'pass'];
205 } elseif ($row[
'pass'] < $sourcePass) {
209 $solutionId = $this->db->nextId(
'tst_solutions');
213 $row[
'points'], $row[
'value1'], $row[
'value2']
222 $res = $this->db->execute(
224 array($this->
getActiveId(), $questionId, $sourcePass)
227 $row = $this->db->fetchAssoc(
$res);
229 $resultId = $this->db->nextId(
'tst_test_result');
233 $row[
'points'], $row[
'manual'], $row[
'hint_count'], $row[
'hint_points'], $row[
'answered']
239 if (self::$preparedDeleteSolutionRecordsStatement === null) {
240 self::$preparedDeleteSolutionRecordsStatement = $this->db->prepareManip(
241 "DELETE FROM tst_solutions WHERE active_fi = ? AND question_fi = ? AND pass = ?",
242 array(
'integer',
'integer',
'integer')
246 return self::$preparedDeleteSolutionRecordsStatement;
251 if (self::$preparedSelectSolutionRecordsStatement === null) {
253 SELECT pass, points, value1, value2 FROM tst_solutions 254 WHERE active_fi = ? AND question_fi = ? AND pass < ? ORDER BY pass DESC 257 self::$preparedSelectSolutionRecordsStatement = $this->db->prepare(
259 array(
'integer',
'integer',
'integer')
263 return self::$preparedSelectSolutionRecordsStatement;
268 if (self::$preparedInsertSolutionRecordStatement === null) {
270 INSERT INTO tst_solutions ( 271 solution_id, active_fi, question_fi, pass, tstamp, points, value1, value2 273 ?, ?, ?, ?, ?, ?, ?, ? 277 self::$preparedInsertSolutionRecordStatement = $this->db->prepareManip(
279 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'text')
283 return self::$preparedInsertSolutionRecordStatement;
288 if (self::$preparedDeleteResultRecordStatement === null) {
289 self::$preparedDeleteResultRecordStatement = $this->db->prepareManip(
290 "DELETE FROM tst_test_result WHERE active_fi = ? AND question_fi = ? AND pass = ?",
291 array(
'integer',
'integer',
'integer')
295 return self::$preparedDeleteResultRecordStatement;
300 if (self::$preparedSelectResultRecordStatement === null) {
302 SELECT points, manual, hint_count, hint_points, answered FROM tst_test_result 303 WHERE active_fi = ? AND question_fi = ? AND pass = ? 306 self::$preparedSelectResultRecordStatement = $this->db->prepare(
308 array(
'integer',
'integer',
'integer')
312 return self::$preparedSelectResultRecordStatement;
317 if (self::$preparedInsertResultRecordStatement === null) {
319 INSERT INTO tst_test_result ( 320 test_result_id, active_fi, question_fi, pass, tstamp, 321 points, manual, hint_count, hint_points, answered 323 ?, ?, ?, ?, ?, ?, ?, ?, ?, ? 327 self::$preparedInsertResultRecordStatement = $this->db->prepareManip(
329 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer')
333 return self::$preparedInsertResultRecordStatement;
setQuestionIds($questionIds)
getPreparedInsertSolutionRecordStatement()
adoptSourceSolution($questionId)
getPreparedInsertResultRecordStatement()
getPreparedSelectResultRecordStatement()
adoptSourceResult($questionId, $sourcePass)
static $preparedInsertResultRecordStatement
static $preparedSelectResultRecordStatement
static $preparedDeleteResultRecordStatement
adoptQuestionAnswer($questionId)
resetTargetResult($questionId)
static $preparedDeleteSolutionRecordsStatement
__construct(ilDBInterface $db, ilSetting $assSettings, $isAssessmentLogEnabled)
static $preparedSelectSolutionRecordsStatement
setTargetPass($targetPass)
getPreparedDeleteResultRecordStatement()
static $preparedInsertSolutionRecordStatement
getPreparedDeleteSolutionRecordsStatement()
getPreparedSelectSolutionRecordsStatement()
resetTargetSolution($questionId)