diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
new file mode 100644
index 0000000..5806fb3
--- /dev/null
+++ b/.idea/kotlinc.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index d4aa574..ca0d76d 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -2,6 +2,8 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
+apply plugin: 'kotlin-kapt'
+
apply plugin: 'kotlin-android-extensions'
android {
@@ -24,7 +26,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index d873b22..b47b937 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/undefined/dsm/getterra/connecter/API.java b/app/src/main/java/undefined/dsm/getterra/connecter/API.java
new file mode 100644
index 0000000..9f7f221
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/connecter/API.java
@@ -0,0 +1,25 @@
+package undefined.dsm.getterra.connecter;
+
+
+
+import retrofit2.Call;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Header;
+import retrofit2.http.POST;
+import retrofit2.http.Path;
+
+
+public interface API {
+ @GET("Solve/solve/{boothName}")
+ Call getSolve (
+ @Header("") String Authorization,
+ @Path("boothName") String boothName
+ );
+ @POST("Solve/solve/{boothCode}")
+ Call postSolve(
+ @Header("") String Authorization,
+ @Path("boothCode") String boothCode,
+ @Body problemIdAnswer PA
+ );
+}
diff --git a/app/src/main/java/undefined/dsm/getterra/connecter/API.kt b/app/src/main/java/undefined/dsm/getterra/connecter/API.kt
deleted file mode 100644
index f88a106..0000000
--- a/app/src/main/java/undefined/dsm/getterra/connecter/API.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package com.justgo.Connecter
-
-import retrofit2.Call
-import okhttp3.MultipartBody
-import retrofit2.http.*
-
-interface API {
-
-}
\ No newline at end of file
diff --git a/app/src/main/java/undefined/dsm/getterra/connecter/Connecter.kt b/app/src/main/java/undefined/dsm/getterra/connecter/Connecter.kt
index 3dc3210..02b47a0 100644
--- a/app/src/main/java/undefined/dsm/getterra/connecter/Connecter.kt
+++ b/app/src/main/java/undefined/dsm/getterra/connecter/Connecter.kt
@@ -5,6 +5,7 @@ import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
+import undefined.dsm.getterra.connecter.API
object Connecter {
lateinit var retrofit: Retrofit
@@ -17,7 +18,7 @@ object Connecter {
retrofit = Retrofit
.Builder()
- .baseUrl("http://ec2-52-79-240-33.ap-northeast-2.compute.amazonaws.com/api/")
+ .baseUrl("https://ec2.istruly.sexy:1234/")
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.client(client)
diff --git a/app/src/main/java/undefined/dsm/getterra/connecter/GetSolve.java b/app/src/main/java/undefined/dsm/getterra/connecter/GetSolve.java
new file mode 100644
index 0000000..22ffc84
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/connecter/GetSolve.java
@@ -0,0 +1,43 @@
+package undefined.dsm.getterra.connecter;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+public class GetSolve {
+ @SerializedName("boothName")
+ @Expose
+ private String boothName;
+ @SerializedName("problemId")
+ @Expose
+ private String problemId;
+ @SerializedName("question")
+ @Expose
+ private String question;
+ @SerializedName("problemType")
+ @Expose
+ private int problemType;
+ @SerializedName("choices")
+ @Expose
+ private String[] choices;
+
+ public String getBoothName() {
+ return boothName;
+ }
+
+ public String getQuestion() {
+ return question;
+ }
+
+ public int getProblemType() {
+ return problemType;
+ }
+
+ public String[] getChoices() {
+ return choices;
+ }
+
+ public String getProblemId()
+ {
+ return problemId;
+ }
+}
diff --git a/app/src/main/java/undefined/dsm/getterra/connecter/PostSolve.java b/app/src/main/java/undefined/dsm/getterra/connecter/PostSolve.java
new file mode 100644
index 0000000..a85a197
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/connecter/PostSolve.java
@@ -0,0 +1,4 @@
+package undefined.dsm.getterra.connecter;
+
+public class PostSolve {
+}
diff --git a/app/src/main/java/undefined/dsm/getterra/connecter/problemIdAnswer.java b/app/src/main/java/undefined/dsm/getterra/connecter/problemIdAnswer.java
new file mode 100644
index 0000000..a95bd51
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/connecter/problemIdAnswer.java
@@ -0,0 +1,10 @@
+package undefined.dsm.getterra.connecter;
+
+public class problemIdAnswer {
+ String problemId, answer;
+ public problemIdAnswer(String a, String b)
+ {
+ problemId = a;
+ answer = b;
+ }
+}
diff --git a/app/src/main/java/undefined/dsm/getterra/ui/CorrectionMainActivity.java b/app/src/main/java/undefined/dsm/getterra/ui/CorrectionMainActivity.java
new file mode 100644
index 0000000..a0e573a
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/ui/CorrectionMainActivity.java
@@ -0,0 +1,60 @@
+package undefined.dsm.getterra.ui;
+
+import android.app.Activity;
+
+import android.content.Intent;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+
+import undefined.dsm.getterra.R;
+
+
+public class CorrectionMainActivity extends AppCompatActivity {
+ Activity quizActivity = QuizMainActivity._QuizMainActivity;
+ View correctionBackground;
+ TextView goToBack;
+ TextView isAnswerTrue_tv;
+ TextView clubName;
+ String boothName;
+ boolean isAnswerTrue;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_correction_main);
+ Intent intent = getIntent();
+ boothName = intent.getStringExtra("boothName");
+ isAnswerTrue = intent.getBooleanExtra("isAnswerTrue",true);
+ correctionBackground = findViewById(R.id.correction_background);
+ goToBack = (TextView)findViewById(R.id.correction_gotoback_tv);
+ isAnswerTrue_tv = (TextView)findViewById(R.id.correction_isanswertrue_tv);
+ clubName = (TextView)findViewById(R.id.correction_clubname_tv);
+ setBackGroundColor();
+ }
+ public void goToMain(View v)
+ {
+ quizActivity.finish();
+ finish();
+ }
+ public void backToResolve(View v)
+ {
+ finish();
+ }
+ public void setBackGroundColor()
+ {
+ clubName.setText(boothName);//동아리이름. 레트로핏 서버연동 필요
+
+ if(isAnswerTrue){ // 정답이 맞으면
+ correctionBackground.setBackgroundColor(0xfffff5f5);
+ isAnswerTrue_tv.setText("정답!");
+ goToBack.setTextColor(0xffffb587);
+ }
+ else{
+ correctionBackground.setBackgroundColor(0xffd4e5ff);
+ isAnswerTrue_tv.setText("오답");
+ goToBack.setTextColor(0xff84b6ff);
+ // 점령시켰다는 메세지 서버에 보내기.
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/undefined/dsm/getterra/ui/MainActivity.kt b/app/src/main/java/undefined/dsm/getterra/ui/MainActivity.kt
index 3e4025d..0497eea 100644
--- a/app/src/main/java/undefined/dsm/getterra/ui/MainActivity.kt
+++ b/app/src/main/java/undefined/dsm/getterra/ui/MainActivity.kt
@@ -1,13 +1,15 @@
package undefined.dsm.getterra.ui
+import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import undefined.dsm.getterra.R
class MainActivity : AppCompatActivity() {
-
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
+ var intent : Intent = Intent(this,QuizMainActivity::class.java)
+ startActivity(intent)
}
-}
+}
\ No newline at end of file
diff --git a/app/src/main/java/undefined/dsm/getterra/ui/OXFragment.java b/app/src/main/java/undefined/dsm/getterra/ui/OXFragment.java
new file mode 100644
index 0000000..152be1b
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/ui/OXFragment.java
@@ -0,0 +1,87 @@
+package undefined.dsm.getterra.ui;
+
+import android.content.Context;
+
+import android.support.v4.app.Fragment;
+import android.os.Bundle;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import undefined.dsm.getterra.R;
+
+public class OXFragment extends Fragment {
+ TextView o, x;
+ boolean b[] = new boolean[2];
+ public OXFragment(){
+
+ }
+
+ public interface SendDataOX{
+ void sendDataOX(boolean OX[]);
+ }
+
+ private SendDataOX sendDataOX;
+
+ @Override
+ public void onAttach(Context context)
+ {
+ super.onAttach(context);
+ if(context instanceof SendDataOX){
+ sendDataOX = (SendDataOX) context;
+ } else{
+ throw new RuntimeException(context.toString() + "must implement");
+ }
+ }
+
+ @Override
+ public void onDetach(){
+ super.onDetach();
+ sendDataOX = null;
+ }
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
+ b[0] = false; b[1] = false;
+ View view = inflater.inflate(R.layout.fragment_ox, container, false);
+ o = view.findViewById(R.id.quiz_answeriso_btn);
+ x = view.findViewById(R.id.quiz_answerisx_btn);
+
+ View.OnClickListener listener = new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ switch (v.getId())
+ {
+ case R.id.quiz_answeriso_btn:
+ b[0] = true; b[1] = false; break;
+ case R.id.quiz_answerisx_btn:
+ b[0] = false; b[1] = true;break;
+ }
+ sendDataOX.sendDataOX(b);
+ selectAnimation(o, b[0]);
+ selectAnimation(x, b[1]);
+ }
+ };
+ o.setOnClickListener(listener);
+ x.setOnClickListener(listener);
+ return view;
+ }
+ public void selectAnimation(TextView t, boolean b){
+ if(b==true)
+ {
+ t.setTextColor(0xffffffff);
+ t.setBackgroundColor(0xffffb587);
+ t.setBackgroundResource(R.drawable.round_background_reverse);
+ }
+ else
+ {
+ t.setTextColor(0xffffb587);
+ t.setBackgroundColor(0xffffffff);
+ t.setBackgroundResource(R.drawable.round_background);
+ }
+ }
+}
diff --git a/app/src/main/java/undefined/dsm/getterra/ui/QuizMainActivity.java b/app/src/main/java/undefined/dsm/getterra/ui/QuizMainActivity.java
new file mode 100644
index 0000000..0d9e7c0
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/ui/QuizMainActivity.java
@@ -0,0 +1,224 @@
+package undefined.dsm.getterra.ui;
+
+import android.app.Activity;
+
+import android.support.v4.app.FragmentManager;
+import android.support.v4.app.FragmentTransaction;
+import android.content.Intent;
+
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+
+import com.justgo.Connecter.Connecter;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+import undefined.dsm.getterra.R;
+import undefined.dsm.getterra.connecter.API;
+import undefined.dsm.getterra.connecter.GetSolve;
+import undefined.dsm.getterra.connecter.PostSolve;
+import undefined.dsm.getterra.connecter.problemIdAnswer;
+
+public class QuizMainActivity extends AppCompatActivity implements OXFragment.SendDataOX, SelectFragment.SendDataSelect{
+ String boothName = "undefined";
+ String question = "문제입니당";
+ String problemId = "문제 아이디";
+ String answer = "답";
+ String choices[] = new String[4];
+ int statusCode;
+ int result;
+ boolean OX[] = new boolean[2];
+ boolean BSelect[] = new boolean[4];
+
+ //Fragment
+ Fragment fr;
+
+ //View
+ TextView _problemType;
+ TextView _question;
+ TextView clubName;
+
+ TextView nextActivity;
+
+ EditText userInput;
+
+ //retrofit
+
+ //test
+ int _problemTypetest = 2;
+ public static Activity _QuizMainActivity;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_quiz_main);
+ //서버에서 데이터 불러와야함.
+ _QuizMainActivity = QuizMainActivity.this;
+
+ _problemType = findViewById(R.id.quiz_problemtype_tv);
+ _question = findViewById(R.id.quiz_problem_tv);
+ userInput = findViewById(R.id.quiz_userInput_et);
+ clubName = findViewById(R.id.quiz_clubname_tv);
+
+ nextActivity = findViewById(R.id.quiz_answer_tv);
+ nextActivity.setOnClickListener(new View.OnClickListener(){
+ @Override
+ public void onClick (View v)
+ {
+ switch(_problemTypetest)
+ {
+ case 0: answer = userInput.getText().toString(); if(answer.length()==0){Toast.makeText(getApplicationContext(), "정답을 입력해주세요.",Toast.LENGTH_SHORT).show(); return;}
+ case 1:
+ for(int i=0; i<4; i++)
+ {
+ if(BSelect[i]==true)
+ {
+ answer = Integer.toString(i);
+ break;
+ }
+ }
+ case 2:
+ {
+ if(OX[0]==true)
+ {
+ answer = "O";
+ }
+ else if(OX[1]==true)
+ {
+ answer = "X";
+ }
+ }
+ }
+ Submission();
+ Intent intent = new Intent(getApplicationContext(), CorrectionMainActivity.class);
+ switch(result)
+ {
+ case 401:Toast.makeText(getApplicationContext(), "request header에 access token 없음.",Toast.LENGTH_SHORT).show(); break;
+ case 403:Toast.makeText(getApplicationContext(), "권한 없음.",Toast.LENGTH_SHORT).show(); break;
+ case 406:Toast.makeText(getApplicationContext(), "게임 시작 전.",Toast.LENGTH_SHORT).show(); break;
+ case 412:Toast.makeText(getApplicationContext(), "게임 종료.",Toast.LENGTH_SHORT).show(); break;
+ case 201:intent.putExtra("isAnswerTrue",true); intent.putExtra("boothName",boothName); startActivity(intent); break;
+ case 204:intent.putExtra("isAnswerTrue",false); intent.putExtra("boothName",boothName); startActivity(intent); break;
+ }
+ }
+
+ //retrofit
+
+ });
+ QuizSet();
+ switch(statusCode)
+ {
+ case 204:Toast.makeText(getApplicationContext(), "해당 부스아이디에 해당하는 부스 없음.",Toast.LENGTH_SHORT).show(); finish(); break;
+ case 205:Toast.makeText(getApplicationContext(), "이미 팀에서 점령한 부스임.",Toast.LENGTH_SHORT).show(); finish(); break;
+ case 401:Toast.makeText(getApplicationContext(), "request header에 access token 없음.",Toast.LENGTH_SHORT).show(); finish(); break;
+ case 403:Toast.makeText(getApplicationContext(), "권한 없음.",Toast.LENGTH_SHORT).show(); finish(); break;
+ case 406:Toast.makeText(getApplicationContext(), "게임 시작 전.",Toast.LENGTH_SHORT).show(); finish(); break;
+ case 412:Toast.makeText(getApplicationContext(), "게임 종료.",Toast.LENGTH_SHORT).show(); finish(); break;
+ }
+ QuizActivitySet();
+ FragmentSet();
+ }
+ public void QuizActivitySet(){
+ switch (_problemTypetest)
+ {
+ case 0: {_problemType.setText("주관식");
+ fr = new SubjectFragment();
+ userInput.setVisibility(View.VISIBLE);
+
+ break;
+ }
+ case 1: {_problemType.setText("객관식");
+ fr = new SelectFragment();
+ Bundle bundle = new Bundle();
+ bundle.putString("f_sel",choices[0]);
+ bundle.putString("s_sel",choices[1]);
+ bundle.putString("t_sel",choices[2]);
+ bundle.putString("o_sel",choices[3]);
+ fr.setArguments(bundle);
+ userInput.setVisibility(View.GONE);
+ break;
+ }
+ case 2: {_problemType.setText("O/X");
+ fr = new OXFragment();
+ userInput.setVisibility(View.GONE);
+ break;
+ }
+ }
+ _question.setText(question);
+ clubName.setText(boothName);
+ }
+ public void QuizSet()
+ {
+ API service = Connecter.api;
+ Call call = service.getSolve("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1Mzk5NjU5NzIsIm5iZiI6MTUzOTk2NTk3MiwianRpIjoiNGY2YTAyNDUtMjRiZS00NDg1LWJhNmYtOTFhY2ZlMzZlMjQ2IiwiZXhwIjoxNTcxNTAxOTcyLCJpZGVudGl0eSI6Im5lcmQiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.ugcB9wpQJkAO3CwgKMX-vkU44OT97HAKEN8q_Po4MP8",boothName);
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if(response.isSuccessful()) {
+ GetSolve solve = response.body();
+ _problemTypetest =solve.getProblemType();
+ question = solve.getQuestion();
+ boothName = solve.getBoothName();
+ problemId = solve.getProblemId();
+ choices = solve.getChoices();
+ }else {
+ statusCode = response.code();
+ // handle request errors depending on status code
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Toast.makeText(getApplicationContext(), "서버에 접속할 수 없습니다.",Toast.LENGTH_SHORT).show();
+ //finish();
+ }
+ });
+ }
+ public void Submission()
+ {
+ API service = Connecter.api;
+ problemIdAnswer PA = new problemIdAnswer(problemId, answer);
+ Call call = service.postSolve("Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE1Mzk5NjU5NzIsIm5iZiI6MTUzOTk2NTk3MiwianRpIjoiNGY2YTAyNDUtMjRiZS00NDg1LWJhNmYtOTFhY2ZlMzZlMjQ2IiwiZXhwIjoxNTcxNTAxOTcyLCJpZGVudGl0eSI6Im5lcmQiLCJmcmVzaCI6ZmFsc2UsInR5cGUiOiJhY2Nlc3MifQ.ugcB9wpQJkAO3CwgKMX-vkU44OT97HAKEN8q_Po4MP8",boothName, PA);
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if(response.isSuccessful()) {
+ result = response.code();
+ }else {
+ result = response.code();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Toast.makeText(getApplicationContext(), "서버에 접속할 수 없습니다.",Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+ public void FragmentSet()
+ {
+ FragmentManager fragment = getSupportFragmentManager();
+ FragmentTransaction fragmentTransaction = fragment.beginTransaction();
+ fragmentTransaction.replace(R.id.quiz_fragment_fg, fr);
+ fragmentTransaction.commit();
+ }
+ public void backFromQuizMain(View v)
+ {
+ finish();
+ }
+ @Override
+ public void sendDataOX(boolean mOX[])
+ {
+ OX = mOX;
+ }
+ public void sendDataSelect(boolean mSelect[])
+ {
+ BSelect = mSelect;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/undefined/dsm/getterra/ui/SelectFragment.java b/app/src/main/java/undefined/dsm/getterra/ui/SelectFragment.java
new file mode 100644
index 0000000..f2f6a76
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/ui/SelectFragment.java
@@ -0,0 +1,131 @@
+package undefined.dsm.getterra.ui;
+
+import android.support.v4.app.Fragment;
+import android.content.Context;
+import android.os.Bundle;
+
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.TextView;
+
+import undefined.dsm.getterra.R;
+
+public class SelectFragment extends Fragment {
+ TextView s1, s2, s3, s4;
+ boolean st[] = new boolean[4];
+
+ public SelectFragment(){
+ }
+
+ public interface SendDataSelect{
+ void sendDataSelect(boolean select[]);
+ }
+
+ private SendDataSelect sendDataSelect;
+
+ @Override
+ public void onAttach(Context context)
+ {
+ super.onAttach(context);
+ if(context instanceof SendDataSelect){
+ sendDataSelect = (SendDataSelect) context;
+ } else{
+ throw new RuntimeException(context.toString() + "must implement");
+ }
+ }
+
+ @Override
+ public void onDetach(){
+ super.onDetach();
+ sendDataSelect = null;
+ }
+
+ Bundle bundle = getArguments();
+ String fSel = bundle.getString("f_sel");
+ String sSel = bundle.getString("s_sel");
+ String tSel = bundle.getString("t_sel");
+ String oSel = bundle.getString("o_sel");
+
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState){
+ for(int i=0; i<4; i++){
+ st[i] = false;
+ }
+ View view = inflater.inflate(R.layout.fragment_select, container, false);
+ s1 = view.findViewById(R.id.quiz_selectfirst_tv);
+ s2 = view.findViewById(R.id.quiz_selectsecond_tv);
+ s3 = view.findViewById(R.id.quiz_selectthird_tv);
+ s4 = view.findViewById(R.id.quiz_selectfourth_tv);
+
+ s1.setText(fSel);
+ s2.setText(sSel);
+ s3.setText(tSel);
+ s4.setText(oSel);
+
+ View.OnClickListener listener = new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View v)
+ {
+ switch (v.getId())
+ {
+
+ case R.id.quiz_selectfirst_tv:
+ for(int i=0; i<4; i++)
+ {
+ if(i==0) st[i] = true;
+ else st[i] = false;
+ }
+ break;
+ case R.id.quiz_selectsecond_tv:
+ for(int i=0; i<4; i++)
+ {
+ if(i==1) st[i] = true;
+ else st[i] = false;
+ }
+ break;
+ case R.id.quiz_selectthird_tv:
+ for(int i=0; i<4; i++)
+ {
+ if(i==2) st[i] = true;
+ else st[i] = false;
+ }
+ break;
+ case R.id.quiz_selectfourth_tv:
+ for(int i=0; i<4; i++)
+ {
+ if(i==3) st[i] = true;
+ else st[i] = false;
+ }
+ break;
+ }
+ sendDataSelect.sendDataSelect(st);
+ selectAnimation(s1, st[0]);
+ selectAnimation(s2, st[1]);
+ selectAnimation(s3, st[2]);
+ selectAnimation(s4, st[3]);
+ }
+ };
+ s1.setOnClickListener(listener);
+ s2.setOnClickListener(listener);
+ s3.setOnClickListener(listener);
+ s4.setOnClickListener(listener);
+ return view;
+ }
+ public void selectAnimation(TextView t, boolean b){
+ if(b==true)
+ {
+ t.setTextColor(0xffffffff);
+ t.setBackgroundColor(0xffffb587);
+ t.setBackgroundResource(R.drawable.round_background_reverse);
+ }
+ else
+ {
+ t.setTextColor(0xffffb587);
+ t.setBackgroundColor(0xffffffff);
+ t.setBackgroundResource(R.drawable.round_background);
+ }
+ }
+
+}
diff --git a/app/src/main/java/undefined/dsm/getterra/ui/SubjectFragment.java b/app/src/main/java/undefined/dsm/getterra/ui/SubjectFragment.java
new file mode 100644
index 0000000..336d2c3
--- /dev/null
+++ b/app/src/main/java/undefined/dsm/getterra/ui/SubjectFragment.java
@@ -0,0 +1,18 @@
+package undefined.dsm.getterra.ui;
+import android.support.v4.app.Fragment;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import undefined.dsm.getterra.R;
+
+public class SubjectFragment extends Fragment {
+ public SubjectFragment(){
+
+ }
+ @Override
+ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
+ return inflater.inflate(R.layout.fragment_subject, container, false);
+ }
+}
diff --git a/app/src/main/res/drawable/back_topbackground.png b/app/src/main/res/drawable/back_topbackground.png
new file mode 100644
index 0000000..ae09139
Binary files /dev/null and b/app/src/main/res/drawable/back_topbackground.png differ
diff --git a/app/src/main/res/drawable/round_background.xml b/app/src/main/res/drawable/round_background.xml
new file mode 100644
index 0000000..6e322dd
--- /dev/null
+++ b/app/src/main/res/drawable/round_background.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/round_background_reverse.xml b/app/src/main/res/drawable/round_background_reverse.xml
new file mode 100644
index 0000000..f1ef69b
--- /dev/null
+++ b/app/src/main/res/drawable/round_background_reverse.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/drawable/round_borderlinebackground.xml b/app/src/main/res/drawable/round_borderlinebackground.xml
new file mode 100644
index 0000000..898a905
--- /dev/null
+++ b/app/src/main/res/drawable/round_borderlinebackground.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_correction_main.xml b/app/src/main/res/layout/activity_correction_main.xml
new file mode 100644
index 0000000..7bc2623
--- /dev/null
+++ b/app/src/main/res/layout/activity_correction_main.xml
@@ -0,0 +1,111 @@
+
+
+
+
+
+ f
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_quiz_main.xml b/app/src/main/res/layout/activity_quiz_main.xml
new file mode 100644
index 0000000..8a2fbf2
--- /dev/null
+++ b/app/src/main/res/layout/activity_quiz_main.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_quiz_question.xml b/app/src/main/res/layout/activity_quiz_question.xml
new file mode 100644
index 0000000..295c0ef
--- /dev/null
+++ b/app/src/main/res/layout/activity_quiz_question.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_ox.xml b/app/src/main/res/layout/fragment_ox.xml
new file mode 100644
index 0000000..d9bd138
--- /dev/null
+++ b/app/src/main/res/layout/fragment_ox.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_select.xml b/app/src/main/res/layout/fragment_select.xml
new file mode 100644
index 0000000..e055db7
--- /dev/null
+++ b/app/src/main/res/layout/fragment_select.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_subject.xml b/app/src/main/res/layout/fragment_subject.xml
new file mode 100644
index 0000000..7fb8dfc
--- /dev/null
+++ b/app/src/main/res/layout/fragment_subject.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 5885930..f2f67d9 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -1,11 +1,16 @@
-
+
-