3
0
Fork 0
mirror of https://github.com/fsr/eseeva synced 2024-11-15 00:43:12 +01:00

added the requested drop down menu for the patrons

This commit is contained in:
Lucas Woltmann 2014-07-21 15:48:40 +02:00
parent 0726d74796
commit b5956dd094
22 changed files with 67 additions and 13 deletions

2
README.md Normal file → Executable file
View file

@ -32,7 +32,7 @@ The people responsible for the ESE create a new list of keys by using the page *
### 5. Analyse the results of the evaluation questionnaires ### 5. Analyse the results of the evaluation questionnaires
//TODO Just go to the *analysis.php* site to see the results.
### 6. Files ### 6. Files

0
analysis.php Normal file → Executable file
View file

0
css/bootstrap.css vendored Normal file → Executable file
View file

0
css/ese-logo.png Normal file → Executable file
View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

0
css/print.css Normal file → Executable file
View file

0
css/style.css Normal file → Executable file
View file

5
index.php Normal file → Executable file
View file

@ -17,8 +17,9 @@
$error = 0; $error = 0;
// Determines if a message box is shown, and what type of message box is shown // Determines if a message box is shown, and what type of message box is shown
$keyState = ""; $keyState = "";
// load the questionnaire data // load the questionnaire and patrons data
$questionnaire = ReadQuestionnaireFile(STUDENT_QUESTIONNAIRE); $questionnaire = ReadQuestionnaireFile(STUDENT_QUESTIONNAIRE);
$patrons = ReadPatronsFile(PATRONS);
// if the variable is set, the form has been posted to itself and can be validated // if the variable is set, the form has been posted to itself and can be validated
if (isset($_POST["submit"])) if (isset($_POST["submit"]))
{ {
@ -73,7 +74,7 @@
else else
CreateKeyMessageBox($keyState); CreateKeyMessageBox($keyState);
CreateQuestionnaireElement("code", $questionnaire, $_POST); CreateQuestionnaireElement("code", $questionnaire, $_POST);
CreateQuestionnaireElement("tutorName", $questionnaire, $_POST); CreateQuestionnaireElement("tutorName", $questionnaire, $patrons);
CreateQuestionnaireElement("legend", $questionnaire, $_POST); CreateQuestionnaireElement("legend", $questionnaire, $_POST);
CreateAllQuestionElements($questionnaire, $_POST); CreateAllQuestionElements($questionnaire, $_POST);
CreateQuestionnaireElement("comment", $questionnaire, $_POST); CreateQuestionnaireElement("comment", $questionnaire, $_POST);

0
keyControlPanel.php Normal file → Executable file
View file

0
keyTable.php Normal file → Executable file
View file

0
libs/chartLib.php Normal file → Executable file
View file

35
libs/formLib.php Normal file → Executable file
View file

@ -1,9 +1,9 @@
<?php <?php
//============================================================================ //============================================================================
// Name : formLib.php // Name : formLib.php
// Author : Patrick Reipschläger // Authors : Patrick Reipschläger, Lucas Woltmann
// Version : 1.0 // Version : 1.1
// Date : 08-2013 // Date : 07-2014
// Description : Provides several functions for displaying form elements // Description : Provides several functions for displaying form elements
// for the ESE evaluation for students and tutors. // for the ESE evaluation for students and tutors.
//============================================================================ //============================================================================
@ -211,6 +211,11 @@
CreateQuestion($entry[1], $id, $value); CreateQuestion($entry[1], $id, $value);
else if ($type == Q_COMMENT) else if ($type == Q_COMMENT)
CreateCommentBox($entry[1], $id, $value); CreateCommentBox($entry[1], $id, $value);
else if ($type == Q_DROPDOWN)
{
$value = $formData;
CreateDropDownMenu($entry[1], $id, $value);
}
} }
/** /**
* Echos a range of new divisions with switching row styles for all questions that * Echos a range of new divisions with switching row styles for all questions that
@ -260,4 +265,28 @@
echo " </div>\n"; echo " </div>\n";
echo "</div>\n"; echo "</div>\n";
} }
/**
* Echos a new division with a labelled text box and switching row styles.
*
* @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 $value The options that should be displayed within the dropdown menu.
*
*/
function CreateDropDownMenu($label, $id, $value)
{
CreateRowHeader();
echo " <div class=\"col-sm-8\">\n";
echo " <p class=\"lead\">" . $label . "</p>\n";
echo " </div>\n";
echo " <div class=\"col-sm-4\">\n";
echo " <select class=\"form-control\" id=\"". $id . "\" name=\"". $id ."\" required>\n";
foreach ($value as $key => $entry) {
echo " <option value=\"".$entry."\">".$entry."</option>\n";
}
echo " </select>\n";
echo " </div>\n";
echo "</div>\n";
}
?> ?>

