Skip to content
Snippets Groups Projects
Commit 9beb0e6d authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Elmar Ludwig
Browse files

fix sql query, fixes #2285

Closes #2285

Merge request studip/studip!1511
parent 5655e10f
No related branches found
No related tags found
1 merge request!4Draft: Icon creation
......@@ -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]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment