gradescope / gradescope-utils

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

Allow for local testing #6

Closed mikeh2 closed 5 years ago

mikeh2 commented 6 years ago

I realize this could be submitted as a pull request.

FILE: gradescope-utils/gradescope_utils/autograder_utils/files.py: ISSUE: SUBMISSION_BASE should be passed in as an default argument to allow local testing.

SUBMISSION_BASE = '/autograder/submission'
def check_submitted_files(paths, base=SUBMISSION_BASE):
...
    target_path = os.path.join(base, path)
...
ibrahima commented 5 years ago

Good suggestion, I would love to make it easier to test autograders locally.

mikeh2 commented 5 years ago

any chance for this getting done? It's literally only 2 lines of code to change. Thanks so much

ibrahima commented 5 years ago

Done! Try installing v0.2.8, it should work there.

mikeh2 commented 5 years ago

Thanks

I was looking for a way to set the weight attribute myself in the unit test.

inside my one of my test methods dir(getattr(self, self._testMethodName)) —> shows that weight is there BUT setattr( of the above, 'weight', 0.33) fails saying object has no attribute weight

Any chance you know what I am doing wrong ?

thanks so much!!

mike

On Sep 25, 2018, at 3:30 PM, Ibrahim Awwal notifications@github.com wrote:

Closed #6 https://github.com/gradescope/gradescope-utils/issues/6.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gradescope/gradescope-utils/issues/6#event-1867025376, or mute the thread https://github.com/notifications/unsubscribe-auth/AAZnNX3zjyh_eazZrucZRkoi4tlB6iq5ks5ueq6VgaJpZM4VGB9h.

ibrahima commented 5 years ago

Are you the Mike that wanted to set up partial credit for tests? I'm working on a decorator for that actually but I ran into some issues, but hopefully I can resolve them tomorrow!

ibrahima commented 5 years ago

I haven't actually tried your code above, but you may want to check this out: https://github.com/gradescope/gradescope-utils/pull/9 . I need to do a little more testing but it seems to work so far.

I would suggest that changing the weight of the test case dynamically is a little confusing, but would certainly achieve the goal of modifying the total score. But I think it's a little more informative to set the score rather than the weight because otherwise it's not clear what the maximum value is anymore, and as a student you won't be able to (easily) know whether you got the right answer.