Closed xarielah closed 4 months ago
@xarielah What if the student wants to change or add details to their solution? Should I add submissions like in Leetcode?
@xarielah What if the student wants to change or add details to their solution?
Should I add submissions like in Leetcode?
I'm not too familiar with submissions on Leetcode but maybe having an edit button on the solution that'll load the contents of the solution into the editor or transform the solution post into an editor and when the user saves the changes it'll update the content?
Btw I would advice having optimistic updates, it will make the interaction in general much smoother
@xarielah ok I will think about how to implement it. Where do you think i should use optimistic updates? On which components?
@xarielah ok I will think about how to implement it.
Where do you think i should use optimistic updates? On which components?
I would support implementing it where ever theres an interaction of a user and an asynchronous operation such as updating the solution, adding a question, liking, commenting etc...
Edit: I would research on useOptimistic
@noams24 Btw wanted to also add here, that Next and react basically is all about caching the state, being reactive but only when ever you set it to be. For example (might be better to open as another issue or enhencment) I commented and someone's solution, switched between "תיאור" and "פתרונות" tabs, didn't see the comment counter change untill I refreshed.
@noams24 Btw wanted to also add here, that Next and react basically is all about caching the state, being reactive but only when ever you set it to be. For example (might be better to open as another issue or enhencment) I commented and someone's solution, switched between "תיאור" and "פתרונות" tabs, didn't see the comment counter change untill I refreshed.
Thanks for noticing, I fixed it using react query invalidation. Should work fine now
@xarielah
I added submissions tab. Now you can delete your submission or copy an old one to your editor. Let me know what you think.
@xarielah I close this issue for now, if you have another idea to improve please let me know
Problem: After sending a solution to a question, the text editor is not cleared, content is cached and still displays when returning to the question later on.
Reason: Kind of ruins it for the student if they want to rechallenge them selves with the same question.
Screenshot:![image](https://github.com/noams24/Kef-Code/assets/84734223/d610e967-fc25-4bd4-bdd0-f4a50d37a1e7)