Update and add new routes to view submissions.#438
Conversation
|
Thanks for the PR. But Why was this needed. Have a look at |
|
Oh. I just checked, I mistook the tries, which made me think it is a user and challenge pair and that it only gets updated. I can just make use of the existing table then... |
|
Cool, ping me when done |
c334ab7 to
34dcdf0
Compare
| SolvedAt: submission.CreatedAt, | ||
| Flag: submission.Flag, | ||
| Success: submission.Solved, | ||
| Cheating: submission.Cheating, |
There was a problem hiding this comment.
Why are we showing to contestants that if this challenge is cheating or not?
There was a problem hiding this comment.
it is strictly for admin
There was a problem hiding this comment.
ALSO, Why are we showing points? Isn't it same for all always ?
| } | ||
|
|
||
| submissionResp := SubmissionResp{ | ||
| UserId: submissionUser.ID, |
There was a problem hiding this comment.
FIx cheating here. Points make sense here, so your choice to keep it or remove it.
| CreatedAt: time.Now(), | ||
| UserID: user.ID, | ||
| ChallengeID: challenge.ID, | ||
| Solved: false, |
There was a problem hiding this comment.
Solved is also true in case of cheating.
There was a problem hiding this comment.
I don't think you should do this here. See the end of this function. It contains a lot of other preq like updating dynamic points and staling cache, etc. So, the solved:true version should be at end only.
34dcdf0 to
296c925
Compare
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
…from admin to public Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
296c925 to
786f425
Compare
|
@ayu-ch please fix this. |
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
786f425 to
3454799
Compare
|
There's another issue that when a flag is submitted, |
Signed-off-by: ayu-ch <ayu.chandekar@gmail.com>
Why don't you just update the entry, |
Addition of new routes and features:
/api/info/submissions/challenge/:name-> Returns all submissions for a specific challenge. Admin sees all attempts including flags, whereas contestants just see the successful attempts without flag./api/info/submissions/user/:id-> Returns all submissions made by a specific user. Admin sees all attempts including flags, contestants see the successful ones without the flag.Cheating field in the submissions which the admin can use to filter cheated submissions on the frontend.