Skip to content

Commit

Permalink
Fix for usage download
Browse files Browse the repository at this point in the history
  • Loading branch information
allomanta committed Oct 17, 2024
1 parent 389e75e commit e3b6fec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
8 changes: 1 addition & 7 deletions IguideME.Web/Services/Constants/DatabaseQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1151,16 +1151,10 @@ ORDER BY `end_timestamp` DESC
ORDER BY `name` ASC;";

public const string QUERY_USAGE =
@"SELECT `user_tracker`.`id`,
`user_tracker`.`time`,
@"SELECT `user_tracker`.`time`,
`user_tracker`.`user_id`,
`user_tracker`.`action`
FROM `user_tracker`
INNER JOIN `canvas_users`
ON `canvas_users`.`user_id`=`user_tracker`.`user_id`
WHERE `canvas_users`.`sync_hash`=@hash
AND `canvas_users`.`course_id`=@courseID
GROUP BY `user_tracker`.`user_id`
;";

public const string QUERY_USERS_WITH_ROLE_FOR_COURSE =
Expand Down
4 changes: 2 additions & 2 deletions IguideME.Web/Services/DatabaseManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ public void RegisterDiscussionReply(AppDiscussion reply)
public string GetUsage(int courseID)
{
_logger.LogInformation("userID: #actions");
string csv = "";
string csv = "time, userID, action\r\n";
using (
SQLiteDataReader r = Query(
DatabaseQueries.QUERY_USAGE,
Expand All @@ -639,7 +639,7 @@ public string GetUsage(int courseID)
{
while (r.Read())
{
csv += $"{r.GetInt32(0)}, {r.GetValue(1)}, {r.GetValue(2)}, {r.GetValue(3)}\r\n";
csv += $"{r.GetValue(0)}, {r.GetValue(1)}, {r.GetValue(2)}\r\n";
}
}
return csv;
Expand Down
2 changes: 1 addition & 1 deletion IguideME.Web/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"SigningKey": "blawlaekltjwelkrjtwlkejlekwjrklwejr32423"
},
"LMS": {
"Backend": "Brightspace",
"Backend": "Canvas",
"Canvas": {
"Url": "https://uvadlo-tes.instructure.com/",
"AccessToken": "10441~hNIJcVXzv25ibhKMqYROQ06GiBlUkpBEs29h25OBUjGUNZfNtvf4MeVgeC3B1O0p"
Expand Down
4 changes: 2 additions & 2 deletions charts/iguideme/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: iguideme
description: IguideME
type: application
version: 0.2.97
appVersion: "0.2.97"
version: 0.2.98
appVersion: "0.2.98"

0 comments on commit e3b6fec

Please sign in to comment.