Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear compilation error in Python course with keyword typo #54052

Closed
a2937 opened this issue Mar 12, 2024 · 11 comments
Closed

Unclear compilation error in Python course with keyword typo #54052

a2937 opened this issue Mar 12, 2024 · 11 comments
Labels
help wanted Open for all. You do not need permission to work on these. new python course scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.

Comments

@a2937
Copy link
Member

a2937 commented Mar 12, 2024

Describe the Issue

If campers make a typo like using "While" instead of "while" for their loop construct, they have no idea if it's a spacing problem or they're using the wrong keyword. There must be a way to let them know what kind of issue they're facing.

Affected Page

https://www.freecodecamp.org/learn/scientific-computing-with-python/learn-regular-expressions-by-building-a-password-generator/step-24

Your code

 While True:
        password = ''
        # Generate password
        for _ in range(length):
            password += secrets.choice(all_characters)

Expected behavior

The console should inform the camper that the phrase While was unexpected or something among those lines. If a compilation error is happening, the camper should always know what it means instead of guessing.

Screenshots

image

System

  • Device: Desktop
  • OS: Windows 10
  • Browser: Firefox
  • Version: 123.0.1

Additional context

First reported in this thread: https://forum.freecodecamp.org/t/learn-regular-expressions-by-building-a-password-generator-step-24/678788

I also am fairly sure someone accidentally left a console.log statement in execute-challenge-saga.js regarding newTest and it should probably be removed.

@a2937 a2937 added type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc. scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. labels Mar 12, 2024
@a2937 a2937 changed the title Unclear compilation errors in Python course Unclear compilation error in Python course with keyword typo Mar 12, 2024
@Supravisor
Copy link
Contributor

There is an indication. The keyword will appear blue, instead of black. A visual accessibility issue.
image
image

@a2937
Copy link
Member Author

a2937 commented Mar 12, 2024

While that is true and the syntax highlighting is a wonderful thing; I don't think some less savvy campers will pay attention to the highlighted words.

Additionally, some of them might not pick up on why some words are highlighted in the FreeCodeCamp Code Editor. I don't believe at any point up to this section it ever gets explained, though it has been a while since I did a deep dive into the curriculum.

A clear definitive message leaves absolutely zero ambiguity in what kind of error was performed. It'd be one thing if the camper gets some kind of feedback saying they must have a while loop , but right now, all this error gives a compilation error. If a camper hasn't encountered it before, they could easily misinterpret this error as an indentation issue.

@Dario-DC
Copy link
Contributor

Dario-DC commented Mar 12, 2024

My idea is that we should provide a clear indication of the line that caused the error, and other information you would normally get from a traceback. This would help campers and it is also necessary to introduce exceptions.

@ilenia-magoni
Copy link
Contributor

@ojeytonwilliams how is it going with the managing of the exceptions?

@ojeytonwilliams
Copy link
Contributor

@ojeytonwilliams how is it going with the managing of the exceptions?

I haven't had chance to look at it, sorry. I may soon be blocked on some other things I need to work on and so have time for this, but I'm not sure.

@a2937
Copy link
Member Author

a2937 commented Mar 13, 2024

Hi there. I tried tacking this issue myself, but I ran into a small issue. The exception is literally labeled 'other', and I'm having trouble locating where exactly that error information comes from. Can I please get pointed in the right direction?

@JohanSebastian117
Copy link

Thanks, found what was wrong with my code by googling and finding this post lol

@naomi-lgbt
Copy link
Member

I'd be okay with opening this up to contributions, for anyone feeling a li'l ambitious.

@naomi-lgbt naomi-lgbt added help wanted Open for all. You do not need permission to work on these. and removed status: waiting triage This issue needs help from moderators and users to reproduce and confirm its validity and fix. labels Apr 22, 2024
@Dario-DC
Copy link
Contributor

Now that #54185 has been merged, is this still needed?

@naomi-lgbt
Copy link
Member

I don't believe so?

@Dario-DC
Copy link
Contributor

I'm going to close it. I didn't realize that Oliver's PR didn't link to this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Open for all. You do not need permission to work on these. new python course scope: curriculum Lessons, Challenges, Projects and other Curricular Content in curriculum directory. type: bug Issues that need priority attention. Platform, Curriculum tests (if broken completely), etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants