It looks like you're new here. If you want to get involved, click one of these buttons!
<<if ($hero[$i].assignment is “train sword skill”) and ($hero[$i]. swordSkill is 1)>> They practice clumsily with a sword. <<elseif ($hero[$i].assignment is “train sword skill”) and ($hero[$i]. swordSkill is 2)>> They exercise with a sword. <<elseif ($hero[$i].assignment is “train sword skill”) and ($hero[$i]. swordSkill is 3)>> They work masterfully with a sword. <</if>>
<<if ($hero[$i].assignment is “train sword skill”)>> <<elseif ($hero[$i].swordSkill is 1)>> They practice clumsily with a sword. <<elseif ($hero[$i].swordSkill is 2)>> They exercise with a sword. <<elseif ($hero[$i].swordSkill is 3)>> They work masterfully with a sword. <</if>>
Comments
As to how that should be done, greyelf is correct.
Beyond that, the parenthesis are redundant here. Additionally, you seem to be using typographic (a.k.a. curly/smart) quotes (copy/paste from a word processor?) which will not work here. Only double/single quotes are allowable as "programming" quotes. You may still use typographic quotes within your normal text, however.
So, merging greyelf's suggestion with the issues I noted, it should probably look like the following: Whatever you do, mind your whitespace (incl. line breaks).
Speaking of which, here's a somewhat more succinct version, which ensures that it's not creating extra whitespace internally, particularly line breaks: