Commit 80160e31 authored by gaa721's avatar gaa721
Browse files

System B updated

parent 6416ccd0
String[] Questions= {
"Who texted immediately after you got non attentive (if no one type NONE)?",
"How many people texted after you were non attentive?",
"How many text were there after you were not attentive?",
"Did someone text when you were not attentive?"
};
String[][] Answers= {
{"Bob","4","1","yes"},
{"Mackenzie","1","4","yes"},
{"Bob","2","2","yes"},
{"turtlefan25","1","1","yes"},
{"Bob","3","3","yes"},
{"cool_dude","1","1","yes"},
{"Mackenzie","2","1","yes"},
{"Mackenzie","2","1","yes"},
{"cool_dude","2","1","yes"},
{"Mike","1","2","yes"}
};
String[] Questions= {
"Who texted immediately after you got non attentive (if no one type NONE)?",
"How many people texted after you were non attentive?",
"How many text were there after you were not attentive?",
"Did someone text when you were not attentive?"
};
String[][] Answers= {
{"Bob","2","1","yes"},
{"Mackenzie","1","4","yes"},
{"Bob","2","2","yes"},
{"turtlefan25","1","1","yes"},
{"Bob","3","3","yes"},
{"cool_dude","1","1","yes"},
{"Mackenzie","2","1","yes"},
{"Mackenzie","2","1","yes"},
{"cool_dude","2","1","yes"},
{"Mike","1","2","yes"}
};
\ No newline at end of file
/* =========================================================
* ==== WARNING ===
* =========================================================
* The code in this tab has been generated from the GUI form
* designer and care should be taken when editing this file.
* Only add/edit code inside the event handlers i.e. only
* use lines between the matching comment tags. e.g.
void myBtnEvents(GButton button) { //_CODE_:button1:12356:
// It is safe to enter your event code here
} //_CODE_:button1:12356:
* Do not rename this tab!
* =========================================================
*/
public void textfield1_change1(GTextField source, GEvent event) { //_CODE_:textfield1:215102:
println("textfield1 - GTextField >> GEvent." + event + " @ " + millis());
if (event == GEvent.ENTERED)
{
print(source.getText());
participationID = source.getText();
folderName = sketchPath("")+"/chatStudyData/"+day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" +millis() +"-"+ participationID;
File file = new File(folderName);
file.mkdirs();
try
{
//writer = new PrintWriter("c:/Users/gaa721/Desktop/" + day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" + participationID + ".txt");
date = new Date();
writer = new PrintWriter(new FileWriter(folderName+ "/"+day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" + participationID + ".txt"), true);
}
catch(FileNotFoundException e)
{
print(e.toString());
}
catch(IOException e)
{
print(e.toString());
}
startMenu =false;
label1.setVisible(false);
textfield1.setVisible(false);
Stime = millis();
}
} //_CODE_:textfield1:215102:
public void textfield2_change1(GTextField source, GEvent event) { //_CODE_:textfield3:984243:
println("textfield2 - GTextField >> GEvent." + event + " @ " + millis());
if (event == GEvent.ENTERED)
{
String rightorwrong;
double tempPercent = similarity(source.getText(), Answers[tempFiler][questionCounter])*100;
if (tempPercent>80)
rightorwrong = "Correct";
else if (tempPercent>50)
rightorwrong="maybe Correct";
else
rightorwrong="Incorrect";
writer.println("Date " + date.toString() + " Timestamp: " + millis() + " Partipation ID: " + participationID +" Type: "+ questionCounter +" Trial number: " + tempFiler+ ":"+(questionCounter+1) + " Correct Answer: " + Answers[tempFiler][questionCounter] + " Answer Given: " + source.getText() +" Equal Percentage: " + tempPercent + " Comment: " + rightorwrong );
pushMatrix();
// textSize(20);
fill(0, 0, 0);
text( "participationID: " + participationID, 200, 200);
popMatrix();
save(folderName + "/" + day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" +millis() +"-"+ participationID +"-" + tempFiler + (questionCounter+1)+ ".png");
// responseCollection = responseCollection + "Select the portion which was drawn first after the black screen :" +"x: " + mouseX+ "y: " + mouseY +"\n";
timer = 0;
Stime = millis();
question = false;
questionCounter++;
if (questionCounter == 4)
{
pushMatrix();
background(255);
// textSize(20);
text("Thanks", displayWidth/2 -30, displayHeight/2);
popMatrix();
changingFile = true;
button1.setVisible(true);
}
source.setText("");
source.setVisible(false);
}
} //_CODE_:textfield3:984243:
public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:653596:
println("button1 - GButton >> GEvent." + event + " @ " + millis());
tempFiler++;
if(tempFiler>=10)
{
background(255);
text("Thanks",50,50);
source.setVisible(false);
noLoop();
}
else
setupInside();
source.setVisible(false);
} //_CODE_:button1:653596:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI() {
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setCursor(ARROW);
if (frame != null)
frame.setTitle("Sketch Window");
label1 = new GLabel(this, 63, 195, 122, 24);
label1.setText("Enter Participation ID:");
label1.setOpaque(false);
textfield1 = new GTextField(this, 189, 197, 107, 23, G4P.SCROLLBARS_NONE);
textfield1.setOpaque(true);
textfield1.addEventHandler(this, "textfield1_change1");
textfield3 = new GTextField(this, 340, 410, 180, 30, G4P.SCROLLBARS_NONE);
textfield3.setOpaque(true);
textfield3.addEventHandler(this, "textfield2_change1");
button1 = new GButton(this, 52, 338, 149, 34);
button1.setText("Click Here for Next Chat");
button1.setTextBold();
button1.addEventHandler(this, "button1_click1");
}
// Variable declarations
// autogenerated do not edit
GLabel label1;
GTextField textfield1;
GTextField textfield3;
GButton button1;
/* =========================================================
* ==== WARNING ===
* =========================================================
* The code in this tab has been generated from the GUI form
* designer and care should be taken when editing this file.
* Only add/edit code inside the event handlers i.e. only
* use lines between the matching comment tags. e.g.
void myBtnEvents(GButton button) { //_CODE_:button1:12356:
// It is safe to enter your event code here
} //_CODE_:button1:12356:
* Do not rename this tab!
* =========================================================
*/
public void textfield1_change1(GTextField source, GEvent event) { //_CODE_:textfield1:215102:
println("textfield1 - GTextField >> GEvent." + event + " @ " + millis());
if (event == GEvent.ENTERED)
{
print(source.getText());
participationID = source.getText();
folderName = sketchPath("")+"/chatStudyData/"+day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" +millis() +"-"+ participationID;
File file = new File(folderName);
file.mkdirs();
try
{
//writer = new PrintWriter("c:/Users/gaa721/Desktop/" + day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" + participationID + ".txt");
writer = new PrintWriter(new FileWriter(folderName+ "/"+day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" + participationID + ".txt"), true);
}
catch(FileNotFoundException e)
{
print(e.toString());
}
catch(IOException e)
{
print(e.toString());
}
startMenu =false;
label1.setVisible(false);
textfield1.setVisible(false);
Stime = millis();
}
} //_CODE_:textfield1:215102:
public void textfield2_change1(GTextField source, GEvent event) { //_CODE_:textfield3:984243:
println("textfield2 - GTextField >> GEvent." + event + " @ " + millis());
if (event == GEvent.ENTERED)
{
String rightorwrong;
double tempPercent = similarity(source.getText(), Answers[tempFiler][questionCounter])*100;
if (tempPercent>80)
rightorwrong = "Correct";
else if (tempPercent>50)
rightorwrong="maybe Correct";
else
rightorwrong="Incorrect";
date = new Date();
writer.println("Date " + date.toString() + " Timestamp: " + millis() + " Partipation ID: " + participationID +" Type: "+ questionCounter +" Trial number: " + tempFiler+ ":"+(questionCounter+1) + " Correct Answer: " + Answers[tempFiler][questionCounter] + " Answer Given: " + source.getText() +" Equal Percentage: " + tempPercent + " Comment: " + rightorwrong );
pushMatrix();
// textSize(20);
fill(0, 0, 0);
text( "participationID: " + participationID, 200, 200);
popMatrix();
save(folderName + "/" + day()+"-"+month()+"-"+year()+"-"+ hour()+"-"+minute() +"-"+second()+ "-" +millis() +"-"+ participationID +"-" + tempFiler + (questionCounter+1)+ ".png");
// responseCollection = responseCollection + "Select the portion which was drawn first after the black screen :" +"x: " + mouseX+ "y: " + mouseY +"\n";
timer = 0;
Stime = millis();
question = false;
questionCounter++;
if (questionCounter == 4)
{
pushMatrix();
background(255);
// textSize(20);
text("Thanks", displayWidth/2 -30, displayHeight/2);
popMatrix();
changingFile = true;
button1.setVisible(true);
}
source.setText("");
source.setVisible(false);
}
} //_CODE_:textfield3:984243:
public void button1_click1(GButton source, GEvent event) { //_CODE_:button1:653596:
println("button1 - GButton >> GEvent." + event + " @ " + millis());
tempFiler++;
if(tempFiler>=5)
{
background(255);
text("Thanks",50,50);
source.setVisible(false);
noLoop();
}
else
{
setupInside();
chatTimerCounter++;
}
source.setVisible(false);
} //_CODE_:button1:653596:
// Create all the GUI controls.
// autogenerated do not edit
public void createGUI() {
G4P.messagesEnabled(false);
G4P.setGlobalColorScheme(GCScheme.BLUE_SCHEME);
G4P.setCursor(ARROW);
if (frame != null)
frame.setTitle("Sketch Window");
label1 = new GLabel(this, 63, 195, 122, 24);
label1.setText("Enter Participation ID:");
label1.setOpaque(false);
textfield1 = new GTextField(this, 189, 197, 107, 23, G4P.SCROLLBARS_NONE);
textfield1.setOpaque(true);
textfield1.addEventHandler(this, "textfield1_change1");
textfield3 = new GTextField(this, 340, 410, 180, 30, G4P.SCROLLBARS_NONE);
textfield3.setOpaque(true);
textfield3.addEventHandler(this, "textfield2_change1");
button1 = new GButton(this, 52, 338, 149, 34);
button1.setText("Click Here for Next Chat");
button1.setTextBold();
button1.addEventHandler(this, "button1_click1");
}
// Variable declarations
// autogenerated do not edit
GLabel label1;
GTextField textfield1;
GTextField textfield3;
GButton button1;
\ No newline at end of file
Supports Markdown
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