Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Congrats the user#205

GaetanRdn started this conversation inIdeas
Aug 1, 2024· 1 comments· 3 replies
Discussion options

It could be great to detect if the user has succeed the exercice and congrats him.

You must be logged in to vote

Replies: 1 comment 3 replies

Comment options

Nemikolh
Aug 2, 2024
Collaborator

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 thetutorialStore and so you will be able to congratulate the user by doing something along the lines of:

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!...
You must be logged in to vote
3 replies
@GaetanRdn
Comment options

Is it possible to make a diff between the files that the user can modify and the files from the solution?

@Nemikolh
Comment options

NemikolhAug 7, 2024
Collaborator

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.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
3 participants
@GaetanRdn@Nemikolh@AriPerkkio

[8]ページ先頭

©2009-2025 Movatter.jp