3.1 Grade Book Assignment

Under Construction

This page is currently being built. Please check back soon.

A platypus
3.1 Grade Book Assignment — overview

Work through the user stories in order. Each story states the goal and acceptance criteria; its nested tasks retain the detailed implementation and verification steps.

1.Gather your resources
A Open the assignment resources
Set up the checkpoint
2.Copy your GradeBook 2.4 Assignment. Rename the folder and .sln to 3.1
A Verify the required change or observation

Check the result against this instruction: Copy your GradeBook 2.4 Assignment. Rename the folder and .sln to 3.1.

Initialize and grade an encapsulated attempt
3.Review the feature design
A Identify the contracts and expected behavior

This focused design shows the members or flow relevant to this feature. Keep unchanged members from your preceding checkpoint; follow the tasks below for the order of intermediate edits.

Attempt owns initialization and grading. class Attempt { - accuracy : double - completionDate : string - score : double - studentName : string + Attempt(studentName : string, completionDate : string, accuracy : double) + Score : double {get} + Grade(possiblePoints : double) : void } class Assignment { + Grade(attempt : Attempt) : void } class Instructor { + Grade(assignment : Assignment, attempt : Attempt) : bool } Instructor --> Assignment : Grade(attempt) Assignment --> Attempt : Grade(Points)
Attempt owns initialization and grading
  • New
  • Changed
  • Removed
4.Add/modify the class structure for the Attempt and Assignment classes using this story’s design reference
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Add/modify the class structure for the Attempt and Assignment classes using this story’s design reference.

5.Modify the Complete method in the Assignment class
A Delete the lines of code that assign the local submission variable's CompletionDate and StudentName
B Modify the line of code that assigns the submission variable's Accuracy so that the accuracy is stored in a local variable instead
C Move the lines of code that instantiates the submission object to below line of code that assigns the accuracy
D Use the Attempt constructor to assign the values of the submission object
6.Modify the Grade methods in the Instructor, Assignment and Attempt classes
A Move the lines of code in the Instructor's Grade method that assign the accuracyPercentage and attempt object's score to the Grade method in the Attempt

class.

B Refactor the code in the Grade method in the Attempt class to reference 'this' instead of attempt
C Change assignment.Points to the possiblePoints parameter
D In the Grade method in the Assignment class, call Grade on the attempt parameter and pass in a reference to the Points field
E In the Grade method in the Instructor class, call the Grade method on the assignment parameter and pass in the attempt parameter. Call the Score property instead of referencing the score field directly
7.Modify the Attempt instantiation in the MainWindow
A Pass in the proper values as arguments to the Attempt constructors. The accuracy for Blackboard will be 99.0 and the accuracy for Canvas will be 98.0
B Delete the lines of code that assign the CertificationExam values
8.Check Your Work (Blackboard):
A Build your solution. Ensure it compiles without errors or warnings
B Set a breakpoint in the Course class's CompleteAssignment method on the lines that calls Complete
C Start the application. Click the 'New Blackboard' button. Click the 'Take Final' button
D Press F11 to step into the Complete method
E Step over the line of code that assigns the difficultyFactor. Ensure it is 67.6
F Step over the line of code that assigns the accuracy variable. Ensure that it is 66.55
G Step over the line of code that instantiates the submission variable. Ensure that the values match those below
Check Your Work - Submission Values; compare object identities, field values, and execution position with your debugger.
Check Your Work - Submission Values
H Return to the TakeAssignment method. Step into the Grade method
I Step into assignment's Grade method
J Step into the attempt's Grade method
K Step through the Grade method. Ensure that the score field is assigned the value 67
L Step though the remaining code. Ensure the attempt it not submitted
9.Check Your Work (Canvas):
A Set a breakpoint on the closing curly brace of the writeFinalPaperButton_Click event handler
B Start the application. Click the 'New Canvas' button. Click the 'Write Final Paper' button
C Ensure your values match the values below
Check Your Work: Canvas; compare object identities, field values, and execution position with your debugger.
Check Your Work: Canvas
Construct an assignment with private state
10.Review the feature design
A Identify the contracts and expected behavior

This focused design shows the members or flow relevant to this feature. Keep unchanged members from your preceding checkpoint; follow the tasks below for the order of intermediate edits.

Encapsulated assignment values. class Assignment { - difficulty : double - name : string - points : double - type : string - submission : Attempt + Assignment(name : string, type : string, possiblePoints : double, difficulty : double) + Name : string {get} + Points : double {get} + Type : string {get} + Complete(date : string, student : Student) : Attempt + Submit(submission : Attempt) : void + Grade(attempt : Attempt) : void }
Encapsulated assignment values
  • New
  • Changed
  • Removed
11.Make changes to the Assignment class structure using this story’s design reference
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Make changes to the Assignment class structure using this story’s design reference.

12.In the MainWindow, refactor the code to instantiate the assignments using the constructor

When instantiating the CertificationExams, hard-code the instructor's name for the first argument.

