Skip to content

Commit

Permalink
Minor: Update variable name in Survey::checkUniqueCode - refs #5124
Browse files Browse the repository at this point in the history
  • Loading branch information
ywarnier committed Oct 13, 2024
1 parent dbbda28 commit 0adcba5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions main/survey/survey.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,22 @@ public static function generate_unique_code($code)
/**
* Checks if the survey code is unique.
*
* @param string $courseCode
* @param string $surveyCode Proposed new survey code
*
* @return bool
* @assert ('') === false
*/
public static function checkUniqueCode($courseCode)
public static function checkUniqueCode($surveyCode)
{
if (empty($courseCode)) {
return false;
}
$courseId = api_get_course_int_id();
$table = Database::get_course_table(TABLE_SURVEY);
$courseCode = Database::escape_string($courseCode);
$surveyCode = Database::escape_string($surveyCode);

$sql = "SELECT * FROM $table
WHERE code = '$courseCode' AND c_id = $courseId";
WHERE code = '$surveyCode' AND c_id = $courseId";
$result = Database::query($sql);
if (Database::num_rows($result)) {
return false;
Expand Down

0 comments on commit 0adcba5

Please sign in to comment.