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