Saving an experimental condition variable to explicit.txt without user input

31 views
Skip to first unread message

Calvin Lai

unread,
Sep 2, 2020, 9:17:52 PM9/2/20
to Minno.js
I am trying to save a variable to explicit.txt at Project Implicit without any user input in a questionnaire. This is a condition variable that is specified as a Global variable in the manager file. It looks like this:

    API.addGlobal({
        raceset:'black',
    }); 

I want this variable saved in explicit.txt so I know what condition my participants were assigned to through explicit.txt. The best I can do is adding this to the manager file:

API.save({
cond:raceset,
});

This creates a row in my explicit datafile like this:
0 1001 anonymous manager cond black 1 calvin.studyname 6997891

I don't love this because of the weird task number (1001) and the task name (anonymous manager). Here are my questions for the group:

1. Is there a way to rig it so that the variable is tied to a specific task ('task2' rather than 'anonymous manager') with a normal task number (e.g., '2' instead of '1001')?

2. If the answer is yes, is this possible to set this up within:
a. .js miQuest files?
b. .js miTime files?
c. .jst message files?

Best,
Calvin

 


Mayan Navon

unread,
Sep 3, 2020, 4:17:56 AM9/3/20
to Calvin Lai, Minno.js
Hi Calvin,

You can use API.save directly in your tasks (time/ quest). Just define a variable and save it with API.save. For example:
        var chosenTargets = {domTarget: global.dominantCat, nondomTarget: global.nonDominantCat, criterion: global.foundPair};
        API.save(chosenTargets);
-
- In this example, the names of the variables that will be logged are domTarget, nondomTarget, and criterion. They will appear in the explicit file under the task name in which they were saved (in my case, 'rate1'):
image.png

I don't think you can log variables with text files (.jst), but maybe I'm wrong.

In your example you defined raceset as a global variable, so I think that you need to use get.global() when you save it, like this: API.getGlobal().raceset.

Best,
Mayan

--
You received this message because you are subscribed to the Google Groups "Minno.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to minnojs+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/minnojs/bec7a270-4068-43f9-8d59-281e45068c5an%40googlegroups.com.


--
Mayan

Yoav Bar-Anan

unread,
Sep 3, 2020, 4:31:36 AM9/3/20
to Minno.js, Calvin Lai
Adding to Mayan's answer:
If you want to save from the manager file, but don't want the task name to be "anonymous manager ", you can use API.setName to replace anonymous manager with a different name. 

Yoav



Calvin Lai

unread,
Sep 3, 2020, 1:28:07 PM9/3/20
to Minno.js
Thanks! All of this advice worked out well. Thanks for resolving these issues!

The only thing I couldn't correct was the task_number (0) and question_number (e.g., 1001) entries. I may have to add an extra line of code for parts of my data processing script where I try to look at session tasks chronologically, but otherwise it won't cause much trouble.

Calvin

Reply all
Reply to author
Forward
0 new messages