I have flash cards like this:
Front: I don't usualy eat [[ podwieczorek ]]
Back: afternoon tea
I have created an advanced template in HyperTTS that replace the word in [[ ]] brackets with the word that is on the back. Here it's my advanced template script:
def format_text(raw, use):
first = True
while True:
start = raw.find('[')
end = raw.find(']')
if start == -1 or end == -1:
break
if first:
raw = raw[:start] + use + raw[end+1:]
first = False
else:
raw = raw[:start] + raw[end+1:]
return raw
front = template_fields['Przód']
back = template_fields['Tył']
result = format_text(front, back)
For some reason when I want to add a sound it doesn't work properly for the first time, it shows an error:
When I click "Show Settings" and click on "Note Id" it says:
Error: No "result" variable found. You must assign the final template output to a result variable.
When I change something in the script (e.g. remove one letter and add it again) then the whole script will be loaded again and the error no longer appears:
It is very annoying that I have to do this every time when I want to add sounds for my flash cards. It would be great if this problem could be solved.
Hi,
I have flash cards like this: Front:
I don't usualy eat [[ podwieczorek ]]
Back:afternoon tea
I have created an advanced template in HyperTTS that replace the word in [[ ]] brackets with the word that is on the back. Here it's my advanced template script:
For some reason when I want to add a sound it doesn't work properly for the first time, it shows an error:
When I click "Show Settings" and click on "Note Id" it says:
Error: No "result" variable found. You must assign the final template output to a result variable.
When I change something in the script (e.g. remove one letter and add it again) then the whole script will be loaded again and the error no longer appears:
It is very annoying that I have to do this every time when I want to add sounds for my flash cards. It would be great if this problem could be solved.