- Notifications
You must be signed in to change notification settings - Fork97
-
It could be great to detect if the user has succeed the exercice and congrats him. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment 3 replies
-
Hey@GaetanRdn! I think this relates to#178 as right now we don't have any way of knowing that the exercise was completed successfully. Once we have access to this information I think we will expose that through the import{tutorialStore}from'tutorialkit:store';import{useStore}from'@nanostore/react';exportdefaultfunctionCongratz(){constcompleted=useStore(tutorialStore.lessonSolved);if(!completed){returnnull;}return(<divclassName="fixed inset-0 flex items-center justify-center z-50"><divclassName="absolute inset-0 bg-black opacity-50"></div><divclassName="bg-white p-8 rounded-lg shadow-lg z-10 max-w-md w-full"><h2className="text-2xl font-bold mb-4">Congratulations!</h2><pclassName="text-gray-700 mb-6">You've successfully completed the lesson. Great job!</p></div></div>);} And then in a lesson: ---type:lessontitle:Foo---importCongratzfrom'@components/Congratz';<Congratz />#Welcome to Foo!... |
BetaWas this translation helpful?Give feedback.
All reactions
-
Is it possible to make a diff between the files that the user can modify and the files from the solution? |
BetaWas this translation helpful?Give feedback.
All reactions
-
I don't think we expose that information right now. Now with that said, I don't think doing a diff would be very helpful as it's not a correct metric to know whether a lesson was completed successfully or not for programming problems. (If you aren't writing one, then this doesn't apply). The only reliable way is to test the code (although even then it could be buggy). Doing a diff, even one that ignores whitespaces, comments, different name for identifiers, dead code removal, it would still fails for two programs that are both correct but use different solutions. |
BetaWas this translation helpful?Give feedback.
All reactions
-
BetaWas this translation helpful?Give feedback.