diff --git a/.eslintrc.json b/.eslintrc.json
index 1aefcbe..88f55cf 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -163,13 +163,7 @@
]
}
],
- "react/sort-prop-types": [
- "error",
- {
- "callbacksLast": true,
- "requiredFirst": false
- }
- ],
+ "react/jsx-props-no-spreading": "off",
"button-label-required/button-label-required": ["error"]
},
"settings": {
diff --git a/package.json b/package.json
index 15d590b..3d10acf 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "la-feedback-system",
- "version": "1.7.0",
+ "version": "2.0.0",
"private": true,
"license": "Apache-2.0",
"description": "A website to gather feedback from students after interactions with LAs",
@@ -10,6 +10,7 @@
"easymde": "^2.11.0",
"react": "^16.13.1",
"react-bootstrap": "^1.3.0",
+ "react-bootstrap-typeahead": "^5.1.4",
"react-dom": "^16.13.1",
"react-markdown": "^4.3.1",
"react-modal": "^3.11.2",
@@ -26,6 +27,7 @@
"@types/nodemailer-smtp-transport": "^2.7.4",
"@types/react": "^16.9.41",
"@types/react-bootstrap": "^1.0.1",
+ "@types/react-bootstrap-typeahead": "^5.1.1",
"@types/react-dom": "^16.9.8",
"@types/react-modal": "^3.10.6",
"@types/react-transition-group": "^4.4.0",
@@ -52,7 +54,7 @@
"ts-node": "^8.10.2",
"tsconfig-paths-webpack-plugin": "^3.3.0",
"typescript": "^3.9.7",
- "webpack": "^4.42.0",
+ "webpack": "^4.44.2",
"webpack-cli": "^3.3.12"
},
"scripts": {
diff --git a/public/admin.php b/public/admin.php
index 236fb65..9f17056 100644
--- a/public/admin.php
+++ b/public/admin.php
@@ -128,14 +128,22 @@ function get_ratings($la_username) {
'LEFT JOIN interactions i on feedback.interaction_key = i.interaction_key WHERE ' .
'feedback.interaction_key IN (SELECT interaction_key FROM interactions WHERE la_username_key = ' .
'(SELECT username_key FROM cse_usernames WHERE username = ?)) ORDER BY rating DESC;');
- $ps->bind_param('s', $la_username);
- $ps->execute();
- $result = $ps->get_result();
$returnVal = [];
- while ($row = $result->fetch_assoc()) {
- array_push($returnVal, $row);
+ if ($ps) {
+ $ps->bind_param('s', $la_username);
+ $ps->execute();
+ if ($ps->error) {
+ error_log($ps->error);
+ } else {
+ $result = $ps->get_result();
+ while ($row = $result->fetch_assoc()) {
+ array_push($returnVal, $row);
+ }
+ $ps->close();
+ }
+ } else {
+ error_log("Failed to build PS to get ratings for $la_username");
}
- $ps->close();
$conn->close();
return $returnVal;
}
diff --git a/public/announcements.php b/public/announcements.php
index 23ee306..b4dacda 100644
--- a/public/announcements.php
+++ b/public/announcements.php
@@ -109,7 +109,7 @@ function get_announcements($course = 'all') {
clear_announcements();
} else if (isset($obj) && isset($obj->{'body'})) {
set_announcements($obj->{'course'}, $obj->{'body'}, $obj->{'class'});
-} else {
+} else if (isset($obj->{'course'})) {
$response = get_announcements($obj->{'course'});
}
echo json_encode($response);
\ No newline at end of file
diff --git a/public/data/lib/vader/example-results.txt b/public/data/lib/vader/example-results.txt
deleted file mode 100644
index dc49570..0000000
--- a/public/data/lib/vader/example-results.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-# --- output for the above example code ---
-VADER is smart, handsome, and funny.
- {'neg': 0.0, 'neu': 0.254, 'pos': 0.746, 'compound': 0.8316}
-VADER is smart, handsome, and funny!
- {'neg': 0.0, 'neu': 0.248, 'pos': 0.752, 'compound': 0.8439}
-VADER is very smart, handsome, and funny.
- {'neg': 0.0, 'neu': 0.299, 'pos': 0.701, 'compound': 0.8545}
-VADER is VERY SMART, handsome, and FUNNY.
- {'neg': 0.0, 'neu': 0.246, 'pos': 0.754, 'compound': 0.9227}
-VADER is VERY SMART, handsome, and FUNNY!!!
- {'neg': 0.0, 'neu': 0.233, 'pos': 0.767, 'compound': 0.9342}
-VADER is VERY SMART, really handsome, and INCREDIBLY FUNNY!!!
- {'neg': 0.0, 'neu': 0.294, 'pos': 0.706, 'compound': 0.9469}
-The book was good.
- {'neg': 0.0, 'neu': 0.508, 'pos': 0.492, 'compound': 0.4404}
-The book was kind of good.
- {'neg': 0.0, 'neu': 0.657, 'pos': 0.343, 'compound': 0.3832}
-The plot was good, but the characters are uncompelling and the dialog is not great.
- {'neg': 0.327, 'neu': 0.579, 'pos': 0.094, 'compound': -0.7042}
-A really bad, horrible book.
- {'neg': 0.791, 'neu': 0.209, 'pos': 0.0, 'compound': -0.8211}
-At least it isn't a horrible book.
- {'neg': 0.0, 'neu': 0.637, 'pos': 0.363, 'compound': 0.431}
-:) and :D
- {'neg': 0.0, 'neu': 0.124, 'pos': 0.876, 'compound': 0.7925}
-
- {'neg': 0.0, 'neu': 0.0, 'pos': 0.0, 'compound': 0.0}
-Today sux
- {'neg': 0.714, 'neu': 0.286, 'pos': 0.0, 'compound': -0.3612}
-Today sux!
- {'neg': 0.736, 'neu': 0.264, 'pos': 0.0, 'compound': -0.4199}
-Today SUX!
- {'neg': 0.779, 'neu': 0.221, 'pos': 0.0, 'compound': -0.5461}
-Today kinda sux! But I'll get by, lol
- {'neg': 0.195, 'neu': 0.531, 'pos': 0.274, 'compound': 0.2228}
\ No newline at end of file
diff --git a/public/data/tableSetup.sql b/public/data/tableSetup.sql
index 53bfccc..a13b54b 100755
--- a/public/data/tableSetup.sql
+++ b/public/data/tableSetup.sql
@@ -6,6 +6,7 @@
drop table if exists feedback;
drop table if exists interactions;
+drop table if exists logins;
drop table if exists cse_usernames;
drop table if exists announcements;
drop view if exists course_interactions;
@@ -19,14 +20,15 @@ drop view if exists interaction_type_readable;
CREATE TABLE cse_usernames
(
- username_key int auto_increment unique primary key,
- username varchar(20) not null,
- name varchar(70),
- course varchar(10),
- constraint cse_usernames_username_key_uindex
- unique (username_key),
- constraint cse_usernames_username_uindex
- unique (username)
+ username_key int auto_increment unique primary key,
+
+ # Not unique due to potential for students to appear multiple times in the future
+ username varchar(20),
+ canvas_username varchar(20),
+
+ name varchar(70),
+ course varchar(10),
+ email varchar(100)
);
CREATE TABLE interactions
@@ -54,9 +56,7 @@ CREATE TABLE logins
login_key int auto_increment unique primary key,
la_username_key int not null,
time_of_interaction timestamp default current_timestamp() not null,
- constraint interactions_interaction_key_uindex
- unique (login_key),
- constraint interactions_la_fk
+ constraint interactions_la_login_fk
foreign key (la_username_key) references cse_usernames (username_key)
on delete cascade
);
diff --git a/public/getStudents.php b/public/getStudents.php
new file mode 100644
index 0000000..d3ea7c5
--- /dev/null
+++ b/public/getStudents.php
@@ -0,0 +1,36 @@
+prepare('SELECT username_key AS id, name, course, canvas_username FROM cse_usernames;');
+ $ps->execute();
+ $result = $ps->get_result();
+ $returnVal = [];
+ while ($row = $result->fetch_assoc()) {
+ array_push($returnVal, $row);
+ }
+ $ps->close();
+ $conn->close();
+ return $returnVal;
+}
+
+$response = [
+ 'students' => get_students(),
+];
+echo json_encode($response);
\ No newline at end of file
diff --git a/public/index.html b/public/index.html
index b9b4387..e82e2d6 100644
--- a/public/index.html
+++ b/public/index.html
@@ -68,5 +68,6 @@
+