Commit 180222ac authored by Xiaoying Pu's avatar Xiaoying Pu

gen string

parent 63a151e9
......@@ -15,10 +15,9 @@
<group>
<file>file:/Users/pxy/dm_task/src/util/Trial.java</file>
<file>file:/Users/pxy/dm_task/src/tracker/PrimaryTaskController.java</file>
<file>file:/Users/pxy/dm_task/src/tracker/MouseTrackerFacade.java</file>
<file>file:/Users/pxy/dm_task/test/tracker/DecisionTest.java</file>
<file>file:/Users/pxy/dm_task/src/tracker/Decision.java</file>
</group>
</open-files>
......
......@@ -51,8 +51,51 @@ public class Decision {
// not the usual stereotypical association
int isArtsOrMale = ThreadLocalRandom.current().nextInt(0, 2);
int oneIsRight = ThreadLocalRandom.current().nextInt(0, 2);
int categoryChoice = ThreadLocalRandom.current().nextInt(0, 2);
//int categoryChoice = ThreadLocalRandom.current().nextInt(0, 2);
String stimulus;
int choice = ThreadLocalRandom.current().nextInt(0, 2);
if (isArtsOrMale == 1) {
int randInt = ThreadLocalRandom.current().nextInt(0, femaleList.length);
String maleStimuli = maleList[randInt];
randInt = ThreadLocalRandom.current().nextInt(0, artsList.length);
String artStim = artsList[randInt];
stimulus = choice == 1 ? artStim : maleStimuli;
} else {// is science or female
int randInt = ThreadLocalRandom.current().nextInt(0, maleList.length);
String femaleS = femaleList[randInt];
randInt = ThreadLocalRandom.current().nextInt(0, scienceList.length);
String scienceS = scienceList[randInt];
stimulus = choice == 1 ? scienceS : femaleS;
}
result.add(stimulus);
result.add(condition);
result.add(" ");// TODO this may break it, randomize trial block
if (oneIsRight == 1) {
result.add("1");
result.add("2");
if (isArtsOrMale == 1) {
result.add("Male|Art");
result.add("Female|Science");
} else {
result.add("Female|Science");
result.add("Male|Arts");
}
} else { // the stuff on the right is right
result.add("2");
result.add("1");
if (isArtsOrMale == 1) {
result.add("Female|Science");
result.add("Male|Art");
} else {
result.add("Male|Art");
result.add("Female|Science");
}
}
// TODO
return String.join(",", result);
......
......@@ -12,7 +12,7 @@ import org.junit.Test;
* @author pxy
*/
public class DecisionTest {
public DecisionTest() {
}
......@@ -40,7 +40,7 @@ public class DecisionTest {
String expResult = "";
String result = instance.getCategory2(condition);
System.out.println(result);
}
/**
......@@ -58,6 +58,15 @@ public class DecisionTest {
}
}
@Test
public void testGetAtypical() {
System.out.println("getAtypical");
Decision instance = new Decision();
for (int i = 0; i < 10; i++) {
System.out.println(instance.getMixAtypical("LWL"));
}
}
/**
* Test of getBreak method, of class Decision.
*/
......@@ -69,5 +78,4 @@ public class DecisionTest {
String result = instance.getBreak();
System.out.println(result);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment