Creating a practice trial with feedback for my line reproduction task

Hi, I want to create a practice trial with feedback for my line reproduction task. For the feedback part, I want to show them how close they were in their reproduction. So,

begin routine:

if key_resp.corr:

msg = ’ Correct’

else:

msg = ‘Incorrect’

Begin experiment:

Msg = ’ ’

Text:

$msg

set every repeat

and Bias current_line_len - currentlinelength

-the current_line_len is the spreadhseet column for the line lengths and currentlinelength is the adjusted ljne length.-

But how can write a code that will calculate how close they were in their reproduction?

Thanks!