A Verify the required change or observation

Check the result against this instruction: In the MainWindow, refactor the code to instantiate the assignments using the constructor.

13.Check Your Work (Blackboard):
A Set a breakpoint at the end of the newBlackboardButton_Click
B Start the application. Click the 'New Blackboard' button
C Ensure your values match the values below
Check Your Work: Blackboard; compare object identities, field values, and execution position with your debugger.
Check Your Work: Blackboard
14.Check Your Work (Canvas):
A Set a breakpoint at the end of the newCanvasButton_Click
B Start the application. Click the 'New Canvas' button
C Ensure your values match the values below
Check Your Work: Canvas; compare object identities, field values, and execution position with your debugger.
Check Your Work: Canvas
Construct the course and its instructor
15.Review the feature design
A Identify the contracts and expected behavior

This focused design shows the members or flow relevant to this feature. Keep unchanged members from your preceding checkpoint; follow the tasks below for the order of intermediate edits.

Construct instructor before course. class Instructor { - knowledgeLevel : double - name : string - salary : decimal - numberOfStudentsTutored : int - certificationExam : Attempt + Instructor(name : string, salary : decimal, knowledgeLevel : double) + CertificationExam : Attempt {get; set} } class Course { - number : string - name : string - fee : decimal - teacher : Instructor + Course(number : string, name : string, fee : decimal, teacher : Instructor) + Teacher : Instructor {get} } Course --> Instructor : teacher
Construct instructor before course
  • New
  • Changed
  • Removed
16.Modify the Course and Instructor classes using this story’s design reference
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Modify the Course and Instructor classes using this story’s design reference.

17.In the MainWindow, use the constructor to instantiate the Instructors
A Verify the required change or observation

Check the result against this instruction: In the MainWindow, use the constructor to instantiate the Instructors.

18.Change the assignment of the Teacher to a local variable named instructor
A Verify the required change or observation

Check the result against this instruction: Change the assignment of the Teacher to a local variable named instructor.

19.In the MainWindow, use the constructor to instantiate the Courses
A Verify the required change or observation

Check the result against this instruction: In the MainWindow, use the constructor to instantiate the Courses.

20.Assign the PrimaryInstructor field to the local instructor variable
A Verify the required change or observation

Check the result against this instruction: Assign the PrimaryInstructor field to the local instructor variable.

21.Check Your Work (Blackboard):
A Set a breakpoint at the end of the newBlackboardButton_Click
B Start the application. Click the 'New Blackboard' button
C Ensure your values match the values below
Check Your Work: Blackboard; compare object identities, field values, and execution position with your debugger.
Check Your Work: Blackboard
22.Check Your Work (Canvas):
A Set a breakpoint at the end of the newCanvasButton_Click
B Start the application. Click the 'New Canvas' button
C Ensure your values match the values below
Debugger checkpoint on source page 8; compare object identities, field values, and execution position with your debugger.
Debugger checkpoint on source page 8
Control student probation through properties
23.Review the feature design
A Identify the contracts and expected behavior

This focused design shows the members or flow relevant to this feature. Keep unchanged members from your preceding checkpoint; follow the tasks below for the order of intermediate edits.

Controlled student properties. class Student { - id : int - knowledgeLevel : double - name : string - requiredSessions : int - course : Course + Student(name : string, id : int, knowledgeLevel : double, course : Course) + IsOnProbation : bool {get} + KnowledgeLevel : double {get} + Name : string {get} + RequiredSessions : int {get; set} + GetHelp() : void + TakeAssignment(type : string, date : string) : Attempt }
Controlled student properties
  • New
  • Changed
  • Removed
Suggested property checks
RequiredSessions assignment Expected IsOnProbation
0 false
1 true
10 true
-1 or 11 Assignment rejected; prior value and status retained
24.Modify the Student class using this story’s design reference
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Modify the Student class using this story’s design reference.

25.In the getter of the IsOnProbation property, return true if the requiredSessions field is greater than 0
A Verify the required change or observation

Check the result against this instruction: In the getter of the IsOnProbation property, return true if the requiredSessions field is greater than 0.

26.In the setter of the RequiredSessions property, check if the incoming value is between 0 and 10 before assigning it to the requiredSessions field
A Verify the required change or observation

Check the result against this instruction: In the setter of the RequiredSessions property, check if the incoming value is between 0 and 10 before assigning it to the requiredSessions field.

27.In the FindHelp method in the Course class, remove the lines of code that check the student's RequiredSessions and assign IsOnProbation
A Verify the required change or observation

Check the result against this instruction: In the FindHelp method in the Course class, remove the lines of code that check the student's RequiredSessions and assign IsOnProbation.

28.In the MainWindow, change the assignment of the Course field to a local variable and update all references
A Verify the required change or observation

Check the result against this instruction: In the MainWindow, change the assignment of the Course field to a local variable and update all references.

29.Move the instantiation of the course above the instantiation of the Student
A Verify the required change or observation

