Skip to content

Commit

Permalink
fix: rename canvas_user_id to lms_user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
TinnaLiu committed Feb 27, 2023
1 parent c15df44 commit fcc684f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions lti-provider-server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ app.post('/postScore', jwtMiddleware({


let semester = calculateSemester(Date.now());
let canvasUserId = user_id;
let lmsUserId = user_id;
let lesson = lessonName;
const submissionsRef = firestoredb.collection('problemSubmissions');
// const submissionsRef = firestoredb.collection('development_problemSubmissions');

const queryRef = submissionsRef.where('semester', '==', semester)
.where('canvas_user_id', '==', canvasUserId)
.where('lms_user_id', '==', lmsUserId)
.where('lesson', '==', lesson)
.orderBy('time_stamp', 'asc')
.orderBy('problemID', 'asc');
Expand Down Expand Up @@ -334,7 +334,7 @@ app.post('/postScore', jwtMiddleware({

// get time of first action
const firstQueryRef = submissionsRef.where('semester', '==', semester)
.where('canvas_user_id', '==', canvasUserId)
.where('lms_user_id', '==', lmsUserId)
.where('lesson', '==', lesson)
.orderBy('time_stamp', 'asc')
.orderBy('problemID', 'asc')
Expand All @@ -348,7 +348,7 @@ app.post('/postScore', jwtMiddleware({


// get time of last action before this lesson
const prevQueryRef = submissionsRef.where('canvas_user_id', '==', canvasUserId)
const prevQueryRef = submissionsRef.where('lms_user_id', '==', lmsUserId)
.where('time_stamp', '<', lastTime)
.orderBy('time_stamp', 'desc')
.limit(1);
Expand Down
4 changes: 2 additions & 2 deletions src/ProblemLogic/Firebase.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ class Firebase {
course_name: this.ltiContext.course_name,
course_code: this.ltiContext.course_code,

canvas_user_id: this.ltiContext.user_id
lms_user_id: this.ltiContext.user_id
}
: {
course_id: "n/a",
course_name: "n/a",
course_code: "n/a",

canvas_user_id: "n/a"
lms_user_id: "n/a"
},

...data
Expand Down
2 changes: 1 addition & 1 deletion src/tools/firebaseManipulateCSV.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const transform = document => {
if (document.course_id === "n/a") {
document.course_code = "n/a"
document.course_name = "n/a"
document.canvas_user_id = "n/a"
document.lms_user_id = "n/a"
}
if (document.semester === undefined || document.semester === "" || document.semester === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/firebaseVerifyCSV.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ async function verifyCSVs(_spinner, csvSelections, collectionType, useSampleMode
object.assertPredicate("course_id", val => val === "n/a" || val?.toString().length === 40)
object.assertPredicate("course_code", val => val === "n/a" || val?.toString().length >= 2)
object.assertPredicate("course_name", val => val === "n/a" || val?.toString().length >= 4)
object.assertPredicate("canvas_user_id", val => val === "n/a" || val?.toString().length === 40)
object.assertPredicate("lms_user_id", val => val === "n/a" || val?.toString().length === 40)

object.assertType("timeStamp", "undefined")
object.assertType("canvasStudentID", "undefined")
Expand Down
2 changes: 1 addition & 1 deletion src/tools/populateGoogleSheets.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const INTERPOLATORS = {
"Semester": val => calculateSemester(val)
}

const EXCLUDED_FIELDS = ["semester", "canvas_user_id", "course_code", "course_id", "server_time"]
const EXCLUDED_FIELDS = ["semester", "lms_user_id", "course_code", "course_id", "server_time"]

const HASH_EXCLUDE_FIELDS = ['status', 'resolution', 'resolveDate', 'deployDate', 'versionFixed', 'Issue Type']

Expand Down

0 comments on commit fcc684f

Please sign in to comment.