org.olat.ims.qti.container
Class ItemContext

java.lang.Object
  extended by org.olat.ims.qti.container.ItemContext
All Implemented Interfaces:
java.io.Serializable

public class ItemContext
extends java.lang.Object
implements java.io.Serializable

Author:
Potable Shop restrictions on items so far: - only one resprocessing element is evaluated. duration: from ims qti 1.2.1 best practice: duration The duration element is used within the item, section and assessment elements to define the permitted duration for the enclosed activity. The duration is defined as the period between the activity's activation and completion. The ISO 8601 format is used: PnYnMnDTnHnMnS. in mchc_smimr_104.xml example: 0000:00:00T:01:00:00d in ...101.xml: pTH02 iso website: http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html and http://www.w3.org/TR/NOTE-datetime from some page: specified in numbers of years [Y], months [M] or weeks [W], days [D], hours [H] and so on, introduced by a ?P?, for example: P6W2D -> not a date, but only a duration makes sense: -> I shall take the ISO 8601 Time of the day hh:mm:ss format for now
See Also:
Serialized Form

Constructor Summary
ItemContext()
          default constructor needed for persistence
 
Method Summary
 int addItemInput(ItemInput theItemInput)
          Sets the itemInput.
 void clearDurationLimit()
           
 void eval()
           
 long getDurationLimit()
          Returns the duration.
 org.dom4j.Element getEl_item()
           
 int getHintLevel()
           
 java.lang.String getIdent()
          Method getIdent.
 ItemInput getItemInput()
           
 long getLatestAnswerTime()
           
 int getMaxAttempts()
           
 float getMaxScore()
           
 Output getOutput()
           
 Item getQtiItem()
           
 float getScore()
          Returns the value of the SCORE variable
 long getTimeOfStart()
          Returns the timeOfStart.
 int getTimesAnswered()
           
 long getTimeSpent()
          return duration for answered items
 Variables getVariables()
           
 void init()
           
 boolean isFeedback()
           
 boolean isHints()
           
 boolean isOnTime()
           
 boolean isOpen()
           
 boolean isSolutions()
           
 boolean isStarted()
           
 boolean isUnderMaxAttempts()
           
 void resetVariables()
           
 void setHintLevel(int hintLevel)
          Sets the hintLevel.
 void setUp(AssessmentInstance assessInstance, org.dom4j.Element el_orig_item, Switches sw)
          Method setUp.
 void start()
          Method start.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemContext

public ItemContext()
default constructor needed for persistence

Method Detail

init

public void init()

setUp

public void setUp(AssessmentInstance assessInstance,
                  org.dom4j.Element el_orig_item,
                  Switches sw)
Method setUp.

Parameters:
assessInstance -
el_orig_item -
sw -

getVariables

public Variables getVariables()
Returns:
Variables

getOutput

public Output getOutput()
Returns:

getItemInput

public ItemInput getItemInput()
Returns:
ItemInput

addItemInput

public int addItemInput(ItemInput theItemInput)
Sets the itemInput.

Parameters:
theItemInput - The itemInput to set. max be null for "unanswered"
Returns:
the status of the add operation, e.g. ok

getTimesAnswered

public int getTimesAnswered()
Returns:
int

getIdent

public java.lang.String getIdent()
Method getIdent.

Returns:
String

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getTimeOfStart

public long getTimeOfStart()
Returns the timeOfStart.

Returns:
long

isOpen

public boolean isOpen()
Returns:

isOnTime

public boolean isOnTime()
Returns:

isUnderMaxAttempts

public boolean isUnderMaxAttempts()
Returns:

getEl_item

public org.dom4j.Element getEl_item()
Returns:
Element

start

public void start()
Method start.


getTimeSpent

public long getTimeSpent()
return duration for answered items

Returns:

getDurationLimit

public long getDurationLimit()
Returns the duration.

Returns:
long

isStarted

public boolean isStarted()
Returns:

getMaxAttempts

public int getMaxAttempts()
Returns:
int

getLatestAnswerTime

public long getLatestAnswerTime()
Returns:
long

eval

public void eval()

getMaxScore

public float getMaxScore()
Returns:

getScore

public float getScore()
Returns the value of the SCORE variable

Returns:

isFeedback

public boolean isFeedback()
Returns:
boolean

isHints

public boolean isHints()
Returns:
boolean

isSolutions

public boolean isSolutions()
Returns:
boolean

resetVariables

public void resetVariables()

getHintLevel

public int getHintLevel()
Returns:
int

setHintLevel

public void setHintLevel(int hintLevel)
Sets the hintLevel.

Parameters:
hintLevel - The hintLevel to set

clearDurationLimit

public void clearDurationLimit()

getQtiItem

public Item getQtiItem()
Returns:
item