Skip to content

Commit

Permalink
Hacks to enable easier TRIAL testing
Browse files Browse the repository at this point in the history
  • Loading branch information
0queue committed May 2, 2017
1 parent 87baebd commit b97001d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
15 changes: 13 additions & 2 deletions app/src/main/java/edu/umd/cmsc436/mstestsuite/MainPresenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ public void run() {
mView.getContext().getString(R.string.app_name),
mView.getContext().getString(R.string.prescription_spreadsheet_id),
mView.getContext().getString(R.string.prescription_spreadsheet_id));
mSheet.fetchPrescription(mUserManager.getCurUserID(), this);

mMainAdapter.setEnabled(0, true);
}

@Override
Expand Down Expand Up @@ -164,7 +165,17 @@ public void onPackageInstalled() {
@Override
public void onAppSelected(TestApp app) {
try {
mView.startPracticeMode(app.getPackageName());

int[] difficulties = new int[mAllApps.length];
for (int i = 0; i < mAllApps.length; i++) {
if (mAllApps[i].getPackageName().equals(app.getPackageName())) {
difficulties[i] = 1;
} else {
difficulties[i] = 0;
}
}

CoordinatorActivity.start(mView.getContext(), mUserManager.getCurUserID(), difficulties, 3);
} catch (ActivityNotFoundException anfe) {
mView.showToast(app.getDisplayName() + " not found");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package edu.umd.cmsc436.mstestsuite.ui;

import android.annotation.SuppressLint;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
Expand Down Expand Up @@ -140,7 +141,13 @@ private void popLaunchIntent () {
toaster.setText(text);
toaster.show();

startActivityForResult(mLastIntent, 3000 + mLaunchIntents.size());
try {
startActivityForResult(mLastIntent, 3000 + mLaunchIntents.size());
} catch (ActivityNotFoundException anfe) {
toaster.setText((appendage == null ? "null" : appendage.toId()) + " not found");
toaster.show();
finish();
}
} else {
// TODO report finished/completed/whatever
finish();
Expand Down

0 comments on commit b97001d

Please sign in to comment.