I'm having trouble with the grader Programming Assignment: Social Network Database Fix

What Tom is trying to inquire is that you are not supposed to share the solution in a public platform! It doesnt help the learner tacke problems on their own…

1 Like

I’ve edited your post to remove the link to your repo.

Sharing solutions to the programming assignments is not allowed by the Code of Conduct.

1 Like

I encountered a weird error: For exercise 2, I obtained the same result as the expected output, but the grading system assigned 0/25 to this exercise. Inside the notebook, it shows that the test has passed, but the grading system’s result is 0. The error is Failed test case: Failed execution for club description Fitness Club. Any suggestions to get the score 25?
Expected:
Function must run properly,
but got:
Exception thrown: name ‘club_members’ is not defined.

This is fairly common, learners report this with some regularity.

The usual reason is this:
The grader always tests your code with a totally different set of tests, run from an entirely different “grader script”.

If your code in the notebook uses any global variables that the grader does not provide, then the grader will throw errors.

So check your notebook to be sure that the code you added does not use global variables.

There is obviously something wring with the code you have provided as a solution to this exercise. You can always ask the LLM that has produced the code you are using as solution to also identify where the problem is and this is also part of the LLM collaboration in designing software. dont forget to feed it all the code not just the one it has produced.

The next step is to check the functions yourself, do they make sense, are the variables in the function definition placed properly, the solution itself and are the functions returning what are required to!

I have tried all the suggestions given above. The output generated by the code was correct. The error is nonsense. I am not a junior programmer to copy and paste whatever the LLM gives me. There is something wrong with the grading system. Even the same code generated the correct output, as expected yesterday. Today, it shows an error like the following. ---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[34], line 6
1 # Example usage of the get_club_members function
2
3 # Assume the session and all models have been correctly set up and populated as per your initial code
4
5 # Fetching members of the “Hiking Club”
----> 6 hiking_club_members = get_club_members(session, “Hiking Club”)
8 # Printing out the names of all members of the Hiking Club
9 print(“Members of the Hiking Club:”)

NameError: name ‘session’ is not defined

Did you run the first cell which contains:

Session = sessionmaker(bind=engine)
session = Session()

This errors seems to me that the session is not created!

Yes, I did it ten times.

May I suggest to give it one more try by reseting the assignment at the top right hand corner at the question mark, there is a “Get Latest Version” which resets the assignment when the current one is deleted (you can also reset the entire folder from there). But keep the current solutions somewhere so you can use them again after the reset!

Thanks it worked. Cheers.

1 Like