kotkabeans
Class WizardBean

java.lang.Object
  |
  +--kotkabeans.WizardBean

public class WizardBean
extends java.lang.Object

Title: WizardBean

Description:

Copyright: Copyright (c) KORPPI-PROJEKTIRYHMÄ 2003

Company: Jyu

Usage:


Field Summary
protected  CourseInstance ci
           
protected  boolean computeGrade
           
 java.lang.String CREDITS_FIELD
           
protected  boolean creditsFieldWanted
           
 java.lang.String DEMO_BONUS_FIELD
           
 java.lang.String DEMO_FIELD
           
 java.lang.String DEMO_FORM
           
 java.lang.String DEMO_SUM_FIELD
           
protected  boolean demoBonusWanted
           
protected  boolean demosWanted
           
 java.lang.String EXAM_FIELD
           
 java.lang.String EXAM_FORM
           
 java.lang.String EXAM_SUM_FIELD
           
protected  boolean examWanted
           
 java.lang.String EXERCISE_BONUS_FIELD
           
 java.lang.String EXERCISE_FIELD
           
 java.lang.String EXERCISE_FORM
           
protected  boolean exerciseBonusWanted
           
protected  boolean exerciseCompulsory
           
protected  boolean exerciseWanted
           
protected  int fieldsInDemoForm
           
protected  int fieldsInExamForm
           
protected  int fieldsInTestForm
           
protected  kotkabeans.WizardBean.EvaluationFunction function
           
 java.lang.String FUNCTION
           
 java.lang.String GRADE_FIELD
           
 java.lang.String GRADE_FORM
           
protected  boolean gradeFormShows
           
protected  double maxDemoBonusPercent
           
protected  int maxDemoBonusPoints
           
protected  int maxDemoPoints
           
protected  double minDemoBonusPercent
           
protected  int minDemoBonusPoints
           
protected  int nbrOfTestForms
           
protected  boolean newCi
           
 java.lang.String POINTS_FIELD
           
 java.lang.String TEST_FIELD
           
 java.lang.String TEST_FORM
           
protected  boolean testWanted
           
protected  boolean translated
           
protected  User user
           
 
Constructor Summary
WizardBean()
          Dummy constructor.
WizardBean(User u)
          Constructor with user to set.
 
Method Summary
 void addFieldToForm(FieldGroup form, java.lang.String fieldName, int fieldType)
          Adds new field to certain form.
 void addFieldToForm(java.lang.String formName, java.lang.String fieldName, int fieldType)
          Adds new field to certain form.
 void createForm(java.lang.String formName, int nbrOfForms, java.lang.String fieldName, int nbrOfFields, int fieldType, int teacherAccessRight, int studentAccessRight, boolean addSumField)
           
 void createForm(java.lang.String formName, int nbrOfForms, java.lang.String fieldName, java.lang.String nbrOfFields, int fieldType, int teacherAccessRight, int studentAccessRight, boolean addSumField)
           
 void createForm(java.lang.String formName, java.lang.String nbrOfForms, java.lang.String fieldName, int nbrOfFields, int fieldType, int teacherAccessRight, int studentAccessRight, boolean addSumField)
           
 void createForm(java.lang.String formName, java.lang.String nbrOfForms, java.lang.String fieldName, java.lang.String nbrOfFields, int fieldType, int teacherAccessRight, int studentAccessRight, boolean addSumField)
          Creates fieldgroup to course instance.
 void createFunction()
          Creates evaluationfunction with attributes given earlier.
 void createGradeForm()
          Creates fieldgroup to course instance.
 CourseInstance getCi()
           
 int getFieldsInDemoForm()
           
 int getFieldsInExamForm()
           
 int getFieldsInTestForm()
           
 java.lang.String getFunctionName()
           
 java.lang.String getFunctionSummary()
          Returns description of created evaluation function based on saved attributes.
 double getMaxDemoBonusPercent()
           
 int getMaxDemoBonusPoints()
           
 int getMaxDemoPoints()
           
 double getMinDemoBonusPercent()
           
 int getMinDemoBonusPoints()
           
 int getNbrOfTestForms()
           
 java.lang.String getPreFunctionSummary()
          Returns description of created pre function based on saved attributes.
 void init()
          Initializes attributes.
 boolean isComputeGrade()
           
 boolean isCreditsFieldWanted()
           
 boolean isDemoBonusWanted()
           
 boolean isDemosWanted()
           
 boolean isExamWanted()
           
 boolean isExerciseBonusWanted()
           
 boolean isExerciseCompulsory()
           
 boolean isExerciseWanted()
           
 boolean isGradeFormShows()
           
 boolean isNewCi()
           
 boolean isTestWanted()
           
 boolean isTranslated()
           
 void markAllChanged(boolean changed)
          Marks courseinstances and fieldgroups and its fields all attributes as changed
 int removeForms(java.lang.String formName, int nbrOfForms)
           
 void saveCourseDescription()
          Saves this wizard object's courseinstance's description to db.
 void saveFunction()
          Saves created function.
 void saveFunction(java.lang.String name)
          Saves created function to given name.
