-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interaction counts and feedback averages, both by course
- Loading branch information
Showing
19 changed files
with
1,425 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,12 +3,13 @@ default: clean local_build upload | |
local_build: | ||
npm run eslint | ||
npm run build | ||
rm -rf ./build/.idea | ||
|
||
upload: | ||
ssh [email protected] "rm -rf ~/public_html/LA-Feedback" | ||
scp -r ./build [email protected]:~/public_html/LA-Feedback | ||
ssh [email protected] "mkdir ~/public_html/LA-Feedback/log; chmod -R 755 public_html/LA-Feedback/*; chmod 700 public_html/LA-Feedback/data/" | ||
|
||
clean: | ||
rm -rf ./.idea | ||
rm -rf ./build | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
include_once 'sqlManager.php'; | ||
|
||
ini_set('error_log', './log/times.log'); | ||
|
||
function get_averages() { | ||
$conn = get_connection(); | ||
$ps = $conn->prepare('SELECT course, AVG(rating) AS avg FROM feedback LEFT JOIN interactions i on ' . | ||
'feedback.interaction_key = i.interaction_key WHERE time_of_interaction >= (CURRENT_DATE() - INTERVAL 7 DAY) ' . | ||
'GROUP BY course;'); | ||
$returnVal = []; | ||
if ($ps) { | ||
$ps->execute(); | ||
$result = $ps->get_result(); | ||
while ($row = $result->fetch_assoc()) { | ||
array_push($returnVal, $row); | ||
} | ||
$ps->close(); | ||
} | ||
$conn->close(); | ||
return $returnVal; | ||
} | ||
|
||
echo json_encode(get_averages()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
include_once 'sqlManager.php'; | ||
|
||
ini_set('error_log', './log/times.log'); | ||
|
||
function get_times() { | ||
$conn = get_connection(); | ||
$ps = $conn->prepare('SELECT time_of_interaction, course FROM interactions ORDER BY time_of_interaction;'); | ||
$returnVal = []; | ||
if ($ps) { | ||
$ps->execute(); | ||
$result = $ps->get_result(); | ||
while ($row = $result->fetch_assoc()) { | ||
array_push($returnVal, $row); | ||
} | ||
$ps->close(); | ||
} | ||
$conn->close(); | ||
return $returnVal; | ||
} | ||
|
||
echo json_encode(get_times()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.