Random Problem Generation
doranmartinez opened this issue Β· 9 comments
Would be cool to have a button that randomly selected a problem to study.
Hello there,
Can I please try to work on this issue?
I would like to contribute!
Hi @Shashank5665! Yes, please go ahead and let me know if you have any questions!
Hey @Shashank5665! π I'm checking in to see how you're doing and if I can provide any help/suggestions?
Hello @seanprashad π, I was able to successfully set up the project in my system. But, I was not familiar with react tables, useMemo, and a few other things in this project, and currently, my college exams are going on tooπ. So, I was a bit busy with that.. but yeah I am in the process of learning react and I will definitely complete this once my exams are over, which will get over within 2 weeks or so.
Hello @seanprashad π, I was able to successfully set up the project in my system. But, I was not familiar with react tables, useMemo, and a few other things in this project, and currently, my college exams are going on tooπ. So, I was a bit busy with that.. but yeah I am in the process of learning react and I will definitely complete this once my exams are over, which will get over within 2 weeks or so.
Okay sounds good! Don't hesitate to let me know if you need help, or if you'd like to open this up for another contributor. Good luck in your exams!
Hello @seanprashad, My exams are over :D and I am continuing with the feature, I created a button that when clicked generates a random question, but I have made it such that it opens a new tab and takes the user to the leetcode site with the generated random question. I am finding it a bit difficult in understanding the Header and Cell cuz of which I am not getting how to render the generated question as a row.
Hello @seanprashad, My exams are over :D and I am continuing with the feature, I created a button that when clicked generates a random question, but I have made it such that it opens a new tab and takes the user to the leetcode site with the generated random question. I am finding it a bit difficult in understanding the Header and Cell cuz of which I am not getting how to render the generated question as a row.
Sounds like you're making solid progress so far! Do you have a branch that we could take a look at? Feel free to open a "Draft" Pull Request - that would make it much easier for me to concretely point you in the right direction!
As far as Header and Cell, Header is the code that will generate the "first row" of the table where we have things like dropdown menus:
I think we could place the "Random question" button inside the Header section for Questions, aka right here:
Note that we'll need to add some JavaScript code to specify that "We want to customize this header with a random question button". We've actually already done this for the Hide/Show Patterns toggle - use it as a baseline for your work:
leetcode-patterns/src/components/Table/index.js
Lines 289 to 309 in 8d25c76
Cell is used to refer to the contents of each row - I don't think we'll need to edit the cell in this case, since we don't want the "Randomize Question" button to show up for each and every row! Start small and try to get a button that doesn't do anything with the text "Hello World" to appear. After that, we can discuss how to random the href link that will open when clicked!
Please let me know if anything is unclear - you've got this! π
Fixed with #240
Thank you so much @doranmartinez for opening this issue, I was able to implement this feature with the help of @seanprashad π
