(This is my first question on Stackoverflow, so I hope I'm right.)
I am trying to set up a CrowdCrafting.org project using the PyBOSSA infrastructure . I followed their tutorial to develop a project. The first parts seemed very understandable to me, creating a project and adding that the tasks worked fine. Then I created my own html page to present the task to users. Now the next step is to download tasks from the project, provide them to users and save their answers. Unfortunately, I do not understand how to do this. I will try to formulate some questions so that you understand my problem:
- How can I try this? It seems that the only way is to update the code and then run pbs update_project
- Where can I find documentation for PyBossa.js ? I just saw (in the tutorial and on other pages) that there are some functions, such as
pybossa.taskLoaded(function(task, deferred){}); and pybossa.presentTask(function(task, deferred){}); . But I do not know how they work, and what else is. This page looks like it will contain documentation, but it does not contain (broken links or an empty index). - How to use the library? I want to: a) download the task, b) present it to the user, c) show my progress to the user and d) send an answer. So I think that I will need to name 4 different functions. But I do not know how to do this.
I look forward to any information from you.
Edit: 4. After looking at the sample project code, I donβt understand what kind of disqus it is. I think disqus is a forum software, but I am not sure about it, and I donβt know what it is about my project (or theirs).
Edit: As far as I understand, the main parts of the JS library are:
pybossa.taskLoaded(function(task, deferred) { if ( !$.isEmptyObject(task) ) { deferred.resolve(task); } else { deferred.resolve(task); } }); pybossa.presentTask(function(task, deferred) { if ( !$.isEmptyObject(task) ) { // choose a container within your html to load the data into (depends on your layout and on the way you created the tasks) $("#someID").html(task.info.someName); // by clickin "next_button" save answer and load next task $("#next_button").click( function () { // save answer into variable here var answer = $("#someOtherID").val(); if (typeof answer != 'undefined') { pybossa.saveTask(task.id, answer).done(function() { deferred.resolve(); }); } }); } else { $("#someID").html("There are no more tasks to complete. Thanks for participating in ... "); } }); pybossa.run('<short name>');
javascript crowdsourcing
anjuta
source share