ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilAssQuestionSolutionComparisonExpressionList Class Reference
+ Collaboration diagram for ilAssQuestionSolutionComparisonExpressionList:

Public Member Functions

 __construct (ilDBInterface $db)
 
 load ()
 
 save ()
 
 delete ()
 
 add (ilAssQuestionSolutionComparisonExpression $expression)
 
 get ()
 
 reset ()
 
 getQuestionId ()
 
 setQuestionId ($questionId)
 
 getSkillBaseId ()
 
 setSkillBaseId ($skillBaseId)
 
 getSkillTrefId ()
 
 setSkillTrefId ($skillTrefId)
 

Protected Attributes

 $db
 

Private Attributes

 $questionId
 
 $skillBaseId
 
 $skillTrefId
 
 $expressions
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilAssQuestionSolutionComparisonExpressionList::__construct ( ilDBInterface  $db)
Parameters
ilDBInterface$db

Definition at line 55 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $db, and null.

56  {
57  $this->db = $db;
58 
59  $this->questionId = null;
60  $this->skillBaseId = null;
61  $this->skillTrefId = null;
62 
63  $this->expressions = [];
64  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null

Member Function Documentation

◆ add()

ilAssQuestionSolutionComparisonExpressionList::add ( ilAssQuestionSolutionComparisonExpression  $expression)

Definition at line 115 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References ilAssQuestionSolutionComparisonExpression\getOrderIndex(), getQuestionId(), getSkillBaseId(), getSkillTrefId(), ilAssQuestionSolutionComparisonExpression\setDb(), ilAssQuestionSolutionComparisonExpression\setQuestionId(), ilAssQuestionSolutionComparisonExpression\setSkillBaseId(), and ilAssQuestionSolutionComparisonExpression\setSkillTrefId().

Referenced by load().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilAssQuestionSolutionComparisonExpressionList::delete ( )

Definition at line 101 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References getQuestionId(), getSkillBaseId(), and getSkillTrefId().

101  : void
102  {
103  $query = "
104  DELETE FROM qpl_qst_skl_sol_expr
105  WHERE question_fi = %s AND skill_base_fi = %s AND skill_tref_fi = %s
106  ";
107 
108  $this->db->manipulateF(
109  $query,
110  ['integer', 'integer', 'integer'],
111  [$this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId()]
112  );
113  }
+ Here is the call graph for this function:

◆ get()

ilAssQuestionSolutionComparisonExpressionList::get ( )

◆ getQuestionId()

ilAssQuestionSolutionComparisonExpressionList::getQuestionId ( )

◆ getSkillBaseId()

ilAssQuestionSolutionComparisonExpressionList::getSkillBaseId ( )
Returns
int

Definition at line 154 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $skillBaseId.

Referenced by add(), delete(), and load().

+ Here is the caller graph for this function:

◆ getSkillTrefId()

ilAssQuestionSolutionComparisonExpressionList::getSkillTrefId ( )
Returns
int

Definition at line 170 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $skillTrefId.

Referenced by add(), delete(), and load().

+ Here is the caller graph for this function:

◆ load()

ilAssQuestionSolutionComparisonExpressionList::load ( )

Definition at line 66 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $res, add(), getQuestionId(), getSkillBaseId(), and getSkillTrefId().

66  : void
67  {
68  $query = "
69  SELECT *
70  FROM qpl_qst_skl_sol_expr
71  WHERE question_fi = %s AND skill_base_fi = %s AND skill_tref_fi = %s
72  ";
73 
74  $res = $this->db->queryF(
75  $query,
76  ['integer', 'integer', 'integer'],
77  [$this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId()]
78  );
79 
80  while ($row = $this->db->fetchAssoc($res)) {
82  $expression->setDb($this->db);
83  $expression->initInstanceFromArray($row);
84 
85  $this->add($expression);
86  }
87  }
$res
Definition: ltiservices.php:66
+ Here is the call graph for this function:

◆ reset()

ilAssQuestionSolutionComparisonExpressionList::reset ( )

Definition at line 130 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

130  : void
131  {
132  $this->expressions = [];
133  }

◆ save()

ilAssQuestionSolutionComparisonExpressionList::save ( )

Definition at line 89 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References getQuestionId().

89  : void
90  {
91  $this->delete();
92 
93  foreach ($this->expressions as $orderIndex => $expression) {
94  /* @var ilAssQuestionSolutionComparisonExpression $expression */
95 
96  $expression->setQuestionId($this->getQuestionId());
97  $expression->save();
98  }
99  }
+ Here is the call graph for this function:

◆ setQuestionId()

ilAssQuestionSolutionComparisonExpressionList::setQuestionId (   $questionId)
Parameters
int$questionId

Definition at line 146 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $questionId.

◆ setSkillBaseId()

ilAssQuestionSolutionComparisonExpressionList::setSkillBaseId (   $skillBaseId)
Parameters
int$skillBaseId

Definition at line 162 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $skillBaseId.

◆ setSkillTrefId()

ilAssQuestionSolutionComparisonExpressionList::setSkillTrefId (   $skillTrefId)
Parameters
int$skillTrefId

Definition at line 178 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $skillTrefId.

Field Documentation

◆ $db

ilAssQuestionSolutionComparisonExpressionList::$db
protected

Definition at line 30 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

Referenced by __construct().

◆ $expressions

ilAssQuestionSolutionComparisonExpressionList::$expressions
private

Definition at line 50 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

Referenced by get().

◆ $questionId

ilAssQuestionSolutionComparisonExpressionList::$questionId
private

◆ $skillBaseId

ilAssQuestionSolutionComparisonExpressionList::$skillBaseId
private

◆ $skillTrefId

ilAssQuestionSolutionComparisonExpressionList::$skillTrefId
private

The documentation for this class was generated from the following file: