diff --git a/src/App.jsx b/src/App.jsx index 902a9c1..46c0b7c 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,6 @@ import React from "react"; import Table from "./Table"; +/*Add import statement here*/ class App extends React.Component { constructor(props) { @@ -7,12 +8,14 @@ class App extends React.Component { this.state = { buttonClicked: "", - assignments: [], + assignments: [] /*Below this line, add the students state variable*/, grades: {} }; this.handleButtonClicked = this.handleButtonClicked.bind(this); this.addAssignment = this.addAssignment.bind(this); + /*Uncomment the line below to bind the method*/ + /*this.addStudent = this.addStudent.bind(this);*/ this.addGrade = this.addGrade.bind(this); } @@ -22,12 +25,15 @@ class App extends React.Component { }); } + /*Check out this addAssignment method*/ addAssignment(assignmentName) { this.setState({ assignments: this.state.assignments.concat(assignmentName) }); } + /*Write an addStudent method here*/ + addGrade(assignment, student, score) { let grades = this.state.grades; let assignmentName = assignment; @@ -42,10 +48,48 @@ class App extends React.Component { render() { let tabChoice =
; + /*Uncomment below to render assignments*/ + /*if (this.state.buttonClicked === "assignments") { + tabChoice = ( +