diff --git a/.gitignore b/.gitignore index 6718d14..fe97827 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /bin lint.xml +smiledb-test/ diff --git a/res/values/strings.xml b/res/values/strings.xml index 4246555..d6ddd48 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -72,6 +72,7 @@ Starting... Solving... + Recovering... Question Number Correct Answer diff --git a/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java b/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java index 4afbaef..99eddf0 100644 --- a/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java +++ b/src/main/java/org/smilec/smile/bu/SmilePlugServerManager.java @@ -43,7 +43,6 @@ public class SmilePlugServerManager extends AbstractBaseManager { - // XXX TODO: Add arguments to take Teacher Name, Session Name, and Group Name public void startMakingQuestions(String ip, Context context) throws NetworkErrorException { String url = SmilePlugUtil.createUrl(ip, SmilePlugUtil.START_MAKING_QUESTIONS_URL); put(ip, context, url, "{}"); @@ -86,6 +85,7 @@ public void resetGame(String ip, Context context) throws NetworkErrorException { } + // XXX TODO: Add arguments to take Teacher Name, Session Name, and Group Name public void createSession(String ip, String teacherName, String sessionTitle, String groupName, Context context) throws NetworkErrorException { String url = SmilePlugUtil.createUrl(ip, SmilePlugUtil.CREATE_SESSION); diff --git a/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java b/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java index 45689de..7a92505 100644 --- a/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java +++ b/src/main/java/org/smilec/smile/ui/ChooseActivityFlowDialog.java @@ -98,26 +98,25 @@ private class StartButtonListener implements OnClickListener { @Override public void onClick(View v) { - if (status != null) { - if (!status.equals("")) { - AlertDialog.Builder builder = new AlertDialog.Builder( - ChooseActivityFlowDialog.this); - builder.setMessage(R.string.game_running).setCancelable(false) - .setNeutralButton("Ok", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int id) { - new LoadTask(ChooseActivityFlowDialog.this).execute(); - } - }); - AlertDialog alert = builder.create(); - alert.show(); - } else { - new LoadTask(ChooseActivityFlowDialog.this).execute(); - } + + if (status != null && !status.equals("") && !status.equals("RESET")) { + +// AlertDialog.Builder builder = new AlertDialog.Builder(ChooseActivityFlowDialog.this); +// builder.setMessage(R.string.game_running).setCancelable(false).setNeutralButton("Ok", new DialogInterface.OnClickListener() { +// +// @Override +// public void onClick(DialogInterface dialog, int id) { +// new LoadTask(ChooseActivityFlowDialog.this).execute(); +// } +// }); + new LoadTask(ChooseActivityFlowDialog.this).execute(); + ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.recovering); +// AlertDialog alert = builder.create(); +// alert.show(); } else { new LoadTask(ChooseActivityFlowDialog.this).execute(); + ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.starting); } - ActivityUtil.showLongToast(ChooseActivityFlowDialog.this, R.string.starting); } }