Current implementation model
The step entry must have an unique id
<OTNote title="Noter" isInjectPrompt="true" lockStudentAnswers="false" id="9FF253B1-3C3F-4CD9-ADAB-0AB60CDD3427">
a special OTrunkRim is created.
Map<ResponseDeclarationType, Rim> responseDeclarationsToRims = new HashMap<ResponseDeclarationType, Rim>();
for (ResponseDeclarationType responseDeclarationType : responseDeclaration) {
Rim rim = new OTrunkRim(responseDeclarationType.getIdentifier(), String.class, otAssessment);
responseDeclarationsToRims.put(responseDeclarationType, rim);
}
assessment.setResponseDeclarationsToRims(responseDeclarationsToRims);
Old implementation model
What we need?
Associate students data with a question they answer
old model rim and sock entries.
the answer - no type
OTSockTransferObject
id
Notes from Mar. 31, 2008 meeting
--------------------------------------------
In PasStep:
init() {
if (pasInterfaceRealObject != null) {
// load from the interface object
} else {
// use normal rims/socks
}
}
save() {
if (pasInterfaceRealObject != null) {
// save to the interface real object
OTSockEntry sockEntry = (OTSockEntry) interfaceObject.createSockEntry(sockId);
sockEntry.value = "Whatever data I want to save"
} else {
// use normal rims/socks
}
}
------------------------------------------------
In OTPasStep:
public OTPasInterfaceObject getSavedData();
------------------------------------------------
In OTPasStepController.loadRealObject():
OTPasInterfaceObject savedDataObj = otObj.getSavedData();
if (savedDataObj == null) {
// Create an empty one
}
OTPasInterfaceRealObject realSavedDataObj = (OTPasInterfaceRealObject) controllerService.getRealObject(savedDataObj);
realObject.setOTSaveDataObject(realSavedDataObj);
-----------------------------------------------------
OTPasInterfaceObject:
public OTObjectList getRimSockMapList();
------------------------------------------------------
OTRimSockMapEntry:
public String getId(); public OTSock getSock();
-------------------------------------------------------
OTPasInterfaceObjectController:
loadRealObject() {
// initialize the map
// set up listeners
}
--------------------------------------------------------
OTPasInterfaceRealObject implements Map:
public void add(id, OTSock) public void remove(id) public OTSock get(id) public OTSockEntry createSockEntry(id) public OTSockEntry getSockEntry(id); // in ISock it's peek()
----------------------------------------------------------
OTSockEntry:
public long getMsOffset(); public void setMsOffset(long offset); public String getValue(); public void setValue(String value);
----------------------------------------------------------
OTSock:
public OTObjectList getSockEntryList();
-------------------------------------------------------
persisted form:
<OTPasStep>
<savedData>
<OTPasInterfaceObject>
<rimSockMapList>
<OTRimSockMapEntry id="RD1">
<value>
<OTSock>
<sockEntryList>
<OTSockEntry msOffset="12345" value="String...." />
<OTSockEntry... />
</sockEntryList>
</OTSock>
</value>
</OTRimSockMapEntry>
<OTRimSockMapEntry>
...
</OTRimSockMapEntry>
</rimSockMapList>
</OTPasInterfaceObject>
</savedData>
</OTPasStep>