Skip to content

Commit

Permalink
refactor: use snake case and keep access checking methods private
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-heinrich authored and kergomard committed Feb 18, 2025
1 parent 7faa98a commit 176de69
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,29 @@ class ilAssQuestionSkillAssignmentsTableGUI extends ilTable2GUI
/**
* @var array<int, bool> Question ID => Manipulation allowed
*/
private array $manipulationsAllowedList;
private array $manipulations_allowed_list;

public function setSkillQuestionAssignmentList(ilAssQuestionSkillAssignmentList $assignmentList): void
{
$this->skillQuestionAssignmentList = $assignmentList;
}

/**
* @param array<int, bool> $manipulationsAllowedList
* @param array<int, bool> $manipulations_allowed_list
*/
public function setManipulationAllowedList(array $manipulationsAllowedList): void
public function setManipulationAllowedList(array $manipulations_allowed_list): void
{
$this->manipulationsAllowedList = $manipulationsAllowedList;
$this->manipulations_allowed_list = $manipulations_allowed_list;
}

public function areManipulationsEnabled(): bool
private function areManipulationsPossible(): bool
{
return $this->manipulationsEnabled;
return $this->manipulationsEnabled && array_filter($this->manipulations_allowed_list) !== [];
}

public function areManipulationsPossible(): bool
private function isManipulationAllowedForQuestion(int $q_id): bool
{
return $this->areManipulationsEnabled() && array_filter($this->manipulationsAllowedList) !== [];
}

public function isManipulationAllowedForQuestion(int $q_id): bool
{
return $this->areManipulationsEnabled() && $this->manipulationsAllowedList[$q_id];
return $this->manipulationsEnabled && $this->manipulations_allowed_list[$q_id];
}

public function setManipulationsEnabled(bool $manipulationsEnabled): void
Expand Down

0 comments on commit 176de69

Please sign in to comment.