Check the result against this instruction: Move the instantiation of the course above the instantiation of the Student.

30.Move the instantiation of the instructor above the instantiation of the course
A Verify the required change or observation

Check the result against this instruction: Move the instantiation of the instructor above the instantiation of the course.

31.Instantiate the Student using the constructor
A Verify the required change or observation

Check the result against this instruction: Instantiate the Student using the constructor.

32.Check Your Work (Blackboard):
A Set a breakpoint in the MainWindow on the line of code that assigns the student's RequiredSessions
B Set a breakpoint on the closing curly brace of the newBlackboardButton_Click
C Start the application. Click the 'New Blackboard' button
D Press F11. Ensure the debugger steps into the RequiredSessions setter
E Step over the logic check. Ensure it passes and that the requiredSessions field is assigned the value 3
F Press F5. Ensure your values match the values below
Check Your Work - Blackboard; compare object identities, field values, and execution position with your debugger.
Check Your Work - Blackboard
33.Check Your Work (Canvas):
A Set a breakpoint on the closing curly brace of the newCanvasButton_Click
B Start the application. Click the 'New Canvas' button
C Ensure your values match the values below
Check Your Work - Canvas; compare object identities, field values, and execution position with your debugger.
Check Your Work - Canvas
Construct the grade book last
34.Review the feature design
A Identify the contracts and expected behavior

This focused design shows the members or flow relevant to this feature. Keep unchanged members from your preceding checkpoint; follow the tasks below for the order of intermediate edits.

Construct a grade book from existing objects. class GradeBook { - url : string - version : string - currentStudent : Student - primaryInstructor : Instructor + GradeBook(url : string, version : string, currentStudent : Student, primaryInstructor : Instructor) + CurrentStudent : Student {get} } GradeBook --> Student : currentStudent GradeBook --> Instructor : primaryInstructor Student --> Course : course Course --> Instructor : teacher
Construct a grade book from existing objects
  • New
  • Changed
  • Removed
35.Modify the GradeBook class using this story’s design reference
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Modify the GradeBook class using this story’s design reference.

36.In the MainWindow, move the line that instantiates the GradeBook to be the last line in the event handler
A Verify the required change or observation

Check the result against this instruction: In the MainWindow, move the line that instantiates the GradeBook to be the last line in the event handler.

37.Change the assignment of the CurrentStudent field to be a local variable names student
A Verify the required change or observation

Check the result against this instruction: Change the assignment of the CurrentStudent field to be a local variable names student.

38.Change the lines of code that assign the RequiredSessions field to references the student variable
A Verify the required change or observation

Check the result against this instruction: Change the lines of code that assign the RequiredSessions field to references the student variable.

39.Delete the lines of code that assign the PrimaryInstructor field
A Verify the required change or observation

Check the result against this instruction: Delete the lines of code that assign the PrimaryInstructor field.

40.Use the constructor to instantiate the GradeBook objects
A Verify the required change or observation

Check the result against this instruction: Use the constructor to instantiate the GradeBook objects.

41.Check Your Work (Blackboard):
A Set a breakpoint on the closing curly brace of the newBlackboardButton_Click
B Start the application. Click the 'New Blackboard' button
C Ensure your values match the values below
Check Your Work - Blackboard; compare object identities, field values, and execution position with your debugger.
Check Your Work - Blackboard
42.Check Your Work (Canvas):
A Set a breakpoint on the closing curly brace of the newCanvasButton_Click
B Start the application. Click the 'New Canvas' button
C Ensure your values match the values below
Check Your Work - Canvas; compare object identities, field values, and execution position with your debugger.
Check Your Work - Canvas
Submit your work
43.Ensure you code is StyleCop compliant
A Verify the required change or observation

Check the result against this instruction: Ensure you code is StyleCop compliant

44.Zip the solution and submit to the Feedback System
A Verify the required change or observation

Check the result against this instruction: Zip the solution and submit to the Feedback System.

45.Submit the Feedback System URL to the correct assignment in Canvas
A Verify the required change or observation

Check the result against this instruction: Submit the Feedback System URL to the correct assignment in Canvas.

Completion checklist
46.Review the required evidence
A Check every acceptance criterion

Return to each user story and confirm that you can demonstrate its acceptance criteria. Use the task checkboxes to track completion; a checked box is not a substitute for testing or inspecting the required evidence.

Initialize and grade an encapsulated attempt Construct an assignment with private state Construct the course and its instructor Control student probation through properties Construct the grade book last
B Build and inspect the final solution

Remove temporary lines used only to demonstrate compile-time errors. Build without errors or warnings, check StyleCop compliance, and rerun the required scenario paths.

C Follow this activity’s submission instructions

Use the submission or attendance instructions in this page. For a Feedback System submission, upload the requested ZIP, review and resolve the feedback, and submit the resulting URL to the matching Canvas activity. For a Canvas quiz, enter only the requested answers; for an oral final, complete the scheduling and attendance steps.