<div dir="ltr"><div class="markdown-here-wrapper" id="markdown-here-wrapper-495391" style><p style="margin:1.2em 0px!important">Hi,</p>
<p style="margin:1.2em 0px!important">I’m just wondering, does anyone have any code snippets for saving on web activities?</p>
<p style="margin:1.2em 0px!important">I’m trying to make a web activity and am having some issues. Here is my save+load code: [CoffeeScript]</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;display:inline;white-space:pre;overflow:auto;border-top-left-radius:3px;border-top-right-radius:3px;border-bottom-right-radius:3px;border-bottom-left-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;padding:0.5em;color:rgb(51,51,51);background-color:rgb(248,248,255);background-repeat:initial initial">activity.setup()
datastoreObject = activity.getDatastoreObject()
onLoaded = (error, metadata, data) ->
alert data
obj = JSON.parse data
console.log obj
container.html obj.html
$('section').each (x, ele) ->
scribe_slide_setup ele
undefined
datastoreObject.loadAsText onLoaded
activity.write = ->
obj =
html: container.html()
jsonData = JSON.stringify obj
datastoreObject.setDataAsText jsonData
datastoreObject.save()
</code></pre><p style="margin:1.2em 0px!important">Neither methods end up getting called. I’m using 0.100.0.</p>
<p style="margin:1.2em 0px!important">Thanks,<br>Sam</p>
</div></div>