Defines the cw.quiz library, the quiz that new players have to pass before they can play.

Schemas add questions with cw.quiz:AddQuestion and switch the quiz on with cw.quiz:SetEnabled. The server also sets the share of correct answers needed and the callback run for players who fail.

Summary

Methods

Init()client
Builds the full-screen quiz with its question list and the Disconnect and Continue buttons.
Removes the quiz's background blur along with it.
Blurs the background and draws a black backdrop over the screen.
Centres the question list on the screen at half the screen width.
Fills the quiz with a combo box for each question from cw.quiz:GetQuestions, sorted by question text.
Think()client
Lays the quiz out again each frame.

Methods

Builds the full-screen quiz with its question list and the Disconnect and Continue buttons.

Continue sends the QuizCompleted Cable message; the server decides whether the answers pass.

Removes the quiz's background blur along with it.

Blurs the background and draws a black backdrop over the screen.

Parameters

  • w
  • h

Centres the question list on the screen at half the screen width.

Parameters

  • w
  • h

Fills the quiz with a combo box for each question from cw.quiz:GetQuestions, sorted by question text.

Each answer is sent to the server with the QuizAnswer Cable message as soon as it is picked.

Lays the quiz out again each frame.

Defined in