-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#10950] Track student feedback session in frontend #11005
[#10950] Track student feedback session in frontend #11005
Conversation
@@ -310,6 +313,16 @@ export class SessionSubmissionPageComponent implements OnInit, AfterViewInit { | |||
} | |||
} | |||
|
|||
this.logService.createFeedbackSessionLog({ | |||
courseId: this.courseId, | |||
studentEmail: this.loggedInUser, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's log down the fsname too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, are you sure this is the best place to track the student access? What if the user is using a regKey
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't the loadFeedbackSession
function be called regardless of which auth the user uses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true that the method will be called if auth succeeds. But the thing is the loggedInUser
may not contain the email of the student. I was thinking a safer place to put it would be in the method loadPersonName
}).subscribe(() => { | ||
|
||
}, () => { | ||
this.simpleModalService.openInformationModal('Log Error', SimpleModalType.WARNING, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe would be better to use a toast instead?
@damithc If the tracking of student access/submission fails, would a modal or toast be more appropriate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to toast. I feel it makes more sense too. thanks for the feedback
*/ | ||
createFeedbackSessionLog(queryParams: { | ||
courseId: string, | ||
studentEmail: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here. log down the fsname too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also thinking of logging the fsname
but the current API endpoint only takes in those 3, right? The labels are only setup for the 3 params. Should I add the new parameter now itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the new API endpoint functionality as in #10984, I've recently changed it to take in fsname
too! Sorry if it's a source of confusion.
*/ | ||
createFeedbackSessionLog(queryParams: { | ||
courseId: string, | ||
studentEmail: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the new API endpoint functionality as in #10984, I've recently changed it to take in fsname
too! Sorry if it's a source of confusion.
src/web/services/log.service.ts
Outdated
logType: LogTypes }): Observable<string> { | ||
const paramMap: Record<string, string> = { | ||
courseId: queryParams.courseId, | ||
studentEmail: queryParams.studentEmail, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
courseid
and studentemail
should be in lowercase here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, works as expected. Might want to eventually write more tests for the log service though
/** | ||
* Constant values for all the different log types. | ||
*/ | ||
public enum LogTypes { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, just a nit: could this be called LogType
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am okay with this change - again hard to give a proper review since it feels like this is just one piece of the puzzle.
Part of #10950
Outline of solution
teammates.ui.constants
so that the type is generated for frontend use (and extensibility in case more log types apart from feedback session in future?)