ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 42 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $db, and array.

43  {
44  $this->db = $db;
45 
46  $this->questionId = null;
47  $this->skillBaseId = null;
48  $this->skillTrefId = null;
49 
50  $this->expressions = array();
51  }
Create styles array
The data for the language used.

Member Function Documentation

◆ add()

ilAssQuestionSolutionComparisonExpressionList::add ( ilAssQuestionSolutionComparisonExpression  $expression)

Definition at line 102 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 88 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

References $query, array, getQuestionId(), getSkillBaseId(), and getSkillTrefId().

89  {
90  $query = "
91  DELETE FROM qpl_qst_skl_sol_expr
92  WHERE question_fi = %s AND skill_base_fi = %s AND skill_tref_fi = %s
93  ";
94 
95  $this->db->manipulateF(
96  $query,
97  array('integer', 'integer', 'integer'),
98  array($this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
99  );
100  }
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ get()

ilAssQuestionSolutionComparisonExpressionList::get ( )

◆ getQuestionId()

ilAssQuestionSolutionComparisonExpressionList::getQuestionId ( )

◆ getSkillBaseId()

ilAssQuestionSolutionComparisonExpressionList::getSkillBaseId ( )
Returns
int

Definition at line 141 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 157 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 53 of file class.ilAssQuestionSolutionComparisonExpressionList.php.

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

54  {
55  $query = "
56  SELECT *
57  FROM qpl_qst_skl_sol_expr
58  WHERE question_fi = %s AND skill_base_fi = %s AND skill_tref_fi = %s
59  ";
60 
61  $res = $this->db->queryF(
62  $query,
63  array('integer', 'integer', 'integer'),
64  array($this->getQuestionId(), $this->getSkillBaseId(), $this->getSkillTrefId())
65  );
66 
67  while ($row = $this->db->fetchAssoc($res)) {
69  $expression->setDb($this->db);
70  $expression->initInstanceFromArray($row);
71 
72  $this->add($expression);
73  }
74  }
foreach($_POST as $key=> $value) $res
$query
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ reset()

ilAssQuestionSolutionComparisonExpressionList::reset ( )

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

References array.

118  {
119  $this->expressions = array();
120  }
Create styles array
The data for the language used.

◆ save()

ilAssQuestionSolutionComparisonExpressionList::save ( )

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

References getQuestionId().

77  {
78  $this->delete();
79 
80  foreach ($this->expressions as $orderIndex => $expression) {
81  /* @var ilAssQuestionSolutionComparisonExpression $expression */
82 
83  $expression->setQuestionId($this->getQuestionId());
84  $expression->save();
85  }
86  }
+ Here is the call graph for this function:

◆ setQuestionId()

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

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

References $questionId.

◆ setSkillBaseId()

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

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

References $skillBaseId.

◆ setSkillTrefId()

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

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

References $skillTrefId.

Field Documentation

◆ $db

ilAssQuestionSolutionComparisonExpressionList::$db
protected

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

Referenced by __construct().

◆ $expressions

ilAssQuestionSolutionComparisonExpressionList::$expressions
private

Definition at line 37 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: