001: /**********************************************************************************
002: * $URL: $
003: * $Id: $
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.util.ArrayList;
023:
024: import org.sakaiproject.tool.assessment.data.dao.grading.ItemGradingData;
025: import org.sakaiproject.tool.assessment.data.ifc.assessment.AnswerIfc;
026:
027: /**
028: * $Id: $
029: */
030: public class FinBean {
031:
032: private ItemContentsBean parent;
033: private AnswerIfc answer;
034: private ItemGradingData data;
035: private String response;
036: private String text;
037: private boolean isCorrect;
038: private boolean hasInput;
039:
040: public ItemContentsBean getItemContentsBean() {
041: return parent;
042: }
043:
044: public void setItemContentsBean(ItemContentsBean bean) {
045: parent = bean;
046: }
047:
048: public AnswerIfc getAnswer() {
049: return answer;
050: }
051:
052: public void setAnswer(AnswerIfc newanswer) {
053: answer = newanswer;
054: }
055:
056: public ItemGradingData getItemGradingData() {
057: return data;
058: }
059:
060: public void setItemGradingData(ItemGradingData newdata) {
061: data = newdata;
062: }
063:
064: public String getResponse() {
065: if (response == null)
066: return "";
067: return response;
068: }
069:
070: public void setResponse(String newresp) {
071: response = newresp;
072: if (data == null) {
073: data = new ItemGradingData();
074: data.setPublishedItemId(parent.getItemData().getItemId());
075: data.setPublishedItemTextId(answer.getItemText().getId());
076: data.setPublishedAnswerId(answer.getId());
077: ArrayList items = parent.getItemGradingDataArray();
078: items.add(data);
079: parent.setItemGradingDataArray(items);
080: }
081: data.setAnswerText(newresp);
082: }
083:
084: public String getText() {
085: return text;
086: }
087:
088: public void setText(String newtext) {
089: text = newtext;
090: }
091:
092: public boolean getIsCorrect() {
093: return isCorrect;
094: }
095:
096: public void setIsCorrect(boolean newb) {
097: isCorrect = newb;
098: }
099:
100: public boolean getHasInput() {
101: return hasInput;
102: }
103:
104: public void setHasInput(boolean newin) {
105: hasInput = newin;
106: }
107: }
|