How to run mysql query for function

DELIMITER//
CREATE FUNCTION marksfunction(marks int)
RETURNS varchar(50)
BEGIN
DECLARE level varchar(50);
if (marks<20) THEN set level=‘poor’;
ELSEIF (marks>20 and marks<60) them set level=‘moderate’;
ELSEIF (marks>60) then set level=‘Excellent’;
END IF;
RETURN(level);
END//

IT SHOWING ERROR--------------------------------
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘DELIMITER//
CREATE FUNCTION marksfunction(marks int)
RETURNS varchar(50)
B…’ at line 1

SIR WHAT TO DO-------------