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

adding a lighten download csv button #937

Closed
wants to merge 2 commits into from
Closed

adding a lighten download csv button #937

wants to merge 2 commits into from

Conversation

Drumor
Copy link
Collaborator

@Drumor Drumor commented Apr 13, 2023

This "dummy" solution fix #936 by adding a lighten csv download button.

for col in data[entry]:
columns.add(col)
if lighten:
columns = ["_id","best","courseid","grade","result","status","submitted_on","taskid","username"]
Copy link
Member

Choose a reason for hiding this comment

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

This goes against the principles of the function code, which remains content agnostic. This is one of the things we should be careful doing Python code. Things hardcoded here will clearly be missed in case of refactor (changing field names, ...).

A more robust solution should be dynamic. Something even more convenient would be to select the displayable columns in the frontend UI and send the columns ids from the form.

Another valid and more straightforward solution, as what is called here "lightened csv" is to provide the current visible columns only, is simply to make the form send back the shown columns ids.

@anthonygego
Copy link
Member

I suggest to close this PR as this is better to generate the available fields on the fly based on what's inside the submission dict, and to propagate it in HTML and then in Python, instead of hardcoding the fields in the code.

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.

[course_admin/submissions] lighten CSV outputs
2 participants