MDL-39230 refactor question import code

to allow reuse of code for an individual question's import
MDL-39230 refactor save question ready to eliminate duplication.