When having students enter in variables, I find that using underscores isn't always the best so I both modify the TeX output and use alias, that way students can just type 'x1' vs having to making it an underscore for simplicity, but the TeX output will show the underscore. I have reduced this to two variables, but you can modify as needed.
Context('Numeric')->variables->are(
x1 => [ 'Real', TeX => 'x_1 ' ],
x2 => [ 'Real', TeX => 'x_2 ' ],
x_1 => [ 'Real', alias => 'x1' ],
x_2 => [ 'Real', alias => 'x2' ],
);
Of course if you want x_1 and x_2 to be the main variables, you can use x1 => ['Real', alias => 'x_1'] if you would prefer. I just do the other way as I find students have an easier time entering in x1 and not use underscores. This way the output looks like I want it to, students can enter in the answers without underscores, but if they do use underscores it still works.
Context('Numeric')->variables->are(
x1 => [ 'Real', TeX => 'x_1 ' ],
x2 => [ 'Real', TeX => 'x_2 ' ],
x_1 => [ 'Real', alias => 'x1' ],
x_2 => [ 'Real', alias => 'x2' ],
);
Of course if you want x_1 and x_2 to be the main variables, you can use x1 => ['Real', alias => 'x_1'] if you would prefer. I just do the other way as I find students have an easier time entering in x1 and not use underscores. This way the output looks like I want it to, students can enter in the answers without underscores, but if they do use underscores it still works.