Skip to content

Commit

Permalink
Added functionality of lists of stimuli
Browse files Browse the repository at this point in the history
  • Loading branch information
dialoguetoolkit committed Nov 27, 2021
1 parent bd59b2d commit 49786f6
Show file tree
Hide file tree
Showing 14 changed files with 923 additions and 240 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rorschachlongersequence.txt
rorschachlongersequence.txt
rorschachlongersequence.txt
rorschachlongersequence.txt
rorschachshortsequence.txt
3 changes: 3 additions & 0 deletions src/main/java/diet/server/Conversation.java
Original file line number Diff line number Diff line change
Expand Up @@ -2522,6 +2522,9 @@ public void printWln(String windowName, String text){
if(em!=null){
em.println(windowName, text);
}
else{
System.err.println("PRINTWLN EM IS NULL"+windowName+" "+text);
}
convIO.saveWindowTextToLog(windowName, text);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import diet.server.Participant;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;
import diet.tg.TelegramMessageFromClient;
import diet.tg.TelegramParticipant;
import org.telegram.telegrambots.meta.api.objects.CallbackQuery;
Expand All @@ -22,8 +23,8 @@
*/
public class Telegram_Dyadic_Customizable_ReferentialTask extends TelegramController{


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, null, null );
CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this,true);
CustomizableReferentialTaskSettings crts=crtsf.getNextCustomizableReferentialTaskSettings();
CustomizableReferentialTask crt = new CustomizableReferentialTask(this, crts);
// CustomizableReferentialTask crt = new CustomizableReferentialTask(this, 5000,true);
// Participant pDirector;
Expand All @@ -32,10 +33,15 @@ public class Telegram_Dyadic_Customizable_ReferentialTask extends TelegramContro

public Telegram_Dyadic_Customizable_ReferentialTask(Conversation c) {
super(c);


}

public Telegram_Dyadic_Customizable_ReferentialTask(Conversation c, long istypingtimeout) {
super(c, istypingtimeout);



}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
package diet.server.ConversationController;

import diet.server.Conversation;
import diet.server.ConversationController.ui.CustomDialog;
import diet.server.Participant;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;
import diet.tg.TelegramMessageFromClient;
import diet.tg.TelegramParticipant;
import java.util.Hashtable;
Expand All @@ -24,7 +23,9 @@
public class Telegram_Dyadic_Customizable_ReferentialTask_Automatic_Start extends TelegramController{


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, null, null );

CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this, true);
CustomizableReferentialTaskSettings crts = crtsf.getNextCustomizableReferentialTaskSettings();
//CustomizableReferentialTask crt = new CustomizableReferentialTask(this, crts);
// CustomizableReferentialTask crt = new CustomizableReferentialTask(this, 5000,true);
// Participant pDirector;
Expand All @@ -33,10 +34,13 @@ public class Telegram_Dyadic_Customizable_ReferentialTask_Automatic_Start extend

public Telegram_Dyadic_Customizable_ReferentialTask_Automatic_Start(Conversation c) {
super(c);

}

public Telegram_Dyadic_Customizable_ReferentialTask_Automatic_Start(Conversation c, long istypingtimeout) {
super(c, istypingtimeout);


}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import diet.server.Participant;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;
import diet.tg.TelegramMessageFromClient;
import diet.tg.TelegramParticipant;
import org.telegram.telegrambots.meta.api.objects.CallbackQuery;
Expand All @@ -23,7 +24,9 @@
public class Telegram_Dyadic_DeepfakeBotOrNot extends TelegramController{


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "facerealornot" ,"facefakeorreal.txt");
CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this, true, "facerealornot" ,"facefakeorreal.txt");
CustomizableReferentialTaskSettings crts = crtsf.getNextCustomizableReferentialTaskSettings();
//CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "facerealornot" ,"facefakeorreal.txt");
CustomizableReferentialTask crt = new CustomizableReferentialTask(this, crts);
// CustomizableReferentialTask crt = new CustomizableReferentialTask(this, 5000,true);
// Participant pDirector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import diet.server.Participant;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;
import diet.tg.TelegramMessageFromClient;
import diet.tg.TelegramParticipant;
import org.telegram.telegrambots.meta.api.objects.CallbackQuery;
Expand All @@ -23,7 +24,12 @@
public class Telegram_Dyadic_Rorschach extends TelegramController{


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "rorschachset02" ,"rorschachsequence01.txt");

CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this, true, "rorschachset02" ,"rorschachsequence01.txt");
CustomizableReferentialTaskSettings crts = crtsf.getNextCustomizableReferentialTaskSettings();


//CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "rorschachset02" ,"rorschachsequence01.txt");
CustomizableReferentialTask crt = new CustomizableReferentialTask(this, crts);
// CustomizableReferentialTask crt = new CustomizableReferentialTask(this, 5000,true);
// Participant pDirector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import diet.server.ParticipantGroups.ParticipantGroup;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;
import diet.tg.TelegramMessageFromClient;
import diet.tg.TelegramParticipant;
import java.util.Hashtable;
Expand All @@ -26,7 +27,12 @@
public class Telegram_Dyadic_TangramTask extends TelegramController{


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "tangramset01", "tangramsequence.txt" );

CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this, true, "tangramset01" ,"tangramsequence.txt");
CustomizableReferentialTaskSettings crts = crtsf.getNextCustomizableReferentialTaskSettings();


//CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "tangramset01", "tangramsequence.txt" );

Hashtable ht_pg_crt = new Hashtable();
Hashtable ht_p_crt = new Hashtable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import diet.server.Participant;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;
import diet.tg.TelegramMessageFromClient;
import diet.tg.TelegramParticipant;
import java.util.Hashtable;
Expand All @@ -37,7 +38,11 @@ public class Telegram_dyadic_AskFor_Language_NL_EN_FILTEROK_RORSCHACH extends Te
// CustomizableReferentialTask crt = new CustomizableReferentialTask(this, 5000,true);


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, "rorschachset01", "rorschachlongersequence.txt" );
CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this, true, "rorschachset01", "rorschachlongersequence.txt");
CustomizableReferentialTaskSettings crts = crtsf.getNextCustomizableReferentialTaskSettings();


// CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this,true, );

// CustomizableReferentialTask crt = new CustomizableReferentialTask(this, 5000,true);
// Participant pDirector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import diet.server.Participant;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTask;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettings;
import diet.task.CustomizableReferentialTask.CustomizableReferentialTaskSettingsFactory;

/**
*
Expand All @@ -20,8 +21,13 @@
public class TurnByTurn_Dyadic_Customizable_ReferentialTask extends TurnByTurn_Dyadic{


CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this, false, null, null );
CustomizableReferentialTaskSettingsFactory crtsf = new CustomizableReferentialTaskSettingsFactory(this,false);
CustomizableReferentialTaskSettings crts;// = new CustomizableReferentialTaskSettings(this,true, null, null );
CustomizableReferentialTask crt = new CustomizableReferentialTask(this, crts);


//CustomizableReferentialTaskSettings crts = new CustomizableReferentialTaskSettings(this, false, null, null );
//CustomizableReferentialTask crt = new CustomizableReferentialTask(this, crts);
// Participant pDirector;
// Participant pMatcher;

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/diet/server/io/IntelligentIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ public void writeToThrowableFileCreatingIfNecessary(String filename, Throwable t


public void saveWindowTextToLog(String windowName, String s){
this.writeToTextFileCreatingIfNecessary("window_"+windowName+".txt", s+"\n");
long t = new Date().getTime();
this.writeToTextFileCreatingIfNecessary("window_"+windowName+".txt", t+": "+ s+"\n");
System.err.println("Saving window message:"+s);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ public class CustomizableReferentialTask implements JTrialTimerActionRecipientIn
boolean showScoreOnEachGame = false;
boolean showIfSelectionWasCorrrectOrIncorrect = false;
boolean advanceToNextManually = false;

String filename ="";



Expand All @@ -126,6 +128,7 @@ public CustomizableReferentialTask(DefaultConversationController cC, Customizabl
this.correctscoreinrement = crts.correctscoreinrement;
this.deleteStimulusAfterEachTrial = crts.deleteStimulusAfterEachTrial;
this.directoryname = crts.directoryname;
this.filename = crts.filename;
this.durationOfGame = crts.durationOfGame;
this.durationOfStimulus= crts.durationOfStimulus;
this.htIMAGE= crts.htIMAGE;
Expand All @@ -136,10 +139,15 @@ public CustomizableReferentialTask(DefaultConversationController cC, Customizabl
this.stimuluswidth=crts.stimuluswidth;
this.telegram=crts.telegram;

Vector[] vstimuli = crts.getVstimuli();
if(!telegram)CustomDialog.showDialog("This code has been mainly tested with the Telegram interface.\nT"
+ "There might be some bugs that need ironing out if running this code with the java interface.\n"
+ "Please let the developers know if you encounter anything that needs to be fixed!"
+ "");

//Vector[] vstimuli = crts.getVstimuli();

this.vstimuli=vstimuli[0];
this.vstimuliFULL=vstimuli[1];
this.vstimuli=crts.getVstimuli();
this.vstimuliFULL=CustomizableReferentialTaskSettings.duplicateVectorOfStringArray(vstimuli);


this. showScoreOnEachGame = crts.showScoreOnEachGame;
Expand Down Expand Up @@ -1228,6 +1236,7 @@ public Vector getAdditionalValues(Participant p){
String stimulusself ="";
String stimulusother ="";
Vector avs = new Vector();
AttribVal av = new AttribVal("setname",""+this.filename);
if(pA==p){
stimulusself=directoryname+"/"+this.currentTrial[0];
stimulusother=directoryname+"/"+this.currentTrial[1];
Expand All @@ -1244,6 +1253,7 @@ public Vector getAdditionalValues(Participant p){
else {
av6 = new AttribVal("haslooped","NO");
}
avs.addElement(av);
avs.addElement(av0);avs.addElement(av1); avs.addElement(av2); avs.addElement(av3); avs.addElement(av4); avs.addElement(av5);avs.addElement(av6);
}
if(pB==p){
Expand All @@ -1261,6 +1271,7 @@ public Vector getAdditionalValues(Participant p){
}else {
av6 = new AttribVal("haslooped","NO");
}
avs.addElement(av);
avs.addElement(av0);avs.addElement(av1); avs.addElement(av2); avs.addElement(av3); avs.addElement(av4);avs.addElement(av5);avs.addElement(av6);
}

Expand Down
Loading

0 comments on commit 49786f6

Please sign in to comment.