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

Add refetch button to assignment list #1930

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

KrKOo
Copy link

@KrKOo KrKOo commented Oct 15, 2024

This PR adds a "Refetch" button to the student's assignment list. This allows the student to reset any assignment files to their original version in case they got bricked by the student. Until now, this was possible only using the terminal, which might not be intuitive for some students.

If a student wants to reset a file to its original version, he deletes it and clicks the "Refetch" button. The missing files will be downloaded.

Copy link
Contributor

Binder 👈 Launch a Binder on branch KrKOo/nbgrader/refetch

refetchButton.setAttribute('title', 'If you broke any of your assignment files and you want to redownload them, delete those files and click this button to refetch the original version of those files.')
container.append(refetchButton);

refetchButton.innerText = 'Refetch';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Refetch" is quite ambiguous, somebody might expect that it will overwrite existing files. Can we call it "Fetch missing files" (or "Refetch missing files")?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be nice to have the button disabled if no files are actually missing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, the button can be renamed to "Refetch missing files".

The problem with disabling the button is that the Exchange has no API for listing all the files of an assignment. Or well... there is ExchangeList.list_files(), but in the default exchange, it is implemented in a weird way, where it does not really list any files. Instead, it returns a list of assignments. So it sure can be done by modifying the exchange a bit, but people can already rely on the way it works now so then it would break their stuff. Someone can even have their own exchange implementation, and since the output of list_files() is not unified, I think, it will not work for everyone.

Do you have any better idea regarding this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, so the API would probably have to be extended with a new function... But it can be done later, this is still a big improvement!

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

Successfully merging this pull request may close these issues.

2 participants