> For the complete documentation index, see [llms.txt](https://docs.smartbotpro.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smartbotpro.io/mini-course/template-test-with-a-set-of-points.md).

# Template "Test with a set of points"

If the user writes "Test" or "Take the test", the bot will offer testing:

![](/files/CG7t2ZMpUM5BwoOp6vIg)

For each correct answer, we will award points. We will store them in the variable "points" for the test. We reset this variable before starting the test:

![](/files/FahcIfv9zS7alpbveqD4)

Now you can ask the first question.

There are 4 answer buttons for the question. One of them leads to a message about the correct answer and points. All the rest - to the message that the user answered incorrectly. After that, for any outcome, the bot writes the correct answer, waits 10 seconds and moves on to the next question.

![](/files/bGxetOiyRx87Pt3w5GfO)

Pay attention to the block with crediting points:

![](/files/OJUGHdXLbOsCpoTTbxsl)

In double curly braces, you can write any arithmetic expressions with variables, as well as use our special [SmartQuery](https://docs.smartbotpro.ru/smartquery/sintaksis-yazyka) language, in which you can do a variety of things - from arithmetic to processing API return data:

![](/files/uBewLOFA9XqJgzKX6YuR)

The 2nd question of the test is: “How far (in millions of kilometers) is the Earth from the Sun? Write the approximate number of million km.&#x20;

The user must enter the answer himself. We save the answer in the %Answer to the second question% variable and proceed to the condition: the variable must be in the range from 140 to 160. Then we will assume that the user knows the answer approximately.&#x20;

After that, we follow the familiar pattern: if the answer is correct, we go to the script branch with crediting points. If incorrect, then we say that the user made a mistake and continue:

![](/files/fGQXa5SYjSerJqxxBUlo)

The 3rd question is: “Which planet from the Sun is the Earth?” Thanks to the “Wait for a response from the user” checkbox, we expect a response in the same block. This allows you not to take extra steps like "Process message" or "Save to variable". After that, we make a condition on the message itself from the user. This condition always works on the last message, which must be equal to "3" for the correct option.

![](/files/SumQsw9wlgJdalOzdLN9)
