001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/tags/sakai_2-4-1/samigo-app/src/java/org/sakaiproject/tool/assessment/ui/bean/evaluation/PartData.java $
003: * $Id: PartData.java 22199 2007-03-05 22:02:40Z ktsao@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.evaluation;
021:
022: import java.io.Serializable;
023: import java.util.ArrayList;
024:
025: import org.sakaiproject.tool.assessment.ui.bean.util.Validator;
026:
027: /**
028: *
029: * <p>Description: Helper bean for QuestionScoresBean getPartList.</p><p>
030: * Note: All part and question numbers are strings for maximum flexibility.</p>
031: * <p>Copyright: Copyright (c) 2004 Sakai Project</p>
032: * <p> </p>
033: * @author Ed Smiley
034: * @version $Id: PartData.java 22199 2007-03-05 22:02:40Z ktsao@stanford.edu $
035: */
036: public class PartData implements Serializable {
037: /**
038: *
039: */
040: private static final long serialVersionUID = -6113822805534954287L;
041: private ArrayList questionNumberList;
042: private String partNumber;
043: private String id;
044: private boolean linked;
045: private boolean isRandomDrawPart;
046: private int numberQuestionsDraw;
047: private int numberQuestionsTotal;
048: private boolean noQuestions;
049:
050: /**
051: * Returns a list of the question numbers as Strings.
052: * @return ArrayList
053: */
054: public ArrayList getQuestionNumberList() {
055: if (questionNumberList == null)
056: return new ArrayList();
057: return questionNumberList;
058: }
059:
060: /**
061: * Sets a list of question number Strings.
062: * @param pquestionNumberList ArrayList
063: */
064: public void setQuestionNumberList(ArrayList pquestionNumberList) {
065: questionNumberList = pquestionNumberList;
066: }
067:
068: /**
069: * set the part number for this part as a String
070: * @param ppartNumber String
071: */
072: public void setPartNumber(String ppartNumber) {
073: partNumber = ppartNumber;
074: }
075:
076: public String getPartNumber() {
077: return Validator.check(partNumber, "N/A");
078: }
079:
080: public void setId(String pid) {
081: id = pid;
082: }
083:
084: public String getId() {
085: return Validator.check(id, "0");
086: }
087:
088: public boolean getLinked() {
089: return linked;
090: }
091:
092: public void setLinked(boolean newLinked) {
093: linked = newLinked;
094: }
095:
096: public boolean getIsRandomDrawPart() {
097: return isRandomDrawPart;
098: }
099:
100: public void setIsRandomDrawPart(boolean isRandomDrawPart) {
101: this .isRandomDrawPart = isRandomDrawPart;
102: }
103:
104: public boolean getNoQuestions() {
105: noQuestions = false;
106: if (questionNumberList.size() == 0) {
107: noQuestions = true;
108: }
109: return noQuestions;
110: }
111:
112: public int getNumberQuestionsDraw() {
113: return numberQuestionsDraw;
114: }
115:
116: public void setNumberQuestionsDraw(int numberQuestionsDraw) {
117: this .numberQuestionsDraw = numberQuestionsDraw;
118: }
119:
120: public int getNumberQuestionsTotal() {
121: return this.questionNumberList.size();
122: }
123:
124: }
|