Adaptive assignment algorithm returnGrade(N)
In order to grade the assignment and return N (rather than the basic calculated grade), precede the returnGrade(N); command with the return command. This will cause the assignment to end, and execute returnGrade(N); as specified.
ExampleTo have a Algorithm section contain multiple return conditions, you would use the following code snippet to return a grade of 3 if they are are in branch 2, or a grade of 4 if they are in branch 3.
... if current_branch = 2 then return returnGrade(3); if current_branch = 3 then return returnGrade(4); if ...
Did you find this article helpful?