In Moodle 3.3,
go to /mod/quiz/renderer.php
comment out line 742 like this (add // infront):
//$button->add_action(new confirm_action(get_string('confirmclose', 'quiz'), null,
Then in the following line, remove 2 brackets from this:-
get_string('submitallandfinish', 'quiz')));
to this:-
get_string('submitallandfinish', 'quiz');
credits to Tim