These are chat archives for Learnosity/Support

15th
Sep 2014
Michael Sharman
@michaelsharman
Sep 15 2014 00:02
ok we’ll take a look at that now
barzee
@barzee
Sep 15 2014 01:58
Any updates on these? Thanks.
klauste
@klauste
Sep 15 2014 02:00
Hi there, I'm working on this
so far, I'm not certain where the error is coming from
I'll let you know once I know more
barzee
@barzee
Sep 15 2014 02:04
thanks.
klauste
@klauste
Sep 15 2014 02:23
@barzee I was able to get the items api going with a time node, so I don't think this has anything to do with a specific node
I think the problem might be some whitespace
what worked well for me, is to create a JSONObject from the JSONString
and then to pass the JSONObject to the sdk
do you want to give that a try?
barzee
@barzee
Sep 15 2014 02:58
OK
I'll let you know.
barzee
@barzee
Sep 15 2014 03:28
Can you give simple example what exactly you did? Thanks.
klauste
@klauste
Sep 15 2014 03:44
sure, here's the code:
        String itemSecString = "{\"consumer_key\":\"yis0TYCu7U9V4o7M\","
                +    "\"domain\": \"demos.vg.learnosity.com\","
                +   "\"user_id\": \"demo_student\"}";

        String itemsString = "{\"activity_id\": \"itemsassessdemo\","
                + "\"name\": \"Items API demo - assess activity\","
                + "\"rendering_type\" : \"assess\","
                + "\"state\"          : \"initial\","
                + "\"type\"           : \"submit_practice\","
                + "\"course_id\"      : \"demo_yis0TYCu7U9V4o7M\","
                + "\"session_id\"     : \"041f48c9-cb80-42e8-9d06-467d92013b00\","
                + "\"user_id\"        : \"demo_student\","
                + "\"items\": [\"Demo3\", \"Demo4\", \"Demo5\", \"Demo6\", \"Demo7\", \"Demo8\", \"Demo9\",\"Demo10\"],"
                + "\"assess_inline\": true,"
                + "\"config\": {"
                + "\"title\": \"Demo activity - showcasing question types and assess options\","
                + "    \"subtitle\"       : \"Walter White\","
                + "    \"administration\" : {"
                + "        \"pwd\" : \"5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8\","
                + "        \"options\" : {"
                + "            \"show_save\" : true,"
                + "            \"show_exit\" : true,"
                + "            \"show_extend\" : true"
                + "        }"
                + "    },"
                + "    \"navigation\" : {"
                + "        \"scroll_to_top\"            : false,"
                + "        \"scroll_to_test\"           : false,"
                + "        \"show_intro\"               : true,"
                + "        \"show_outro\"               : false,"
                + "        \"show_next\"                : true,"
                + "        \"show_prev\"                : true,"
                + "        \"show_accessibility\"       : true,"
                + "        \"show_fullscreencontrol\"   : true,"
                + "        \"show_progress\"            : true,"
                + "        \"show_submit\"              : true,"
                + "        \"show_title\"               : true,"
                + "        \"show_save\"                : false,"
                + "        \"show_calculator\"          : false,"
                + "        \"show_itemcount\"           : true,"
                + "        \"skip_submit_confirmation\" : false,"
                + "        \"swipe\"                    : true,"
                + "        \"toc\"                      : true,"
                + "        \"transition\"               : \"slide\","
                + "        \"transition_speed\"         : 400,"
                + "        \"warning_on_change\"        : false,"
                + "        \"scrolling_indicator\"      : false,"
                + "        \"show_answermasking\"       : true,"
                + "        \"auto_save\" : {"
                + "            \"ui\" : false,"
                + "            \"saveIntervalDuration\" : 500"
                + "        }"
                + "    },"
                + "    \"time\" : {"
                + "        \"max_time\"     : 1500,"
                + "        \"limit_type\"   : \"soft\","
                + "        \"show_pause\"   : true,"
                + "        \"warning_time\" : 120,"
                + "        \"show_time\"    : true"
                + "    },"
                + "    \"labelBundle\" : {"
                + "        \"item\" : \"Question\""
                + "    },"
                + "    \"ui_style\"            : \"main\","
                + "    \"ignore_validation\"   : false,"
                + "    \"configuration\"       : {"
                + "        \"fontsize\"               : \"normal\","
                + "        \"stylesheet\"             : \"\","
                + "        \"onsubmit_redirect_url\"  : \"itemsapi_assess.php\","
                + "        \"onsave_redirect_url\"    : \"itemsapi_assess.php\","
                + "        \"ondiscard_redirect_url\" : \"itemsapi_assess.php\","
                + "        \"idle_timeout\"           : {"
                + "            \"interval\"       : 300,"
                + "            \"countdown_time\" : 60"
                + "        }"
                + "    }"
                + "}}";

        JSONObject itemsObj = new JSONObject(itemsString);
        //itemsString = itemsObj.toString();
        init = new Init("items", itemSecString, consumerSecret, itemsObj.toString(), "");
        String itemsTest = init.generate();
When calling the constructor, you can also pass in the JSON Object like so:
init = new Init("items", itemSecString, consumerSecret, itemsObj,"");
Does that make sense?
barzee
@barzee
Sep 15 2014 03:49
Before I started this chat I tried passing JSONObject, String with all sorts of options and nothing seemed to work with time node init. I'm trying now with the above code.
klauste
@klauste
Sep 15 2014 03:52
There are a couple of overloaded constructors and the one you'd want to call is this one:
public Init (String service, Object securityPacket, String secret, Object requestPacket, String action)
that's what the above code does
barzee
@barzee
Sep 15 2014 03:52
OK
barzee
@barzee
Sep 15 2014 03:59
Got it. I appreciate your help.
klauste
@klauste
Sep 15 2014 04:11
cool, all good
barzee
@barzee
Sep 15 2014 19:23
I have a question about environments. We currently have DEV,QA and PROD environments and I was wandering if you expose environments for testing and production separately or is all the same?
Michael Sharman
@michaelsharman
Sep 15 2014 22:15
it often depends on how clients want to set things up
you can point to our production versions, for you’re own lower level environments
of course that might mean different versions of our products in your QA for testing and UAT etc
in terms of content from our item bank, you can use the same (production) content across all environments
or we can create different sandboxes in the authoring site for you to have separation of content between your environments
hope that helped