Skip to content

Commit

Permalink
Fix style guide violation
Browse files Browse the repository at this point in the history
  • Loading branch information
Haozhe321 committed Mar 30, 2018
1 parent f94bb5d commit b4e3dcf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public boolean extractQuestionDetails(

setMsqQuestionDetails(numOfMsqChoices, msqChoices, msqOtherEnabled);
} else {
String courseId = HttpRequestHelper.getValueFromParamMap(requestParameters, Const.ParamsNames.COURSE_ID);
setMsqQuestionDetails(FeedbackParticipantType.valueOf(generatedMsqOptions), courseId);
setMsqQuestionDetails(FeedbackParticipantType.valueOf(generatedMsqOptions));
}
return true;
}
Expand All @@ -117,7 +116,7 @@ private void setMsqQuestionDetails(int numOfMsqChoices, List<String> msqChoices,
this.generateOptionsFor = FeedbackParticipantType.NONE;
}

private void setMsqQuestionDetails(FeedbackParticipantType generateOptionsFor, String courseId) {
private void setMsqQuestionDetails(FeedbackParticipantType generateOptionsFor) {
this.msqChoices = new ArrayList<>();
this.otherEnabled = false;
this.generateOptionsFor = generateOptionsFor;
Expand Down Expand Up @@ -335,16 +334,16 @@ public String getQuestionWithoutExistingResponseSubmissionFormHtml(
}

private int numOfChoicesForMsq(String courseId, FeedbackParticipantType generatedOption) {
if(generatedOption == FeedbackParticipantType.NONE) {
if (generatedOption == FeedbackParticipantType.NONE) {
return msqChoices.size();
} else if (generatedOption == FeedbackParticipantType.STUDENTS ||
generatedOption == FeedbackParticipantType.STUDENTS_EXCLUDING_SELF) {
} else if (generatedOption == FeedbackParticipantType.STUDENTS
|| generatedOption == FeedbackParticipantType.STUDENTS_EXCLUDING_SELF) {
List<StudentAttributes> studentList = StudentsLogic.inst().getStudentsForCourse(courseId);
int sizeOfStudentlist = studentList.size();

return generatedOption == FeedbackParticipantType.STUDENTS ? sizeOfStudentlist : sizeOfStudentlist - 1;
} else if (generatedOption == FeedbackParticipantType.TEAMS ||
generatedOption == FeedbackParticipantType.TEAMS_EXCLUDING_SELF) {
} else if (generatedOption == FeedbackParticipantType.TEAMS
|| generatedOption == FeedbackParticipantType.TEAMS_EXCLUDING_SELF) {
try {
List<TeamDetailsBundle> teamList = CoursesLogic.inst().getTeamsForCourse(courseId);
int sizeOfTeamlist = teamList.size();
Expand All @@ -355,9 +354,8 @@ private int numOfChoicesForMsq(String courseId, FeedbackParticipantType generate
}
} else {
List<InstructorAttributes> instructorList = InstructorsLogic.inst().getInstructorsForCourse(courseId);
int sizeOfInstructorlist = instructorList.size();

return sizeOfInstructorlist;
return instructorList.size();
}
return 0;
}
Expand Down Expand Up @@ -500,9 +498,9 @@ public String getQuestionAdditionalInfoHtml(int questionNumber, String additiona
"<br>The options for this question is automatically generated from the list of all %s in this course.",
generateOptionsFor.toString().toLowerCase());
optionListHtml.append(optionHelpText);
}else if (!msqChoices.isEmpty()) {
} else if (!msqChoices.isEmpty()) {
optionListHtml.append("<ul style=\"list-style-type: disc;margin-left: 20px;\" >");
for (String msqChoice : msqChoices){
for (String msqChoice : msqChoices) {
String optionFragment =
Templates.populateTemplate(optionFragmentTemplate,
Slots.MSQ_CHOICE_VALUE, SanitizationHelper.sanitizeForHtml(msqChoice));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public boolean isIndividualResponsesShownToStudents() {

/**
* Validates the question details.
* @param courseId
* @param courseId courseId of the question
* @return A {@code List<String>} of error messages (to show as status message to user) if any, or an
* empty list if question details are valid.
*/
Expand Down

0 comments on commit b4e3dcf

Please sign in to comment.