3.2 Grade Book Assignment

Under Construction

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

A platypus
3.2 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 3.1 Assignment. Rename the folder and .sln to 3.2
A Verify the required change or observation

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

Use different assignment and attempt types
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.

Specialized attempts and assignment factories. Attempt exposes a read/write Score property and a virtual Grade method. GradedAttempt and CompleteIncompleteAttempt override Grade. Assignment exposes a virtual CreateAttempt factory method. PlanAssignment creates CompleteIncompleteAttempt; MidtermAssignment and FinalAssignment create GradedAttempt.
Specialized attempts and assignment factories
  • New
  • Changed
  • Removed
4.Add two folders to your project; one named Assignments and one named Attempts
A Verify the required change or observation

Check the result against this instruction: Add two folders to your project; one named Assignments and one named Attempts.

5.Change how different type of Attempts are handled
A Make changes to the class structure using this story’s design reference
B Cut the body of the Grade method in the Attempt class and paste it into the Grade method in the GradedAttempt class and use the Score property to assign the score. Leave the virtual Grade method empty
C In the Grade method in the CompleteIncompleteAttempt class, assign the Score property to 100.0
D In the MainWindow, instantiate the teacher's CertificationExam's as GradedAttempt types
6.Create different kinds of Attempts based on the Assignment type
A Make changes to the class structure using this story’s design reference
B In the CreateAttempt method in the Assignment class return null
C In the FinalAssignment and MidtermAssignment classes in the CreateAttempt method, return a GradedAttempt object based on the parameters passed in
D In the PlanAssignment class in the CreateAttempt method, return a

CompleteIncompleteAttempt object based on the parameters passed in.

E In the Complete method in the Assignment class, call CreateAttempt instead of creating a new Attempt
F In the MainWindow, instantiate Assignments based on their type (Plan, Midterm or Final) based on the example below
course.AddAssignment(new PlanAssignment("Plan", "Start Here", 5.0, 2.1));
7.Create a new event handler for taking the PlanAssignment
A In the MainWindow.xaml between the tutorSamantha and writeEssay buttons, paste the code b
<Button x:Name="finishPlanButton" Content="Finish plan" Click="finishPlanButton_Click" />
B Create an event handler
C In the event handler, call TakeAssignment and pass in "Start Here" and "09/01/2018" as arguments
8.Check Your Work (Blackboard):
A Build your solution and ensure there are no errors or warnings
B Set a breakpoint in the newBlackboardButton_Click the line of code that instantiates a PlanAssignment
C Set a breakpoint in the Complete method in the Assignment class on the line of code that calls CreateAttempt
D Set a breakpoint in the Grade method in the Assignment class on the line of code that calls Grade
E Start the application. Click the 'New Blackboard' button
F Press F10. Ensure your values match those below
CYW - PlanAssignment; compare object identities, field values, and execution position with your debugger.
CYW - PlanAssignment
G Step over the lines that instantiate the MidtermAssignment and FinalAssignment. Ensure your values match the values below
3.2 Grade Book 2 CYW Midterm_Final.png; compare object identities, field values, and execution position with your debugger.
3.2 Grade Book 2 CYW Midterm_Final.png
H Press F5. Click the 'Take Midterm' button
I Press F11. Ensure the debugger steps into the Name property and then the CreateAttempt method in the MidtermAssignment class
J Step through the method body. Ensure the object returned matches the values below
CYW - Midterm Submission; compare object identities, field values, and execution position with your debugger.
CYW - Midterm Submission
K Press F5. Press F11 to step into the Grade method. Ensure the debugger steps into the Points property and then the Grade method in the GradedAttempt class
L Step through the Grade method body. Ensure the debugger steps into the Score property and assigns the score field to 80
9.Check Your Work (Canvas):
A Set a breakpoint on the closing curly brace of the newCanvasButton_Click
B Set a breakpoint in the Complete method in the Assignment class on the line of code that calls CreateAttempt
C Set a breakpoint in the Grade method in the Assignment class on the line of code that calls Grade
D Start the application. Click the 'New Canvas' button. Ensure your values match the values below
CYW - Canvas Assignments; compare object identities, field values, and execution position with your debugger.
CYW - Canvas Assignments
E Press F5. Click the 'Finish plan' button
F Press F10. Ensure the Attempt object returned matches the values below
CYW - Plan Assignment; compare object identities, field values, and execution position with your debugger.
CYW - Plan Assignment
G Press F5. Press F11 to step into the Grade method. Ensure the debugger steps into the Points property and then the Grade method in the CompleteIncompleteAttempt class
H Press F11 to step through the Grade method. Ensure the debugger steps into the Score property and assigns the score to 100
Select assignments by runtime type
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.

Use runtime type for assignment selection. class Assignment { + Assignment(name : string, possiblePoints : double, difficulty : double) } class Student { + TakeAssignment(type : Type, date : string) : Attempt } class Course { + GetAssignmentByType(type : Type) : Assignment } Student --> Course note right of Assignment Remove type field and Type property. Derived constructors also omit type. end note note right of Course Compare a.GetType() == type. Callers pass typeof(PlanAssignment), etc. end note
Use runtime type for assignment selection
  • New
  • Changed
  • Removed
11.Remove parameters and arguments 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: Remove parameters and arguments using this story’s design reference.

12.Modify the TakeAssignment method and the GetAssignmentByType methods have a parameter of type Type instead of string
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Modify the TakeAssignment method and the GetAssignmentByType methods have a parameter of type Type instead of string.

13.In the GetAssignmentByType method, use GetType to compare the object and parameter
A Verify the required change or observation

Check the result against this instruction: In the GetAssignmentByType method, use GetType to compare the object and parameter.

14.In the MainWindow, use typeof in the calls to TakeAssignment to take the correct assignment
A Verify the required change or observation

Check the result against this instruction: In the MainWindow, use typeof in the calls to TakeAssignment to take the correct assignment.

15.Check Your Work (Blackboard):
A Set a breakpoint in the takeMidtermButton_Click on the line that calls TakeAssignment
B Start the application. Click the 'New Blackboard' button. Click the 'Take midterm' button
C Press F11. Ensure the debugger steps into the CurrentStudent property and into the TakeAssignment method. Ensure that the Value of type matched the Value below
CYW - TakeAssignment; compare object identities, field values, and execution position with your debugger.
CYW - TakeAssignment
D Step over the call to GetAssignmentByType. Ensure that the assignment returned is the "HTML Exercises" assignment
16.Check Your Work (Canvas):
A Set a breakpoint on the closing curly brace of the finishPlanButton_Click event handler
B Start the application. Click the 'New Canvas' button. Click the 'Finish plan' button
C Ensure your values match the values below
Debugger checkpoint on source page 7; compare object identities, field values, and execution position with your debugger.
Debugger checkpoint on source page 7
Submit your work
17.Ensure your code is StyleCop compliant
A Verify the required change or observation

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

18.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.

19.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
20.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.

Use different assignment and attempt types Select assignments by runtime type
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.