gradescope / gradescope-utils

Python package for building Gradescope autograders
https://gradescope-utils.readthedocs.io/en/latest/
MIT License
33 stars 25 forks source link

Error, not able to implement @partial_credit decorator #11

Closed Manojbhat09 closed 5 years ago

Manojbhat09 commented 5 years ago

I am getting this error when I use partial_credit decorator

@partial_credit(10)\nNameError: name 'partial_credit' is not defined\n\n"

I use it like this: @partial_credit(10) def test_exercise_1(self, set_score=None): """Exercise 1 answers""" flag = 0 ... if(flag == 0): set_score((8-flag)*/8) return 1

Where am I going wrong?

ibrahima commented 5 years ago

Did you make sure to import the decorator before using it? Otherwise it won't be defined.

E.g. see https://github.com/gradescope/autograder_samples/blob/master/python/src/tests/test_simple.py#L2

Also, what version do you have installed? You should make sure you have the latest version or else you won't have that decorator. Ensure that your requirements.txt or Pipfile or whatever has the appropriate version requirement, although if you don't specify anything it should install the latest version anyway, unless some version is already installed.

Manojbhat09 commented 5 years ago

Hello @ibrahima , Thank you very much for your instant reply on the issue. We have fixed the AutoGrader code with the new additions. The partial_credit was missing on import and there were some other issues which is now fixed.

We are still figuring out how to limit the number of submissions by the student by max 2 submissions per 24 hours. Is it possible to implement through autograder this git package?

Please inform us.

ibrahima commented 5 years ago

No, this package won't help with that, but you can refer to our documentation site to see the information you'd need to do that. Please follow up by emailing help@gradescope.com if you have further questions about that. Thanks!