Skip to content

Commit

Permalink
SAM-3398: Samigo > Published Copy > Scores > Questions Tab > matching…
Browse files Browse the repository at this point in the history
… questions with distractors apply the checkmark to incorrectly matched distractors
  • Loading branch information
plukasew authored and bjones86 committed Apr 23, 2018
1 parent 343c4a8 commit 648dbf4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,9 @@ public class QuestionScoreListener implements ActionListener,
// private static EvaluationListenerUtil util;
private static BeanSort bs;

private static final String noAnswer = (String) ContextUtil
.getLocalizedString(
"org.sakaiproject.tool.assessment.bundle.EvaluationMessages",
"no_answer");

private static final String noneOfTheAbove = (String) ContextUtil
.getLocalizedString(
"org.sakaiproject.tool.assessment.bundle.EvaluationMessages",
"none_above");
private static final String MSG_BUNDLE = "org.sakaiproject.tool.assessment.bundle.EvaluationMessages";
private static final String noAnswer = ContextUtil.getLocalizedString(MSG_BUNDLE, "no_answer");
private static final String noneOfTheAbove = ContextUtil.getLocalizedString(MSG_BUNDLE, "none_above");

/**
* Standard process action method.
Expand All @@ -122,9 +116,7 @@ public void processAction(ActionEvent event)
.lookupBean("questionScores");

// Reset the search field
String defaultSearchString = ContextUtil.getLocalizedString(
"org.sakaiproject.tool.assessment.bundle.EvaluationMessages",
"search_default_student_search_string");
String defaultSearchString = ContextUtil.getLocalizedString(MSG_BUNDLE, "search_default_student_search_string");
bean.setSearchString(defaultSearchString);

// we probably want to change the poster to be consistent
Expand Down Expand Up @@ -632,7 +624,7 @@ else if (bean.getTypeId().equals("14")) {//gopalrc - EMI

if ("4".equals(bean.getTypeId())) {
if (rb == null) {
rb = new ResourceLoader("org.sakaiproject.tool.assessment.bundle.EvaluationMessages");
rb = new ResourceLoader(MSG_BUNDLE);
}
if ("true".equals(answerText)) {
answerText = rb.getString("true_msg");
Expand Down Expand Up @@ -744,8 +736,10 @@ else if ("false".equals(answerText)) {
*/

//SAM-755-"checkmark" indicates right, add "X" to indicate wrong
String checkmarkGif = "<img src='/samigo-app/images/delivery/checkmark.gif'>";
String crossmarkGif = "<img src='/samigo-app/images/crossmark.gif'>";
String correct = ContextUtil.getLocalizedString(MSG_BUNDLE, "alt_correct");
String incorrect = ContextUtil.getLocalizedString(MSG_BUNDLE, "alt_incorrect");
String checkmarkGif = String.format("<span title=\"%s\" class=\"icon-sakai--check feedBackCheck\"></span>", correct);
String crossmarkGif = String.format("<span title=\"%s\" class=\"icon-sakai--delete feedBackCross\"></span>", incorrect);
if (gdataAnswer != null) {
answerText = FormattedText.escapeHtml(answerText, true);
if (bean.getTypeId().equals("8") || bean.getTypeId().equals("11")) {
Expand Down Expand Up @@ -790,8 +784,7 @@ else if (bean.getTypeId().equals("15")) { // CALCULATED_QUESTION
}
else if(!bean.getTypeId().equals("3")){
if((gdataAnswer.getIsCorrect() != null && gdataAnswer.getIsCorrect()) ||
(gdataAnswer.getPartialCredit() != null && gdataAnswer.getPartialCredit() > 0) ||
(delegate.isDistractor(gdataAnswer.getItemText())) ){
(gdataAnswer.getPartialCredit() != null && gdataAnswer.getPartialCredit() > 0)){
answerText = checkmarkGif + answerText;
}else if(gdataAnswer.getIsCorrect() != null && !gdataAnswer.getIsCorrect()){
answerText = crossmarkGif + answerText;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,8 @@ include file for displaying matching questions
<h:outputText value="#{itemText.sequence}#{evaluationMessages.dot} #{itemText.text}" escape="false" />
<h:dataTable value="#{itemText.answerArrayWithDistractorSorted}" var="answer">
<h:column>
<h:graphicImage alt="#{evaluationMessages.alt_correct}" id="image4" rendered="#{answer.isCorrect}"
url="/images/delivery/checkmark.gif" >
</h:graphicImage>
<h:graphicImage id="image5" rendered="#{!answer.isCorrect}"
alt=" " url="/images/crossmark.gif" >
</h:graphicImage>
<h:outputText value="" rendered="#{answer.isCorrect}" title="#{evaluationMessages.alt_correct}" styleClass="icon-sakai--check feedBackCheck" />
<h:outputText value="" rendered="#{!answer.isCorrect}" title="#{evaluationMessages.alt_incorrect}" styleClass="icon-sakai--delete feedBackCross" />
</h:column>
<h:column>
<h:outputText value="#{answer.text}" escape="false" />
Expand Down

0 comments on commit 648dbf4

Please sign in to comment.