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());
161 $this->processLockerFactory->setQuestionId($questionId);
162 $processLocker = $this->processLockerFactory->getLocker();
164 $processLocker->executeUserTestResultUpdateLockOperation(
function () use ($questionId) {
177 if ($sourcePass !== null) {
200 $res = $this->db->execute(
207 while (
$row = $this->db->fetchAssoc(
$res)) {
208 if ($sourcePass === null) {
209 $sourcePass =
$row[
'pass'];
210 } elseif (
$row[
'pass'] < $sourcePass) {
214 $solutionId = $this->db->nextId(
'tst_solutions');
227 $res = $this->db->execute(
234 $resultId = $this->db->nextId(
'tst_test_result');
244 if (self::$preparedDeleteSolutionRecordsStatement === null) {
245 self::$preparedDeleteSolutionRecordsStatement = $this->db->prepareManip(
246 "DELETE FROM tst_solutions WHERE active_fi = ? AND question_fi = ? AND pass = ?",
247 array(
'integer',
'integer',
'integer')
251 return self::$preparedDeleteSolutionRecordsStatement;
256 if (self::$preparedSelectSolutionRecordsStatement === null) {
258 SELECT pass, points, value1, value2 FROM tst_solutions 259 WHERE active_fi = ? AND question_fi = ? AND pass < ? ORDER BY pass DESC 262 self::$preparedSelectSolutionRecordsStatement = $this->db->prepare(
264 array(
'integer',
'integer',
'integer')
268 return self::$preparedSelectSolutionRecordsStatement;
273 if (self::$preparedInsertSolutionRecordStatement === null) {
275 INSERT INTO tst_solutions ( 276 solution_id, active_fi, question_fi, pass, tstamp, points, value1, value2 278 ?, ?, ?, ?, ?, ?, ?, ? 282 self::$preparedInsertSolutionRecordStatement = $this->db->prepareManip(
284 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'text',
'text')
288 return self::$preparedInsertSolutionRecordStatement;
293 if (self::$preparedDeleteResultRecordStatement === null) {
294 self::$preparedDeleteResultRecordStatement = $this->db->prepareManip(
295 "DELETE FROM tst_test_result WHERE active_fi = ? AND question_fi = ? AND pass = ?",
296 array(
'integer',
'integer',
'integer')
300 return self::$preparedDeleteResultRecordStatement;
305 if (self::$preparedSelectResultRecordStatement === null) {
307 SELECT points, manual, hint_count, hint_points, answered FROM tst_test_result 308 WHERE active_fi = ? AND question_fi = ? AND pass = ? 311 self::$preparedSelectResultRecordStatement = $this->db->prepare(
313 array(
'integer',
'integer',
'integer')
317 return self::$preparedSelectResultRecordStatement;
322 if (self::$preparedInsertResultRecordStatement === null) {
324 INSERT INTO tst_test_result ( 325 test_result_id, active_fi, question_fi, pass, tstamp, 326 points, manual, hint_count, hint_points, answered 328 ?, ?, ?, ?, ?, ?, ?, ?, ?, ? 332 self::$preparedInsertResultRecordStatement = $this->db->prepareManip(
334 array(
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer',
'integer')
338 return self::$preparedInsertResultRecordStatement;
setQuestionIds($questionIds)
getPreparedInsertSolutionRecordStatement()
adoptSourceSolution($questionId)
getPreparedInsertResultRecordStatement()
getPreparedSelectResultRecordStatement()
adoptSourceResult($questionId, $sourcePass)
static $preparedInsertResultRecordStatement
static $preparedSelectResultRecordStatement
foreach($_POST as $key=> $value) $res
static $preparedDeleteResultRecordStatement
adoptQuestionAnswer($questionId)
resetTargetResult($questionId)
Create styles array
The data for the language used.
static $preparedDeleteSolutionRecordsStatement
__construct(ilDBInterface $db, ilSetting $assSettings, $isAssessmentLogEnabled)
static $preparedSelectSolutionRecordsStatement
setTargetPass($targetPass)
getPreparedDeleteResultRecordStatement()
static $preparedInsertSolutionRecordStatement
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getPreparedDeleteSolutionRecordsStatement()
getPreparedSelectSolutionRecordsStatement()
resetTargetSolution($questionId)