Designing Elixir Systems with OTP: The Proctor's start_quiz implementation uses add_template/2 wrong (page 166)

The Proctor code won’t compile:

error: undefined function add_template/2 (expected Mastery.Boundary.Proctor to define such a function or for it to be imported, but none are available)

I think the best remedy is to fix two errors in the same spot. For one, which is the compilation error, the function called resides in QuizManager. What’s more, if you only namespace that function correctly, you get crashes, because the Proctor’s internal quiz hashmap structure is not used as keys in the manager, so we must pick the quiz’ title from it instead.

Within start_quiz/2, change

Enum.each(quiz.templates, &add_template(quiz, &1))

to

Enum.each(quiz.templates, &QuizManager.add_template(quiz.fields.title, &1))