Browse Source

Added first version of README.md

Victor Hernandez 4 years ago
parent
commit
868f704eb3
1 changed files with 151 additions and 0 deletions
  1. 151
    0
      README.md

+ 151
- 0
README.md View File

1
+# TANIA Web App
2
+
3
+This web app serves as a backend management system for the client, Juan Lugo (juan.ramirez3@upr.edu) which integrates both the Android and iOS apps. Some of the functionalities include creating experiences where students can enroll in through the mobile apps, creating questionnaires ("repertoires" of questions), creating moments out of those questionnaires, and creating milestones that can be used to track any trend on students' answers. Questionnaires and moments can be imported through an Excel sheet with a specified format or created from scratch directly from the 'experience' page. Moments, milestones and questions can be edited at will through the use of a calendar and two other pages. Results can be accessed through an "export" button and inspected through numerous different charts in the 'results' page. More, smaller functionalities and features lie within the web app.
4
+
5
+This guide is a project-wide overview of how each script communicates with each other and should be used to navigate through each different file in the project. More in-depth explanations of how each function and chunks of code work can be found in the files themselves. As this was developed mostly by Víctor Hernández (victor.hernandez17@upr.edu) backed by database overseen by Carlos Corrada (carlos.corrada2@upr.edu), any questions can be made to any of the aforementioned developers' emails.
6
+
7
+
8
+## Legend:
9
+`* <- Means name may change`
10
+`** <- Means input validation still hasn't been done`
11
+`*** <- Means styling still hasn't been finished`
12
+`**** <- Means not in use anymore`
13
+
14
+
15
+## Partials:
16
+Files used mostly for layout and importing styles and common images.
17
+- `header.php`
18
+- `footer.php`
19
+
20
+
21
+## Views:
22
+Files that the user gets to interact with (the "actual" frontend).
23
+- `index.php`
24
+> Login / landing page. Provides a brief overview of the project and contact info.
25
+- `home.php`
26
+> Provides a mechanism to create new Experiences. Also displays all of the user's Experiences. Provides a link to access all of the user's Questionnaires. Provides a link to Sign Out.
27
+- `viewExperience.php`
28
+> Provides all the info about a user's Experience. Has a calendar of events (that includes the start date, the end date, the Milestones, and the Moments). Lists the Questionnaires, Moments and Milestones (provides mechanism to create all of these too). Provides a mechanism to change the Experience's title and description.
29
+- `viewQuestionnaire.php`***
30
+> Provides all the info about a user's Questionnaire. Lists all of its Questions, along with a "**Delete**" button to delete a given Question **(this affects the Moments and the Results)**. Provides a mechanism to add a new Question to the Questionnaire.
31
+- `viewMoment.php`***
32
+> Provides all the info about a user's Moment. Lists all of its Questions, along with a "**Remove**" button to remove a given Question from the Moment. Provides a mechanism to add a new Question to the Moment **(from the Questionnaire it's associated to)**.
33
+- `questionnaires.php`\****
34
+> Lists all of the user's Questionnaires. Provides a mechanism to create a new one from scratch (the same one as in `viewExperience.php`). Provides a mechanism to import a new one from a `.csv `file (along with a "**Download Template**" button so that the user follows the suggested guidelines). Also provides a mechanism to "**Duplicate**" a given Questionnaire from one Experience to another (so that the user can reuse them in different Experiences).
35
+- `respuestas.php`*
36
+> Lists all of the Results of a given experience (i.e. the _scaled_ answers), along with **mean**, **stdev** and **percent change** (between pre-post, pre-tania, post-tania). Can filter through subcategories, categories and individual students.
37
+- `error.php`
38
+> Lets user know there has been an error. Mostly occurs when the user's session has expired (which is a 1 hour limit). Redirects to `login.php`.
39
+- `unauthorized.php`
40
+> Lets user know that his email is unauthorized to use TANIA and makes sure `$_SESSION` variables are unset/destroyed. Redirects to `login.php`. **NOTE:** The user's email **(and only the user's email)** has to be in the DB table `researcher` to be considered "registered". During first login, `callback.php` is in charge of retrieving the data from user's Google account.
41
+- `users.php`
42
+> Lets administrators add users and decide which other users are administrators.
43
+- `../enrollInExp.php`
44
+> Landing page for the students. Presents the necessary steps for a student to participate in an experience, along with TANIA logo, links to CDCC page, etc.
45
+
46
+
47
+## Configuration:
48
+Files used for database connection, login logic and other configurations.
49
+- `dbh.inc.php`
50
+> Database configuration file. Provides a `$connection` variable that is used throughout all other scripts.
51
+- `config.php`
52
+> Google OAuth2 configuration file.
53
+- `callback.php`
54
+> After the user logs in through Google, it receives the user's data and sets `$_SESSION` variables, as well as `$dbUserData` variable.
55
+- `checkLogin.php`
56
+> Checks if the appropriate `$_SESSION` variables are set so that the user can continue in the page. If they are not set (or if invalid), it redirects user to `error.php` or `unauthorized.php`.
57
+
58
+
59
+## Backend:
60
+Files used for database transactions. Most are named in `<action><Entity>.php` where the `action` is done __over__ an `entity`. Some are used for visualizations in other pages such as `respuestas.php`. Another is used for the calendar in `viewExperience.php`, and so on.
61
+- `export.php`**
62
+> Exports the Results from `respuestas.php` in `.csv` format.
63
+- `logout.php`
64
+> Logs user out (unsets/destroys `$_SESSION` variables).
65
+- `special.php`*
66
+> Populates dropdown (in `viewExperience.php`) with a Questionnaire's Questions (by specifying Questionnaire ID)
67
+- `special2.php`*
68
+> Gathers Moments, Milestones and other details from a given Experience, sending them out in JSON so that the Calendar (in `viewExperience.php`) gets populated with events (by specifying Experience ID).
69
+- `special4.php`*
70
+> Changes the StartDate of a given calendar event (Moment or Milestone) by specifying 1) the “event ID” and “event Type” separated by a '-', 2) the corresponding Experience ID, and 3) the event's new StartDate (in `viewExperience.php`).
71
+- `special5.php`*
72
+> Spits out JSON data for "Answer Rate" histogram, which indicates how many people have answered each moment (i.e. 5 people answered moment 1, while 7 people answered moment 3, etc.)
73
+- `special6.php`*
74
+> I THINK THIS IS NOT BEING USED...
75
+- `funciones.php`*
76
+> Functions used by `siCategoria.php`, `siPreguntas.php` and `siSubCategoria.php`.
77
+- `respuestasData.php`*
78
+> Used asynchronously by `respuestas.php` when changes in the table are made.
79
+- `siCategoria.php`*
80
+> Used asynchronously by `respuestas.php` when changes in the table are made.
81
+- `siPreguntas.php`*
82
+> Used asynchronously by `respuestas.php` when changes in the table are made.
83
+- `siSubCategoria.php`*
84
+> Used asynchronously by `respuestas.php` when changes in the table are made.
85
+- `insertExperience.php`
86
+- `updateExperience.php`
87
+- `insertQuestionnaire.php`
88
+- `updateQuestionnaire.php`
89
+- `importQuestionnaire.php`**
90
+- `duplicateQuestionnaire.php`
91
+- `insertMoment.php`
92
+- `updateMoment.php`
93
+- `insertMilestone.php`
94
+- `updateQuestion.php`
95
+- `insertQuestionToQuestionnaire.php`
96
+- `addExistingQuestionToMoment.php`
97
+- `removeQuestionFromMoment.php`
98
+- `deleteQuestionnaire.php`
99
+- `deleteMoment.php`
100
+- `deleteQuestion.php`
101
+- `addUser.php`
102
+- `makeManager.php`
103
+- `categoryBreakdown.php`
104
+> This script fetches how many people, for every category, have answered a given score and spits out a JSON with an array of category ID, category name, score and count.
105
+- `questionBreakdown.php`
106
+> This script fetches how many people, for every question, have answered a given score and spits out a JSON with an array of question ID, question premise, score and count.
107
+- `subcategoryBreakdown.php`
108
+> This script fetches how many people, for every subcategory, have answered a given score and spits out a JSON with an array of subcategory ID, subcategory name, score and count.
109
+
110
+
111
+## Styling:
112
+- `css/`
113
+> Compiled CSS from SASS files in folder `scss/`.
114
+- `scss/`
115
+> Uncompiled SASS files.
116
+
117
+
118
+## Images:
119
+- `img/`
120
+> Provides the photos used for `header.php`, `index.php`, `home.php` and `enrollInExp.php`.
121
+
122
+
123
+## Dynamicity:
124
+- `js/`
125
+> Folder that contains the javascript code for each "View" PHP script. The names are the same as their corresponding PHP scripts.
126
+
127
+
128
+## Testing/Prototyping:
129
+Used sparingly for testing backend and frontend code before moving it to a working script.
130
+- `test.php`
131
+- `testFrontEnd.php`
132
+
133
+
134
+## Old Code:
135
+Old files used for the alpha version of TANIA (EMA/MARLE) which are not in use currently. Created mostly by Coralys Cubero (coralys.cubero@upr.edu) from August 2018 to February 2019.
136
+- `old_code/`
137
+- `processes/old_code3`
138
+- `../old_code2`
139
+
140
+
141
+## Libraries:
142
+- `jQuery`
143
+> Mainly used for asynchronous requests in the server (in `home.php`, `viewExperience.php` and `respuestas.php`* ) as well as other features inside of Bootstrap.
144
+- `jQuery UI`
145
+> Used for inputs of type `date` and `datetime` in `home.php` and `viewExperience.php`.
146
+- `Bootstrap`
147
+> Mainly used for styling purposes.
148
+- `FullCalendar`
149
+> Used for the calendar in `viewExperience.php`.
150
+- `Chart.js`
151
+> Used for the charts in `respuestas.php`*.