{"id":306074,"date":"2020-06-28T21:01:35","date_gmt":"2020-06-28T21:01:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=306074"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=306074","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 xAPI (Tin Can) \u0438 CMI5 \u0432 \u0438\u043c\u0438\u0442\u0430\u0442\u043e\u0440\u0430\u0445"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508624\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pl\/3e\/cj\/pl3ecjxunuggfztyctmiohj5yu4.jpeg\" alt=\"image\"><\/div>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e SCORM 2004 \u0435\u0449\u0435 \u00ab\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u0438\u00bb, \u043f\u043e\u0440\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 xAPI \/ TinCab \/ CMI5. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430\u0445 <a href=\"http:\/\/www.SCORM.com\" rel=\"nofollow\">www.SCORM.com<\/a> \u0438 <a href=\"http:\/\/www.adlnet.gov\" rel=\"nofollow\">www.adlnet.gov<\/a>.<\/p>\n<p>  \u0418\u0442\u0430\u043a, Tin Can API \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0432 \u0441\u0444\u0435\u0440\u0435 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043f\u0443\u0442\u0451\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0437\u0430\u043d\u044f\u0442\u0438\u0439 \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0447\u0435\u0431\u043d\u043e\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u2014 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 (\u0430\u043d\u0433\u043b. learning record store, LRS). <\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u043d\u0430 <a href=\"https:\/\/books.ifmo.ru\/file\/pdf\/1772.pdf\" rel=\"nofollow\">books.ifmo.ru\/file\/pdf\/1772.pdf<\/a><\/p>\n<p>  \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Tin Can API:<\/p>\n<p>  Tin Can API \u2014 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SCORM<br \/>  Tin Can API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u044b\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430<br \/>  Tin Can API \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0421\u0414\u041e<br \/>  Tin Can API \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043e\u0446\u0435\u043d\u0438\u043c\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c \u0443\u0447\u0435\u0431\u043d\u044b\u043c \u043e\u0442\u0434\u0435\u043b\u0430\u043c, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0443\u0447\u0435\u0431\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0432\u044b\u0448\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u042d\u0442\u043e \u0442\u0435\u043e\u0440\u0438\u044f, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430.<\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 SCORM \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u00ab\u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445. <br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u0443 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\u2026<\/p>\n<pre><code class=\"plaintext\">min = 0 max= 100 raw_score = 100 scaled = raw_score \/ max -- \u041e\u0446\u0435\u043d\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u043a \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 0..1. \t ScormSetValue(&quot;cmi.score.min&quot;, &quot;&quot;..min); -- \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 ScormSetValue(&quot;cmi.score.max&quot;, &quot;&quot;..max); -- \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 ScormSetValue(&quot;cmi.score.raw&quot;, &quot;&quot;..raw_score); -- \u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 ScormSetValue(&quot;cmi.score.scaled&quot;, &quot;&quot;..scaled); -- \u041e\u0446\u0435\u043d\u043a\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0430\u044f \u043a \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0443 0..1.  --\u041e\u0431\u044a\u0435\u043c (\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e) 0..1 ScormSetValue(&quot;cmi.progress_measure&quot;, &quot;1&quot;);  ScormSetValue(&quot;cmi.success_status&quot;, &quot;passed&quot;); ScormSetValue(&quot;cmi.completion_status&quot;, &quot;completed&quot;);  ScormGetValue(&quot;cmi.learner_name&quot;); ScormGetValue(&quot;cmi.learner_id&quot;); ScormGetValue(&quot;cmi.suspend_data&quot;); ScormGetValue(&quot;cmi.scaled_passing_score&quot;); ScormGetValue(&quot;cmi.completion_threshold&quot;);  print ( ScormGetValue(&quot;cmi._version&quot;)) print ( ScormGetValue(&quot;cmi.total_time&quot;)) print ( ScormGetValue(&quot;cmi.time_limit_action&quot;)) print ( ScormGetValue(&quot;cmi.max_time_allowed&quot;))  --\u0417\u0430\u043f\u0438\u0441\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0446\u0438\u0439 ScormSetValue(&quot;cmi.interactions.0.id&quot;,&quot;Step1&quot;);  ScormSetValue(&quot;cmi.interactions.0.description&quot;, &quot;17:14:28\t\u041f\u0440\u043e\u0438\u0437\u0432\u0435\u0441\u0442\u0438 \u0430\u0432\u0430\u0440\u0438\u0439\u043d\u044b\u0439 \u043e\u0441\u0442\u0430\u043d\u043e\u0432 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u043f\u0440\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0441\u0442\u0430\u043d\u0446\u0438\u0439&quot;) ScormSetValue(&quot;cmi.interactions.0.result&quot;,&quot;correct&quot;);  ScormSetValue(&quot;cmi.interactions.1.id&quot;,&quot;Step2&quot;);  ScormSetValue(&quot;cmi.interactions.1.type&quot;,&quot;fill-in&quot;);  ScormSetValue(&quot;cmi.interactions.1.objectives.0.id&quot;,&quot;urn:ADL:objectiveid-0001&quot;); ScormSetValue(&quot;cmi.interactions.1.description&quot;, &quot;privet&quot;);  ScormSetValue(&quot;cmi.interactions.1.learner_response&quot;, &quot;privet&quot;);  ScormSetValue(&quot;cmi.interactions.1.timestamp&quot;, &quot;2005-10-11T09:00:30&quot;); ScormSetValue(&quot;cmi.interactions.1.correct_responses.0.pattern&quot;, &quot;privet&quot;); ScormSetValue(&quot;cmi.interactions.1.weighting&quot;, &quot;1&quot;); --correct, incorrect, unanticipated, neutral , number 0..1 ScormSetValue(&quot;cmi.interactions.1.result&quot;,&quot;unanticipated&quot;); ScormSetValue(&quot;cmi.interactions.1.latency&quot;, &quot;PT0H0M5.0S&quot;);  ScormSetValue (&quot;cmi.comments_from_learner.0.comment&quot;,q1); ScormSetValue (&quot;cmi.comments_from_learner.1.comment&quot;,q2); <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a \u0432\u0441\u0435 \u0438 \u0434\u0435\u043b\u0430\u043b\u043e\u0441\u044c\u2026 \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430 xAPI\u2026<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u0435\u0445 LRS \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u043b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f (\u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 login\/pass \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e)\u2026<\/p>\n<ul>\n<li>host = \u00ab<a href=\"https:\/\/cloud.scorm.com\/ScormEngineInterface\/TCAPI\/public\/statements\" rel=\"nofollow\">cloud.scorm.com\/ScormEngineInterface\/TCAPI\/public\/statements<\/a>\u00bb<\/li>\n<li>host = \u00ab<a href=\"https:\/\/lrs.adlnet.gov\/xapi\/statements\" rel=\"nofollow\">lrs.adlnet.gov\/xapi\/statements<\/a>\u00bb<\/li>\n<li>\/\/\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u2014 <a href=\"https:\/\/lrs.adlnet.gov\/prototypes\/StatementViewer\/index.html\" rel=\"nofollow\">lrs.adlnet.gov\/prototypes\/StatementViewer\/index.html<\/a><\/li>\n<li><a href=\"https:\/\/watershed.ws\/tc\" rel=\"nofollow\">watershed.ws\/tc<\/a><\/li>\n<li><a href=\"http:\/\/tincanapi.com\/public-lrs\/\" rel=\"nofollow\">tincanapi.com\/public-lrs<\/a><\/li>\n<li>host = \u00ab<a href=\"https:\/\/cloud.scorm.com\/tc\/QXTBX7C4VK\/sandbox\/statements\/\" rel=\"nofollow\">cloud.scorm.com\/tc\/QXTBX7C4VK\/sandbox\/statements<\/a>\u00bb<\/li>\n<li>\/\/\u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u2014 <a href=\"https:\/\/cloud.scorm.com\/sc\/user\/LRSView\" rel=\"nofollow\">cloud.scorm.com\/sc\/user\/LRSView<\/a><\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 xAPI \u043d\u0430 C++ \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f CURL \u0438 \u043a\u0430\u043a\u0430\u044f-\u043d\u0438\u0431\u0443\u0434\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 JSON (cJSON \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440)\u2026<\/p>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 xAPI \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"plaintext\">TinCanAddRecord(&quot;actor:::mbox:::mailto:mathmodel@mathmodel.com&quot;)\t\t\tTinCanAddRecord(&quot;actor:::name:::mathmodel&quot;) TinCanAddRecord(&quot;actor:::objectType:::Agent&quot;) TinCanAddRecord(&quot;verb:::id:::http:\/\/adlnet.gov\/expapi\/verbs\/interacted&quot;) TinCanAddRecord(&quot;object:::id:::http:\/\/lcontent.ru\/lms1\/simulator2&quot;) TinCanAddRecord(&quot;object:::objectType:::Activity&quot;) \t\t\t \t\t\tTinCanAddRecord(&quot;object:::definition:::type:::http:\/\/www.lcontent.ru\/lms1\/simulator1&quot;) TinCanAddRecord(&quot;object:::definition:::name:::en-US:::mathmodel&quot;) TinCanAddRecord(&quot;object:::definition:::description:::en-US:::mathmodel log&quot;) \t\t\t TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/Teapot1 angle:::&quot; .. a1) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/Teapot2 angle:::&quot; .. a2) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/Teapot3 angle:::&quot; .. a3) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/time:::&quot; .. (os.clock() - veryoldtime)) \t\t\t TinCanAddRecord(&quot;actor:::mbox:::mailto:maxgammer@gmail.com&quot;) TinCanAddRecord(&quot;actor:::name:::Maxim Gammer&quot;) TinCanAddRecord(&quot;actor:::objectType:::Agent&quot;) TinCanAddRecord(&quot;verb:::id:::http:\/\/adlnet.gov\/expapi\/verbs\/interacted&quot;) TinCanAddRecord(&quot;object:::id:::http:\/\/lcontent.ru\/lms1\/simulator2&quot;) TinCanAddRecord(&quot;object:::objectType:::Activity&quot;) TinCanAddRecord(&quot;object:::definition:::type:::http:\/\/lcontent.ru\/lms1\/simulator1&quot;) TinCanAddRecord(&quot;object:::definition:::name:::en-US:::User move&quot;) TinCanAddRecord(&quot;object:::definition:::description:::en-US:::User coordinates&quot;) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/time:::&quot; .. (os.clock() - veryoldtime)) \t\t\t TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/X:::&quot; .. UserData.X) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/Y:::&quot; .. UserData.Y) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/Z:::&quot; .. UserData.Z) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/HeadYaw:::&quot; .. UserData.HeadYaw) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/HeadPitch:::&quot; .. UserData.HeadPitch) TinCanAddRecord(&quot;object:::extensions:::http:\/\/lcontent.ru\/upsv\/HeadRoll:::&quot; .. UserData.HeadRoll)<\/code><\/pre>\n<p>  \u0412\u0441\u0435, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0437\u0430\u043f\u0438\u0441\u0438 \u0432 LRS.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jv\/fa\/sb\/jvfasbjdgecsbpuq8t1fuepyg04.png\">&quot; <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">InterfaceForTinCan.cpp<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">#include &lt;stdio.h&gt; #include &lt;fcntl.h&gt; #include &lt;sys\/stat.h&gt; #include &lt;string&gt; #include &lt;string.h&gt; #include &lt;iostream&gt; #include &lt;fstream&gt;  #include &lt;vector&gt; #include &lt;map&gt; #include &lt;algorithm&gt; #include &lt;iterator&gt;  #include &lt;curl\/curl.h&gt;  \/\/using namespace std;  #ifdef WIN32 \t#include &quot;.\/cJSON.h&quot; #else \t#include &quot;.\/cJSON.h&quot; #endif  class InterfaceForTinCan { public: \tInterfaceForTinCan(); \tvoid AddTinCanRecord(std::string str, std::string type); \tvoid PostToLRS(std::string host, std::string login, std::string password); \tvoid PostFileToLRS(std::string filename); \tvoid PostToFile (std::string filename); \t  private: \tstd::vector&lt;std::string&gt; split(const std::string&amp; s, const std::string&amp; delim, const bool keep_empty = true ) ;  \t\/\/\u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \tstd::map &lt;std::string, cJSON *&gt; OBJECTS; \t\/\/ \tcJSON *top;  \tstd::string LRS_host; \tstd::string LRS_login; \tstd::string LRS_password;    \tvoid PostStringToLRS(std::string zzz);  };   InterfaceForTinCan::InterfaceForTinCan() { \ttop=cJSON_CreateObject(); }  void InterfaceForTinCan::AddTinCanRecord(std::string str, std::string type) { \t\/\/1. \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0441\u0442\u0440\u0430\u043a\u0443 \u0432 \u0432\u0435\u043a\u0442\u043e\u0440 \u0447\u0435\u0440\u0435\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c (::: \u0438\u043b\u0438 @@@) \tstd::vector&lt;std::string&gt; words = split(str, &quot;:::&quot;); \t\/\/\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 2 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u044d\u0442\u043e \u043f\u043e\u043b\u0435=\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \tint numOfObject = words.size();  \t\/\/ \tstd::string z =  words [0]; \tif( OBJECTS.end() != OBJECTS.find(z)) \t{ \t\t\/\/\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \t}  \telse \t{ \t\t\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \t\tOBJECTS[z] =cJSON_CreateObject(); \t\t\/\/\u043a\u043b\u0435\u0438\u043c \u043a root \t\tcJSON_AddItemToObject(top,z.c_str(), OBJECTS[z]); \t}  \tfor (int i=1; i &lt; numOfObject -2; i++) \t{ \t\tstd::string oldz = z; \t\tz = z + &quot;:::&quot; + words [i];  \t\tif( OBJECTS.end() != OBJECTS.find(z)) \t\t{ \t\t\t\/\/\u043a\u043b\u044e\u0447 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \t\t}  \t\telse \t\t{ \t\t\t\/\/\u0441\u043e\u0437\u0434\u0430\u0435\u043c \t\t\tOBJECTS[z] =cJSON_CreateObject(); \t\t\t\/\/\u043a\u043b\u0435\u0438\u043c \u043a  \t\t\tcJSON_AddItemToObject(OBJECTS[oldz], words [i].c_str(), OBJECTS[z]); \t\t} \t}  \tstd::string value = words [numOfObject-1]; \tif (type==&quot;string&quot;) \t{ \t\tcJSON_AddStringToObject(OBJECTS[z], words [numOfObject-2].c_str(), value.c_str()); \t} \telse if  (type==&quot;number&quot;) \t{ \t\tcJSON_AddNumberToObject(OBJECTS[z], words [numOfObject-2].c_str(), std::stod(value)); \t} \telse if  (type==&quot;bool&quot;) \t{ \t\tbool val = false; \t\tif ((value==&quot;true&quot;)||(value==&quot;TRUE&quot;)) val = true; \t\tcJSON_AddBoolToObject(OBJECTS[z], words [numOfObject-2].c_str(), val); \t} }   void InterfaceForTinCan::PostToLRS(std::string host, std::string login, std::string password) { \tchar* out=cJSON_Print(top);\t \tstd::string zzz = out; \tcJSON_Delete(top); \tOBJECTS.clear();  \tprintf(&quot;%s\\n&quot;,out); \tfree(out); \ttop=cJSON_CreateObject();   \tLRS_host = host; \tLRS_login = login; \tLRS_password = password;  \tPostStringToLRS(zzz); }  void InterfaceForTinCan::PostFileToLRS(std::string filename) { \tstd::string zzz; \tstd::string line; \tstd::ifstream myfile (filename.c_str());     if (myfile.is_open())     { \t\twhile ( myfile.good() ) \t\t{ \t\t\tgetline (myfile,line); \t\t\tzzz = zzz + line; \t\t} \t\tmyfile.close();     } \t\/\/ \tPostStringToLRS(zzz); }  void InterfaceForTinCan::PostToFile(std::string filename) { \tchar* out=cJSON_Print(top);\t \tstd::string zzz = out; \tcJSON_Delete(top); \tOBJECTS.clear(); \t \tstd::ofstream myfile; \tmyfile.open (filename); \tmyfile &lt;&lt; zzz; \tmyfile.close();  \tfree(out); \ttop=cJSON_CreateObject(); }  void InterfaceForTinCan::PostStringToLRS(std::string zzz) { \tstd::string URL = LRS_host; \/\/&quot;https:\/\/cloud.scorm.com\/ScormEngineInterface\/TCAPI\/public\/statements&quot;; \tstd::string loginpassword = LRS_login + &quot;:&quot; + LRS_password; \/\/&quot;test:test&quot;   \tCURL *curl; \tstruct curl_slist *headers=NULL;       headers = curl_slist_append(headers, &quot;Accept: application\/json&quot;);     headers = curl_slist_append( headers, &quot;Content-Type: application\/json&quot;);     headers = curl_slist_append( headers, &quot;X-Experience-API-Version:1.0.0&quot;);     headers = curl_slist_append( headers, &quot;charsets: utf-8&quot;);  \tcurl = curl_easy_init();       if (curl)     {         \/* enable verbose for easier tracing *\/         curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);          curl_easy_setopt(curl, CURLOPT_URL, URL.c_str());         curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, &quot;POST&quot;); \/\/PUT         curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); \t\t\/\/         curl_easy_setopt( curl, CURLOPT_USERPWD, loginpassword.c_str() ); \/\/&quot;test:test&quot; \t\t\/\/ With the curl command line tool, you disable this with -k\/--insecure.         curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);         curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, false); \t\t         curl_easy_setopt(curl, CURLOPT_POST, 1);         curl_easy_setopt(curl, CURLOPT_POSTFIELDS, zzz.c_str());          std::cout&lt;&lt; &quot;...&quot; &lt;&lt; std::endl; \t\tCURLcode res = curl_easy_perform(curl);         std::cout&lt;&lt;   std::endl &lt;&lt; &quot;...&quot; &lt;&lt; std::endl;  \t\t\/* Check for errors *\/          if(res != CURLE_OK)         {             std::cout&lt;&lt; &quot;error:&quot; &lt;&lt; std::endl;             fprintf(stderr, &quot;curl_easy_perform() failed: %s\\n&quot;, curl_easy_strerror(res));             std::cout &lt;&lt; std::endl;         }  \t\tcurl_easy_cleanup(curl); \t} \telse \t{ \t\tstd::cout &lt;&lt; &quot;false&quot; &lt;&lt; std::endl; \t} }  std::vector&lt;std::string&gt; InterfaceForTinCan::split(const std::string&amp; s, const std::string&amp; delim, const bool keep_empty)  { \tstd::vector &lt;std::string&gt; result; \tif (delim.empty())  \t{ \t\tresult.push_back(s); \t\treturn result; \t}     std::string::const_iterator substart = s.begin(), subend;     while (true)  \t{         subend = search(substart, s.end(), delim.begin(), delim.end());         std::string temp(substart, subend);         if (keep_empty || !temp.empty()) {             result.push_back(temp);         }         if (subend == s.end()) {             break;         }         substart = subend + delim.size();     }     return result; } <\/code><\/pre>\n<p>  <\/div>\n<\/p><\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/508624\/\"> https:\/\/habr.com\/ru\/post\/508624\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/508624\/\">\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pl\/3e\/cj\/pl3ecjxunuggfztyctmiohj5yu4.jpeg\" alt=\"image\"><\/div>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e SCORM 2004 \u0435\u0449\u0435 \u00ab\u0434\u0435\u0440\u0436\u0438\u0442 \u043f\u043e\u0437\u0438\u0446\u0438\u0438\u00bb, \u043f\u043e\u0440\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u044b. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 xAPI \/ TinCab \/ CMI5. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u0434 \u043d\u0430 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u0430\u0445 <a href=\"http:\/\/www.SCORM.com\" rel=\"nofollow\">www.SCORM.com<\/a> \u0438 <a href=\"http:\/\/www.adlnet.gov\" rel=\"nofollow\">www.adlnet.gov<\/a>.<\/p>\n<p>  \u0418\u0442\u0430\u043a, Tin Can API \u2014 \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c \u0432 \u0441\u0444\u0435\u0440\u0435 \u0434\u0438\u0441\u0442\u0430\u043d\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u0443\u0447\u0430\u044e\u0449\u0438\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c \u043e\u0431\u0449\u0430\u0442\u044c\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u0441\u043e\u0431\u043e\u0439 \u043f\u0443\u0442\u0451\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0437\u0430\u043d\u044f\u0442\u0438\u0439 \u0432\u0441\u0435\u0445 \u0432\u0438\u0434\u043e\u0432. \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e\u0431 \u0443\u0447\u0435\u0431\u043d\u043e\u0439 \u0434\u0435\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u0432 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u0431\u0430\u0437\u0443 \u2014 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0443\u0447\u0435\u0431\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 (\u0430\u043d\u0433\u043b. learning record store, LRS). <\/p>\n<p>  \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0447\u0435\u0441\u0442\u044c \u043d\u0430 <a href=\"https:\/\/books.ifmo.ru\/file\/pdf\/1772.pdf\" rel=\"nofollow\">books.ifmo.ru\/file\/pdf\/1772.pdf<\/a><\/p>\n<p>  \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 Tin Can API:<\/p>\n<p>  Tin Can API \u2014 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u0430\u044f \u0437\u0430\u043c\u0435\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 SCORM<br \/>  Tin Can API \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u043e\u043f\u044b\u0442 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u0434\u0430\u0435\u0442 \u043d\u0430\u043c \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u0443\u044e \u043a\u0430\u0440\u0442\u0438\u043d\u0443 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430<br \/>  Tin Can API \u0441\u043d\u0438\u043c\u0430\u0435\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f, \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0421\u0414\u041e<br \/>  Tin Can API \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0435\u043e\u0446\u0435\u043d\u0438\u043c\u0443\u044e \u043f\u043e\u043c\u043e\u0449\u044c \u0443\u0447\u0435\u0431\u043d\u044b\u043c \u043e\u0442\u0434\u0435\u043b\u0430\u043c, \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0443\u0447\u0435\u0431\u043d\u044b\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u043f\u043e\u0432\u044b\u0448\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u042d\u0442\u043e \u0442\u0435\u043e\u0440\u0438\u044f, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0430.<\/p>\n<p>  \u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 SCORM \u0432\u0441\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u00ab\u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0442\u044c\u00bb \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-306074","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306074","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=306074"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/306074\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=306074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=306074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=306074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}