3 declare(strict_types=1);
    32     protected \ilDBInterface 
$db;
    46         $atom_query = $this->db->buildAtomQuery();
    47         $atom_query->addTableLock(self::TABLE_NAME_ANSWERS);
    48         $atom_query->addTableLock(self::TABLE_NAME_ANSWERS . 
'_seq');
    50         $atom_query->addQueryCallable(
    65         return new \ilAssOrderingElementList($question_id, $elements);
    73         $query = 
'SELECT' . PHP_EOL
    74             . 
'answer_id, answertext, solution_key, random_id, depth, position' . PHP_EOL
    75             . 
'FROM ' . self::TABLE_NAME_ANSWERS . PHP_EOL
    76             . 
'WHERE question_fi=' . $question_id . PHP_EOL
    77             . 
'ORDER BY position ASC';
    80         $res = $this->db->query($query);
    81         while ($row = $this->db->fetchAssoc(
$res)) {
    83                 (
int) $row[
'answer_id'],
    84                 (
int) $row[
'random_id'],
    85                 (
int) $row[
'solution_key'],
    86                 (
int) $row[
'position'],
    88                 (
string) $row[
'answertext']
    96         $query = 
'DELETE FROM ' . self::TABLE_NAME_ANSWERS . PHP_EOL
    97             . 
'WHERE question_fi = ' . $question_id;
    98         $this->db->manipulate($query);
   103         $next_id = $this->db->nextId(self::TABLE_NAME_ANSWERS);
   105             'answer_id' => [
'integer', $next_id],
   106             'question_fi' => [
'integer', $question_id],
   107             'answertext' => [
'text', $order_element->
getContent()],
   110             'position' => [
'integer', $order_element->
getPosition()],
   112             'tstamp' => [
'integer', $this->
getTime()]
   114         $this->db->insert(self::TABLE_NAME_ANSWERS, $values);
   124         int $random_identifier,
   125         int $solution_identifier,
   132             ->withSolutionIdentifier($solution_identifier)
   133             ->withPosition($position)
   134             ->withIndentation($indentation)
   135             ->withContent($content);
 getOrderingElementsForList(int $question_id)
 
repository for assOrderingQuestion (the answer elements within, at least...) 
 
__construct(\ilDBInterface $db)
 
getOrderingList(int $question_id)
 
buildOrderingElement(int $answer_id, int $random_identifier, int $solution_identifier, int $position, int $indentation, string $content)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const TABLE_NAME_QUESTIONS
 
withRandomIdentifier(int $id)
 
insertOrderingElement(\ilAssOrderingElement $order_element, int $question_id)
 
buildOrderingList(int $question_id)
 
updateOrderingList(\ilAssOrderingElementList $list)
 
deleteOrderingElements(int $question_id)