protected  void saveFunction(kotkabeans.WizardBean.EvaluationFunction f, java.lang.String name)
          Saves created function.
 void setCi(CourseInstance newCi)
           
 void setComputeGrade(boolean b)
           
 void setCreditsFieldWanted(boolean b)
           
 void setDemoBonusWanted(boolean b)
           
 void setDemosWanted(boolean b)
           
 void setExamWanted(boolean b)
           
 void setExerciseBonusWanted(boolean b)
           
 void setExerciseCompulsory(boolean b)
           
 void setExerciseWanted(boolean b)
           
 void setFieldsInDemoForm(int nbr)
           
 void setFieldsInDemoForm(java.lang.String nbr)
           
 void setFieldsInExamForm(int nbr)
           
 void setFieldsInExamForm(java.lang.String nbr)
           
 void setFieldsInTestForm(int nbr)
           
 void setFieldsInTestForm(java.lang.String nbr)
           
 void setFunctionName(java.lang.String name)
          Sets new name to the evaluation function.
 void setGradeFormShows(boolean b)
           
 void setMaxDemoBonusPercent(double percent)
           
 void setMaxDemoBonusPercent(java.lang.String percent)
           
 void setMaxDemoBonusPoints(int points)
           
 void setMaxDemoBonusPoints(java.lang.String points)
           
 void setMaxDemoPoints(int points)
           
 void setMaxDemoPoints(java.lang.String points)
           
 void setMinDemoBonusPercent(double percent)
           
 void setMinDemoBonusPercent(java.lang.String percent)
           
 void setMinDemoBonusPoints(int points)
           
 void setMinDemoBonusPoints(java.lang.String points)
           
 void setNbrOfTestForms(int nbr)
           
 void setNbrOfTestForms(java.lang.String nbr)
           
 void setNewCi(boolean b)
           
 void setTestWanted(boolean b)
           
 void setUser(User u)
          Sets user for this WizardBean object and translates translateable attributes if they aren't translated yet
 void toHtml(javax.servlet.jsp.JspWriter out)
          Just for the debug Prints out this object's values of attributes
 void translate()
          Translates translateable attributes if not translated yet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRADE_FORM

public java.lang.String GRADE_FORM

GRADE_FIELD

public java.lang.String GRADE_FIELD

CREDITS_FIELD

public java.lang.String CREDITS_FIELD

POINTS_FIELD

public java.lang.String POINTS_FIELD

EXERCISE_FORM

public java.lang.String EXERCISE_FORM

EXERCISE_FIELD

public java.lang.String EXERCISE_FIELD

EXERCISE_BONUS_FIELD

public java.lang.String EXERCISE_BONUS_FIELD

TEST_FORM

public java.lang.String TEST_FORM

TEST_FIELD

public java.lang.String TEST_FIELD

EXAM_FORM

public java.lang.String EXAM_FORM

EXAM_FIELD

public java.lang.String EXAM_FIELD

EXAM_SUM_FIELD

public java.lang.String EXAM_SUM_FIELD

DEMO_FORM

public java.lang.String DEMO_FORM

DEMO_FIELD

public java.lang.String DEMO_FIELD

DEMO_BONUS_FIELD

public java.lang.String DEMO_BONUS_FIELD

DEMO_SUM_FIELD

public java.lang.String DEMO_SUM_FIELD

FUNCTION

public java.lang.String FUNCTION

translated

protected boolean translated

computeGrade

protected boolean computeGrade

gradeFormShows

protected boolean gradeFormShows

creditsFieldWanted

protected boolean creditsFieldWanted

demosWanted

protected boolean demosWanted

demoBonusWanted

protected boolean demoBonusWanted

exerciseWanted

protected boolean exerciseWanted

exerciseCompulsory

protected boolean exerciseCompulsory

exerciseBonusWanted

protected boolean exerciseBonusWanted

testWanted

protected boolean testWanted

examWanted

protected boolean examWanted

newCi

protected boolean newCi

maxDemoPoints

protected int maxDemoPoints

maxDemoBonusPoints

protected int maxDemoBonusPoints

minDemoBonusPoints

protected int minDemoBonusPoints

