Skip to content
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

Merged

Conversation

AdithyaNarayan
Copy link
Contributor

Part of #10950

Outline of solution

  • Added new log service in frontend and call the create logs API in the session submission page for access and submission
  • Added the log types in 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?)

@AdithyaNarayan AdithyaNarayan added the s.ToReview The PR is waiting for review(s) label Mar 4, 2021
Adithya Narayan Rangarajan Sreenivasan added 2 commits March 4, 2021 17:05
@@ -310,6 +313,16 @@ export class SessionSubmissionPageComponent implements OnInit, AfterViewInit {
}
}

this.logService.createFeedbackSessionLog({
courseId: this.courseId,
studentEmail: this.loggedInUser,
Copy link
Contributor

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

Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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, '');
Copy link
Contributor

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?

Copy link
Contributor Author

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,
Copy link
Contributor

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

Copy link
Contributor Author

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?

Copy link
Contributor

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,
Copy link
Contributor

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.

logType: LogTypes }): Observable<string> {
const paramMap: Record<string, string> = {
courseId: queryParams.courseId,
studentEmail: queryParams.studentEmail,
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks

Copy link
Contributor

@halfwhole halfwhole left a 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 {
Copy link
Contributor

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?

Copy link
Contributor

@rrtheonlyone rrtheonlyone left a 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.

@rrtheonlyone rrtheonlyone merged commit 76fcd8e into TEAMMATES:audit-logs Mar 14, 2021
madanalogy pushed a commit that referenced this pull request Mar 15, 2021
* Add tracking to frontend

* Fix test case for log service

* Fix lint

* Add fsname to params

* Shift log creation to loadPersonName

Co-authored-by: Adithya Narayan Rangarajan Sreenivasan <e0426343@u.nus.edu>
madanalogy pushed a commit that referenced this pull request Mar 22, 2021
* Add tracking to frontend

* Fix test case for log service

* Fix lint

* Add fsname to params

* Shift log creation to loadPersonName

Co-authored-by: Adithya Narayan Rangarajan Sreenivasan <e0426343@u.nus.edu>
@madanalogy madanalogy added this to In progress in Audit Logs for Instructors via automation Mar 22, 2021
@madanalogy madanalogy moved this from In progress to Done in Audit Logs for Instructors Mar 22, 2021
halfwhole pushed a commit that referenced this pull request Mar 30, 2021
* Add tracking to frontend

* Fix test case for log service

* Fix lint

* Add fsname to params

* Shift log creation to loadPersonName

Co-authored-by: Adithya Narayan Rangarajan Sreenivasan <e0426343@u.nus.edu>
halfwhole pushed a commit that referenced this pull request Mar 30, 2021
* Add tracking to frontend

* Fix test case for log service

* Fix lint

* Add fsname to params

* Shift log creation to loadPersonName

Co-authored-by: Adithya Narayan Rangarajan Sreenivasan <e0426343@u.nus.edu>
wkurniawan07 pushed a commit that referenced this pull request Mar 30, 2021
* Add tracking to frontend

* Fix test case for log service

* Fix lint

* Add fsname to params

* Shift log creation to loadPersonName

Co-authored-by: Adithya Narayan Rangarajan Sreenivasan <e0426343@u.nus.edu>
madanalogy pushed a commit that referenced this pull request Apr 5, 2021
* Add tracking to frontend

* Fix test case for log service

* Fix lint

* Add fsname to params

* Shift log creation to loadPersonName

Co-authored-by: Adithya Narayan Rangarajan Sreenivasan <e0426343@u.nus.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s.ToReview The PR is waiting for review(s)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants