no.inspera.services.pedal
Class Module

java.lang.Object
  extended by no.inspera.services.pedal.Module

public class Module
extends java.lang.Object

Module represents a course module. Any given course consists of several logical modules.

Modules are instantiated when the user logs on to the system. The state of the module is not persisted, which means every time the user logs on the modules are reinitialized. Therefore it is safe, to store the sequencing state which is specific to a user.

Since:
20.12.2007
Version:
$Id: Module.java 45069 2008-05-29 08:25:25Z naimdjon $
Author:
Naimdjon Takhirov

Constructor Summary
Module(long moduleId)
          Constructs a new Module object with the specified moduleId
 
Method Summary
 void addItem(LearningObject learningObject)
          Adds this item to the list of available items within this module.
 java.util.Collection<LearningObject> getAllItems()
          Returns all items within this module.
 SequencingState getCurrentState()
          Returns the current state of sequenced items.
 LearningObject getExample()
          Getter for example.
 LearningObject getExercise()
          Getter for exercise
 LearningObject getItem(long id)
          Looks up an item with specified id.
 long getModuleId()
          Getter for moduleId
 LearningObject getTheory()
          Getter for theory
 java.lang.String toString()
          Returns string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Module

public Module(long moduleId)
Constructs a new Module object with the specified moduleId

Parameters:
moduleId - the id of module.
Method Detail

addItem

public void addItem(LearningObject learningObject)
Adds this item to the list of available items within this module.

Parameters:
learningObject - item to be added

getItem

public LearningObject getItem(long id)
Looks up an item with specified id.

Parameters:
id - the id of an item (either theory, exercise or example)
Returns:
an item matching specified id or null if there is no item with that id

getAllItems

public java.util.Collection<LearningObject> getAllItems()
Returns all items within this module.

Returns:
all items in this module.

getExample

public LearningObject getExample()
Getter for example.

Returns:
example

getTheory

public LearningObject getTheory()
Getter for theory

Returns:
theory

getExercise

public LearningObject getExercise()
Getter for exercise

Returns:
exercise or null if exercise is not available

toString

public java.lang.String toString()
Returns string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
string representation of this object

getCurrentState

public SequencingState getCurrentState()
Returns the current state of sequenced items.

Returns:
current state of sequenced items.

getModuleId

public long getModuleId()
Getter for moduleId

Returns:
moduleId


Copyright © 2008 Naimdjon Takhirov (naimdjon@gmail.com). All Rights Reserved.