Skip to content

Commit

Permalink
refactor: simplify if-clause
Browse files Browse the repository at this point in the history
  • Loading branch information
janbritz committed Jul 29, 2024
1 parent abce26a commit 68633ef
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/question_ui_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ private function hide_unwanted_feedback(): void {
$feedback = $element->getAttributeNS(constants::NAMESPACE_QPY, "feedback");

if (
!in_array($feedback, ["general", "specific"])
|| ($feedback == "general" && !$this->options->generalfeedback)
|| ($feedback == "specific" && !$this->options->feedback)
!(
($feedback == "general" && $this->options->generalfeedback)
|| ($feedback == "specific" && $this->options->feedback)
)
) {
$element->parentNode->removeChild($element);
}
Expand Down

0 comments on commit 68633ef

Please sign in to comment.