2.2 Grade Book Assignment

Under Construction

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

A platypus
2.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 2.1 Grade Book end code and rename the folder and solution to 2.2
A Verify the required change or observation

Check the result against this instruction: Copy your 2.1 Grade Book end code and rename the folder and solution to 2.2

Grade an attempt before submitting it
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.

Return and grade an attempt. class Student { + TakeAssignment(type : string, date : string) : Attempt } class Course { + GetAssignmentByType(type : string) : Assignment + CompleteAssignment(assignment : Assignment, date : string, student : Student) : Attempt } class Assignment { + Complete(date : string, student : Student) : Attempt + Submit(submission : Attempt) : void } class Instructor { + Grade(assignment : Assignment, attempt : Attempt) : bool } Student --> Course Course --> Assignment Student --> Instructor : Teacher
Return and grade an attempt
  • New
  • Changed
  • Removed
Submit only an accepted attempt. start :assignment = Course.GetAssignmentByType(type); :attempt = Course.CompleteAssignment(assignment, date, this); :accuracyPercentage = attempt.Accuracy / 100; :attempt.Score = round(assignment.Points * accuracyPercentage); if (attempt.Score > 70?) then (yes) :assignment.Submit(attempt); else (no) :Do not replace Submission; endif :Return attempt; stop
Submit only an accepted attempt
  • New
  • Changed
  • Removed
Grading and submission checks
Scenario Rounded score Submit?
Blackboard midterm 80 Yes
Blackboard final 67 No
Canvas midterm 86 Yes
Canvas final 77 Yes
4.Make changes to the 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 class structure using this story’s design reference.

5.Ensure the code follows the sequence diagram below
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Ensure the code follows the sequence diagram below.

6.Modify the TakeAssignment method in the Student class using this story’s design reference
Review this feature’s design and requirements
A Define a local variable named assignment of type Assignment and assign it to the return from GetAssignmentByType. Pass in the type parameter as the argument
B Define a local variable named attempt of type Attempt and assign it to the return from CompleteAssignment. Pass in the assignment local variable, the date parameter and the current instance as arguments
C Add an if conditional that checks the return from the call to the Teacher's Grade method. Pass in the assignment variable and the attempt variable as arguments. If the conditional passes, call the assignment's Submit method and pass in the attempt variable as the argument
7.Modify the GetAssignmentByType in the Course class using this story’s design reference
Review this feature’s design and requirements
A Define a local variable named result of type Assignment
B If the type parameter is the same as the Midterm's Type, assign the result variable to the Midterm field. If the type is the same as the Final's Type, assign the result variable to the Final field. If it is neither, assign the result to null
C Return the result variable
8.Modify the CompleteAssignment method in the Course class by removing the logic and calling the Complete method on the assignment parameter. Return the return from Complete
A Verify the required change or observation

Check the result against this instruction: Modify the CompleteAssignment method in the Course class by removing the logic and calling the Complete method on the assignment parameter. Return the return from Complete.

9.Modify the Complete method in the Assignment class
A Assign the new instance of the Attempt class to a local variable named submission instead of the Submission field
B Change all references to the Submission field to the submission variable
C Return the submission variable
10.Modify the Grade method in the Instructor class using this story’s design reference
Review this feature’s design and requirements
A Assign a local variable named accuracyPercentage of type double to the attempt's Accuracy divided by 100
B Assign the attempt's Score to the rounded result of the assignment's Points multiplied by the accuracyPercentage
C If the attempt's Score is greater than 70 return true. If it is less than or equal to 70, return false
11.Modify the Submit method in the Assignment class by assigning the Submission field to the submission parameter
A Verify the required change or observation

Check the result against this instruction: Modify the Submit method in the Assignment class by assigning the Submission field to the submission parameter.

