<commit_before>/** 
 * jspsych-call-function
 * plugin for calling an arbitrary function during a jspsych experiment
 * <NAME>
 * 
 * documentation: https://github.com/jodeleeuw/jsPsych/wiki/jspsych-call-function
 * 
**/

(function($) {
    jsPsych['call-function'] = (function() {

        var plugin = {};

        plugin.create = function(params) {
            var trials = new Array(1);
            trials[0] = {
                "func": params.func,
                "args": params.args || []
            };
            return trials;
        };

        plugin.trial = function(display_element, trial) {
            var return_val = trial.func.apply({}, [trial.args]);
            if (typeof return_val !== 'undefined') {
                jsPsych.data.write($.extend({},{
                    value: return_val
                },trial.data));
            }

            jsPsych.finishTrial();
        };

        return plugin;
    })();
})(jQuery);<commit_msg>remove args param<commit_after>/** 
 * jspsych-call-function
 * plugin for calling an arbitrary function during a jspsych experiment
 * <NAME>
 * 
 * documentation: https://github.com/jodeleeuw/jsPsych/wiki/jspsych-call-function
 * 
**/

(function($) {
    jsPsych['call-function'] = (function() {

        var plugin = {};

        plugin.create = function(params) {
            var trials = new Array(1);
            trials[0] = {
                "func": params.func
            };
            return trials;
        };

        plugin.trial = function(display_element, trial) {
            var return_val = trial.func();
            
            jsPsych.data.write($.extend({},{
                value: return_val
            },trial.data));
            

            jsPsych.finishTrial();
        };

        return plugin;
    })();
})(jQuery);
{'fraction_non_alphanumeric': 0.14183222958057395, 'fraction_numerical': 0.002207505518763797, 'mean_word_length': 1.6819526627218935, 'pattern_counts': {'":': 3, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6591167', 'n_tokens_mistral': 534, 'n_tokens_neox': 485, 'n_words': 98}