From 782f0bd8f6dddf65f29b3290ce17c084ff1418de Mon Sep 17 00:00:00 2001 From: Earle Nietzel Date: Mon, 17 Oct 2022 10:31:00 -0400 Subject: [PATCH] Revert "SAK-47629 samigo: Add incorrect answer filter to student feedback (#10770)" This reverts commit e1eea0f5ba1e3f35edf48dd616e22b09e1ca4e27. --- .../ifc/assessment/AssessmentFeedbackIfc.java | 6 - .../bundle/DeliveryMessages.properties | 2 - .../bundle/TemplateMessages.properties | 3 +- .../bean/author/AssessmentSettingsBean.java | 13 -- .../PublishedAssessmentSettingsBean.java | 13 -- .../ui/bean/delivery/DeliveryBean.java | 2 - .../ui/bean/delivery/DeliveryBeanie.java | 1 - .../ui/bean/delivery/FeedbackComponent.java | 5 - .../author/SaveAssessmentSettings.java | 5 - .../author/SavePublishedSettingsListener.java | 4 - .../delivery/BeginDeliveryActionListener.java | 4 +- .../delivery/DeliveryActionListener.java | 144 ++++++++---------- .../listener/select/SelectActionListener.java | 16 -- .../src/webapp/jsf/author/authorSettings.jsp | 7 +- .../webapp/jsf/author/publishedSettings.jsp | 7 +- .../webapp/jsf/delivery/deliverAssessment.jsp | 6 - .../dao/assessment/AssessmentBase.hbm.xml | 1 - .../dao/assessment/AssessmentFeedback.java | 17 +-- .../assessment/PublishedAssessment.hbm.xml | 1 - .../assessment/PublishedAssessmentData.java | 20 ++- .../dao/assessment/PublishedFeedback.java | 31 ++-- .../facade/AssessmentFacadeQueries.java | 2 +- .../facade/PublishedAssessmentFacade.java | 34 ++--- .../PublishedAssessmentFacadeQueries.java | 13 +- .../assessment/services/GradingService.java | 42 +++-- 25 files changed, 127 insertions(+), 272 deletions(-) diff --git a/samigo/samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentFeedbackIfc.java b/samigo/samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentFeedbackIfc.java index ed550c550778..752705fb1658 100644 --- a/samigo/samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentFeedbackIfc.java +++ b/samigo/samigo-api/src/java/org/sakaiproject/tool/assessment/data/ifc/assessment/AssessmentFeedbackIfc.java @@ -37,8 +37,6 @@ public interface AssessmentFeedbackIfc public static final Integer BOTH_FEEDBACK = 3; public static final Integer SELECT_COMPONENTS = 2; // select feedback components public static final Integer SHOW_TOTALSCORE_ONLY = 1; // select feedback components - public static final Integer ALL_QUESTIONS = 1; // select all question - public static final Integer INCORRECT_QUESTIONS = 2; // select only incorrect questions Long getId(); @@ -100,8 +98,4 @@ public interface AssessmentFeedbackIfc void setFeedbackComponentOption(Integer feedbackComponentOption); - Integer getCorrectAnswerOption(); - - void setCorrectAnswerOption(Integer correctAnswerOption); - } diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/DeliveryMessages.properties b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/DeliveryMessages.properties index fb6ed655c04c..496348bcb3f6 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/DeliveryMessages.properties +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/DeliveryMessages.properties @@ -193,8 +193,6 @@ objective=Objective: one_per=(one per line) only=Only only_next= There are only NEXT buttons only to go forward. -only_showing_incorrect=Feedback is configured to only show incorrect responses. This means you won't see items \ -that you have answered correctly. org=Organization p=Part p_information=Part Information: diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/TemplateMessages.properties b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/TemplateMessages.properties index d2e091d2a108..2306b9a2af18 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/TemplateMessages.properties +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/bundle/TemplateMessages.properties @@ -178,7 +178,6 @@ alt_sortLastModifiedDescending=Sort by Last Modified in Descending feedback_components_select=Display questions and additional feedback (options expand when selected) feedback_components_totalscore_only=Only display the student's total score (questions not shown) -feedback_components_all_questions=All questions -feedback_components_incorrect_questions_only=Only incorrect questions locked_browser=Require Locked Browser + diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AssessmentSettingsBean.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AssessmentSettingsBean.java index c2ff09848d57..4af28a269001 100644 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AssessmentSettingsBean.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/AssessmentSettingsBean.java @@ -173,7 +173,6 @@ public class AssessmentSettingsBean extends SpringBeanAutowiringSupport implemen // properties of AssesmentFeedback private String feedbackDelivery; // immediate, on specific date , no feedback private String feedbackComponentOption; // 2 = select options, 1 = total scores only - private String correctAnswerOption; //private String editComponents; // 0 = cannot private boolean showQuestionText = true; @@ -408,10 +407,6 @@ public void setAssessment(AssessmentFacade assessment) { if (feedback.getFeedbackComponentOption()!=null) this.feedbackComponentOption = feedback.getFeedbackComponentOption().toString(); - if (feedback.getCorrectAnswerOption() != null) { - this.correctAnswerOption = feedback.getCorrectAnswerOption().toString(); - } - if (feedback.getFeedbackAuthoring()!=null) this.feedbackAuthoring = feedback.getFeedbackAuthoring().toString(); @@ -880,14 +875,6 @@ public String getFeedbackComponentOption() { public void setFeedbackComponentOption(String feedbackComponentOption) { this.feedbackComponentOption = feedbackComponentOption; } - - public String getCorrectAnswerOption() { - return this.correctAnswerOption; - } - - public void setCorrectAnswerOption(String correctAnswerOption) { - this.correctAnswerOption = correctAnswerOption; - } public boolean getShowQuestionText() { return showQuestionText; diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/PublishedAssessmentSettingsBean.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/PublishedAssessmentSettingsBean.java index 110de885486e..fab22c653c82 100644 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/PublishedAssessmentSettingsBean.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/author/PublishedAssessmentSettingsBean.java @@ -174,7 +174,6 @@ public class PublishedAssessmentSettingsBean extends SpringBeanAutowiringSupport // properties of PublishedFeedback private String feedbackDelivery; // immediate, on specific date , no feedback private String feedbackComponentOption; // 2 = select options, 1 = total scores only - private String correctAnswerOption; private String feedbackAuthoring; private boolean showQuestionText = false; private boolean showStudentResponse = false; @@ -384,10 +383,6 @@ public void setAssessment(PublishedAssessmentFacade assessment) { if (feedback.getFeedbackComponentOption()!=null) this.feedbackComponentOption = feedback.getFeedbackComponentOption().toString(); - if (feedback.getCorrectAnswerOption() != null) { - this.correctAnswerOption = feedback.getCorrectAnswerOption().toString(); - } - if (feedback.getFeedbackAuthoring()!=null) this.feedbackAuthoring = feedback.getFeedbackAuthoring().toString(); @@ -829,14 +824,6 @@ public void setFeedbackComponentOption(String feedbackComponentOption) { this.feedbackComponentOption = feedbackComponentOption; } - public String getCorrectAnswerOption() { - return this.correctAnswerOption; - } - - public void setCorrectAnswerOption(String correctAnswerOption) { - this.correctAnswerOption = correctAnswerOption; - } - public String getFeedbackAuthoring() { return feedbackAuthoring; } diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java index 65d7f5c605b1..6c4b9c250b30 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBean.java @@ -211,8 +211,6 @@ public class DeliveryBean implements Serializable { @Getter @Setter private String feedbackComponentOption; @Getter @Setter - private boolean onlyShowingIncorrect = false; - @Getter @Setter private boolean feedbackOnDate; @Getter @Setter private String errorMessage; diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBeanie.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBeanie.java index c49c8e79b301..4a086f3b2ce2 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBeanie.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/DeliveryBeanie.java @@ -66,7 +66,6 @@ public class DeliveryBeanie @Getter @Setter private Double feedbackScoreThreshold; private String feedbackDelivery; private String feedbackComponentOption; - @Getter @Setter private String correctAnswerOption; private String showScore; private String submissionHours; private String submissionMinutes; diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/FeedbackComponent.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/FeedbackComponent.java index eee628f0fab6..289e140af177 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/FeedbackComponent.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/FeedbackComponent.java @@ -24,8 +24,6 @@ package org.sakaiproject.tool.assessment.ui.bean.delivery; import java.io.Serializable; -import lombok.Getter; - import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentFeedbackIfc; /** @@ -51,7 +49,6 @@ public class FeedbackComponent implements Serializable private boolean showStudentQuestionScore; private boolean showDateFeedback; private boolean showNoFeedback; - @Getter private Integer correctAnswerOption; /** * @@ -286,8 +283,6 @@ public void setAssessmentFeedback(AssessmentFeedbackIfc feedback){ setShowImmediate(AssessmentFeedbackIfc.IMMEDIATE_FEEDBACK.equals(feedbackDelivery)); setShowOnSubmission(AssessmentFeedbackIfc.FEEDBACK_ON_SUBMISSION.equals(feedbackDelivery)); setShowNoFeedback(AssessmentFeedbackIfc.NO_FEEDBACK.equals(feedbackDelivery)); - - this.correctAnswerOption = feedback.getCorrectAnswerOption(); } } diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SaveAssessmentSettings.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SaveAssessmentSettings.java index 881e89551966..a7f4cbbb5373 100644 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SaveAssessmentSettings.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SaveAssessmentSettings.java @@ -231,11 +231,6 @@ public AssessmentFacade save(AssessmentSettingsBean assessmentSettings, boolean feedback.setFeedbackDelivery(new Integer(assessmentSettings.getFeedbackDelivery())); if (StringUtils.isNotBlank(assessmentSettings.getFeedbackComponentOption())) feedback.setFeedbackComponentOption(new Integer(assessmentSettings.getFeedbackComponentOption())); - - if (StringUtils.isNotBlank(assessmentSettings.getCorrectAnswerOption())) { - feedback.setCorrectAnswerOption(new Integer(assessmentSettings.getCorrectAnswerOption())); - } - if (assessmentSettings.getFeedbackAuthoring()!=null) feedback.setFeedbackAuthoring(new Integer(assessmentSettings.getFeedbackAuthoring())); // if 'No feedback' (it corresponds to value 3) is selected, diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SavePublishedSettingsListener.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SavePublishedSettingsListener.java index 38f7ba63ccee..db5dcd9037f6 100644 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SavePublishedSettingsListener.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/author/SavePublishedSettingsListener.java @@ -652,10 +652,6 @@ else if ("".equals(assessmentSettings.getRetractDateString())) { if (StringUtils.isNotBlank(assessmentSettings.getFeedbackComponentOption())) feedback.setFeedbackComponentOption(new Integer(assessmentSettings.getFeedbackComponentOption())); - if (StringUtils.isNotBlank(assessmentSettings.getCorrectAnswerOption())) { - feedback.setCorrectAnswerOption(new Integer(assessmentSettings.getCorrectAnswerOption())); - } - control.setFeedbackDate(assessmentSettings.getFeedbackDate()); control.setFeedbackEndDate(assessmentSettings.getFeedbackEndDate()); //Set the value if the checkbox is selected, wipe the value otherwise. diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/BeginDeliveryActionListener.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/BeginDeliveryActionListener.java index b024d8466f1d..532690c620e5 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/BeginDeliveryActionListener.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/BeginDeliveryActionListener.java @@ -228,7 +228,7 @@ public void populateBeanFromPub(DeliveryBean delivery, else { delivery.setFeedbackComponentOption("1"); } - + // important: set feedbackOnDate last Date currentDate = new Date(); if (component.getShowDateFeedback()) { @@ -254,7 +254,7 @@ private FeedbackComponent populateFeedbackComponent(PublishedAssessmentFacade pu { FeedbackComponent component = new FeedbackComponent(); AssessmentFeedbackIfc info = pubAssessment.getAssessmentFeedback(); - if (info != null) { + if ( info != null) { component.setAssessmentFeedback(info); } return component; diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java index 658a628a043c..a8ebbb03d938 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/delivery/DeliveryActionListener.java @@ -30,14 +30,12 @@ import java.util.Comparator; import java.util.Date; import java.util.HashMap; -import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Random; import java.util.ResourceBundle; import java.util.Set; -import java.util.stream.Collectors; import javax.faces.context.FacesContext; import javax.faces.event.AbortProcessingException; @@ -246,74 +244,73 @@ public void processAction(ActionEvent ae) throws break; case 3: // Review assessment - setFeedbackMode(delivery); //this determine if we should gather the itemGrading - Integer scoringoption = publishedAssessment.getEvaluationModel().getScoringType(); - String assessmentGradingId = ContextUtil.lookupParam("assessmentGradingId"); + setFeedbackMode(delivery); //this determine if we should gather the itemGrading + Integer scoringoption = publishedAssessment.getEvaluationModel().getScoringType(); + String assessmentGradingId = ContextUtil.lookupParam("assessmentGradingId"); - if (("true").equals(delivery.getFeedback())) { + if (("true").equals(delivery.getFeedback())){ itemGradingHash = new HashMap(); - if (delivery.getFeedbackComponent().getShowResponse() - || delivery.getFeedbackComponent().getShowStudentQuestionScore() - ||delivery.getFeedbackComponent().getShowItemLevel()) { - + if (delivery.getFeedbackComponent().getShowResponse() || delivery.getFeedbackComponent().getShowStudentQuestionScore() || + delivery.getFeedbackComponent().getShowItemLevel()) itemGradingHash = service.getSubmitData(id, agent, scoringoption, assessmentGradingId); - } ag = setAssessmentGradingFromItemData(delivery, itemGradingHash, false); delivery.setAssessmentGrading(ag); } - setDisplayByAssessment(delivery); - FeedbackComponent component = new FeedbackComponent(); - AssessmentFeedbackIfc info = (AssessmentFeedbackIfc) publishedAssessment.getAssessmentFeedback(); - if ( info != null) { - component.setAssessmentFeedback(info); - } - delivery.setFeedbackComponent(component); - AssessmentGradingData agData = null; - if (EvaluationModelIfc.LAST_SCORE.equals(scoringoption)){ - agData = (AssessmentGradingData) service.getLastSubmittedAssessmentGradingByAgentId(id, agent, assessmentGradingId); - } else { - agData = (AssessmentGradingData) service.getHighestSubmittedAssessmentGrading(id, agent, assessmentGradingId); - } - if (agData == null) { - delivery.setOutcome("reviewAssessmentError"); - return; - } - - //agData.setItemGradingSet(agData.getItemGradingSet().stream().filter(gd -> !gd.getIsCorrect()).collect(Collectors.toSet())); - log.debug("GraderComments: getComments()" + agData.getComments()); - delivery.setGraderComment(agData.getComments()); - delivery.setAssessmentGradingAttachmentList(agData.getAssessmentGradingAttachmentList()); - delivery.setHasAssessmentGradingAttachment( - agData.getAssessmentGradingAttachmentList() != null && agData.getAssessmentGradingAttachmentList().size() > 0); - delivery.setAssessmentGradingId(agData.getAssessmentGradingId()); - delivery.setOutcome("takeAssessment"); - delivery.setSecureDeliveryHTMLFragment( "" ); - delivery.setBlockDelivery( false ); - - if ( secureDelivery.isSecureDeliveryAvaliable() ) { - String moduleId = publishedAssessment.getAssessmentMetaDataByLabel( SecureDeliveryServiceAPI.MODULE_KEY ); - if ( moduleId != null && ! SecureDeliveryServiceAPI.NONE_ID.equals( moduleId ) ) { - HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); - PhaseStatus status = secureDelivery.validatePhase(moduleId, Phase.ASSESSMENT_REVIEW, publishedAssessment, request ); - delivery.setSecureDeliveryHTMLFragment( - secureDelivery.getHTMLFragment(moduleId, publishedAssessment, request, Phase.ASSESSMENT_REVIEW, status, new ResourceLoader().getLocale() ) ); - if ( PhaseStatus.FAILURE == status ) { - delivery.setOutcome( "secureDeliveryError" ); - delivery.setBlockDelivery( true ); - } + setDisplayByAssessment(delivery); + //setDeliveryFeedbackOnforEvaluation(delivery); + //setGraderComment(delivery); + FeedbackComponent component = new FeedbackComponent(); + AssessmentFeedbackIfc info = (AssessmentFeedbackIfc) publishedAssessment.getAssessmentFeedback(); + if ( info != null) { + component.setAssessmentFeedback(info); + } + delivery.setFeedbackComponent(component); + AssessmentGradingData agData = null; + if (EvaluationModelIfc.LAST_SCORE.equals(scoringoption)){ + agData = (AssessmentGradingData) service.getLastSubmittedAssessmentGradingByAgentId(id, agent, assessmentGradingId); + } else { + agData = (AssessmentGradingData) service.getHighestSubmittedAssessmentGrading(id, agent, assessmentGradingId); + } + if (agData == null) { + delivery.setOutcome("reviewAssessmentError"); + return; + } + log.debug("GraderComments: getComments()" + agData.getComments()); + delivery.setGraderComment(agData.getComments()); + delivery.setAssessmentGradingAttachmentList(agData.getAssessmentGradingAttachmentList()); + delivery.setHasAssessmentGradingAttachment( + agData.getAssessmentGradingAttachmentList() != null && agData.getAssessmentGradingAttachmentList().size() > 0); + delivery.setAssessmentGradingId(agData.getAssessmentGradingId()); + delivery.setOutcome("takeAssessment"); + delivery.setSecureDeliveryHTMLFragment( "" ); + delivery.setBlockDelivery( false ); + + if ( secureDelivery.isSecureDeliveryAvaliable() ) { + + String moduleId = publishedAssessment.getAssessmentMetaDataByLabel( SecureDeliveryServiceAPI.MODULE_KEY ); + if ( moduleId != null && ! SecureDeliveryServiceAPI.NONE_ID.equals( moduleId ) ) { + + HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest(); + PhaseStatus status = secureDelivery.validatePhase(moduleId, Phase.ASSESSMENT_REVIEW, publishedAssessment, request ); + delivery.setSecureDeliveryHTMLFragment( + secureDelivery.getHTMLFragment(moduleId, publishedAssessment, request, Phase.ASSESSMENT_REVIEW, status, new ResourceLoader().getLocale() ) ); + if ( PhaseStatus.FAILURE == status ) { + delivery.setOutcome( "secureDeliveryError" ); + delivery.setBlockDelivery( true ); + } + } } - } - generateSecureTokenForAssessment(delivery); + generateSecureTokenForAssessment(delivery); - // post event - eventRef = new StringBuffer("publishedAssessmentId="); - eventRef.append(delivery.getAssessmentId()); - eventRef.append(", submissionId="); - eventRef.append(agData.getAssessmentGradingId()); - event = eventTrackingService.newEvent(SamigoConstants.EVENT_ASSESSMENT_REVIEW, eventRef.toString(), true); - eventTrackingService.post(event); - break; + // post event + eventRef = new StringBuffer("publishedAssessmentId="); + eventRef.append(delivery.getAssessmentId()); + eventRef.append(", submissionId="); + eventRef.append(agData.getAssessmentGradingId()); + event = eventTrackingService.newEvent(SamigoConstants.EVENT_ASSESSMENT_REVIEW, eventRef.toString(), true); + eventTrackingService.post(event); + break; case 4: // Grade assessment String gradingData = ContextUtil.lookupParam("gradingData"); @@ -840,20 +837,14 @@ private ContentsDeliveryBean getPageContentsByAssessment( SectionContentsBean partBean = getPartBean( (SectionDataIfc) iter.next(), itemGradingHash, delivery, publishedAnswerHash); - - // If we are in review mode and only show incorrect responses is checked in the - // assignment settings, there may well be no parts added. If so, we want to skip - // the empty section but still do the max score calculations. - if (partBean.getItemContents().size() > 0) { - partBean.setNumParts(Integer.toString(partSet.size())); - if (partBean.getItemContentsSize().equals("0")) { - log.debug("getPageContentsByAssessment(): no question"); - partBean.setNoQuestions(true); - } - partsContents.add(partBean); + partBean.setNumParts(Integer.toString(partSet.size())); + if (partBean.getItemContentsSize().equals("0")) { + log.debug("getPageContentsByAssessment(): no question"); + partBean.setNoQuestions(true); } currentScore += partBean.getPoints(); maxScore += partBean.getMaxPoints(); + partsContents.add(partBean); } delivery.setPrevious(false); @@ -1083,14 +1074,7 @@ private SectionContentsBean getPartBean(SectionDataIfc part, Map itemGradingHash { unansweredQuestions++; } - - Integer correctAnswerOption = delivery.getFeedbackComponent().getCorrectAnswerOption(); - delivery.setOnlyShowingIncorrect(correctAnswerOption == AssessmentFeedbackIfc.INCORRECT_QUESTIONS); - if (delivery.getActionMode() != DeliveryBean.REVIEW_ASSESSMENT) { - itemContents.add(itemBean); - } else if (correctAnswerOption == AssessmentFeedbackIfc.ALL_QUESTIONS || itemBean.getItemGradingDataArray().stream().anyMatch(gd -> gd.getIsCorrect() == null || !gd.getIsCorrect())) { - itemContents.add(itemBean); - } + itemContents.add(itemBean); } // scoring information diff --git a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java index 2f273e95afb7..3a27afafba48 100755 --- a/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java +++ b/samigo/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/listener/select/SelectActionListener.java @@ -255,8 +255,6 @@ else if (submissionAllowed > 1) { publishedAssessmentHash)); delivery.setFeedbackComponentOption(getFeedbackComponentOption(g.getPublishedAssessmentId(), publishedAssessmentHash)); - delivery.setCorrectAnswerOption(getCorrectAnswerOption(g.getPublishedAssessmentId(), - publishedAssessmentHash)); delivery.setFeedbackDate(getFeedbackDate(g.getPublishedAssessmentId(), publishedAssessmentHash)); delivery.setFeedbackEndDate(getFeedbackEndDate(g.getPublishedAssessmentId(), @@ -837,20 +835,6 @@ private String getFeedbackComponentOption(Long publishedAssessmentId, Map publis } else return null; } - - private String getCorrectAnswerOption(Long publishedAssessmentId, Map publishedAssessmentHash){ - PublishedAssessmentFacade p = (PublishedAssessmentFacade)publishedAssessmentHash.get(publishedAssessmentId); - if (p!=null) { - Integer option = p.getCorrectAnswerOption(); - if (option == null) { - return null; - } else { - return option.toString(); - } - } else { - return null; - } - } private boolean getHasAssessmentBeenModified(SelectAssessmentBean select, AssessmentGradingData g, Map publishedAssessmentHash){ PublishedAssessmentFacade p = (PublishedAssessmentFacade)publishedAssessmentHash. diff --git a/samigo/samigo-app/src/webapp/jsf/author/authorSettings.jsp b/samigo/samigo-app/src/webapp/jsf/author/authorSettings.jsp index 6777a18f8db5..d92be81d1de4 100755 --- a/samigo/samigo-app/src/webapp/jsf/author/authorSettings.jsp +++ b/samigo/samigo-app/src/webapp/jsf/author/authorSettings.jsp @@ -629,11 +629,8 @@