39 $this->objectivesByQuestion = array();
40 $this->objectivesTitles = array();
49 $this->objectivesByQuestion[$questionId] = $objectiveIds;
58 if (!isset($this->objectivesByQuestion[$questionId])) {
62 return (
bool) count($this->objectivesByQuestion[$questionId]);
70 return $this->objectivesByQuestion[$questionId];
75 foreach ($this->objectivesByQuestion as $objectiveIds) {
76 foreach ($objectiveIds as $objectiveId) {
77 if (!isset($this->objectivesTitles[$objectiveId])) {
79 $this->objectivesTitles[$objectiveId] = $objectiveTitle;
91 if (!isset($this->objectivesByQuestion[$questionId])
92 || !is_array($this->objectivesByQuestion[$questionId])) {
97 foreach ($this->objectivesByQuestion[$questionId] as $objectiveId) {
98 $titles[] = $this->objectivesTitles[$objectiveId];
101 return implode(
', ', $titles);
106 return implode(
', ', $this->objectivesTitles);
111 $objectiveTitles = array();
113 foreach ($this->objectivesByQuestion as $questionId => $objectiveIds) {
114 if (!in_array($questionId, $questionIds)) {
118 foreach ($objectiveIds as $objectiveId) {
119 $objectiveTitles[$objectiveId] = $this->objectivesTitles[$objectiveId];
123 return implode(
', ', $objectiveTitles);
128 return $this->objectivesTitles[$objectiveId];
138 if (!isset($this->objectivesByQuestion[$questionId])
139 || !is_array($this->objectivesByQuestion[$questionId])) {
143 foreach ($this->objectivesByQuestion[$questionId] as $relatedObjectiveId) {
144 if ($relatedObjectiveId == $objectiveId) {
154 $filteredResults = array();
156 foreach ($testResults as $questionId => $resultData) {
161 $filteredResults[$questionId] = $resultData;
164 return $filteredResults;
static lookupObjectiveTitle(int $a_objective_id, bool $a_add_description=false)