Data returned from server: 1411746297.05 BEFORE SET {u'cmi.interactions.0.correct_responses.0.pattern': u'0'} = {}
Data returned from server: 1411746297.05 AFTER SET {u'cmi.interactions.0.correct_responses.0.pattern': u'0'} = {u'cmi.interactions.0.correct_responses.0.pattern': u'0'} (index):1039Data returned from server: 1411746297.06 BEFORE SET {u'cmi.interactions.0.result': u'correct'} = {}
Data returned from server: 1411746297.07 AFTER SET {u'cmi.interactions.0.result': u'correct'} = {u'cmi.interactions.0.result': u'correct'} API.LMSSetValue("one","one")(0.001) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)
(0.000) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "one"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one"\n }\n}', 281)var data = [["one","uno"],["one","eins"],["one","eens"],["two","dos"],["one","wa'"]]
for (var i in data) { API.LMSSetValue(data[i][0],data[i][1]) } ;# Whooooole bunch of SELECTs, then...
(0.004) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "uno"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "uno"\n }\n}', 281)
(0.000) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)
(0.054) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)
(0.061) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "eens"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "eens"\n }\n}', 281)
(0.239) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "eins"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "eins"\n }\n}', 281)
## NOTE THIS BIT HERE. The "two" property is added, but then...
(0.421) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "one",
"two": "dos"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one",\n "two": "dos"\n }\n}', 281)
## ...in the next operation, it's gone.
(0.465) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "wa'"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "wa\'"\n }\n}', 281)
API.LMSSetValue("one","one")
API.LMSSetValue("two", "two")(0.000) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "one" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one"\n }\n}', 281)
(0.000) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "one", "two": "two" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one",\n "two": "two"\n }\n}', 281)var data = [["one","uno"],["one","eins"],,["two","dos"],["three","tres"],["one","wa'"]]
for (var i in data) { API.LMSSetValue(data[i][0],data[i][1]) } ;
## Updating "one" to "uno": looks good
(0.004) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "uno", "two": "two" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "uno",\n "two": "two"\n }\n}', 281)(0.003) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')(0.001) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)(0.000) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)(0.044) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)
## Huh. Updating "two" to "dos" was the *third* update issued, not the second, AND the value of "one" got reverted (0.074) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "one", "two": "dos" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one",\n "two": "dos"\n }\n}', 281)
## Then we update "one" to "eins" (second command issued), and "two" reverts!(0.556) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "eins", "two": "two" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "eins",\n "two": "two"\n }\n}', 281)
## Now the fifth update issued happens. "two" is still its original value.(0.925) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "wa'", "two": "two" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "wa\'",\n "two": "two"\n }\n}', 281)
## The fourth operation, adding a "three" key, lands last... and now "one" is reverted, too.(1.294) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = { "scorm_data": { "one": "one", "three": "tres", "two": "two" }} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one",\n "three": "tres",\n "two": "two"\n }\n}', 281)Data returned from server: 1411834063.46 AFTER SET {u'one': u'uno'} = {u'two': u'two', u'one': u'uno'} (index):1039Data returned from server: 1411834063.46 BEFORE SET {u'one': u'uno'} = {u'two': u'two', u'one': u'one'} (index):1039Data returned from server: 1411834063.47 AFTER SET {u'two': u'dos'} = {u'two': u'dos', u'one': u'one'} (index):1039Data returned from server: 1411834063.47 BEFORE SET {u'two': u'dos'} = {u'two': u'two', u'one': u'one'} (index):1039Data returned from server: 1411834063.47 AFTER SET {u'one': u'eins'} = {u'two': u'two', u'one': u'eins'} (index):1039Data returned from server: 1411834063.47 BEFORE SET {u'one': u'eins'} = {u'two': u'two', u'one': u'one'} (index):1039Data returned from server: 1411834063.48 AFTER SET {u'one': u"wa'"} = {u'two': u'two', u'one': u"wa'"} (index):1039Data returned from server: 1411834063.47 BEFORE SET {u'one': u"wa'"} = {u'two': u'two', u'one': u'one'} (index):1039Data returned from server: 1411834063.47 AFTER SET {u'three': u'tres'} = {u'three': u'tres', u'two': u'two', u'one': u'one'} (index):1039Data returned from server: 1411834063.47 BEFORE SET {u'three': u'tres'} = {u'two': u'two', u'one': u'one'} Thanks for the quick response!
Ok, looking in workbench.log...Let's start with something simple. In the JS console I'll run:API.LMSSetValue("one","one")This produces the following log:(0.001) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT "workbench_xblockstate"."id", "workbench_xblockstate"."scope", "workbench_xblockstate"."scope_id", "workbench_xblockstate"."user_id", "workbench_xblockstate"."scenario", "workbench_xblockstate"."tag", "workbench_xblockstate"."created", "workbench_xblockstate"."state" FROM "workbench_xblockstate" WHERE ("workbench_xblockstate"."scope" = usage AND "workbench_xblockstate"."tag" = xb_scorm AND "workbench_xblockstate"."scope_id" = xblockscorm.xb_scorm.d0.u0 AND "workbench_xblockstate"."scenario" = xblockscorm AND "workbench_xblockstate"."user_id" = student_1 ); args=('usage', u'xb_scorm', u'xblockscorm.xb_scorm.d0.u0', u'xblockscorm', u'student_1')
(0.000) SELECT (1) AS "a" FROM "workbench_xblockstate" WHERE "workbench_xblockstate"."id" = 281 LIMIT 1; args=(281,)
(0.000) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
"scorm_data": {
"one": "one"
}
} WHERE "workbench_xblockstate"."id" = 281 ; args=(u'usage', u'xblockscorm.xb_scorm.d0.u0', u'student_1', u'xblockscorm', u'xb_scorm', u'2014-09-26 15:02:30.212505', '{\n "scorm_data": {\n "one": "one"\n }\n}', 281)That's more SELECTs than I would have expected, but the UPDATE at the end looks OK.Now let's try something more challenging from the console...var data = [["one","uno"],["one","eins"],["one","eens"],["two","dos"],["one","wa'"]]
for (var i in data) { API.LMSSetValue(data[i][0],data[i][1]) } ;Now I see this in the logs...
# Whooooole bunch of SELECTs, then...
(0.004) UPDATE "workbench_xblockstate" SET "scope" = usage, "scope_id" = xblockscorm.xb_scorm.d0.u0, "user_id" = student_1, "scenario" = xblockscorm, "tag" = xb_scorm, "created" = 2014-09-26 15:02:30.212505, "state" = {
...
"scorm_data"<span style="color: #660;" class="s