The MPADQ uses a single MySQL database namedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ijmeisner/einerlei/llms.txt
Use this file to discover all available pages before exploring further.
Quiz that holds license keys, administrator credentials, demographic survey data, Likert questionnaire content, and computed results. All tables use the InnoDB storage engine to enforce foreign-key relationships. You must create the database and run the SQL setup scripts in the exact order described below before the application will function correctly.
Create the Database
Log in to MySQL as a user withCREATE privileges and run:
src/login.php.
Configure src/login.php
Before running any SQL scripts, create the credentials file that the application requires. This file must exist on the server atsrc/login.php and must not be committed to version control.
Run the SQL Setup Scripts
Execute the scripts below in the order listed. Each script targets theQuiz database via a USE Quiz; statement at the top, so you can run them from any working directory.
Create the License Table
Run This creates:Each row holds one MD5-hashed license key. The
mysql/keyTable.mysql to create the License table, which stores all issued license keys.active flag is set to true when a key is issued and flipped to false after the quiz is completed.Create the admins Table and Insert Default Admin
Run This creates:The inserted password is the MD5 hash of
mysql/adminUser.mysql to create the admins table and insert the default administrator account.test. Change it immediately after setup.Create Demographic Tables and Seed Questions
Run This creates
mysql/demographic/demographicTables.mysql to create the demographic survey tables and insert the 14 questions shown to respondents before the Likert section.DemographicQuestion and DemographicAnswer, then inserts the 14 survey questions, including items for gender, age, years of study, instrument/voice type, performance history, health conditions, substance use, and professional goals.Create Likert Tables and Seed Categories
Run This creates
mysql/likert/likertTables.mysql to create the five Likert-related tables and seed the broad and sub-category names.LikertAnswerBroadCategory, LikertAnswerSubCategory, LikertQuestion, LikertValue, and LikertAnswer. It then inserts the two broad categories — Symptomatology and Contributing Factors — along with all 24 sub-categories (3 under Symptomatology and 21 under Contributing Factors).Create Results Tables
Run This creates:Results are written to these tables by
mysql/likert/likertResults.mysql to create the two tables that store computed quiz results.finish/index.php once a respondent completes the full questionnaire.Seed Likert Questions
Run This first deletes any existing rows in
mysql/likert/likertfill.mysql to insert the Likert scale values and populate the LikertQuestion table with all questionnaire items.LikertValue and LikertQuestion, then inserts the valid answer values (0, 25, 50, 75, 100 for scored responses; 6 represents N/A) and all questionnaire items. Each question row records its broad category, one or two sub-categories, and whether it is scored inversely.The
mysql/tablefill.mysql script populates placeholder result-report text (text_area1 and text_area2) for each sub-category in LikertAnswerSubCategory. Run it after the steps above if your deployment requires pre-filled report text, then replace the placeholder content with the actual interpretive copy before going live.Table Schema Reference
The tables below are the core of the data model. All foreign keys are enforced by InnoDB.License
Stores one row per issued license key. Created bymysql/keyTable.mysql.
| Column | Type | Notes |
|---|---|---|
id | INT UNSIGNED AUTO_INCREMENT | Primary key |
licenseKey | VARCHAR(255) UNIQUE | MD5 hash of the 10-character alphanumeric key sent to the buyer |
active | BOOL | true while quiz is in progress; set to false on completion |
admins
Stores administrator login credentials. Created bymysql/adminUser.mysql.
| Column | Type | Notes |
|---|---|---|
id | INT AUTO_INCREMENT | Primary key |
username | VARCHAR(255) | Admin username |
password | VARCHAR(255) | MD5 hash of the password |
DemographicQuestion / DemographicAnswer
Created bymysql/demographic/demographicTables.mysql.
| Column | Type | Notes |
|---|---|---|
id | INT UNSIGNED AUTO_INCREMENT | Primary key (DemographicQuestion) |
question | VARCHAR(255) UNIQUE | Question text |
license_id | INT UNSIGNED FK → License(id) | Ties the answer to a specific respondent (DemographicAnswer) |
demographic_question_id | INT UNSIGNED FK → DemographicQuestion(id) | Which question was answered |
answer | VARCHAR(255) | Respondent’s free-text or selected answer |
LikertQuestion
Created bymysql/likert/likertTables.mysql. Seeded by mysql/likert/likertfill.mysql.
| Column | Type | Notes |
|---|---|---|
id | INT UNSIGNED AUTO_INCREMENT | Primary key |
question | VARCHAR(255) UNIQUE | Question text shown to respondent |
broad_category_id | INT UNSIGNED FK → LikertAnswerBroadCategory(id) | Symptomatology or Contributing Factors |
sub_category_id1 | INT UNSIGNED FK → LikertAnswerSubCategory(id) | Primary sub-category |
sub_category_id2 | INT UNSIGNED NULL FK → LikertAnswerSubCategory(id) | Optional second sub-category |
score_inversely | BOOL | When true, a response of 1 maps to 100 and 5 maps to 0 |
LikertAnswer
Created bymysql/likert/likertTables.mysql.
| Column | Type | Notes |
|---|---|---|
license_id | INT UNSIGNED FK → License(id) | Respondent identifier |
question_id | INT UNSIGNED FK → LikertQuestion(id) | Which question was answered |
answer | TINYINT UNSIGNED FK → LikertValue(input) | One of: 0, 25, 50, 75, 100, or 6 (N/A) |
SubCategoryResult / BroadCategoryResult
Created bymysql/likert/likertResults.mysql. Written by finish/index.php.
| Column | Type | Notes |
|---|---|---|
license_id | INT UNSIGNED FK → License(id) | Respondent identifier |
sub_category_id / broad_category_id | INT UNSIGNED FK | Category the result belongs to |
result | INT | Computed average score for that category (0–100 scale) |