diff --git a/CHANGELOG.md b/CHANGELOG.md index 873d550..e90c3c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ Note that major version zero (0.y.z) is for initial development and anything may - Filter out unpublished assignment and those missing a max score. - Put assignment titles on top of plots instead of to the left. - Maintain assignment order from Canvas in all visualizations. +- Only show a sample of the students with unposted assignments. ### Fixed - Make rounding work with dfs containing None instead of NaN diff --git a/canvascli/main.py b/canvascli/main.py index 5dd825c..f10b23d 100644 --- a/canvascli/main.py +++ b/canvascli/main.py @@ -405,18 +405,23 @@ def get_canvas_grades(self): 'Remember to post all assignments on Canvas' '\nbefore creating the CSV-file to upload to the FSC.' '\nThere are currently unposted Canvas assignments' - '\nthat would change the final score of the following students:\n' ) - click.echo( - self.canvas_grades - .query( - '@different_unposted_score == True' - ) - .to_markdown( - index=False - ) + students_with_unposted_score = self.canvas_grades.query( + '@different_unposted_score == True' + ) + if students_with_unposted_score.shape[0] > 10: + click.echo( + 'that would change the final score of ' + + click.style(f'{students_with_unposted_score.shape[0]} students.', bold=True) ) - click.echo() + click.echo('Showing the first 10 here:\n') + click.echo(students_with_unposted_score[:10].to_markdown(index=False)) + else: + click.echo( + 'that would change the final score of the following ' + + click.style(f'{students_with_unposted_score.shape[0]} students:\n', bold=True) + ) + click.echo(students_with_unposted_score.to_markdown(index=False)) return def drop_student_entries(self):