import { IInputQuestionAnswerFull , TQuestionFull , TResultQuestion } from '../types' ; export function transformResultQuestionToRegularQuestion ( question ) { if ( question . type === 'MS' || question . type === 'MCQ' ) { question . options . forEach ( ( option ) => { delete option . isCorrect ; delete option . userSelected ; } ) ; } else { ( question . answers as IInputQuestionAnswerFull [ ] [ ] ) . forEach ( ( answers ) => { answers . forEach ( ( answer ) => { delete answer . isCorrect ; } ) ; } ) ; } return question as TQuestionFull ; }