Mark the questions solved as green in the list
Closed this issue · 7 comments
Currently, there is no functionality to show the user on the website if he has solved the question yet, so we need to mark those questions as green, with some style after fetching if that question is solved or not.
Hey @shrinish123, I'd like to work on this issue, kindly assign under KWoC'22.
Welcome @chhavitekriwal to letsUpsolve. I will assign this issue to you, Kindly please mention a deadline to submit it, What I would suggest you to do is to it multiple steps so that I can I have a track of your progress and you would receive more Prs for this task Looking forward towards your contribution.
Also It would be good if you mention your algorithm and API endpoints that you would be using in order to find if a particular question is solved by the current user.
I guess in the first step you can just mention me here your algorithm to find if user has solved a question or not and implement it the code , next can be styling and rendering it
Hey @shrinish123, thanks for assigning the issue. I am looking it through and trying to understand it. You can expect the first update by Saturday or Sunday.
I guess in the first step you can just mention me here your algorithm to find if user has solved a question or not and implement it the code , next can be styling and rendering it
Hey @shrinish123, I think the following algorithm can be used.
Through the API endpoint /user.status we can get problems corresponding to all the submissions of the particular user and then filter it to select only those which have verdict as "OK" to form a set. Then we can check if the particular problem is present in this set. If yes, mark it as green otherwise no.
Kindly let me know if this is okay.
Sorry for the late reply. I think you are good to go with the algorithm, the only thing I want to mention to you is, that a problem on code forces API doesn't have a problem id or something like this to uniquely identify a problem( You need to uniquely identify a problem when you want to check if a particular problem is present in the set or not ), so a good way to identify a problem uniquely is to use a string like (contested + index ) something like (1758A). I guess you could figure out all the other things.
Yes I was thinking to generate the same string. Cool, I'll implement it by tomorrow.