Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can parts of the grader.check() output be hidden without hiding the entire test? #616

Closed
jake-bobowski opened this issue Mar 7, 2023 · 6 comments
Labels
question Further information is requested

Comments

@jake-bobowski
Copy link

Is it possible to hide parts of the output from grader.check() and display only a custom failure_message?

Here is screenshot of an example configuration notebook:

image

There is a single multiple-choice question and students should enter 'a' as the answer. Here's what students see in their notebooks when entering a valid, but incorrect response.

image

I've set a custom failure_message that, in this case, says "Please try again". The output of grader.check() reveals the correct answer by displaying "a1_1.lower() == 'a'". Is it possible to hide parts of this output while displaying only the custom failure_message? I'd like students to know that they've entered an incorrect response without revealing the correct answer. In this toy example, the failure_message is not useful, but it could be setup to provide valuable feedback/hints in a real-life example.

Thanks!

Jake
@Jaymes92 @jake-bobowski

@jake-bobowski jake-bobowski added the question Further information is requested label Mar 7, 2023
@joelostblom
Copy link
Contributor

I think this would be very useful as well and I started this work in #536, but won't have time to pick that up in another few months unfortunately. Help welcome!

@aaronsmoore
Copy link

A temporary workaround that I've been using has been hashing the multiple choice answers so students only see a hashed version of the answer like this:

D62F010D-EC85-4B2E-8D70-8B138E1A7B36

Not sure this is what you're looking for but I can send more details if you're interested.

@jake-bobowski
Copy link
Author

Thanks @aaronsmoore, that looks great! I would definitely be interested in seeing the details.

@aaronsmoore
Copy link

All credit to the D102 team for this method.

You'll use the following function to hash students' answers.

import hashlib

def get_hash(num):
    """Helper function for assessing correctness"""
    return hashlib.md5(str(num).encode()).hexdigest()

The general workflow looks something like this.

image

There are some other considerations for multiple-answer questions such as sorting the student answer list/numpy array so it lines up with the hashed answer.

Let me know if you have any questions about this.

@jake-bobowski
Copy link
Author

Hi @aaronsmoore, Thanks so much for the suggestion. It was really helpful and easy to implement. Here's an example use from our first-year physics course:

image

@chrispyles
Copy link
Member

I hope the hashing solution temporarily helps with this issue @jake-bobowski. Since this seems like the same ask as #419, I'm going to de-dupe it in favor of that one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants