Skip to content

Commit

Permalink
Merge pull request #2763 from objectcomputing/bug-2762/merit-report-a…
Browse files Browse the repository at this point in the history
…nswers

Do not use sentiment at all.  Always take the answer text.
  • Loading branch information
mkimberlin authored Nov 13, 2024
2 parents 665d0e8 + f0fc674 commit 319e965
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,7 @@ private List<Feedback> getFeedbackType(FeedbackType type) {
feedbackAnswers.add(
new Feedback.Answer(
recipientName, request.getSubmitDate(), questionText,
questionType.equals(textQuestion) ||
questionType.equals(radioQuestion) ?
answer.getAnswer() :
String.valueOf(answer.getSentiment()),
questionType,
questionNumber));
answer.getAnswer(), questionType, questionNumber));
}
}
}
Expand Down
31 changes: 0 additions & 31 deletions web-ui/src/pages/MeritReportPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,6 @@ import { useQueryParameters } from '../helpers/query-parameters';
import markdown from 'markdown-builder';

const MeritReportPage = () => {
const agreeMarks = [
'Strongly Disagree',
'Disagree',
'Neither Agree nor Disagree',
'Agree',
'Strongly Agree'
];
const frequencyMarks = [
'Very Infrequently',
'Infrequently',
'Neither Frequently nor Infrequently',
'Frequently',
'Very Frequently'
];

const { state, dispatch } = useContext(AppContext);

const csrf = selectCsrfToken(state);
Expand Down Expand Up @@ -338,22 +323,6 @@ const MeritReportPage = () => {
};

const getAnswerText = (answer) => {
if (answer.type == "SLIDER" || answer.type == "FREQ") {
const sentiment = parseFloat(answer.answer);
if (!isNaN(sentiment)) {
if (answer.type == "SLIDER") {
const index = sentiment * agreeMarks.length;
if (index >= 0 && index < agreeMarks.length) {
return agreeMarks[index];
}
} else if (answer.type == "FREQ") {
const index = sentiment * frequencyMarks.length;
if (index >= 0 && index < frequencyMarks.length) {
return frequencyMarks[index];
}
}
}
}
return answer.answer;
};

Expand Down

0 comments on commit 319e965

Please sign in to comment.