grade = 0
if rate >= 0.6 and rate < 1 then
grade = 5*rate*0.8
elseif rate >=1 and rate < 1.1 then
grade = 5*rate*1
elseif rate >=1.1 then
grade = 5*rate*1.1
else
grade = 0
end if
if grade >= 5*1.3 then
grade = 5*1.3
end if
grade = 0
if rate >= 0.6 and rate < 1 then
grade = 5*rate*0.8
elseif rate >=1 and rate < 1.1 then
grade = 5*rate*1
elseif rate >=1.1 then
grade = 5*rate*1.1
else
grade = 0
end if
if grade >= 5*1.3 then
grade = 5*1.3
end if