12.Check Your Work (Blackboard Midterm):
A Set a breakpoint in the MainWindow in the takeMidtermButton_Click on the line of code that calls TakeAssignment
B Start the application. Click the 'New Blackboard' button. Click the 'Take Midterm' button
C Press F11 to step into the TakeAssignment method. Press F11 to step into the GetAssignmentByType method. Ensure that the type parameter is "Midterm"
D Step through the method body. Ensure that the result variable is assigned to the instance of the "HTML Exercises" Midterm. Return to the TakeAssignment method
E Press F11 to step into the CompleteAssignment method. Ensure that the assignment parameter is the instance of the "HTML Exercises" Midterm
F Step into the Complete method. Step through the Complete method. Ensure the values of the submission variable match those below
Check Your Work - Blackboard Midterm Complete; compare object identities, field values, and execution position with your debugger.
Check Your Work - Blackboard Midterm Complete
G Return to the TakeAssignment method. Press F11 to step into the Grade method
H Step through the Grade method. Ensure that the values match those below
Check Your Work - Blackboard Midterm Grade; compare object identities, field values, and execution position with your debugger.
Check Your Work - Blackboard Midterm Grade
I Return to the TakeAssignment method. Press F11 to step into the Submit method
J Step over the line of code that assigns the Submission field. Ensure the values match those below
2.2 Grade Book CYW SubmitBBMidterm.PNG; compare object identities, field values, and execution position with your debugger.
2.2 Grade Book CYW SubmitBBMidterm.PNG
13.Check Your Work (Blackboard Final):
A Set a breakpoint at the beginning of the Grade method in the Instructor class. Start the application. Click the 'New Blackboard' button. Click the 'Take Final' button
B Step through the method. Ensure the values match those below
Check Your Work - Blackboard Grade Final; compare object identities, field values, and execution position with your debugger.
Check Your Work - Blackboard Grade Final
C Return to the TakeAssignment method. Ensure the logic check fails
14.Check Your Work (Canvas Midterm):
A Set a breakpoint in the MainWindow in the writeEssayButton_Click on the line that calls TakeAssignment
B Start the application. Click the 'New Canvas' button. Click the 'Write Midterm Essay' button
C Press F10. Ensure your values match those below
Check Your Work - Canvas Midterm; compare object identities, field values, and execution position with your debugger.
Check Your Work - Canvas Midterm
15.Check Your Work (Canvas Final):
A Set a breakpoint in the MainWindow in the writeFinalPaperButton_Click on the line that calls TakeAssignment
B Start the application. Click the 'New Canvas' button. Click the 'Write Final Paper' button
C Press F10. Ensure your values match those below
Check Your Work - Canvas Final; compare object identities, field values, and execution position with your debugger.
Check Your Work - Canvas Final
Get a tutor as a returned object
16.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.

Return an assistant or the teacher. start if (Teacher.Assistant != null?) then (yes) :result = Teacher.Assistant; else (no) :result = Teacher; endif :Return result; stop
Return an assistant or the teacher
  • New
  • Changed
  • Removed
17.Modify the 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: Modify the class structure using this story’s design reference.

18.Modify the FindHelp method using this story’s design reference
Review this feature’s design and requirements
A Remove the logic that checks if the Assistant exists or not
B Define a local variable named tutor of type Instructor and assign it to the return from GetTutor
C Call the TutorStudent method on the tutor variable instead of the Assistant and Teacher fields
19.Modify the GetTutor method using this story’s design reference
Review this feature’s design and requirements
A Define a local variable named result of type Instructor
B If the Assistant exists, assign the result to the Assistant. In any other case, assign the result to the Teacher
C Return the result
20.Ensure the Instructor's TutorStudent method follows the Activity Diagram below:
Review this feature’s design and requirements
A Verify the required change or observation

Check the result against this instruction: Ensure the Instructor's TutorStudent method follows the Activity Diagram below:

21.Check Your Work (Blackboard):
A Set a breakpoint in tutorArthurButton_Click, on the line that calls GetHelp
B Start the application. Click the 'New Blackboard' button. Click the 'Tutor Arthur' button
C Press F11. Press F11 to step into the FindHelp method
D Press F11 to step into the GetTutor method
E Step through the method. Ensure that result is assigned to the instance of Sheldon
F Return to the FindHelp method. Press F11 to step into the TutorStudent method

Ensure that 'this' is the instance of Sheldon.

22.Check Your Work (Canvas):
A Set a breakpoint in tutorSamanthaButton_Click, on the line that calls GetHelp
B Start the application. Click the 'New Canvas' button. Click the 'Tutor Samantha' button
C Press F10. Ensure that your values match the values below
Check Your Work - Canvas Tutor; compare object identities, field values, and execution position with your debugger.
Check Your Work - Canvas Tutor
Submit your work
23.Ensure that all code is StyleCop compliant
A Verify the required change or observation

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

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

25.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
26.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.

Grade an attempt before submitting it Get a tutor as a returned object
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.