Allow teachers to override or disable honesty prompt
dmalan opened this issue · 9 comments
Perhaps add a
submit50:
honesty: VALUE
key, where VALUE
can be false
or a string that's displayed instead of the default https://github.com/cs50/submit50/blob/develop/submit50/__main__.py#L80?
Hey David, this is my first time contributing and I just have a question. Do you want this value to be a command-line argument?
Thanks, @ashermkn1! This would need to be a setting in a teacher's .cs50.yml
file, else it'd be overridable by students.
At present, the prompt is passed in as an argument to lib50.push
in the form of a function that takes the included/excluded files as input and returns a boolean indicating whether or not the submission should go through. submit50
calls lib50.push
with the function you linked which prints out the included/excluded files using the relevant terminal colors and returns true/false depending on whether the user said yes/no. check50
calls lib50.push
with the default function that just always returns True.
One issue is that in principle, whatever code that does this should be in lib50, since lib50 is what handles all of the .cs50.yml
stuff. However, one of the design goals of lib50 is that it knows nothing about check50
or submit50
. In the case of an honesty
key, check50
and submit50
have different defaults. submit50
should default to our honesty prompt to make writing checks easier on us, but check50
should default to no prompt (or not have the option all together). lib50
intentionally isn't designed to distinguish based on what the tool being used is.
Probably the nicest way to handle this is just to have the prompt
function (that's an argument to lib50.push
) take an additional argument e.g. question
which for would default to "Keeping in mind the course's policy on academic honesty, are you sure you want to submit these files?"
(though if you choose to overwrite this, you probably give up internationalization of that message, which is probably fine). lib50 can then check if config["honesty"]
is false and if so, it doesn't call the prompt function, otherwise it calls it with config["honesty"]
as an argument.
Thank you so much for the explanation @crossroads1112, I will definitely do that.
Oh, I'm so sorry @ashermkn1 I totally didn't see your first comment, just Davids in my notification. I actually just did it cs50/lib50#59. That said, submit50
still needs to be updated since it's prompt function needs to take in the additional argument and utilize it. I can leave that to you if you want!
That would be great! I would love for my first contribution to be for cs50
@crossroads1112 , The Travis Build keeps failing and it cannot find version 3.0.0 that you updated and I don't know how to fix that or tell it that the version it is looking for hasn't been pushed yet. Any help you could give me?
Right, that version of lib50
hasn't been published yet, so no worries on the build failure for now. In the meantime, I made a couple of comments on your PR!
pulls