Greetings All,
Add this one single call:
to any html activity located _anywhere_ on the web in order to participate in the NetDispenser ecosystem.
It's funny how things work out, in this case it's funny that a hack I did to quickly import apps to NetDispenser for PyCon turns out to provide a super-simple solution to integrating any web app (activity) to the system. You see, in the days before PyCon I realized that I wasn't going to have enough time to "bring-in" several activities from the Sugarizer project. But I really wanted a few of them, and I wanted them to actually work when I launched them ... so I wrapped _all_ activities in iframes. It was a hack at the time, now it's a clean / minimalist solution to a seemingly ugly problem.
So from your dashboard you launch an app. You see the css animated transition as the iframe expands like a modal window to cover your dashboard and run the activity inside. These activities currently being called and run-via-iframes at
www.creditfeed.me at the moment are all located on remote servers, they're just running in iframes. So the dashboard window is the parent window to whatever's in the iframe. Thus, when the user reaches the goal of the activity, the activity just needs to make the above call, which will show a hidden button which, when pushed, will close the iframe and collect the credits. The button belongs to the parent window, it's just hidden (display=none) until some action occurs, then the (remote) activity calls "try{parent.showCollectB();}catch(e){;}" and everything that needs to happen has happened.
This is a bare-bones, minimalist solution to answer the question: What is the absolute most simple/minimal way to add a new activity?
You could try this out on
www.creditfeed.me logged-in as parent. Just create a new app of the "Now Read This" type (need to change name to "Article Reader"). Now click the gear icon on top of the assignment object. Note the red exit button in bottom right corner. There's a gold, hidden "collect button" just above it. When you hit the big orange "Next" button the activity calls parent.showCollectB(). When you push the button you are awarded credits. (actual incrementing of credits not implemented yet).
--------------------
Example:
You have an app at
mydomain.org/myapp.html.
Edit
this section of this file with your apps url.
Add your app to the dropdown list
right here.
Submit your 3-5 lines back to GitHub and voila! Your app is part of NetDispenser, kids will get 1800 credits for completing it.
--------------------
I love it when huge problems collapse to nothing. This is one of the biggest collapses I can recall. Just had to add a hidden button and a one-line callback. I can think of a lot of more complicated solutions.
Does anyone see anything wrong with this?
Best to all,
-Charles