Class ilUserQuestionResult.
More...
◆ __construct()
ilUserQuestionResult::__construct |
( |
|
$question, |
|
|
|
$active_id, |
|
|
|
$pass |
|
) |
| |
◆ addKeyValue()
ilUserQuestionResult::addKeyValue |
( |
|
$key, |
|
|
|
$value |
|
) |
| |
- Parameters
-
Definition at line 57 of file class.ilUserQuestionResult.php.
58 {
59 $this->solutions[] = array(
60 self::$USER_SOLUTION_IDENTIFIER_KEY => $key,
61 self::$USER_SOLUTION_IDENTIFIER_VALUE => $value
62 );
63 }
◆ getReachedPercentage()
ilUserQuestionResult::getReachedPercentage |
( |
| ) |
|
◆ getSolutionForKey()
ilUserQuestionResult::getSolutionForKey |
( |
|
$key | ) |
|
- Parameters
-
- Returns
- array
Definition at line 117 of file class.ilUserQuestionResult.php.
118 {
119 foreach($this->solutions as $solution)
120 {
121 if($solution[self::$USER_SOLUTION_IDENTIFIER_KEY] == $key)
122 {
123 return $solution;
124 }
125 }
126 return null;
127 }
◆ getSolutions()
ilUserQuestionResult::getSolutions |
( |
| ) |
|
◆ getUserSolutionsByIdentifier()
ilUserQuestionResult::getUserSolutionsByIdentifier |
( |
|
$identifier | ) |
|
- Parameters
-
- Returns
- array
- Exceptions
-
Definition at line 86 of file class.ilUserQuestionResult.php.
87 {
88 if(
89 $identifier != self::$USER_SOLUTION_IDENTIFIER_KEY &&
90 $identifier != self::$USER_SOLUTION_IDENTIFIER_VALUE
91 )
92 {
93 throw new Exception(sprintf("Unkown Identifier %s", $identifier));
94 }
95
97 foreach($this->solutions as $solution)
98 {
100 }
102 }
References $solutions.
◆ hasSolutions()
ilUserQuestionResult::hasSolutions |
( |
| ) |
|
◆ removeByKey()
ilUserQuestionResult::removeByKey |
( |
|
$key | ) |
|
- Parameters
-
Definition at line 68 of file class.ilUserQuestionResult.php.
69 {
70 foreach($this->solutions as $array_key => $solution)
71 {
72 if($solution[self::$USER_SOLUTION_IDENTIFIER_KEY] == $key)
73 {
74 unset($this->solutions[$array_key]);
75 break;
76 }
77 }
78 }
◆ setReachedPercentage()
ilUserQuestionResult::setReachedPercentage |
( |
|
$reached_percentage | ) |
|
◆ $active_id
ilUserQuestionResult::$active_id |
|
protected |
◆ $pass
ilUserQuestionResult::$pass |
|
protected |
◆ $question
ilUserQuestionResult::$question |
|
protected |
◆ $reached_percentage
ilUserQuestionResult::$reached_percentage |
|
protected |
◆ $solutions
ilUserQuestionResult::$solutions = array() |
|
protected |
◆ $USER_SOLUTION_IDENTIFIER_KEY
ilUserQuestionResult::$USER_SOLUTION_IDENTIFIER_KEY = "key" |
|
static |
◆ $USER_SOLUTION_IDENTIFIER_VALUE
ilUserQuestionResult::$USER_SOLUTION_IDENTIFIER_VALUE = "value" |
|
static |
The documentation for this class was generated from the following file: