001: /**********************************************************************************
002: * $URL: https://source.sakaiproject.org/svn/sam/trunk/component/src/java/org/sakaiproject/tool/assessment/facade/TypeFacade.java $
003: * $Id: TypeFacade.java 9273 2006-05-10 22:34:28Z 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.facade;
021:
022: import java.io.IOException;
023: import java.io.Serializable;
024: import java.util.Date;
025:
026: import org.sakaiproject.tool.assessment.data.ifc.shared.TypeIfc;
027:
028: public class TypeFacade implements Serializable, TypeIfc {
029:
030: // please make sure that the value match with the one in the Type table. Also see
031: // 02_TypeData.sql when generate the table
032: // these are qestion type available in this site,
033:
034: /**
035: *
036: */
037: private static final long serialVersionUID = -3400550482739705371L;
038: public static final Long MULTIPLE_CHOICE = new Long(1);
039: public static final Long MULTIPLE_CORRECT = new Long(2);
040: public static final Long MULTIPLE_CHOICE_SURVEY = new Long(3);
041: public static final Long TRUE_FALSE = new Long(4);
042: public static final Long ESSAY_QUESTION = new Long(5);
043: public static final Long FILE_UPLOAD = new Long(6);
044: public static final Long AUDIO_RECORDING = new Long(7);
045: public static final Long FILL_IN_BLANK = new Long(8);
046: public static final Long FILL_IN_NUMERIC = new Long(11);
047: public static final Long MATCHING = new Long(9);
048: // these are section type available in this site,
049: public static final Long DEFAULT_SECTION = new Long(21);
050: // these are assessment template type available in this site,
051: public static final Long TEMPLATE_QUIZ = new Long(41);
052: public static final Long TEMPLATE_HOMEWORK = new Long(42);
053: public static final Long TEMPLATE_MIDTERM = new Long(43);
054: public static final Long TEMPLATE_FINAL = new Long(44);
055: // these are assessment type available in this site,
056: public static final Long QUIZ = new Long(61);
057: public static final Long HOMEWORK = new Long(62);
058: public static final Long MIDTERM = new Long(63);
059: public static final Long FINAL = new Long(64);
060:
061: private Long typeId;
062: private String authority;
063: private String domain;
064: private String keyword;
065: private String description;
066: private int status;
067: private String createdBy;
068: private Date createdDate;
069: private String lastModifiedBy;
070: private Date lastModifiedDate;
071:
072: public TypeFacade() {
073: }
074:
075: public TypeFacade(String authority, String domain, String keyword) {
076: this .authority = authority;
077: this .domain = domain;
078: this .keyword = keyword;
079: }
080:
081: public TypeFacade(String authority, String domain, String keyword,
082: String description) {
083: this .authority = authority;
084: this .domain = domain;
085: this .keyword = keyword;
086: this .description = description;
087: }
088:
089: public TypeFacade(String authority, String domain, String keyword,
090: String description, int status, String createdBy,
091: Date createdDate, String lastModifiedBy,
092: Date lastModifiedDate) {
093: this .authority = authority;
094: this .domain = domain;
095: this .keyword = keyword;
096: this .description = description;
097: this .status = status;
098: this .createdBy = createdBy;
099: this .createdDate = createdDate;
100: this .lastModifiedBy = lastModifiedBy;
101: this .lastModifiedDate = lastModifiedDate;
102: }
103:
104: public TypeFacade(TypeIfc typeData) {
105: this .typeId = typeData.getTypeId();
106: this .authority = typeData.getAuthority();
107: this .domain = typeData.getDomain();
108: this .keyword = typeData.getKeyword();
109: this .description = typeData.getDescription();
110: this .status = typeData.getStatus();
111: this .createdBy = typeData.getCreatedBy();
112: this .createdDate = typeData.getCreatedDate();
113: this .lastModifiedBy = typeData.getLastModifiedBy();
114: this .lastModifiedDate = typeData.getLastModifiedDate();
115: }
116:
117: public void setTypeId(Long typeId) {
118: this .typeId = typeId;
119: }
120:
121: public Long getTypeId() {
122: return this .typeId;
123: }
124:
125: public String getAuthority() {
126: return this .authority;
127: }
128:
129: public void setAuthority(String authority) {
130: this .authority = authority;
131: }
132:
133: public String getDomain() {
134: return this .domain;
135: }
136:
137: public void setDomain(String domain) {
138: this .domain = domain;
139: }
140:
141: /**
142: * Return the keyword for this ItemType.
143: */
144: public String getKeyword() {
145: return this .keyword;
146: }
147:
148: /**
149: * Set the keyword for this ItemType.
150: */
151: public void setKeyword(String keyword) {
152: this .keyword = keyword;
153: }
154:
155: public String getDescription() {
156: return this .description;
157: }
158:
159: public void setDescription(String description) {
160: this .description = description;
161: }
162:
163: /**
164: * Return the status for this ItemType.
165: */
166: public int getStatus() {
167: return this .status;
168: }
169:
170: /**
171: * Set the status for this ItemType.
172: */
173: public void setStatus(int status) {
174: this .status = status;
175: }
176:
177: /**
178: * Return the createdBy for this ItemType.
179: */
180: public String getCreatedBy() {
181: return this .createdBy;
182: }
183:
184: /**
185: * Set the createdBy for this ItemType.
186: */
187: public void setCreatedBy(String createdBy) {
188: this .createdBy = createdBy;
189: }
190:
191: /**
192: * Return the createdDate for this ItemType.
193: */
194: public Date getCreatedDate() {
195: return this .createdDate;
196: }
197:
198: /**
199: * Set the createdDate for this ItemType.
200: */
201: public void setCreatedDate(Date createdDate) {
202: this .createdDate = createdDate;
203: }
204:
205: /**
206: * Return the lastModifiedBy for this ItemType.
207: */
208: public String getLastModifiedBy() {
209: return this .lastModifiedBy;
210: }
211:
212: /**
213: * Set the lastModifiedBy for this ItemType.
214: */
215: public void setLastModifiedBy(String lastModifiedBy) {
216: this .lastModifiedBy = lastModifiedBy;
217: }
218:
219: /**
220: * Return the lastModifiedDate for this ItemType.
221: */
222: public Date getLastModifiedDate() {
223: return this .lastModifiedDate;
224: }
225:
226: /**
227: * Set the lastModifiedDate for this ItemType.
228: */
229: public void setLastModifiedDate(Date lastModifiedDate) {
230: this .lastModifiedDate = lastModifiedDate;
231: }
232:
233: private void writeObject(java.io.ObjectOutputStream out)
234: throws IOException {
235: out.defaultWriteObject();
236: }
237:
238: private void readObject(java.io.ObjectInputStream in)
239: throws IOException, ClassNotFoundException {
240: in.defaultReadObject();
241: }
242:
243: }
|