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

Export stats #94

Merged
merged 2 commits into from
Nov 20, 2017
Merged

Export stats #94

merged 2 commits into from
Nov 20, 2017

Conversation

srallen
Copy link
Contributor

@srallen srallen commented Nov 14, 2017

To be merged after #90. This closes #50. It finishes the export stats class method for the individual classroom edit view. Note: I've renamed the button and method to Export Stats and exportStats because I think we should avoid saying grades anywhere. As a former IT person who worked for a couple of Universities, even implying we store grades could make us vulnerable to complying with student privacy laws. It's up to the teacher if they want to use these stats in their grading, but they aren't grades.

@srallen
Copy link
Contributor Author

srallen commented Nov 17, 2017

I've rebase this, so it's ready to be reviewed. Thanks!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@@ -177,9 +182,9 @@ const ClassroomEditor = (props) => {
props.assignments[props.selectedClassroom.id] &&
props.assignments[props.selectedClassroom.id].length > 0 &&
students.map((student) => {
const galaxyAssignment = props.assignments[props.selectedClassroom.id].filter(
const galaxyAssignment = assignments.filter(
Copy link
Member

Choose a reason for hiding this comment

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

[minor] If you're changing props.assignments[props.selectedClassroom.id] to the more sensible assignments, wouldn't you also want to update the condition checks as well? i.e.

{props.assignmentsStatus === ASSIGNMENTS_STATUS.SUCCESS &&
props.assignments[props.selectedClassroom.id] &&
props.assignments[props.selectedClassroom.id].length > 0 &&
  students.map((student) => {
...

@shaunanoordin
Copy link
Member

shaunanoordin commented Nov 20, 2017

WTF? When I'm looking at the I2A classrooms as zootester1, I receive a warning in the console that says

Warning: Failed prop type: The prop assignments.isRequired is marked as required in ClassroomsTableContainer, but its value is undefined.
in ClassroomsTableContainer (created by Connect(ClassroomsTableContainer))

but the problem is I can't find anything in our code that asks for isRequired

@srallen
Copy link
Contributor Author

srallen commented Nov 20, 2017

@shaunanoordin I have no idea where those warnings are coming from. It's a mystery to me at the moment!

Copy link
Member

@shaunanoordin shaunanoordin left a comment

Choose a reason for hiding this comment

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

PR Review

This PR adds functionality to the "Export Stats" button, which exists inside the Edit Classroom page.

screen shot 2017-11-20 at 17 02 51
Note the teal "Export Stats" button when we're viewing/editing this Classroom as zootester1.

  • Clicking on the Export Stats button prompts the user's browser to download the statistics of the classroom (i.e. the percentage of work done by each student) as a CSV.
  • NOTE: This Export Stats function works primarily for I2A classrooms, as the exported CSV is hardcoded for the I2A classes' known structure.

Comments

Overall, this PR looks good, but I had an initial concern that the "Export Stats" feature is making the Classroom Editor common component more specific/hardcoded for I2A.

But then I realised that we never actually followed up on the discussion of shared Classroom components (vs shared Classroom APIs/features/etc), and I need to start properly designing the Darien/Wildcam-specific components and figure out how they should spin off from the existing I2A-specific compos and general app architecture. (Side note: the current ClassroomEditor component might need to be relabelled as AstroClassroomEditor when that happens.)

Status

Anyway, TL;DR, this PR is 👍 and I need to start working on the Darien-specific Classroom components and figure out how 'shared' classroom compos/features can work.

Approved, merging.

@shaunanoordin shaunanoordin merged commit f7d0ef8 into master Nov 20, 2017
@shaunanoordin
Copy link
Member

*shakes fists at the heavens* Damn you mysterious React warning, NOBODY said assignments is required!

@srallen
Copy link
Contributor Author

srallen commented Nov 20, 2017

the current ClassroomEditor component might need to be relabelled as AstroClassroomEditor when that happens.

@shaunanoordin this will likely have to happen because as it is now the ClassroomEditor is really for I2A. I've opened #85 to discuss it. I think a mix of pulling more shared methods into the ducks as well as some refactoring should do it. I'm becoming more comfortable with higher order components, so those could help us out possibly too.

@shaunanoordin shaunanoordin deleted the export-stats branch December 13, 2017 13:45
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.

Use SuperDownloadButton for grade export
2 participants