From 897d70ca5ca819ce74168e23567fd4cab38eb93c Mon Sep 17 00:00:00 2001 From: Lucas Woltmann Date: Sat, 7 Nov 2015 16:15:29 +0100 Subject: [PATCH] Kommentare, Kommentare, Kommentare --- libs/formLib.php | 6 +++--- libs/keyLib.php | 11 +++++++++-- index.php => student_questionnaire.php | 7 +++++-- 3 files changed, 17 insertions(+), 7 deletions(-) rename index.php => student_questionnaire.php (98%) diff --git a/libs/formLib.php b/libs/formLib.php index c84a402..c7b8544 100755 --- a/libs/formLib.php +++ b/libs/formLib.php @@ -267,10 +267,10 @@ } /** - * Echos a new division with a labelled text box and switching row styles. + * Echos a new division with a dropdown menu. * * @param string $label The label that should be displayed for the dropdown menu. - * @param string $id The unique id that is used to identify the dropdownmenu. + * @param string $id The unique id that is used to identify the dropdown menu. * @param string $value The options that should be displayed within the dropdown menu. * */ @@ -289,4 +289,4 @@ echo " \n"; echo "\n"; } -?> \ No newline at end of file +?> diff --git a/libs/keyLib.php b/libs/keyLib.php index 4471a6f..86ce0c9 100755 --- a/libs/keyLib.php +++ b/libs/keyLib.php @@ -125,7 +125,14 @@ //else // echo ""; fclose($handle); - return true; + if ($res) + { + return true; + } + else + { + return false; + } } /** * Get the current state of the specified key which will be one of the defines @@ -163,4 +170,4 @@ } return false; } -?> \ No newline at end of file +?> diff --git a/index.php b/student_questionnaire.php similarity index 98% rename from index.php rename to student_questionnaire.php index 2c05355..e3fbfe4 100755 --- a/index.php +++ b/student_questionnaire.php @@ -47,7 +47,10 @@ if (WriteLogFile(STUDENTLOGFILE, $questionData, $tutorData, $commentData)) { SetKeyState($keyData, $_POST["code"], KEYSTATE_ACTIVATED); - WriteKeyFile(KEYFILE, $keyData); + if (!WriteKeyFile(KEYFILE, $keyData)) + { + $error = 1; + } } // otherwise set the error flag else @@ -101,4 +104,4 @@ case KEYSTATE_USED: CreateMessageBox(MSG_DANGER, "Achtung!", "Der angegebene Code ist wurde bereits eingelöst. Es darf pro Student nur eine ESE-Tasse ausgegeben werden."); break; } } -?> \ No newline at end of file +?>