0
libs/keyLib.php Normal file → Executable file
View file

2
libs/loggingLib.php Normal file → Executable file
View file

@ -252,7 +252,7 @@
continue; continue;
// get the type of the element with the same id as the form element from the questionnaire // get the type of the element with the same id as the form element from the questionnaire
$type = $questionnaire[$id][0]; $type = $questionnaire[$id][0];
// check if the element is a question on continue with the next one if that is not hte case // check if the element is a question on continue with the next one if that is not the case
if ($type != "Question") if ($type != "Question")
continue; continue;
// if there is not field for the current element in the question dsta array, create a new // if there is not field for the current element in the question dsta array, create a new

29
libs/questionnaireLib.php Normal file → Executable file
View file

@ -1,15 +1,16 @@
<?php <?php
//============================================================================ //============================================================================
// Name : questionnaireLib.php // Name : questionnaireLib.php
// Author : Patrick Reipschläger // Authors : Patrick Reipschläger, Lucas Woltmann
// Version : 1.0 // Version : 1.1
// Date : 8-2013 // Date : 07-2014
// Description : Provides functions for handling questionnaire text files // Description : Provides functions for handling questionnaire text files
// for the ESE questionnaire for students and tutors. // for the ESE questionnaire for students and tutors.
//============================================================================ //============================================================================
define ("STUDENT_QUESTIONNAIRE", "questionnaires/student_questionnaire.txt"); define ("STUDENT_QUESTIONNAIRE", "questionnaires/student_questionnaire.txt");
define ("TUTOR_QUESTIONNAIRE", "questionnaires/tutor_questionnaire.txt"); define ("TUTOR_QUESTIONNAIRE", "questionnaires/tutor_questionnaire.txt");
define ("PATRONS", "questionnaires/namenspatronen.txt");
// Possible Questionnaire Element Types // Possible Questionnaire Element Types
// Should be used by all scripts when referencing them // Should be used by all scripts when referencing them
/** /**
@ -41,6 +42,12 @@
* - Label for the CommentBox * - Label for the CommentBox
*/ */
define ("Q_COMMENT", "Comment"); define ("Q_COMMENT", "Comment");
/**
* DropDown Element
* Parameter:
* - Label for the DropDownMenu
*/
define ("Q_DROPDOWN", "DropDown");
/** /**
* Reads the questionnaire file with the specified name and returns an array * Reads the questionnaire file with the specified name and returns an array
@ -74,4 +81,20 @@
} }
return $data; return $data;
} }
function ReadPatronsFile($fileName)
{
if (!file_exists($fileName))
return null;
$handle = fopen($fileName, 'r');
if (!$handle)
return null;
$rawData = fread($handle, filesize($fileName));
$lines = explode("\n", $rawData);
$data = array();
for ($i = 0; $i < count($lines); $i++)
$data[trim($lines[$i])] = trim($lines[$i]);
return $data;
}
?> ?>

0
logs/.gitignore vendored Normal file → Executable file
View file

0
menu.php Normal file → Executable file
View file

0
patronGen.php Normal file → Executable file
View file

0
patronGenTut.php Normal file → Executable file
View file

5
questionnaires/student_questionnaire.txt Normal file → Executable file
View file

@ -16,6 +16,7 @@
# Takes the question as a parameter. # Takes the question as a parameter.
# Comment = A box for comments (It is assumed there is only one such box) # Comment = A box for comments (It is assumed there is only one such box)
# Takes the label of the comment box as a parameter. # Takes the label of the comment box as a parameter.
# DropDown = Dropdown menu for the tutor
# #
# If fundamental changes are made (other than changing strings or adding/removing questions) # If fundamental changes are made (other than changing strings or adding/removing questions)
# The files 'student_questionnaire.php' and 'student_analysis' should be checked for validity, # The files 'student_questionnaire.php' and 'student_analysis' should be checked for validity,
@ -23,14 +24,14 @@
#------------------------------------------------ #------------------------------------------------
# -- Header --- # -- Header ---
headline; Headline; ESE 2013 headline; Headline; ESE 2014
# -- personal Code -- # -- personal Code --
# this is important and should stay so the student can identify himself to the system and receive his cup later on # this is important and should stay so the student can identify himself to the system and receive his cup later on
code; TextBox; Persönlicher Code: code; TextBox; Persönlicher Code:
# -- Name of the tutor -- # -- Name of the tutor --
tutorName; TextBox; Wer war dein Namenspatron? (Nachname) tutorName; DropDown; Wer war dein Namenspatron?;
# -- Legend -- # -- Legend --
legend; Legend; legend; Legend;

0
questionnaires/tutor_questionnaire.txt Normal file → Executable file
View file

0
tutorAnalysis.php Normal file → Executable file
View file

0
tutor_questionnaire.php Normal file → Executable file
View file