When I run the codes , it shows All tests passed!
If you made your solution in a different cell, make sure to include it in the graded cell as well.
But when I run submission_checker.check_notebook() ,
it shows
NameError: name ‘submission_checker’ is not defined
And upon submission, I get 0/100 and the message:
There was a problem compiling the code from your notebook, please check that you saved before submitting. Details:
No module named ‘unittests’
for all the functions.
Can someone please help me out with this as I am a beginner to this and I have trying to do this for a couple of days but still no result.
Every time you open a notebook, you must run all of the cells in sequence, starting from the top. That is where the assets are imported and the workspace is created.
Be extremely careful that you do not modify, or move, or delete any of the cells in the notebook, nor insert any new cells. Any of those are a sure way to confuse the grader.
I am running them one by one, 2 of them run, 2 dont, I am trying to optimize the ones that dont but in submission_checker.check_notebook() , this error is coming and I dont undersatnd how this one is occuring or how to fix this
The problem is that ‘r’ (probably for ‘red’) is passed as second argument to colored() on line 423 of submission_checker.py, but the lookup of the color for ‘r’ then fails, apparently there is nothing that corresponds to r.
This seems to be a problem with the infrastructure code, i.e. if this is the original colored() something is wrong.
This is likely termcolor colored, and it doesn’t have an r value.
(this should really not lead to a fatal error, just a warning, but that’s just an extra)
But looking at it differently, this error in the infrastructure is triggered by an error in the results produced in the cell you are running. An unexpected class, it seems: condition_classes != got_classes. So you should try to fix that.
I’m not a mentor for that course, but I’d guess from the error and the “check_notebook()” context that there is something that you’ve added or modified in your notebook that is breaking the grader.
Perhaps you could rename your current notebook, and get a new copy. Then very carefully update the new notebook by only copying in the code that you have added - not any additional changes.
how can I get a new notebook copy,
also I tried to update r to red as I posted this on multiple AI sites for help and they said to do it, but this still shows the same error.
Hello, in the question mark on the top right corner if you click on it, in the “Get Latest Version” you can reset the Lab, but delete or rename the current one. The errors you are showing here do not make sense to me because if you have run all previous cells, unittests should be already imported.
Try to reset the Lab and run it again lets see what happens…
So, I reset the lab, in the cell where you run the code to check if its passing the cases, this error occurs. this code worked previously and I got the message all test cases passes so I dont understand why this is occuring
I was able to fix this by importing unittests seperately in my exercises code, it showed the message :
“All tests passed!
If you made your solution in a different cell, make sure to include it in the graded cell as well.”
But when I submitted the assignment to check if this question is being graded, I got this message:
You don’t have to edit that cell, you just have to run it every time you open the notebook.
Don’t add extra import statements - that’s fixing a symptom, not the problem.
I notice that the "cell counter’ next to the first cell says you’ve run it 51 times since you last restarted the kernel. That’s bad.
I recommend you restart the kernel and clear all the output, then run all of the cells in the notebook once. Then look to see if you pass all the tests and get all of the correct results.
Only then should you submit your notebook for grading.