diff --git a/lib/evaluation/classes/db/EvaluationQuestionDB.class.php b/lib/evaluation/classes/db/EvaluationQuestionDB.class.php index 9c7ce4667d2e21039d307ed5a337a4cc243400e5..b6cea2499bebe62caec3f6573ba069588a47f896 100644 --- a/lib/evaluation/classes/db/EvaluationQuestionDB.class.php +++ b/lib/evaluation/classes/db/EvaluationQuestionDB.class.php @@ -280,26 +280,18 @@ class EvaluationQuestionDB extends EvaluationObjectDB { $db = DBManager::get(); - if (EvaluationObjectDB::getGlobalPerm() == "root") { - $sql = - "SELECT" . - " evalquestion_id " . - "FROM" . - " evalquestion " . - "WHERE" . - " parent_id = '0' ORDER BY text"; + if (EvaluationObjectDB::getGlobalPerm() === 'root') { + $sql = "SELECT evalquestion_id + FROM evalquestion + WHERE parent_id = '0' + ORDER BY text"; return $db->fetchFirst($sql); } else { - $sql = - "SELECT" . - " evalquestion_id " . - "FROM" . - " evalquestion " . - "WHERE" . - " parent_id = '" . $userID . "' " . - "OR " . - " parent_id = '0' ORDER BY text"; - $sql .= " "; + $sql = "SELECT evalquestion_id + FROM evalquestion + WHERE parent_id = ? + OR parent_id = '0' + ORDER BY text"; return $db->fetchFirst($sql, [$userID]); } }