001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/tags/sakai_2-4-1/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/delivery/FeedbackComponent.java $
003: * $Id: FeedbackComponent.java 12885 2006-07-25 21:10:20Z lydial@stanford.edu $
004: ***********************************************************************************
005: *
006: * Copyright (c) 2004, 2005, 2006 The Sakai Foundation.
007: *
008: * Licensed under the Educational Community License, Version 1.0 (the"License");
009: * you may not use this file except in compliance with the License.
010: * You may obtain a copy of the License at
011: *
012: * http://www.opensource.org/licenses/ecl1.php
013: *
014: * Unless required by applicable law or agreed to in writing, software
015: * distributed under the License is distributed on an "AS IS" BASIS,
016: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017: * See the License for the specific language governing permissions and
018: * limitations under the License.
019: *
020: **********************************************************************************/package org.sakaiproject.tool.assessment.ui.bean.delivery;
021:
022: import java.io.Serializable;
023:
024: import org.sakaiproject.tool.assessment.data.ifc.assessment.AssessmentFeedbackIfc;
025:
026: /**
027: * @author casong
028: * @author esmiley@stanford.edu
029: * $Id: FeedbackComponent.java 12885 2006-07-25 21:10:20Z lydial@stanford.edu $
030: */
031: public class FeedbackComponent implements Serializable {
032: /** Use serialVersionUID for interoperability. */
033: private final static long serialVersionUID = -1090852048737428722L;
034:
035: private boolean showCorrectResponse;
036: private boolean showGraderComment;
037: private boolean showItemLevel;
038: private boolean showQuestion;
039: private boolean showResponse;
040: private boolean showSelectionLevel;
041: private boolean showStats;
042: private boolean showImmediate;
043: private boolean showStudentScore;
044: private boolean showStudentQuestionScore;
045: private boolean showDateFeedback;
046: private boolean showNoFeedback;
047:
048: /**
049: *
050: * @return true if it is correct
051: */
052: public boolean getShowCorrectResponse() {
053: return showCorrectResponse;
054: }
055:
056: /**
057: *
058: * @return
059: */
060: public boolean getShowStudentScore() {
061: return this .showStudentScore;
062: }
063:
064: /**
065: *
066: * @return
067: */
068: public boolean getShowStudentQuestionScore() {
069: return this .showStudentQuestionScore;
070: }
071:
072: /**
073: * If feedback is displayed on the item level.
074: * @return if feedback is displayed on the item level.
075: */
076: public boolean getShowItemLevel() {
077: return this .showItemLevel;
078: }
079:
080: /**
081: * If feedback is displayed on the selection level.
082: * @return if feedback is displayed on the selection level.
083: */
084: public boolean getShowSelectionLevel() {
085: return this .showSelectionLevel;
086: }
087:
088: /**
089: * If feedback is displayed on the comment level.
090: * @return
091: */
092: public boolean getShowGraderComment() {
093: return this .showGraderComment;
094: }
095:
096: /**
097: * If statistics are shown to student.
098: * @return
099: */
100: public boolean getShowStats() {
101: return this .showStats;
102: }
103:
104: /**
105: * If informaton is displayed on the question.
106: * @return if information is displayed on the question.
107: */
108: public boolean getShowQuestion() {
109: return this .showQuestion;
110: }
111:
112: /**
113: * If response is displayed.
114: * @return if response is displayed
115: */
116: public boolean getShowResponse() {
117: return this .showResponse;
118: }
119:
120: /**
121: * If feedback is displayed on the immediate level.
122: * @return true if feedback is displayed on immediately.
123: */
124: public boolean getShowImmediate() {
125: return showImmediate;
126: }
127:
128: /**
129: * If feedback is displayed on the immediate level.
130: * @param showImmediate if feedback is displayed on immediately.
131: */
132: public void setShowImmediate(boolean showImmediate) {
133: this .showImmediate = showImmediate;
134: }
135:
136: /**
137: * If feedback is displayed on date.
138: * @return if feedback is displayed on the date level.
139: */
140: public boolean getShowDateFeedback() {
141: return showDateFeedback;
142: }
143:
144: /**
145: * If feedback is displayed on the date level.
146: * @param showDateFeedback if feedback is displayed on the date level.
147: */
148: public void setShowDateFeedback(boolean showDateFeedback) {
149: this .showDateFeedback = showDateFeedback;
150: }
151:
152: /**
153: * If feedback is displayed on NO level.
154: * @return true if NO feedback is displayed.
155: */
156: public boolean getShowNoFeedback() {
157: return showNoFeedback;
158: }
159:
160: /**
161: * If feedback is displayed on NO level.
162: * @param showNoFeedback NO feedback is displayed?
163: */
164: public void setShowNoFeedback(boolean showNoFeedback) {
165: this .showNoFeedback = showNoFeedback;
166: }
167:
168: /**
169: * If correct answer is displayed.
170: * @param showCorrectResponse If correct answer is displayed.
171: */
172: public void setShowCorrectResponse(boolean showCorrectResponse) {
173: this .showCorrectResponse = showCorrectResponse;
174: }
175:
176: /**
177: * Show comments from grader?
178: * @param showGraderComment
179: */
180: public void setShowGraderComment(boolean showGraderComment) {
181: this .showGraderComment = showGraderComment;
182: }
183:
184: /**
185: * If feedback is displayed on the item level.
186: * @param showItemLevel
187: */
188: public void setShowItemLevel(boolean showItemLevel) {
189: this .showItemLevel = showItemLevel;
190: }
191:
192: /**
193: * Show question?
194: * @param showQuestion
195: */
196: public void setShowQuestion(boolean showQuestion) {
197: this .showQuestion = showQuestion;
198: }
199:
200: /**
201: * Show response?
202: * @param showResponse
203: */
204: public void setShowResponse(boolean showResponse) {
205: this .showResponse = showResponse;
206: }
207:
208: /**
209: * If feedback is displayed on the selection level.
210: * @param showSelectionLevel
211: */
212: public void setShowSelectionLevel(boolean showSelectionLevel) {
213: this .showSelectionLevel = showSelectionLevel;
214: }
215:
216: /**
217: * Show statistics?
218: * @param showStats
219: */
220: public void setShowStats(boolean showStats) {
221: this .showStats = showStats;
222: }
223:
224: /**
225: * Show score?
226: * @param showStudentScore
227: */
228: public void setShowStudentScore(boolean showStudentScore) {
229: this .showStudentScore = showStudentScore;
230: }
231:
232: /**
233: * Show Question score?
234: * @param showStudentQuestionScore
235: */
236: public void setShowStudentQuestionScore(
237: boolean showStudentQuestionScore) {
238: this .showStudentQuestionScore = showStudentQuestionScore;
239: }
240:
241: public void setAssessmentFeedback(AssessmentFeedbackIfc feedback) {
242: setShowCorrectResponse(feedback.getShowCorrectResponse()
243: .booleanValue());
244: setShowGraderComment(feedback.getShowGraderComments()
245: .booleanValue());
246: setShowItemLevel(feedback.getShowQuestionLevelFeedback()
247: .booleanValue());
248: setShowQuestion(feedback.getShowQuestionText().booleanValue());
249: setShowResponse(feedback.getShowStudentResponse()
250: .booleanValue());
251: setShowSelectionLevel(feedback.getShowSelectionLevelFeedback()
252: .booleanValue());
253: setShowStats(feedback.getShowStatistics().booleanValue());
254: setShowStudentScore(feedback.getShowStudentScore()
255: .booleanValue());
256: if (feedback.getShowStudentQuestionScore() != null)
257: setShowStudentQuestionScore(feedback
258: .getShowStudentQuestionScore().booleanValue());
259: else
260: setShowStudentQuestionScore(false);
261: Integer feedbackDelivery = feedback.getFeedbackDelivery();
262: setShowDateFeedback(AssessmentFeedbackIfc.FEEDBACK_BY_DATE
263: .equals(feedbackDelivery));
264: setShowImmediate(AssessmentFeedbackIfc.IMMEDIATE_FEEDBACK
265: .equals(feedbackDelivery));
266: setShowNoFeedback(AssessmentFeedbackIfc.NO_FEEDBACK
267: .equals(feedbackDelivery));
268: }
269:
270: }
|