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.32k stars 289 forks source link

[BUG] Class names can be duplicate #1278

Closed TiBiBa closed 2 years ago

TiBiBa commented 2 years ago

Describe the bug Currently, we are able to create multiple classes with an identical name. I think this is undesirable and should be prevented. Might be best to tackle this issue at the same time as #1152.

Paste the Hedy code & level It is super helpful if we can copy-paste the Hedy code to test, so please paste the code here, and don't forget to tell us what level you were in.

Add a screenshot (optional) Make a picture or screenshot to show the issue. Tip! You can make a screenshot and simply paste the image into GitHub with ctrl-v.

Expected behavior A clear and concise description of what you expected to happen.

What machine and browser you were using (optional) If the issue concerns things in the website, let us know:

TiBiBa commented 2 years ago

We've written a fix for #1152 but for this issue we need database access. @fpereiro do you know if it is possible to retrieve the classes of a teacher by classname? Currently we are only able to use the class id to look up classes.

Felienne commented 2 years ago

We've written a fix for #1152 but for this issue we need database access. @fpereiro do you know if it is possible to retrieve the classes of a teacher by classname? Currently we are only able to use the class id to look up classes.

Hi @TiBiBa! I can give you access to the tables in AWS (see Slack). I do not think we have an index on class by name now, but of course you can add it.

fpereiro commented 2 years ago

Hi @TiBiBa ! I believe we haven't indexed the name column of classes, just the id and owner fields.