Added toggle function to preamble functor#6
Conversation
There was a problem hiding this comment.
I don't think we should merge this as-is, since it would break existing autograders using the Preamble functor (which we shouldn't do without a major-version bump). We could add a second functor, though (maybe ConditionalPreamble?) and then implement the existing Preamble in terms of it.
| @@ -1,5 +1,6 @@ | |||
| functor Preamble ( | |||
| val preamble : string | |||
| val show : Rational.t -> bool | |||
There was a problem hiding this comment.
One thought: instead of Rational.t, what about Grader.Rubric.t, so the preamble switch doesn't have to factor through the score?
Upon further reflection, perhaps we should even generalize to val show : Grader.Rubric.t -> string option or something, allowing for a different preamble per rubric item? (The existing behavior could be recovered with Fn.const (SOME preambleString), of course.)
There was a problem hiding this comment.
I don't think we should merge this as-is
Fair
val show : Grader.Rubric.t -> string optionor something, allowing for a different preamble per rubric item?
I thought about this but the issue I see with it is that we need to know the what the rubric is which isn't exactly clear and would make it hard to actually use this.
show : Rational.t -> boolwhich is used to determine whether the preamble should be included in the string. Useful for when you only want to show certain messages if a student doesn't get a high enough score.