Templates
Templates are dynamic expressions evaluated on the server before the page is sent to the players. In the browser, only the result of the expression for their specific team is shown. The template code itself is NOT visible, even in the page source code.
Classic applications of templates:
- Individual tasks for the team (splitting flows).
Templates can be written in regular editor mode or in Source mode in the task description, hint text, or bonus text. Templates can be nested.
Google Sheet for Template Generation
To make it easier to write template syntax, you can copy and use a special spreadsheet: QEng Template Generation Google Sheet.
Various Types of Templates
Task Modification for a Team
By Lineup ID (Sequence)
{% match line }:{
{%= 688 /*comment: lineup name*/}:{
Text for lineup with ID 688
%}
{%= 643 }:{
Text for lineup with ID 643
%}
{%= 653,655 }:{
Text for lineup with ID 653 or 655
%}
{%= ?}:{
Text for any other lineup
%}
%}
By Team ID
{% match team }:{
{%= 688 /*comment: team name*/}:{
Text for team with ID 688
%}
{%= 643 }:{
Text for team with ID 643
%}
{%= 653,655 }:{
Text for team with ID 653 or 655
%}
{%= ?}:{
Text for any other team
%}
%}
Binding a Task Event to Real Time
Useful for releasing codes or hints at a specific absolute time. To convert date/time, use Unix Time Converter.
{% unix_time 1639999296/*date in unix time*/, Opens, Left}:{
This text will be shown after the specified time.
%}
Templates Using Answers in the Task
Check the Last (Current) Answer Submitted for the First Code
*(Replace `code_1` with the required code index, e.g. `code_5` for the fifth code)*
{% match code_1 }:{
{%= abc}:{
The answer "abc" is submitted for the first code.
%}
{%= bac, cba}:{
The answer "bac" or "cba" is submitted for the first code.
%}
{%= !no_answer!}:{
No correct answer has been submitted for the first code yet.
%}
{%= ?}:{
Some other answer synonym has been submitted.
%}
%}
Check the Very First Answer Submitted for the Second Code
{% match code_first_2 }:{
{%= abc}:{
The first answer submitted for this code was "abc".
%}
{%= !no_answer!}:{
The code has not been submitted yet.
%}
{%= ?}:{
Another answer was submitted.
%}
%}
Check Bonuses and Spanning Bonuses
Just like codes, you can check answers for bonuses:
bonus_1/bonus_first_1— last or first answer submitted for bonus 1 on the current task.gbonus_1/gbonus_first_1— last or first answer submitted for spanning (global) bonus 1. Spanning bonuses can be checked even on levels where they are not displayed.
Check Who Submitted the Answer
You can prepend who_ to answer checks to find out who in the team submitted the answer.
Possible values:
me— code was submitted by the current logged-in user.other— code was submitted by another team member.!no_answer!— not submitted yet.
*(Anonymous players without registration are treated as the same user).*
{% match who_code_1 }:{
{%= me}:{
I submitted the first code.
%}
{%= other}:{
My teammate submitted the first code.
%}
{%= !no_answer!}:{
Nobody has submitted the code yet.
%}
%}
Check Which Team Submitted the Answer (for Inter-team Duels)
Prepend who_team_ to check which team solved a spanning/shared task:
Possible values:
me— my team solved the code.other— an opponent team solved the code.!no_answer!— not solved yet.
{% match who_team_code_1 }:{
{%= me}:{
Our team solved this code first!
%}
{%= other}:{
Opponent team solved this code first.
%}
%}
Templates Based on Player Interface Language
{% match lang }:{
{%= ru}:{
Russian interface language selected.
%}
{%= uk }:{
Ukrainian interface language selected (uk).
%}
{%= en }:{
English interface language selected.
%}
{%= ?}:{
Some other language.
%}
%}
Check Product Purchase Status (Paywall)
If your game uses paid levels or paid hints, you can check the purchase status:
product_KEY— where KEY is the product key from settings.
Possible values:
yes— product purchased by the team.pending— payment started but not yet finalized.no— not purchased.
{% match product_level_5 }:{
{%= yes}:{
The team purchased access to level 5.
%}
{%= pending}:{
Payment is pending. Please wait and refresh the page.
%}
{%= no}:{
Access closed. Price is $1. Click to purchase:
%pay_button level_5%
%}
%}