Code Monkey home page Code Monkey logo

experiments's Issues

add table to summary docs

The table should link to the experiments (repos and previews) that are in the library. Thus, this table should be derived from the library manifest.

updating existing experiments

I made some changes to the existing experiments and I'm wondering if I would need to make another pull request. If so, could you provide me wit some instructions? I remember not doing the pull request correctly and I would like to get them right this time.

Requirements for config.json

These are relatively simple to provide, so it should be reasonable.

Required

  • exp_id: must not yet exist for all expfactory experiments, alphanumerical / _ and - allowed.
  • url: the repository where the code is maintained
  • description: tell us what it is
  • time: estimated time to complete experiment, in minutes

Optional

  • contributors: a list of contributor names
  • cognitive_atlas_task_id: if relevant
  • notes: any additional notes
  • template: a html/framework template, if relevant
  • reference: references, if this is important to you

These will be checked in the CI, and added to the CONTRIBUTING.md document.

Unexpected behaviour when saving user data.

I'm having some trouble saving the experiment data where (1) the data would fail to save and (2) the program will not automatically advance to the next experiment in the container. This occurs for both JsPsych and custom experiments. Here is the code that I'm using to save the data:

For JsPsych:

const settings = {
    fullscreen: true,
    on_finish: function (data) {
        // Serialize the data
        var promise = new Promise(function (resolve, reject) {
            var data = jsPsych.data.get().json();
            resolve(data);
        })

        promise.then(function (data) {
            sendResults(data);
        })
    }

}

const jsPsych = initJsPsych(settings);
async function sendResults(results) {
    function handleErrors(response) {
        if (!response.ok) {
            throw Error(response.statusText);
        }
        return response;
    }

    fetch("/save", {
        method: "POST",
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({ data: results })
    })
        .then(handleErrors)
        .then(response => console.log("Request complete! response: ", response))
        .catch(error =>
            jsPsych.data.get().localSave('csv', 'cognitive_estimation_task_result.csv')
        );
}

For custom:

async function sendResults(results) {
    function handleErrors(response) {
          if (!response.ok) {
              throw Error(response.statusText);
          }
          return response;
      }

      fetch("/save", {
          method: "POST",
          headers: { 'Content-Type': 'application/json' },
          body: JSON.stringify({ data: results })
      })
          .then(handleErrors)
          .then(response => console.log("Request complete! response: ", response))
          .catch(error => console.log("We got an error: ", error));
}

step 2: testing of actual experiments - existing of correct post/save

We would want a change in an experiment repo to trigger another test, that will alert the library if it doesn't pass. I need to think about how to best do this, there are a few options (and I'd like to avoid sharing of any kind of credential between repos). Arguably, the test cases should be provided for the experiment submitted, and then asserted to exist in testing. Any change to the status of the downstream repo (not passing tests, etc.) should alert the library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.