Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
unfiltered_activity_name,unfiltered_row,unfiltered_column,filtered_activity_name,filtered_row,filtered_column
write.ltr.uc.dic:vow.asc.A..Z.3,0,49,akira:vow.ltr.uc:A..Z.vow.5.asc.say.11,0,50
write.ltr.uc.dic:all.asc.A..Z.9,2,243,bpop.ltr.uc:A..Z.all.rand.all.stat.noShow.77,2,244
write.missingLtr:lc.begin.ha.1,6,7,story.echo::begin.wrd.ha.rand.35,6,8
write.missingLtr:lc.begin.ha.18,6,9,story.hear::begin.wrd.ka.rand.2,6,10
write.missingLtr:lc.begin.ka.2,6,17,story.echo::begin.wrd.ka.rand.36,6,18
write.missingLtr:lc.begin.ka.19,6,19,story.hear::begin.wrd.ki.rand.3,6,20
write.missingLtr:lc.begin.ki.3,6,27,story.echo::begin.wrd.ki.rand.37,6,28
write.missingLtr:lc.begin.ki.20,6,29,story.hear::begin.wrd.ku.rand.4,6,30
write.missingLtr:lc.begin.ku.4,6,34,story.echo::begin.wrd.ku.rand.38,6,35
write.missingLtr:lc.begin.na.5,6,41,bpop.wrd:begin.wrd.na.noShow.10,6,42
write.missingLtr:lc.begin.na.22,6,44,story.hear::begin.wrd.si.rand.6,6,45
write.missingLtr:lc.begin.si.6,6,49,bpop.wrd:begin.wrd.si.noShow.12,6,50
write.missingLtr:lc.begin.si.23,6,52,story.hear::begin.wrd.ta.rand.7,6,53
write.missingLtr:lc.begin.ta.7,6,56,story.parrot::begin.wrd.ta.rand.24,6,57
write.missingLtr:lc.begin.ta.24,6,60,story.hear::begin.wrd.wa.rand.8,6,61
write.missingLtr:lc.begin.wa.8,6,65,bpop.wrd:begin.wrd.wa.noShow.16,6,66
write.missingLtr:lc.begin.wa.25,6,68,story.hear::end.wrd.ko.rand.9,6,69
write.missingLtr:lc.end.ko.9,6,73,bpop.wrd:end.wrd.ko.noShow.18,6,74
write.missingLtr:lc.end.ko.26,6,76,story.hear::end.wrd.le.rand.10,6,77
write.missingLtr:lc.end.le.10,6,81,bpop.wrd:end.wrd.le.noShow.20,6,82
write.missingLtr:lc.end.le.27,6,84,story.hear::end.wrd.li.rand.11,6,85
write.missingLtr:lc.end.li.11,6,89,bpop.wrd:end.wrd.li.noShow.22,6,90
write.missingLtr:lc.end.li.28,6,92,story.hear::end.wrd.ma.rand.12,6,93
write.missingLtr:lc.end.ma.12,6,97,bpop.wrd:end.wrd.ma.noShow.24,6,98
write.missingLtr:lc.end.ma.29,6,100,story.hear::end.wrd.na.rand.13,6,101
write.missingLtr:lc.end.na.13,6,105,bpop.wrd:end.wrd.na.noShow.26,6,106
write.missingLtr:lc.end.na.30,6,108,story.hear::end.wrd.ni.rand.14,6,109
write.missingLtr:lc.end.ni.14,6,113,bpop.wrd:end.wrd.ni.noShow.28,6,114
write.missingLtr:lc.end.ni.31,6,116,story.hear::end.wrd.sa.rand.15,6,117
write.missingLtr:lc.end.sa.15,6,121,bpop.wrd:end.wrd.sa.noShow.30,6,122
write.missingLtr:lc.end.sa.32,6,124,story.hear::end.wrd.wa.rand.16,6,125
write.missingLtr:lc.end.wa.16,6,129,bpop.wrd:end.wrd.wa.noShow.32,6,130
write.missingLtr:lc.end.wa.33,6,132,story.hear::end.wrd.we.rand.17,6,133
write.missingLtr:lc.end.we.17,6,137,bpop.wrd:end.wrd.we.noShow.34,6,138
write.missingLtr:lc.end.we.34,6,140,bpop.wrd:begin.wrd.all.noShow.35,6,141
write.missingLtr:1.0.1.fin.v,8,25,bpop.wrd:wrd.4.lc.rand.stat.noShow.2__it_2,8,26
write.missingLtr:1.0.1.init.c,8,27,bpop.wrd:wrd.4.lc.rand.stat.noShow.2__it_3,8,28
write.missingLtr:0.1.2.init.s,9,18,story.echo::story_18,9,19
write.missingLtr:0.1.2.fin.s,9,20,bpop.wrd:wrd.5.lc.rand.stat.noShow.4__it_2,9,21
write.missingLtr:0.1.3.init.s,10,25,bpop.wrd:wrd.6.lc.rand.stat.noShow.6__it_2,10,27
write.missingLtr:0.1.3.fin.s,10,26,bpop.wrd:wrd.6.lc.rand.stat.noShow.6__it_2,10,27
write.missingLtr:0.1.3.med.s,12,17,story.echo::story_36,12,18
write.missingLtr:0.1.4.init.s,12,19,bpop.wrd:wrd.7.lc.rand.stat.noShow.8__it_2,12,20
write.missingLtr:0.1.4.fin.s,13,22,story.echo::story_42,13,23
write.missingLtr:0.1.4.med.s,13,24,bpop.wrd:wrd.8.lc.rand.stat.noShow.10__it_2,13,25
write.missingLtr:0.1.5.init.s,15,17,story.echo::story_54,15,18
write.missingLtr:0.1.5.fin.s,15,19,bpop.wrd:wrd.9.lc.rand.stat.noShow.12__it_2,15,20
write.missingLtr:0.1.5.med.s,16,6,story.echo::HF.wrd.len-10.rand.14,16,7
write.missingLtr:0.1.6.init.s,16,8,bpop.wrd:wrd.10.lc.rand.stat.noShow.14__it_2,16,9
write.sen.copy.ltr:story_1.noerror.1.1,17,2,story.read::story_2,17,3
write.sen.copy.ltr:story_1.noerror.1.2,17,4,story.read::story_3,17,5
write.sen.copy.ltr:story_1.noerror.1.3,17,6,story.read::story_4,17,7
write.sen.copy.ltr:story_1.noerror.1.4,17,8,story.read::story_5,17,9
write.sen.copy.ltr:story_2.noerror.2.1,17,10,story.read::story_6,17,11
write.sen.copy.ltr:story_2.noerror.2.2,17,12,story.read::story_7,17,13
write.sen.copy.ltr:story_2.noerror.2.3,17,14,story.read::story_8,17,15
write.sen.dic.ltr:story_1.noerror.1.1,17,44,story.read::story_22,17,45
write.sen.dic.ltr:story_1.noerror.1.2,17,46,story.read::story_23,17,47
write.sen.dic.ltr:story_1.noerror.1.3,17,48,story.read::story_24,17,49
write.sen.dic.ltr:story_1.noerror.1.4,17,50,story.read::story_25,17,51
write.sen.dic.ltr:story_2.noerror.2.1,17,52,story.read::story_26,17,53
write.sen.dic.ltr:story_2.noerror.2.2,17,54,story.read::story_27,17,55
write.sen.dic.ltr:story_2.noerror.2.3,17,56,story.read::story_28,17,57
12 changes: 12 additions & 0 deletions app/src/main/assets/tutors/armweights.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"arm_name": "test1",
"arm_weight": 0.5,
"filepath": "app/src/main/assets/tutors/armweights.json"
},
{
"arm_name": "test2",
"arm_weight": 0.9,
"filepath": "app/src/main/assets/tutors/armweights.json"
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,19 @@
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.StringTokenizer;

import cmu.xprize.comp_intervention.data.CUpdateInterventionStudentData;
import cmu.xprize.comp_logging.CLogManager;
Expand Down Expand Up @@ -820,6 +827,11 @@ private static TransitionMatrixModel loadTransitionMatrixModel() {
// Load the datasource into a separate class...
TransitionMatrixModel matrix = new TransitionMatrixModel(dataPath + dataFile, mRootScope);
matrix.validateAll();
System.out.println("dataPath: " + dataPath);
System.out.println("Log pointer");

HashMap<String, String> h2 = loadTranslationTable(Activity.getApplicationContext());
System.out.println("h2 : " + h2);
return matrix;
}

Expand All @@ -846,6 +858,49 @@ public void loadJSON(JSONObject jsonData, IScope2 scope) {
public void loadJSON(JSONObject jsonObj, IScope scope) {
// Log.d(TAG, "Loader iteration");
loadJSON(jsonObj, (IScope2) scope);

}
public static HashMap<String, String> loadTranslationTable(Context context) {
HashMap<String, String> hm = new HashMap<>();

try {
//csv file containing data
InputStream is = context.getResources().openRawResource(R.raw.filtered_translation);

//create BufferedReader to read csv file
BufferedReader br = new BufferedReader(new InputStreamReader(is, Charset.forName("UTF-8")));
String strLine;
StringTokenizer st;
int lineNumber = 0, tokenNumber = 0;

//read comma-separated file line by line
while ((strLine = br.readLine()) != null) {
lineNumber++;

//break comma-separated line using ","
st = new StringTokenizer(strLine, ",");

while (st.hasMoreTokens()) {
tokenNumber++;
String a = st.nextToken();
tokenNumber+=2;
String b = st.nextToken();
hm.put(a, b);
}
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}

return hm;
}


}





Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ private String getNextPromotionTutor(String activeTutorId, PromotionRules.Promot
CAt_Data transitionData = transitionMap.get(activeTutorId);
if (transitionData == null) {
CErrorManager.logEvent(TAG, "ERROR: no entry found for " + activeTutorId + ". Using rootTutor instead.", false);
// instead of root tutor, call filteredTranslation
transitionData = transitionMap.get(rootTutor);
}
switch (promotionDecision) {
Expand Down
64 changes: 64 additions & 0 deletions app/src/main/res/raw/filtered_translation.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
unfiltered_activity_name,unfiltered_row,unfiltered_column,filtered_activity_name,filtered_row,filtered_column
write.ltr.uc.dic:vow.asc.A..Z.3,0,49,akira:vow.ltr.uc:A..Z.vow.5.asc.say.11,0,50
write.ltr.uc.dic:all.asc.A..Z.9,2,243,bpop.ltr.uc:A..Z.all.rand.all.stat.noShow.77,2,244
write.missingLtr:lc.begin.ha.1,6,7,story.echo::begin.wrd.ha.rand.35,6,8
write.missingLtr:lc.begin.ha.18,6,9,story.hear::begin.wrd.ka.rand.2,6,10
write.missingLtr:lc.begin.ka.2,6,17,story.echo::begin.wrd.ka.rand.36,6,18
write.missingLtr:lc.begin.ka.19,6,19,story.hear::begin.wrd.ki.rand.3,6,20
write.missingLtr:lc.begin.ki.3,6,27,story.echo::begin.wrd.ki.rand.37,6,28
write.missingLtr:lc.begin.ki.20,6,29,story.hear::begin.wrd.ku.rand.4,6,30
write.missingLtr:lc.begin.ku.4,6,34,story.echo::begin.wrd.ku.rand.38,6,35
write.missingLtr:lc.begin.na.5,6,41,bpop.wrd:begin.wrd.na.noShow.10,6,42
write.missingLtr:lc.begin.na.22,6,44,story.hear::begin.wrd.si.rand.6,6,45
write.missingLtr:lc.begin.si.6,6,49,bpop.wrd:begin.wrd.si.noShow.12,6,50
write.missingLtr:lc.begin.si.23,6,52,story.hear::begin.wrd.ta.rand.7,6,53
write.missingLtr:lc.begin.ta.7,6,56,story.parrot::begin.wrd.ta.rand.24,6,57
write.missingLtr:lc.begin.ta.24,6,60,story.hear::begin.wrd.wa.rand.8,6,61
write.missingLtr:lc.begin.wa.8,6,65,bpop.wrd:begin.wrd.wa.noShow.16,6,66
write.missingLtr:lc.begin.wa.25,6,68,story.hear::end.wrd.ko.rand.9,6,69
write.missingLtr:lc.end.ko.9,6,73,bpop.wrd:end.wrd.ko.noShow.18,6,74
write.missingLtr:lc.end.ko.26,6,76,story.hear::end.wrd.le.rand.10,6,77
write.missingLtr:lc.end.le.10,6,81,bpop.wrd:end.wrd.le.noShow.20,6,82
write.missingLtr:lc.end.le.27,6,84,story.hear::end.wrd.li.rand.11,6,85
write.missingLtr:lc.end.li.11,6,89,bpop.wrd:end.wrd.li.noShow.22,6,90
write.missingLtr:lc.end.li.28,6,92,story.hear::end.wrd.ma.rand.12,6,93
write.missingLtr:lc.end.ma.12,6,97,bpop.wrd:end.wrd.ma.noShow.24,6,98
write.missingLtr:lc.end.ma.29,6,100,story.hear::end.wrd.na.rand.13,6,101
write.missingLtr:lc.end.na.13,6,105,bpop.wrd:end.wrd.na.noShow.26,6,106
write.missingLtr:lc.end.na.30,6,108,story.hear::end.wrd.ni.rand.14,6,109
write.missingLtr:lc.end.ni.14,6,113,bpop.wrd:end.wrd.ni.noShow.28,6,114
write.missingLtr:lc.end.ni.31,6,116,story.hear::end.wrd.sa.rand.15,6,117
write.missingLtr:lc.end.sa.15,6,121,bpop.wrd:end.wrd.sa.noShow.30,6,122
write.missingLtr:lc.end.sa.32,6,124,story.hear::end.wrd.wa.rand.16,6,125
write.missingLtr:lc.end.wa.16,6,129,bpop.wrd:end.wrd.wa.noShow.32,6,130
write.missingLtr:lc.end.wa.33,6,132,story.hear::end.wrd.we.rand.17,6,133
write.missingLtr:lc.end.we.17,6,137,bpop.wrd:end.wrd.we.noShow.34,6,138
write.missingLtr:lc.end.we.34,6,140,bpop.wrd:begin.wrd.all.noShow.35,6,141
write.missingLtr:1.0.1.fin.v,8,25,bpop.wrd:wrd.4.lc.rand.stat.noShow.2__it_2,8,26
write.missingLtr:1.0.1.init.c,8,27,bpop.wrd:wrd.4.lc.rand.stat.noShow.2__it_3,8,28
write.missingLtr:0.1.2.init.s,9,18,story.echo::story_18,9,19
write.missingLtr:0.1.2.fin.s,9,20,bpop.wrd:wrd.5.lc.rand.stat.noShow.4__it_2,9,21
write.missingLtr:0.1.3.init.s,10,25,bpop.wrd:wrd.6.lc.rand.stat.noShow.6__it_2,10,27
write.missingLtr:0.1.3.fin.s,10,26,bpop.wrd:wrd.6.lc.rand.stat.noShow.6__it_2,10,27
write.missingLtr:0.1.3.med.s,12,17,story.echo::story_36,12,18
write.missingLtr:0.1.4.init.s,12,19,bpop.wrd:wrd.7.lc.rand.stat.noShow.8__it_2,12,20
write.missingLtr:0.1.4.fin.s,13,22,story.echo::story_42,13,23
write.missingLtr:0.1.4.med.s,13,24,bpop.wrd:wrd.8.lc.rand.stat.noShow.10__it_2,13,25
write.missingLtr:0.1.5.init.s,15,17,story.echo::story_54,15,18
write.missingLtr:0.1.5.fin.s,15,19,bpop.wrd:wrd.9.lc.rand.stat.noShow.12__it_2,15,20
write.missingLtr:0.1.5.med.s,16,6,story.echo::HF.wrd.len-10.rand.14,16,7
write.missingLtr:0.1.6.init.s,16,8,bpop.wrd:wrd.10.lc.rand.stat.noShow.14__it_2,16,9
write.sen.copy.ltr:story_1.noerror.1.1,17,2,story.read::story_2,17,3
write.sen.copy.ltr:story_1.noerror.1.2,17,4,story.read::story_3,17,5
write.sen.copy.ltr:story_1.noerror.1.3,17,6,story.read::story_4,17,7
write.sen.copy.ltr:story_1.noerror.1.4,17,8,story.read::story_5,17,9
write.sen.copy.ltr:story_2.noerror.2.1,17,10,story.read::story_6,17,11
write.sen.copy.ltr:story_2.noerror.2.2,17,12,story.read::story_7,17,13
write.sen.copy.ltr:story_2.noerror.2.3,17,14,story.read::story_8,17,15
write.sen.dic.ltr:story_1.noerror.1.1,17,44,story.read::story_22,17,45
write.sen.dic.ltr:story_1.noerror.1.2,17,46,story.read::story_23,17,47
write.sen.dic.ltr:story_1.noerror.1.3,17,48,story.read::story_24,17,49
write.sen.dic.ltr:story_1.noerror.1.4,17,50,story.read::story_25,17,51
write.sen.dic.ltr:story_2.noerror.2.1,17,52,story.read::story_26,17,53
write.sen.dic.ltr:story_2.noerror.2.2,17,54,story.read::story_27,17,55
write.sen.dic.ltr:story_2.noerror.2.3,17,56,story.read::story_28,17,57