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/ContentsDeliveryBean.java $
003: * $Id: ContentsDeliveryBean.java 15083 2006-09-20 20:03:55Z 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: /**
025: * <p> Table of Contents and Contents Data</p>
026: * <p>This is a 'dual purpose' bean. It can serve as a
027: * representation of the entire (table of) contents for an
028: * assessment, or the contents presented in a praticular page view.</p>
029: */
030:
031: public class ContentsDeliveryBean implements Serializable {
032: /**
033: *
034: */
035: private static final long serialVersionUID = -4619361961662881387L;
036: private java.util.ArrayList partsContents;
037: private float currentScore;
038: private float maxScore; // SectionContentsBeans
039: // for display/hide score
040: private boolean showStudentScore;
041: private String pointsDisplayString;
042:
043: /**
044: * Current score for entire contents.
045: * @return current score for entire contents
046: */
047: public float getCurrentScore() {
048: return currentScore;
049: }
050:
051: /**
052: * Current score for entire contents
053: * @param currentScore current score for entire contents
054: */
055: public void setCurrentScore(float currentScore) {
056: this .currentScore = currentScore;
057: }
058:
059: /**
060: * Maximum score for entire contents.
061: * @return maximum score for entire contents
062: */
063: public float getMaxScore() {
064: return maxScore;
065: }
066:
067: /**
068: * Maximum score for entire contents.
069: * @param maxScore maximum score for entire contents
070: */
071: public void setMaxScore(float maxScore) {
072: this .maxScore = maxScore;
073: }
074:
075: /**
076: * List of parts (SectionContentsBeans) for entire contents.
077: * @return parts for entire contents
078: */
079: public java.util.ArrayList getPartsContents() {
080: return partsContents;
081: }
082:
083: /**
084: * Set parts (SectionContentsBeans) for entire contents
085: * @param partsContents parts (SectionContentsBeans) for entire contents
086: */
087: public void setPartsContents(java.util.ArrayList partsContents) {
088: this .partsContents = partsContents;
089: }
090:
091: /**
092: * Show the student score currently earned?
093: * @return the score
094: */
095: public boolean isShowStudentScore() {
096: return showStudentScore;
097: }
098:
099: /**
100: * Set the student score currently earned.
101: * @param showStudentScore true/false Show the student score currently earned?
102: */
103: public void setShowStudentScore(boolean showStudentScore) {
104: this .showStudentScore = showStudentScore;
105: }
106:
107: /**
108: * If we display the current score, return it, otherwise an empty string.
109: * Not currently used, provided if we need it later.
110: * @return either, a) the current score, otherwise, b) "" (empty string)
111: */
112: public String getPointsDisplayString() {
113: String pointsDisplayString = "";
114: if (showStudentScore) {
115: pointsDisplayString = "" + currentScore;
116: }
117: return pointsDisplayString;
118: }
119:
120: }
|