maxDemoBonusPercent

protected double maxDemoBonusPercent

minDemoBonusPercent

protected double minDemoBonusPercent

ci

protected CourseInstance ci

user

protected User user

function

protected kotkabeans.WizardBean.EvaluationFunction function

fieldsInDemoForm

protected int fieldsInDemoForm

nbrOfTestForms

protected int nbrOfTestForms

fieldsInTestForm

protected int fieldsInTestForm

fieldsInExamForm

protected int fieldsInExamForm
Constructor Detail

WizardBean

public WizardBean()
Dummy constructor.

See Also:
init()

WizardBean

public WizardBean(User u)
Constructor with user to set.

See Also:
setUser(User), init()
Method Detail

setUser

public void setUser(User u)
Sets user for this WizardBean object and translates translateable attributes if they aren't translated yet

See Also:
translate()

getCi

public CourseInstance getCi()

setCi

public void setCi(CourseInstance newCi)

isComputeGrade

public boolean isComputeGrade()

isGradeFormShows

public boolean isGradeFormShows()

isCreditsFieldWanted

public boolean isCreditsFieldWanted()

isDemosWanted

public boolean isDemosWanted()

isDemoBonusWanted

public boolean isDemoBonusWanted()

isExerciseWanted

public boolean isExerciseWanted()

isExerciseCompulsory

public boolean isExerciseCompulsory()

isExerciseBonusWanted

public boolean isExerciseBonusWanted()

isTestWanted

public boolean isTestWanted()

isExamWanted

public boolean isExamWanted()

getMaxDemoPoints

public int getMaxDemoPoints()

getMaxDemoBonusPoints

public int getMaxDemoBonusPoints()

getMinDemoBonusPoints

public int getMinDemoBonusPoints()

getMaxDemoBonusPercent

public double getMaxDemoBonusPercent()

getMinDemoBonusPercent

public double getMinDemoBonusPercent()

setComputeGrade

public void setComputeGrade(boolean b)

setGradeFormShows

public void setGradeFormShows(boolean b)

setCreditsFieldWanted

public void setCreditsFieldWanted(boolean b)

setDemosWanted

public void setDemosWanted(boolean b)

setDemoBonusWanted

public void setDemoBonusWanted(boolean b)

setMaxDemoPoints

public void setMaxDemoPoints(int points)

setMaxDemoPoints

public void setMaxDemoPoints(java.lang.String points)

setMaxDemoBonusPoints

public void setMaxDemoBonusPoints(int points)

setMaxDemoBonusPoints

public void setMaxDemoBonusPoints(java.lang.String points)

setMinDemoBonusPoints

public void setMinDemoBonusPoints(int points)

setMinDemoBonusPoints

public void setMinDemoBonusPoints(java.lang.String points)

setMaxDemoBonusPercent

public void setMaxDemoBonusPercent(double percent)

setMaxDemoBonusPercent

public void setMaxDemoBonusPercent(java.lang.String percent)

setMinDemoBonusPercent

public void setMinDemoBonusPercent(double percent)

setMinDemoBonusPercent

public void setMinDemoBonusPercent(java.lang.String percent)

setExerciseWanted

public void setExerciseWanted(boolean b)

setExerciseCompulsory

public void setExerciseCompulsory(boolean b)

setExerciseBonusWanted

public void setExerciseBonusWanted(boolean b)

setTestWanted

public void setTestWanted(boolean b)

setExamWanted

public void setExamWanted(boolean b)

setNewCi

public void setNewCi(boolean b)

isNewCi

public boolean isNewCi()

setFieldsInDemoForm

public void setFieldsInDemoForm(int nbr)

setFieldsInDemoForm

public void setFieldsInDemoForm(java.lang.String nbr)

getFieldsInDemoForm

public int getFieldsInDemoForm()

setNbrOfTestForms

public void setNbrOfTestForms(int nbr)

setNbrOfTestForms

public void setNbrOfTestForms(java.lang.String nbr)

getNbrOfTestForms

public int getNbrOfTestForms()

setFieldsInTestForm

public void setFieldsInTestForm(int nbr)

setFieldsInTestForm

public void setFieldsInTestForm(java.lang.String nbr)

getFieldsInTestForm

public int getFieldsInTestForm()

setFieldsInExamForm

public void setFieldsInExamForm(int nbr)

setFieldsInExamForm

public void setFieldsInExamForm(java.lang.String nbr)

getFieldsInExamForm

public int getFieldsInExamForm()

isTranslated

public boolean isTranslated()

toHtml

public void toHtml(javax.servlet.jsp.JspWriter out)
            throws java.io.IOException
