SmartbotPro
  • Smartbot Pro – messenger marketing tool
  • Most important
  • Mini-course
    • Registration and personal account
    • Initial scripting tools
    • Creating the first script
    • Users and collection of information
    • Applications, variables and managers
    • Data validation
    • Collection of applications for a webinar within Telegram
    • Testing unpublished scripts
    • Newsletters
    • Template "Test with a set of points"
    • Statistics
    • Interface hacks
  • Beginning of work
    • Registration in the service
    • More about scripts
    • How to add messenger
      • Adding Telegram
        • Adding a bot to a group chat in Telegram
      • Adding ВК
      • Adding Viber
      • Connecting a channel to a script
      • Linking a social network account
  • Scripts
    • Basics
      • Create a script
      • Script templates
      • Editor interface
      • Publishing a script
      • Script testing
      • How the script is chosen
    • Script events
      • Message from user
      • No appropriate script
      • First message
      • VK Events
      • Webhook
    • Actions
      • Send a message
        • Buttons
      • Process message
      • Extract data
      • Change context
      • Write to statistics
      • Send Notification
      • Switching to another script
      • Working with the user
      • Set variable
      • Scheduled transitions
      • Run SmartQuery
    • Conditions
      • Condition
      • Condition with options
      • Conditions of VKontakte
    • Variables
      • Special Variables
      • User variables
      • Global variables
      • Variable %ref%
    • Acceptance of payment
    • Telegram bot menu
    • Integrations
      • Google-таблицы
      • http request
      • amoCRM
      • Get Course
      • Yukassa for receiving payments
    • Reactions
  • Newsletters
  • Settings
    • Projects
    • Cabinets
  • Information sections
    • Statistics
    • Users
  • SmartQuery
    • Introduction
    • Language syntax
    • Function Reference
  • The documents
    • Privacy Policy
    • Terms of service
    • Subscription and rates
Powered by GitBook
On this page
  1. Mini-course

Template "Test with a set of points"

PreviousNewslettersNextStatistics

Last updated 2 years ago

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

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:

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.

Pay attention to the block with crediting points:

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.

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.

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:

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.

In double curly braces, you can write any arithmetic expressions with variables, as well as use our special language, in which you can do a variety of things - from arithmetic to processing API return data:

SmartQuery