mirror of
https://github.com/fsr/eseeva
synced 2025-04-28 09:28:31 +02:00
added the requested drop down menu for the patrons
This commit is contained in:
parent
0726d74796
commit
b5956dd094
22 changed files with 67 additions and 13 deletions
29
libs/questionnaireLib.php
Normal file → Executable file
29
libs/questionnaireLib.php
Normal file → Executable file
|
@ -1,15 +1,16 @@
|
|||
<?php
|
||||
//============================================================================
|
||||
// Name : questionnaireLib.php
|
||||
// Author : Patrick Reipschläger
|
||||
// Version : 1.0
|
||||
// Date : 8-2013
|
||||
// Authors : Patrick Reipschläger, Lucas Woltmann
|
||||
// Version : 1.1
|
||||
// Date : 07-2014
|
||||
// Description : Provides functions for handling questionnaire text files
|
||||
// for the ESE questionnaire for students and tutors.
|
||||
//============================================================================
|
||||
|
||||
define ("STUDENT_QUESTIONNAIRE", "questionnaires/student_questionnaire.txt");
|
||||
define ("TUTOR_QUESTIONNAIRE", "questionnaires/tutor_questionnaire.txt");
|
||||
define ("PATRONS", "questionnaires/namenspatronen.txt");
|
||||
// Possible Questionnaire Element Types
|
||||
// Should be used by all scripts when referencing them
|
||||
/**
|
||||
|
@ -41,6 +42,12 @@
|
|||
* - Label for the CommentBox
|
||||
*/
|
||||
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
|
||||
|
@ -74,4 +81,20 @@
|
|||
}
|
||||
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;
|
||||
}
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue