set, get not working for some values

175 views
Skip to first unread message

Ryan W.

unread,
Aug 27, 2010, 4:40:17 AM8/27/10
to eLearning Technology and Development
Hey all, this should be a simple mistake on my part, but I can't see
it. I'm trying to use pipwerks' scorm wrapper to connect to moodle LMS
(Moodle 1.8.13+ (Build: 20100825) )




I set a number of values and do scorm.save()
Then I try to retrieve the values. I can retrieve the version and
cmi.interactions._count
=0 changes to cmi.interactions._count=2 when I refresh which suggests
set is working somehow (right?)
But cmi.interactions group= still returns nothing.
I'd set and saved the following values. cmi.interactions.group SHOULD
return them via series of get statements converted into strings. Any
ideas? SCORM 2004 is backwards compatible with 1.2, right? Thanks for
any help!!
....

scorm.set("cmi.interactions.1.id","Q_123435467-foo");
scorm.set("cmi.interactions.1.type","multiple_choice");
scorm.set("cmi.interactions.1.objectives.0.id","iobjid1");
scorm.set("cmi.interactions.1.timestamp","2007-01-18T22:10:35.84Z");
scorm.set("cmi.interactions.1.correct_responses.
0.pattern","blue[,]white][,]red");
scorm.set("cmi.interactions.1.weighting","2");
scorm.set("cmi.interactions.1.learner_response","blue[,]red");
scorm.set("cmi.interactions.1.result","incorrect");
scorm.set("cmi.interactions.1.latency","PT2M54S");
scorm.set("cmi.interactions.1.description","What are the colors in the
French flag?");
scorm.save();


testvar = "" + scorm.get("cmi.interactions.1.id") +
scorm.get("cmi.interactions.1.type") + scorm.get("cmi.interactions.
1.objectives.0.id") + scorm.get("cmi.interactions.1.timestamp");


output.appendText("\ncmi.interactions group="+testvar);





Here's the whole function for the relevant code;

function testScorm():void{

//interactions; id, objectives, time, type, correct_responses,
weighting, student_response, result, latency


output.mouseWheelEnabled=true;

testvar = scorm.get("cmi._version");
output.appendText( "\ncmi.version=" + testvar); // (characterstring,
RO) Represents the version of the data model
output.appendText( "\ncmi.version test=" + scorm.get("cmi._version") +
scorm.get("cmi._version"));


output.appendText( "\ncmi.interactions._children\n=" +
scorm.get("cmi.interactions._children")); //
(id,type,objectives,timestamp,correct_responses,weighting,learner_resposne,result,latency,description,
RO) Listing of supported data model elements
//cmi.interactions._children=id, objectives, time, type,
correct_responses, weighting, student_response, result, latency


testvar = scorm.get("cmi.comments_from_learner._children");
output.appendText( "\ncmi.comments_from_learner._children=" +
scorm.get("cmi.comments_from_learner._children")); //
cmi.comments_from_learner._children (comment,location.timestamp, RO)
Listing of supported data model elements



testvar = scorm.get("cmi.comments_from_learner._count");
output.appendText( "\ncmi.comments_from_learner._count \n=" +
testvar); // (non-negative integer, RO) Current number of learner
comments
testvar = scorm.get("cmi.comments_from_learner.n.comment");

output.appendText( "\ncmi.comments_from_learner.n.comment\n=" +
testvar); //(localized_string_type (SPM: 4000), RW) Textual input

testvar = scorm.get("cmi.comments_from_learner.n.location");
output.appendText( "\ncmi.comments_from_learner.n.location\n=" +
testvar); // (characterstring (SPM: 250), RW) Point in the SCO to
which the comment applies
testvar = scorm.get("cmi.comments_from_learner.n.timestamp");
output.appendText( "\ncmi.comments_from_learner.n.timestamp\n=" +
testvar); //(time (second,10,0), RW) Point in time at which the
comment was created or most recently changed
testvar = scorm.get("cmi.comments_from_lms._children");
output.appendText( "\ncmi.comments_from_lms._children\n=" +
testvar); //(comment,location.timestamp, RO) Listing of supported data
model elements
testvar = scorm.get("cmi.comments_from_lms._count");
output.appendText( "\ncmi.comments_from_lms._count\n=" + testvar); //
(non-negative integer, RO) Current number of comments from the LMS
testvar = scorm.get("cmi.comments_from_lms.n.comment");
output.appendText( "\ncmi.comments_from_lms.n.comment\n=" +
testvar); //(localized_string_type (SPM: 4000), RO) Comments or
annotations associated with a SCO
testvar = scorm.get("cmi.comments_from_lms.n.location");
output.appendText( "\ncmi.comments_from_lms.n.location\n=" +
testvar); //(characterstring (SPM: 250), RO) Point in the SCO to which
the comment applies
testvar = scorm.get("cmi.comments_from_lms.n.timestamp");
output.appendText( "\ncmi.comments_from_lms.n.timestamp\n=" +
testvar); //(time(second,10,0), RO) Point in time at which the comment
was created or most recently changed
output.appendText( "\ncmi.completion_status\n=" +
scorm.get("cmi.completion_status")); //(state (completed, incomplete,
not attempted, unknown), RW) Indicates whether the learner has
completed the SCO

output.appendText( "\ncmi.completion_threshold\n=" +
scorm.get("cmi.completion_threshold")); //(real(10,7) range (0..1),
RO) Used to determine whether the SCO should be considered complete
output.appendText( "\ncmi.credit\n=" + scorm.get("cmi.credit")); //
(state (credit, no_credit), RO) Indicates whether the learner will be
credited for performance in the SCO
output.appendText( "\ncmi.entry\n=" + scorm.get("cmi.entry")); //
(state (ab_initio, resume, ""), RO) Asserts whether the learner has
previously accessed the SCO
output.appendText( "\ncmi.exit\n=" + scorm.get("cmi.exit")); //(state
(timeout, suspend, logout, normal, ""), W) Indicates how or why the
learner left the SCO

output.appendText( "\ncmi.interactions._count\n=" +
scorm.get("cmi.interactions._count")); //(non-negative integer, RO)
Current number of interactions being stored by the LMS


output.appendText("\ntest 2-----------\n\n");
scorm.set("cmi.interactions.n.id", "this is a test program");

output.appendText( "\ncmi.interactions.n.id\n=" +
scorm.get("cmi.interactions.n.id")); //(long_identifier_type (SPM:
4000), RW) Unique label for the interaction


output.appendText( "\ncmi.interactions.n.type\n=" + scorm.get("
")); //(state (true_false, multiple_choice, fill_in, long_fill_in,
matching, performance, sequencing, likert, numeric, other), RW) Which
type of interaction is recorded


scorm.set("cmi.interactions.1.objectives._count", "thistestb"); //
test. this may not exist
output.appendText( "\ncmi.interactions.1.objectives\n=" +
scorm.get("cmi.interactions.1.objectives"));



output.appendText( "\ncmi.interactions.n.objectives._count\n=" +
scorm.get("cmi.interactions.n.objectives._count")); //(non-negative
integer, RO) Current number of objectives (i.e., objective
identifiers) being stored by the LMS for this interaction

scorm.set("cmi.interactions.1.objectives.1.id", "objective1");

scorm.set("cmi.interactions.0.id","Q_123435467-foo");
scorm.set("cmi.interactions.0.type","multiple_choice");
scorm.set("cmi.interactions.0.objectives.0.id","iobjid1");
scorm.set("cmi.interactions.0.timestamp","2007-01-18T22:10:35.84Z");
scorm.set("cmi.interactions.0.correct_responses.
0.pattern","blue[,]white][,]red");
scorm.set("cmi.interactions.0.weighting","2");
scorm.set("cmi.interactions.0.learner_response","blue[,]red");
scorm.set("cmi.interactions.0.result","incorrect");
scorm.set("cmi.interactions.0.latency","PT2M54S");
scorm.set("cmi.interactions.0.description","What are the colors in the
French flag?");



scorm.set("cmi.interactions.1.id","Q_123435467-foo");
scorm.set("cmi.interactions.1.type","multiple_choice");
scorm.set("cmi.interactions.1.objectives.0.id","iobjid1");
scorm.set("cmi.interactions.1.timestamp","2007-01-18T22:10:35.84Z");
scorm.set("cmi.interactions.1.correct_responses.
0.pattern","blue[,]white][,]red");
scorm.set("cmi.interactions.1.weighting","2");
scorm.set("cmi.interactions.1.learner_response","blue[,]red");
scorm.set("cmi.interactions.1.result","incorrect");
scorm.set("cmi.interactions.1.latency","PT2M54S");
scorm.set("cmi.interactions.1.description","What are the colors in the
French flag?");
scorm.save();

testvar = "" + scorm.get("cmi.interactions.1.id") +
scorm.get("cmi.interactions.1.type") + scorm.get("cmi.interactions.
1.objectives.0.id") + scorm.get("cmi.interactions.1.timestamp");


output.appendText("\ncmi.interactions group="+testvar);





================all testing output follows===================


mi.version=3.4
cmi.version test=3.43.4
cmi.interactions._children
=id, objectives, time, type, correct_responses, weighting,
student_response, result, latency
cmi.comments_from_learner._children=
cmi.comments_from_learner._count
=
cmi.comments_from_learner.n.comment
=
cmi.comments_from_learner.n.location
=
cmi.comments_from_learner.n.timestamp
=
cmi.comments_from_lms._children
=
cmi.comments_from_lms._count
=
cmi.comments_from_lms.n.comment
=
cmi.comments_from_lms.n.location
=
cmi.comments_from_lms.n.timestamp
=
cmi.completion_status
=
cmi.completion_threshold
=
cmi.credit
=
cmi.entry
=
cmi.exit
=
cmi.interactions._count
=2
test 2-----------


cmi.interactions.n.id
=
cmi.interactions.n.type
=
cmi.interactions.1.objectives
=
cmi.interactions.n.objectives._count
=
cmi.interactions group=

Philip Hutchison

unread,
Aug 28, 2010, 6:41:43 PM8/28/10
to elearning-technolo...@googlegroups.com
Hi Ryan

No, SCORM 2004 is not backwards-compatible with SCORM 1.2.  There were some important syntax changes, as well as a bunch of new data items added in SCORM 2004.

Interactions are write-only in SCORM 1.2.  They're read/write in SCORM 2004. I'm assuming you're using SCORM 2004, because you're using SCORM 2004 syntax/element names.

It's kind of hard to read your code because of how it got formatted in the email, but one thing to keep in mind is that it's up to you -- the SCO developer -- to ensure you're setting the interactions using the correct numbering sequence.

SCORM requires all interactions to be set in order 0, 1, 2, 3, 4, etc.  If you skip a number for any reason, you might run into problems.  It's kind of hard to read the code you supplied, but it looks like you might be skipping 0 or using 'n' as a number (using 'n' won't work).

Try something very simple, such as:

scorm.set("cmi.interactions.0.id", "interaction01");
scorm.set("cmi.interactions.1.id", "interaction02");
scorm.save();

then retrieve the values to see if they were properly set:

output.appendText("id01: " +scorm.get("cmi.interactions.0.id"));
output.appendText("id02: " +scorm.get("cmi.interactions.1.id"));


- philip



--
You received this message because you are subscribed to the Google Groups "eLearning Technology and Development" group.
To post to this group, send email to elearning-technolo...@googlegroups.com.
To unsubscribe from this group, send email to elearning-technology-and...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/elearning-technology-and-development?hl=en.


Reply all
Reply to author
Forward
0 new messages