package grade; import javax.swing.*; import java.awt.*; public class GradeEssayView extends JPanel { public GradeEssayView(JFrame main) { mainFrame = main; main.add(this); this.add(questionLabel); this.add(questionTextField); this.add(answerLabel); this.add(answerTextField); this.add(studentAnswerLabel); this.add(studentAnswerTextField); this.add(pointsLabel); this.add(pointsTextField); this.add(totalPointsLabel); this.add(totalPointsTextField); this.add(previousStudentButton); this.add(nextStudentButton); this.add(doneButton); } private JFrame mainFrame; /** * The current quesiton being graded. */ private JLabel questionLabel = new JLabel("Question:"); private JTextArea questionTextField = new JTextArea(10, 20); /** * The teacher answer key. */ private JLabel answerLabel = new JLabel("Answer:"); private JTextArea answerTextField = new JTextArea(10, 20); /** * The student's response. */ private JLabel studentAnswerLabel = new JLabel("Student Answer:"); private JTextArea studentAnswerTextField = new JTextArea(10, 20); /** * The number of points the student receives. */ private JLabel pointsLabel = new JLabel("Points:"); private JTextField pointsTextField = new JTextField(5); /** * The point value of this question. */ private JLabel totalPointsLabel = new JLabel("Total Points:"); private JTextField totalPointsTextField = new JTextField(5); /** * Returns to the last graded student. */ private JButton previousStudentButton = new JButton("Previous Student"); /** * Proceeds to the next student. */ private JButton nextStudentButton = new JButton("Next Student"); /** * Completes grading of this question and takes the user to the question * screen for the test. */ private JButton doneButton = new JButton("Done"); }