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

Assessments tab: total student submission counts #23353

Merged
merged 10 commits into from Jun 27, 2018

Conversation

caleybrock
Copy link
Contributor

@caleybrock caleybrock commented Jun 26, 2018

Updates overview headers for surveys and assessments to include submission and student counts.
screen shot 2018-06-26 at 4 50 10 pm
screen shot 2018-06-26 at 4 50 22 pm

Total students comes from sectionDataRedux and is a simple length operation. Total submissions comes from sectionAssessmentsRedux and requires some iteration.

Copy link
Contributor

@islemaster islemaster left a comment

Choose a reason for hiding this comment

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

Looks good! I have some optional style suggestions.

@@ -101,6 +107,7 @@ export default connect(state => ({
assessmentList: getCurrentScriptAssessmentList(state),
scriptId: state.scriptSelection.scriptId,
assessmentId: state.sectionAssessments.assessmentId,
totalStudentCount: getTotalStudentCount(state),
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this component only cares about totalStudentCount so it can pass it through to child components, but the child components are themselves redux-connected and could retrieve this information themselves. Thoughts on just letting MCAssessmentsOverviewContainer and MCSurveyOverviewContainer ask for the total student count directly?

* Selector function that takes in the state and a boolean indicating
* if the current assessment is a survey.
* Returns an integer total count of the number of students who have submitted
* the current assessment.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer JSDoc @returns for consistency.

/**
 * @returns {number} count of the number of students who have submitted
 *   the current assessment.
 */

* Returns an integer total count of the number of students who have submitted
* the current assessment.
*/
export const getTotalSubmissionForCurrentAssessment = (state, isSurvey) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should Submissions be plural in this name? I'd also consider naming this countSubmissionsForCurrentAssessment which strongly implies that the return value is an integer and hints that some nontrivial computation is going on when you call this method, not just a simple lookup in our state tree.

@caleybrock caleybrock merged commit 0c82886 into staging Jun 27, 2018
@caleybrock caleybrock deleted the total-student-submissions branch June 27, 2018 01:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants