Source:
public String getQuestionWithoutExistingResponseSubmissionFormHtml( boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients) { List<String> choices = generateOptionList(courseId); StringBuilder optionListHtml = new StringBuilder(); String optionFragmentTemplate = FormTemplates.MCQ_SUBMISSION_FORM_OPTIONFRAGMENT; for (int i = 0; i < choices.size(); i++) { String optionFragment = Templates.populateTemplate(optionFragmentTemplate, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.CHECKED, "", Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.MCQ_CHOICE_VALUE, Sanitizer.sanitizeForHtml(choices.get(i))); optionListHtml.append(optionFragment).append(Const.EOL); } if (otherEnabled) { String otherOptionFragmentTemplate = FormTemplates.MCQ_SUBMISSION_FORM_OTHEROPTIONFRAGMENT; String otherOptionFragment = Templates.populateTemplate(otherOptionFragmentTemplate, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.DISABLED, sessionIsOpen ? "" : "disabled", "${text-disabled}", "disabled", Slots.CHECKED, "", Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, "${Const.ParamsNames.FEEDBACK_QUESTION_MCQ_ISOTHEROPTIONANSWER}", Slots.MCQ_CHOICE_VALUE, "", "${mcqOtherOptionAnswer}", "0"); optionListHtml.append(otherOptionFragment).append(Const.EOL); } return Templates.populateTemplate( FormTemplates.MCQ_SUBMISSION_FORM, "${mcqSubmissionFormOptionFragments}", optionListHtml.toString()); }

Target:
public String getQuestionWithoutExistingResponseSubmissionFormHtml( boolean sessionIsOpen, int qnIdx, int responseIdx, String courseId, int totalNumRecipients) { List<String> choices = generateOptionList(courseId); StringBuilder optionListHtml = new StringBuilder(); String optionFragmentTemplate = FormTemplates.MCQ_SUBMISSION_FORM_OPTIONFRAGMENT; for (int i = 0; i < choices.size(); i++) { String optionFragment = Templates.populateTemplate(optionFragmentTemplate, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.CHECKED, "", Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.MCQ_CHOICE_VALUE, Sanitizer.sanitizeForHtml(choices.get(i))); optionListHtml.append(optionFragment).append(Const.EOL); } if (otherEnabled) { String otherOptionFragmentTemplate = FormTemplates.MCQ_SUBMISSION_FORM_OTHEROPTIONFRAGMENT; String otherOptionFragment = Templates.populateTemplate(otherOptionFragmentTemplate, Slots.QUESTION_INDEX, Integer.toString(qnIdx), Slots.RESPONSE_INDEX, Integer.toString(responseIdx), Slots.DISABLED, sessionIsOpen ? "" : "disabled", Slots.TEXT_DISABLED, "disabled", Slots.CHECKED, "", Slots.FEEDBACK_RESPONSE_TEXT, Const.ParamsNames.FEEDBACK_RESPONSE_TEXT, Slots.MCQ_PARAM_IS_OTHER_OPTION_ANSWER, Const.ParamsNames.FEEDBACK_QUESTION_MCQ_ISOTHEROPTIONANSWER, Slots.MCQ_CHOICE_VALUE, "", Slots.MCQ_OTHER_OPTION_ANSWER, "0"); optionListHtml.append(otherOptionFragment).append(Const.EOL); } return Templates.populateTemplate( FormTemplates.MCQ_SUBMISSION_FORM, Slots.MCQ_SUBMISSION_FORM_OPTION_FRAGMENTS, optionListHtml.toString()); }