diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/CycleMatrixActivityMenu.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/CycleMatrixActivityMenu.java index 944cf22e..6b5dce51 100644 --- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/CycleMatrixActivityMenu.java +++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/CycleMatrixActivityMenu.java @@ -9,6 +9,7 @@ import cmu.xprize.comp_ask.CAsk_Data; import cmu.xprize.comp_session.AS_CONST; import cmu.xprize.robotutor.RoboTutor; +import cmu.xprize.robotutor.tutorengine.CTutor; import cmu.xprize.util.CAt_Data; import cmu.xprize.util.CPlacementTest_Tutor; diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/IActivityMenu.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/IActivityMenu.java index 0fed2bf2..cf6480c4 100644 --- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/IActivityMenu.java +++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/IActivityMenu.java @@ -3,6 +3,7 @@ import java.util.Map; import cmu.xprize.comp_ask.CAsk_Data; +import cmu.xprize.robotutor.tutorengine.CTutor; import cmu.xprize.util.CAt_Data; /** diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/PromotionMechanism.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/PromotionMechanism.java index fbd02c21..d2e4e6cd 100644 --- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/PromotionMechanism.java +++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/PromotionMechanism.java @@ -29,6 +29,8 @@ public class PromotionMechanism { private IStudentDataModel _studentModel; // holds the StudentDataModel private TransitionMatrixModel _matrix; // now holds the transition map things... + public static PerformanceData performance = new PerformanceData(); + public PromotionMechanism(IStudentDataModel studentModel, TransitionMatrixModel matrix) { this._studentModel = studentModel; this._matrix = matrix; @@ -156,7 +158,6 @@ private String selectNextTutor(CTutor lastTutorPlayed, String lastSkillPlayed, b rules = new PerformancePromotionRules(); } - PerformanceData performance = new PerformanceData(); performance.setActivityType(activeTutorId); // look up activeSkill every time? performance.setActiveSkill(lastSkillPlayed); @@ -169,6 +170,8 @@ private String selectNextTutor(CTutor lastTutorPlayed, String lastSkillPlayed, b performance.setTotalNumberQuestions(lastTutorPlayed.getTotalQuestions()); + + PromotionRules.PromotionDecision promotionDecision = rules.assessPerformance(performance); RoboTutor.logManager.postEvent_I(MENU_BUG_TAG, "PerformancePromotionRules result = " + promotionDecision); diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/StudentChooseMatrixActivityMenu.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/StudentChooseMatrixActivityMenu.java index 62308423..add3b249 100644 --- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/StudentChooseMatrixActivityMenu.java +++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/util/StudentChooseMatrixActivityMenu.java @@ -7,6 +7,8 @@ import cmu.xprize.comp_ask.CAsk_Data; import cmu.xprize.comp_session.AS_CONST; import cmu.xprize.robotutor.RoboTutor; +import cmu.xprize.robotutor.tutorengine.CTutor; +import cmu.xprize.robotutor.tutorengine.CTutorEngine; import cmu.xprize.util.CAt_Data; import cmu.xprize.util.CPlacementTest_Tutor; @@ -26,17 +28,24 @@ public class StudentChooseMatrixActivityMenu implements IActivityMenu { TransitionMatrixModel _matrix; IStudentDataModel _student; + PerformanceData _performanceData; PromotionMechanism _promotionMechanism; public StudentChooseMatrixActivityMenu(TransitionMatrixModel matrix, IStudentDataModel student) { this._matrix = matrix; this._student = student; - this._promotionMechanism = new PromotionMechanism(_student, _matrix); + this._performanceData = PromotionMechanism.performance; + _promotionMechanism = new PromotionMechanism(_student, _matrix); } @Override public String getLayoutName() { - return "ask_activity_selector_2x3"; + if(_performanceData.getNumberAttempts() > 0 + && + _performanceData.getNumberCorrect() / _performanceData.getNumberAttempts() > PlacementPromotionRules.HIGH_PERFORMANCE_THRESHOLD) + return "ask_activity_selector_elevate"; + else + return "ask_activity_selector_2x3"; } @Override @@ -72,12 +81,21 @@ public CAsk_Data initializeActiveLayout() { activeLayout.items[2].prompt = "numbers and math"; activeLayout.items[2].help = "numbers and math"; - - activeLayout.items[3] = new CAskElement(); - activeLayout.items[3].componentID = "Sbutton1"; - activeLayout.items[3].behavior = AS_CONST.ELEVATE; - activeLayout.items[3].prompt = "escape to placement"; - activeLayout.items[3].help = "escape to placement"; + activeLayout.items[3] = new CAskElement(); + if(_performanceData.getNumberAttempts() > 0 + && + _performanceData.getNumberCorrect() / _performanceData.getNumberAttempts() > PlacementPromotionRules.HIGH_PERFORMANCE_THRESHOLD){ + activeLayout.items[3].componentID = "Sbutton1"; + activeLayout.items[3].behavior = AS_CONST.ELEVATE; + activeLayout.items[3].prompt = "escape to placement"; + activeLayout.items[3].help = "escape to placement"; + } + else{ + activeLayout.items[3].componentID = "SbuttonRepeat"; + activeLayout.items[3].behavior = AS_CONST.SELECT_REPEAT; + activeLayout.items[3].prompt = "lets do it again"; + activeLayout.items[3].help = "lets do it again"; + } activeLayout.items[4] = new CAskElement(); activeLayout.items[4].componentID = "SbuttonExit"; @@ -95,7 +113,14 @@ public Map getButtonBehaviorMap() { map.put(AS_CONST.BEHAVIOR_KEYS.SELECT_WRITING, AS_CONST.QUEUEMAP_KEYS.BUTTON_BEHAVIOR); map.put(AS_CONST.BEHAVIOR_KEYS.SELECT_STORIES, AS_CONST.QUEUEMAP_KEYS.BUTTON_BEHAVIOR); map.put(AS_CONST.BEHAVIOR_KEYS.SELECT_MATH, AS_CONST.QUEUEMAP_KEYS.BUTTON_BEHAVIOR); - map.put(AS_CONST.ELEVATE, AS_CONST.QUEUEMAP_KEYS.BUTTON_BEHAVIOR); + if(_performanceData.getNumberAttempts() > 0 + && + _performanceData.getNumberCorrect() / _performanceData.getNumberAttempts() > PlacementPromotionRules.HIGH_PERFORMANCE_THRESHOLD){ + map.put(AS_CONST.ELEVATE, AS_CONST.QUEUEMAP_KEYS.BUTTON_BEHAVIOR); + } + else{ + map.put(AS_CONST.SELECT_REPEAT, AS_CONST.QUEUEMAP_KEYS.BUTTON_BEHAVIOR); + } map.put(AS_CONST.SELECT_EXIT, AS_CONST.QUEUEMAP_KEYS.EXIT_BUTTON_BEHAVIOR); return map; } @@ -131,6 +156,21 @@ public CAt_Data getTutorToLaunch(String buttonBehavior) { } break; + case AS_CONST.SELECT_REPEAT: + + RoboTutor.STUDENT_CHOSE_REPEAT = true; + + String lastTutor = _student.getLastTutor(); // MENU_LOGIC why is this only called once? + if (lastTutor != null) { // for when it's the first time...s + activeTutorId = lastTutor; + } + if (activeTutorId == null) { + rootTutor = _matrix.getRootSkillByContentArea(SELECT_WRITING); + } + activeSkill = _student.getLastSkill(); + transitionMap = _matrix.getTransitionMapByContentArea(activeSkill); + break; + case SELECT_WRITING: activeSkill = SELECT_WRITING; // √ diff --git a/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TActivitySelector.java b/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TActivitySelector.java index d98b00f8..2d7b91d0 100644 --- a/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TActivitySelector.java +++ b/app/src/main/java/cmu/xprize/robotutor/tutorengine/widgets/core/TActivitySelector.java @@ -684,8 +684,6 @@ private void doTutorLaunchWithVideosAndStuff(CAt_Data tutorToLaunch) { /** * A big and cumbersome method that plays the tutor video... * - * @param prefs - * @param activityPreferenceKey * @param timesPlayedActivity * @param pathToFile */ diff --git a/app/src/main/res/layout/ask_activity_selector_2x3.xml b/app/src/main/res/layout/ask_activity_selector_2x3.xml index a8dda6d6..943d90bf 100644 --- a/app/src/main/res/layout/ask_activity_selector_2x3.xml +++ b/app/src/main/res/layout/ask_activity_selector_2x3.xml @@ -54,7 +54,7 @@ /> + + + + + + + + + + + + + + + + + + \ No newline at end of file