Updated code its working and displays result on moodle website