Just for the debug Prints out this object's values of attributes

java.io.IOException

init

public void init()
Initializes attributes.

See Also:
translate()

translate

public void translate()
               throws java.lang.Exception
Translates translateable attributes if not translated yet.

Throws:
java.lang.Exception - if user is not set.
See Also:
isTranslated()

markAllChanged

public void markAllChanged(boolean changed)
Marks courseinstances and fieldgroups and its fields all attributes as changed

See Also:
#CourseInstance.setAttributesChanged(boolean), #FieldGroup.setAllChanged(boolean), #Field.setAllChanged(boolean)

saveCourseDescription

public void saveCourseDescription()
Saves this wizard object's courseinstance's description to db.


createGradeForm

public void createGradeForm()
                     throws java.lang.Exception
Creates fieldgroup to course instance.
Name of fieldgroup is set to "Tulos" (in user's language) and two fields to the group named "Arvolause" and "Opintoviikot" (in user's language)

java.lang.Exception
See Also:
#CourseInstance.createFieldGroup(String,int,int)

createForm

public void createForm(java.lang.String formName,
                       java.lang.String nbrOfForms,
                       java.lang.String fieldName,
                       java.lang.String nbrOfFields,
                       int fieldType,
                       int teacherAccessRight,
                       int studentAccessRight,
                       boolean addSumField)
                throws java.lang.Exception
Creates fieldgroup to course instance.

Parameters:
formName -
nbrOfForms -
fieldName -
nbrOfFields -
fieldType -
teacherAccessRight -
studentAccessRight -
java.lang.Exception
See Also:
#CourseInstance.createFieldGroup(String,int,int), addFieldToForm(FieldGroup,String,int)

createForm

public void createForm(java.lang.String formName,
                       int nbrOfForms,
                       java.lang.String fieldName,
                       java.lang.String nbrOfFields,
                       int fieldType,
                       int teacherAccessRight,
                       int studentAccessRight,
                       boolean addSumField)
                throws java.lang.Exception
java.lang.Exception

createForm

public void createForm(java.lang.String formName,
                       java.lang.String nbrOfForms,
                       java.lang.String fieldName,
                       int nbrOfFields,
                       int fieldType,
                       int teacherAccessRight,
                       int studentAccessRight,
                       boolean addSumField)
                throws java.lang.Exception
java.lang.Exception

createForm

public void createForm(java.lang.String formName,
                       int nbrOfForms,
                       java.lang.String fieldName,
                       int nbrOfFields,
                       int fieldType,
                       int teacherAccessRight,
                       int studentAccessRight,
                       boolean addSumField)
                throws java.lang.Exception
java.lang.Exception

removeForms

public int removeForms(java.lang.String formName,
                       int nbrOfForms)

addFieldToForm

public void addFieldToForm(java.lang.String formName,
                           java.lang.String fieldName,
                           int fieldType)
                    throws java.lang.Exception
Adds new field to certain form.

Parameters:
formName - name of form where to add new field
fieldName - name of field to add
fieldType - type of field to add
java.lang.Exception
See Also:
FieldType

addFieldToForm

public void addFieldToForm(FieldGroup form,
                           java.lang.String fieldName,
                           int fieldType)
                    throws java.lang.Exception
Adds new field to certain form.

Parameters:
form - form where to add new field
fieldName - name of field to add
fieldType - type of field to add
java.lang.Exception
See Also:
#FieldType

createFunction

public void createFunction()
                    throws java.lang.Exception
Creates evaluationfunction with attributes given earlier.

Throws:
java.lang.Exception - if courseinstance is not in db yet
See Also:
isNewCi()

saveFunction

public void saveFunction(java.lang.String name)
                  throws java.lang.Exception
Saves created function to given name.

java.lang.Exception

saveFunction

public void saveFunction()
                  throws java.lang.Exception
Saves created function.

java.lang.Exception

saveFunction

protected void saveFunction(kotkabeans.WizardBean.EvaluationFunction f,
                            java.lang.String name)
                     throws java.lang.Exception
Saves created function.

Throws:
java.lang.Exception - is something goes wrong
See Also:
#cSQL.hasCourseFunction(String,String),

getFunctionSummary

public java.lang.String getFunctionSummary()
Returns description of created evaluation function based on saved attributes.

Returns:
description of created evaluation function

getPreFunctionSummary

public java.lang.String getPreFunctionSummary()
Returns description of created pre function based on saved attributes.

Returns:
description of created pre function

getFunctionName

public java.lang.String getFunctionName()

setFunctionName

public void setFunctionName(java.lang.String name)
Sets new name to the evaluation function.