Idea 1.
1. Create 1 attributes for the student name (more if you need more information)
2. Create 40 attributes for each student
3. When create token, give an email to only one line for each teacher.
4. Generate the tokens (40 for each teachers)
5. Export token table
6. Update token table to fill the 40 attribute by the final tokens (LibreOffice Calc usdage of paste with transpose for example)
7. Delete token table
8. Create tokan table again
9. In email template : use {if(TOKEN:ATTRIBUTE_X !="" …} to add the link with the token filled in attribute
Sample for email template
Code:
<ul>
{if(TOKEN:ATTRIBUTE_1 !="","<li><a href='https://ls.example.org/"+SID+"?token="+TOKEN:ATTRIBUTE_1+"&newtest=Y>Survey for student 1</a></li","")}
{if(TOKEN:ATTRIBUTE_2 !="","<li><a href='https://ls.example.org/"+SID+"?token="+TOKEN:ATTRIBUTE_2+"&newtest=Y>Survey for student 2</a></li","")}
{if(TOKEN:ATTRIBUTE_3 !="","<li><a href='https://ls.example.org/"+SID+"?token="+TOKEN:ATTRIBUTE_3+"&newtest=Y>Survey for student 3</a></li","")}
…
</ul>