hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.3k stars 285 forks source link

🪲 fix discrepancy programs count #5642

Closed hasan-sh closed 2 months ago

hasan-sh commented 3 months ago

Fixes #5199

How to test?

hasan-sh commented 3 months ago

Hey @hasan-sh , looks good and it works for user3!

But if I login with teacher1 in /programs I have 6 programs saved and in /user/teacher1 there are only 2, and in /landing-page there are 7....

Hey @Annelein , in the landing page, we forgot to add the is_modified check. Just added it! So, it should be the same as in /programs now.

For the /user/<username> page, the count isn't necessarly the same as the other two, because here we only see public programs. Perhaps change the label? Or is it clear @Felienne ?

Annelein commented 3 months ago

Hey @Annelein , in the landing page, we forgot to add the is_modified check. Just added it! So, it should be the same as in /programs now.

For the /user/<username> page, the count isn't necessarly the same as the other two, because here we only see public programs. Perhaps change the label? Or is it clear @Felienne ?

hey! @hasan-sh looks good and yes you are right, those are public programs so they are different. But I guess it is confusing because the label indeed is the same. What about x public programs | x programs saved | x programs submitted ? Let me know if you don't understand what I mean!

hasan-sh commented 2 months ago

hey! @hasan-sh looks good and yes you are right, those are public programs so they are different. But I guess it is confusing because the label indeed is the same. What about x public programs | x programs saved | x programs submitted ? Let me know if you don't understand what I mean!

Not sure if it's logical to show x programs saved AND public programs, because this page is a public one and users don't need to see how many private&public programs a user has made.

What do you think @Felienne? image

Annelein commented 2 months ago

Not sure if it's logical to show x programs saved AND public programs, because this page is a public one and users don't need to see how many private&public programs a user has made.

Then I would say, lets change the label, and make it say 'x public programs', to avoid confusions.

Felienne commented 2 months ago

Not sure if it's logical to show x programs saved AND public programs, because this page is a public one and users don't need to see how many private&public programs a user has made.

Then I would say, lets change the label, and make it say 'x public programs', to avoid confusions.

Yes makes sense to me!

hasan-sh commented 2 months ago

Ok, after further investigation, the count is actually correct. The problem is that the property program_count in the users table for teacher1 was not updated in data-for-testing.json. This is probably because we added programs for testing purposes without updating the program_count field! I'll update it in the local database.

Meaning what you see under x programs saved actually reflects the total programs saved by the user. You can test this by loging in as user with no programs, run programs and see the count in the public-page reflected accordingly.

The question remains do you still need an extra label that counts the number of public programs, even though the page lists all public programs by the user?

Annelein commented 2 months ago

@hasan-sh @Felienne

Allright so the x public programs label should be added for sure, because thats whats being shown in the page.

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

Felienne commented 2 months ago

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

I don't think I agree. Because what does "saved" mean, if users never save anything actively? It used to be an action with a click (before either of you joined, I think, so you might not know all history)

A better label would be "adventures explored" or "tried" because that is what is semantically comes down to.

Or, if we want to keep it simple, we can do "public programs" and simple "programs" <-- My preferred option, I think.

Annelein commented 2 months ago

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

I don't think I agree. Because what does "saved" mean, if users never save anything actively? It used to be an action with a click (before either of you joined, I think, so you might not know all history)

A better label would be "adventures explored" or "tried" because that is what is semantically comes down to.

Or, if we want to keep it simple, we can do "public programs" and simple "programs" <-- My preferred option, I think.

I agree! But that's a different discussion as to keeping this counter or removing it, I guess? Because the counter in /programs and /landing-page also has the label x programs saved. Thats why I compared it to keeping it in this page. So then we would have to change those labels too right?

I want to work on this for #5386 but there is not design proposal yet...

So:

Felienne commented 2 months ago

And then for the x programs saved label, I think we can still keep it, I think users might find it cool to see/show the amount of programs saved? Let me know what you think!

I don't think I agree. Because what does "saved" mean, if users never save anything actively? It used to be an action with a click (before either of you joined, I think, so you might not know all history) A better label would be "adventures explored" or "tried" because that is what is semantically comes down to. Or, if we want to keep it simple, we can do "public programs" and simple "programs" <-- My preferred option, I think.

I agree! But that's a different discussion as to keeping this counter or removing it, I guess? Because the counter in /programs and /landing-page also has the label x programs saved. Thats why I compared it to keeping it in this page. So then we would have to change those labels too right?

I want to work on this for #5386 but there is not design proposal yet...

So:

  • keep the counter in `/user/teacher1'
  • change all labels in to 'adventures explored' or 'adventures tried' or something
  • add the counter x public adventures

Yes, all these three things afaiac!

hasan-sh commented 2 months ago

"programs" <-- My preferred option, I think.

This makes a lot of sense since they don't really save indeed. Will change the amount_saved to simply be programs. And any further changes can be done in your PR @Annelein ?

Now: image

This clearly shows the user has 7 programs and all programs in the tiles are public.

mergify[bot] commented 2 months ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).

mergify[bot] commented 2 months ago

Thank you for contributing! Your pull request is now going on the merge train (choo choo! Do not click update from main anymore, and be sure to allow changes to be pushed to your fork).