Socket
Socket
Sign inDemoInstall

nodus-ponens

Package Overview
Dependencies
164
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodus-ponens

A light, full-stack framework for running high-level reasoning and cognitive science experiments in Node.js.


Version published
Maintainers
1
Weekly downloads
4
increased by300%

Weekly downloads

Readme

Source

nodus-ponens

A light, full-stack framework for running high-level reasoning and cognitive science experiments in Node.js.

Bug fixes

  • Fixed circular dependency warnings + minor bugs
  • Added ability to save incomplete data
  • Added compatibility for Windows line-endings (caught by J. Korman)
  • Added new fn, hideProblem(), in showStimuli
  • Fixed checkbox bugs (caught by J. Korman)
  • Fixed logging errors (caught by J. Korman)
  • Eliminated references to external image files
  • Fixed slider value error (caught by J. Korman)
  • Fixed errors in documentation specification (caught by Z. Horne)
  • Created hanging indentation for radio- and choice-tasks

Preliminary Setup

$ sudo npm install -g shelljs       # nodus-ponens requires global installation of "shelljs"

Quick Start Guide

nodus-ponens is a full-stack framework for running high-level cognitive science experiments. It comes bundled with a fully-functional experiment template. To set the experiment up, run as follows:

$ mkdir temp
$ cd temp
$ npm install nodus-ponens
$ npm explore nodus-ponens -- npm run-script create-template
$ node main.js

The framework will launch a server-side monitoring console (in the terminal), and the experiment can then be viewed at http://localhost:55151.

Usage

var path             = require("path");
var fs               = require('fs');
var staticDirectory  = path.resolve("static");              // Set directory of static HTML+CSS files
var dataDirectory    = path.resolve("data");              // Set directory where data will be written
var participantIndex = 0;                            // Start participant numbering at this value + 1

var np               = require("nodus-ponens")(participantIndex, staticDirectory, dataDirectory);
np.authors           = "Authors";
np.experimentName    = "Template1";
np.port              = 55151;

// Note: The user has to define the function np.loadStimuli() that is intended to take a
// participant's ID number (an integer) as input and return an array of objects representing the
// stimuli catered to that participant. The function allows users to define stimuli directly, read
// stimuli from an external file, or pull stimuli from other resources. In the template file included
// with the experiment (see Quick Start Guide above), the function "setupStimuli" serves this purpose
// by importing experimental stimuli from a CSV file. Supposing that the user successfully defines
// this function, the nodus-ponens setup proceeds as follows:

function setupStimuli(PID)          // Takes integer input and returns stimuli as set of JSON objects
{
   /* Write appropriate stimuli generation code here ... */
   return stimuli;             // To randomize the order of the stimuli, return np.randomize(stimuli)
}

np.loadStimuli = setupStimuli;
np.launchStudy();

License

(c) 2022 Sangeet Khemlani, http://www.khemlani.net/, Creative Commons License.

FAQs

Last updated on 19 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc