Untitled
unknown
plain_text
5 months ago
36 kB
2
Indexable
import android.animation.*; import android.app.*; import android.app.Activity; import android.content.*; import android.content.Intent; import android.content.SharedPreferences; import android.content.res.*; import android.graphics.*; import android.graphics.Typeface; import android.graphics.drawable.*; import android.media.*; import android.net.*; import android.net.Uri; import android.os.*; import android.os.Bundle; import android.text.*; import android.text.style.*; import android.util.*; import android.view.*; import android.view.View; import android.view.View.*; import android.view.animation.*; import android.webkit.*; import android.widget.*; import android.widget.CheckBox; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.ScrollView; import android.widget.SeekBar; import android.widget.TextView; import androidx.annotation.*; import androidx.appcompat.app.AppCompatActivity; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.recyclerview.widget.*; import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView.Adapter; import androidx.recyclerview.widget.RecyclerView.ViewHolder; import androidx.webkit.*; import com.blogspot.atifsoftwares.animatoolib.*; import com.bumptech.glide.Glide; import com.github.barteksc.pdfviewer.*; import com.google.android.gms.ads.MobileAds; import com.google.android.gms.ads.RequestConfiguration; import com.google.android.material.*; import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayout.OnTabSelectedListener; import com.google.firebase.FirebaseApp; import com.google.firebase.database.ChildEventListener; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.GenericTypeIndicator; import com.google.firebase.database.ValueEventListener; import com.razorpay.*; import com.sdsmdg.tastytoast.*; import com.shobhitpuri.custombuttons.*; import com.shockwave.pdfium.*; import com.smarteist.autoimageslider.*; import java.io.*; import java.io.InputStream; import java.text.*; import java.text.DecimalFormat; import java.util.*; import java.util.ArrayList; import java.util.HashMap; import java.util.Timer; import java.util.TimerTask; import java.util.regex.*; import jp.wasabeef.glide.transformations.*; import me.everything.*; import ninjacoder.fixedsizelayoutandroid.*; import org.json.*; import com.google.android.gms.ads.MobileAds; import com.google.android.gms.ads.initialization.InitializationStatus; import com.google.android.gms.ads.initialization.OnInitializationCompleteListener; import com.google.android.gms.ads.AdError; import com.google.android.gms.ads.AdListener; import com.google.android.gms.ads.AdLoader; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.AdValue; import com.google.android.gms.ads.AdView; import com.google.android.gms.ads.FullScreenContentCallback; import com.google.android.gms.ads.LoadAdError; import com.google.android.gms.ads.OnPaidEventListener; import com.google.android.gms.ads.OnUserEarnedRewardListener; import com.google.android.gms.ads.interstitial.InterstitialAd; import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback; import com.google.android.gms.ads.nativead.MediaView; import com.google.android.gms.ads.nativead.NativeAd; import com.google.android.gms.ads.nativead.NativeAdOptions; import com.google.android.gms.ads.nativead.NativeAdView; import com.google.android.gms.ads.rewarded.OnAdMetadataChangedListener; import com.google.android.gms.ads.rewarded.RewardItem; import com.google.android.gms.ads.rewarded.RewardedAd; import com.google.android.gms.ads.rewarded.RewardedAdLoadCallback; import com.google.android.gms.ads.AdSize; import com.google.android.gms.ads.AdView; import androidx.annotation.Nullable; import androidx.swiperefreshlayout.widget.CircularProgressDrawable; import com.bumptech.glide.Glide; import com.bumptech.glide.load.DataSource; import com.bumptech.glide.load.engine.GlideException; import com.bumptech.glide.load.engine.Resource; import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.target.Target; import com.bumptech.glide.Glide; import com.bumptech.glide.load.MultiTransformation; import com.bumptech.glide.load.resource.bitmap.BitmapTransformation; import com.bumptech.glide.load.resource.bitmap.CenterCrop; import com.bumptech.glide.load.resource.bitmap.TransformationUtils; import jp.wasabeef.glide.transformations.BlurTransformation; import android.graphics.Bitmap; public class MockExamActivity extends AppCompatActivity { private InterstitialAd mInterstitialAd; private Timer _timer = new Timer(); private FirebaseDatabase _firebase = FirebaseDatabase.getInstance(); private String data_path = ""; private double position = 0; private double m = 0; private double s = 0; private double pointsEarned = 0; private String selectedAnswer = ""; private double Percentage = 0; private HashMap<String, Object> correct = new HashMap<>(); private HashMap<String, Object> correctAnswerVariableList = new HashMap<>(); private HashMap<String, Object> incorrectAnswerVariableList = new HashMap<>(); private HashMap<String, Object> skippedAnswerVariableList = new HashMap<>(); private double tabIndex = 0; private double number = 0; private double position2 = 0; private String selectedOption = ""; private HashMap<String, Object> incorrect = new HashMap<>(); private HashMap<String, Object> skipped = new HashMap<>(); private String data_path2 = ""; private HashMap<String, Object> attemptedData = new HashMap<>(); private String url = ""; private double questionStartPosition = 0; private double questionEndPosition = 0; private double skippedPositionsVar = 0; private double totalQ = 0; private double skipListClickPosition = 0; private String clkPos = ""; private double clkNum = 0; private double tab2selectPosition = 0; private ArrayList<HashMap<String, Object>> list_map = new ArrayList<>(); private ArrayList<HashMap<String, Object>> correctList = new ArrayList<>(); private ArrayList<HashMap<String, Object>> incorrectList = new ArrayList<>(); private ArrayList<HashMap<String, Object>> skippedList = new ArrayList<>(); private ArrayList<HashMap<String, Object>> correctAnswerListMap = new ArrayList<>(); private ArrayList<HashMap<String, Object>> incorrectAnswerListMap = new ArrayList<>(); private ArrayList<HashMap<String, Object>> skippedAnswerListMap = new ArrayList<>(); private ArrayList<HashMap<String, Object>> totalQuestionsListMap = new ArrayList<>(); private ArrayList<HashMap<String, Object>> subjects = new ArrayList<>(); private ArrayList<HashMap<String, Object>> skippedPositionsMap = new ArrayList<>(); private LinearLayout linear1; private GridView gridview1; private TabLayout tablayout2; private LinearLayout linear34; private ScrollView vscroll2; private TabLayout tablayout1; private LinearLayout linear31; private ScrollView vscroll1; private SeekBar seekbar1; private FrameLayout native_adview; private TextView textview10; private TextView textview1; private TextView textview23; private LinearLayout linear33; private ImageView imageview6; private LinearLayout linear_body; private LinearLayout Question; private LinearLayout linear4; private ImageView imageview5; private LinearLayout linear_A; private LinearLayout linear_B; private LinearLayout linear_C; private LinearLayout linear_D; private LinearLayout linear2; private CheckBox checkbox1; private CheckBox checkbox2; private CheckBox checkbox4; private CheckBox checkbox3; private TextView textview11; private TextView textview4; private TextView textview13; private LinearLayout linear5; private TextView textview14; private TextView A; private TextView textview_A; private TextView B; private TextView textview_B; private TextView C; private TextView textview_C; private TextView D; private TextView textview_D; private TextView textview12; private LinearLayout linear3; private TextView Start; private TextView Submit; private LinearLayout linear6; private RecyclerView recyclerview1; private LinearLayout linear8_overview; private LinearLayout linear7; private LinearLayout box_lang; private LinearLayout box_noti; private LinearLayout box_theme; private LinearLayout box_help; private LinearLayout box_security; private LinearLayout linear28; private LinearLayout img_box_lang; private LinearLayout linear9; private ImageView language; private TextView textview6; private TextView textview15; private LinearLayout img_box_noti; private LinearLayout linear13; private ImageView notification; private TextView textview7; private TextView textview17; private LinearLayout img_box_theme; private LinearLayout linear18; private ImageView theme; private TextView textview8; private TextView textview18; private LinearLayout img_box_help; private LinearLayout linear23; private ImageView help; private TextView textview9; private TextView textview19; private LinearLayout img_box_security; private LinearLayout linear27; private ImageView security; private TextView textview16; private TextView textview20; private LinearLayout linear29; private LinearLayout linear30; private ImageView imageview3; private TextView textview21; private TextView textview22; private DatabaseReference datas = _firebase.getReference("+data_path+"); private ChildEventListener _datas_child_listener; private SharedPreferences sharedPref; private Intent i = new Intent(); private TimerTask timer; private TimerTask adTimer; private SharedPreferences sp; private DatabaseReference datas2 = _firebase.getReference("+data_path2+"); private ChildEventListener _datas2_child_listener; private TimerTask skipDialogTimer; @Override protected void onCreate(Bundle _savedInstanceState) { super.onCreate(_savedInstanceState); setContentView(R.layout.mock_exam); initialize(_savedInstanceState); FirebaseApp.initializeApp(this); MobileAds.initialize(this); List<String> testDeviceIds = Arrays.asList(); MobileAds.setRequestConfiguration(new RequestConfiguration.Builder().setTestDeviceIds(testDeviceIds).build()); initializeLogic(); } private void initialize(Bundle _savedInstanceState) { linear1 = findViewById(R.id.linear1); gridview1 = findViewById(R.id.gridview1); tablayout2 = findViewById(R.id.tablayout2); linear34 = findViewById(R.id.linear34); vscroll2 = findViewById(R.id.vscroll2); tablayout1 = findViewById(R.id.tablayout1); linear31 = findViewById(R.id.linear31); vscroll1 = findViewById(R.id.vscroll1); seekbar1 = findViewById(R.id.seekbar1); native_adview = findViewById(R.id.native_adview); textview10 = findViewById(R.id.textview10); textview1 = findViewById(R.id.textview1); textview23 = findViewById(R.id.textview23); linear33 = findViewById(R.id.linear33); imageview6 = findViewById(R.id.imageview6); linear_body = findViewById(R.id.linear_body); Question = findViewById(R.id.Question); linear4 = findViewById(R.id.linear4); imageview5 = findViewById(R.id.imageview5); linear_A = findViewById(R.id.linear_A); linear_B = findViewById(R.id.linear_B); linear_C = findViewById(R.id.linear_C); linear_D = findViewById(R.id.linear_D); linear2 = findViewById(R.id.linear2); checkbox1 = findViewById(R.id.checkbox1); checkbox2 = findViewById(R.id.checkbox2); checkbox4 = findViewById(R.id.checkbox4); checkbox3 = findViewById(R.id.checkbox3); textview11 = findViewById(R.id.textview11); textview4 = findViewById(R.id.textview4); textview13 = findViewById(R.id.textview13); linear5 = findViewById(R.id.linear5); textview14 = findViewById(R.id.textview14); A = findViewById(R.id.A); textview_A = findViewById(R.id.textview_A); B = findViewById(R.id.B); textview_B = findViewById(R.id.textview_B); C = findViewById(R.id.C); textview_C = findViewById(R.id.textview_C); D = findViewById(R.id.D); textview_D = findViewById(R.id.textview_D); textview12 = findViewById(R.id.textview12); linear3 = findViewById(R.id.linear3); Start = findViewById(R.id.Start); Submit = findViewById(R.id.Submit); linear6 = findViewById(R.id.linear6); recyclerview1 = findViewById(R.id.recyclerview1); linear8_overview = findViewById(R.id.linear8_overview); linear7 = findViewById(R.id.linear7); box_lang = findViewById(R.id.box_lang); box_noti = findViewById(R.id.box_noti); box_theme = findViewById(R.id.box_theme); box_help = findViewById(R.id.box_help); box_security = findViewById(R.id.box_security); linear28 = findViewById(R.id.linear28); img_box_lang = findViewById(R.id.img_box_lang); linear9 = findViewById(R.id.linear9); language = findViewById(R.id.language); textview6 = findViewById(R.id.textview6); textview15 = findViewById(R.id.textview15); img_box_noti = findViewById(R.id.img_box_noti); linear13 = findViewById(R.id.linear13); notification = findViewById(R.id.notification); textview7 = findViewById(R.id.textview7); textview17 = findViewById(R.id.textview17); img_box_theme = findViewById(R.id.img_box_theme); linear18 = findViewById(R.id.linear18); theme = findViewById(R.id.theme); textview8 = findViewById(R.id.textview8); textview18 = findViewById(R.id.textview18); img_box_help = findViewById(R.id.img_box_help); linear23 = findViewById(R.id.linear23); help = findViewById(R.id.help); textview9 = findViewById(R.id.textview9); textview19 = findViewById(R.id.textview19); img_box_security = findViewById(R.id.img_box_security); linear27 = findViewById(R.id.linear27); security = findViewById(R.id.security); textview16 = findViewById(R.id.textview16); textview20 = findViewById(R.id.textview20); linear29 = findViewById(R.id.linear29); linear30 = findViewById(R.id.linear30); imageview3 = findViewById(R.id.imageview3); textview21 = findViewById(R.id.textview21); textview22 = findViewById(R.id.textview22); sharedPref = getSharedPreferences("sharedPref", Activity.MODE_PRIVATE); sp = getSharedPreferences("sp", Activity.MODE_PRIVATE); tablayout2.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { final int _position = tab.getPosition(); questionStartPosition = Double.parseDouble(subjects.get((int)_position).get("Question Start Position").toString()); questionEndPosition = Double.parseDouble(subjects.get((int)_position).get("Question End Position").toString()); position = questionStartPosition; tab2selectPosition = _position; if (_position < 8) { //block made by CreativeDev textview4.setText(Html.fromHtml(list_map.get((int)questionStartPosition).get("Question").toString())); //block made by CreativeDev textview_A.setText(Html.fromHtml(list_map.get((int)questionStartPosition).get("Option A").toString())); //block made by CreativeDev textview_B.setText(Html.fromHtml(list_map.get((int)questionStartPosition).get("Option B").toString())); //block made by CreativeDev textview_C.setText(Html.fromHtml(list_map.get((int)questionStartPosition).get("Option C").toString())); //block made by CreativeDev textview_D.setText(Html.fromHtml(list_map.get((int)questionStartPosition).get("Option D").toString())); textview11.setText("Q.".concat(String.valueOf((long)(questionStartPosition + 1)).concat(" of ".concat(String.valueOf((long)(list_map.size())).concat(":"))))); if (list_map.get((int)questionStartPosition).containsKey("Image")) { /* Glide.with(getApplicationContext()).load(Uri.parse(list_map.get((int)questionStartPosition).get("Image").toString())).into(imageview5); */ _circularLoad(imageview5, list_map.get((int)questionStartPosition).get("Image").toString(), 7, 35); imageview5.setVisibility(View.VISIBLE); } else { imageview5.setVisibility(View.GONE); } } else { } } @Override public void onTabUnselected(TabLayout.Tab tab) { final int _position = tab.getPosition(); } @Override public void onTabReselected(TabLayout.Tab tab) { final int _position = tab.getPosition(); } }); tablayout1.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { final int _position = tab.getPosition(); tablayout1.setVisibility(View.VISIBLE); linear31.setVisibility(View.VISIBLE); vscroll1.setVisibility(View.VISIBLE); if (_position == 0) { tabIndex = _position; recyclerview1.setVisibility(View.GONE); linear8_overview.setVisibility(View.VISIBLE); } else { if (_position == 1) { correct.clear(); correctList.clear(); for (int item = 0; item < (int)(list_map.size()); item++) { if (list_map.get((int)item).get("Answer Status").toString().equals("Correct")) { correct = new HashMap<>(); correct.put("Question", list_map.get((int)item).get("Question").toString()); correct.put("Option A", list_map.get((int)item).get("Option A").toString()); correct.put("Option B", list_map.get((int)item).get("Option B").toString()); correct.put("Option C", list_map.get((int)item).get("Option C").toString()); correct.put("Option D", list_map.get((int)item).get("Option D").toString()); correct.put("Selected", list_map.get((int)item).get("Selected").toString()); correct.put("Correct Option", list_map.get((int)item).get("Correct Option").toString()); correct.put("Position", list_map.get((int)item).get("Position").toString()); if (list_map.get((int)item).containsKey("TextExplanation")) { correct.put("TextExplanation", list_map.get((int)item).get("TextExplanation").toString()); } else { if (list_map.get((int)item).containsKey("ImageExplanation")) { correct.put("ImageExplanation", list_map.get((int)item).get("ImageExplanation").toString()); } else { } } if (list_map.get((int)item).containsKey("Image")) { correct.put("Image", list_map.get((int)item).get("Image").toString()); } else { } correctList.add(correct); } } tabIndex = _position; recyclerview1.setVisibility(View.VISIBLE); linear8_overview.setVisibility(View.GONE); androidx.recyclerview.widget.StaggeredGridLayoutManager slmrecyclerview1 = new androidx.recyclerview.widget.StaggeredGridLayoutManager(1, LinearLayoutManager.VERTICAL); recyclerview1.setLayoutManager(slmrecyclerview1); recyclerview1.setAdapter(new Recyclerview1Adapter(correctList)); } else { if (_position == 2) { incorrect.clear(); incorrectList.clear(); for (int item = 0; item < (int)(list_map.size()); item++) { if (list_map.get((int)item).get("Answer Status").toString().equals("Incorrect")) { incorrect = new HashMap<>(); incorrect.put("Question", list_map.get((int)item).get("Question").toString()); incorrect.put("Option A", list_map.get((int)item).get("Option A").toString()); incorrect.put("Option B", list_map.get((int)item).get("Option B").toString()); incorrect.put("Option C", list_map.get((int)item).get("Option C").toString()); incorrect.put("Option D", list_map.get((int)item).get("Option D").toString()); incorrect.put("Selected", list_map.get((int)item).get("Selected").toString()); incorrect.put("Correct Option", list_map.get((int)item).get("Correct Option").toString()); incorrect.put("Position", list_map.get((int)item).get("Position").toString()); if (list_map.get((int)item).containsKey("TextExplanation")) { incorrect.put("TextExplanation", list_map.get((int)item).get("TextExplanation").toString()); } else { if (list_map.get((int)item).containsKey("ImageExplanation")) { incorrect.put("ImageExplanation", list_map.get((int)item).get("ImageExplanation").toString()); } else { } } if (list_map.get((int)item).containsKey("Image")) { incorrect.put("Image", list_map.get((int)item).get("Image").toString()); } else { } incorrectList.add(incorrect); } } tabIndex = _position; recyclerview1.setVisibility(View.VISIBLE); linear8_overview.setVisibility(View.GONE); androidx.recyclerview.widget.StaggeredGridLayoutManager slmrecyclerview1 = new androidx.recyclerview.widget.StaggeredGridLayoutManager(1, LinearLayoutManager.VERTICAL); recyclerview1.setLayoutManager(slmrecyclerview1); recyclerview1.setAdapter(new Recyclerview1Adapter(incorrectList)); } else { if (_position == 3) { skipped.clear(); skippedList.clear(); for (int item = 0; item < (int)(list_map.size()); item++) { if (list_map.get((int)item).get("Answer Status").toString().equals("Unattempted")) { skipped = new HashMap<>(); skipped.put("Question", list_map.get((int)item).get("Question").toString()); skipped.put("Option A", list_map.get((int)item).get("Option A").toString()); skipped.put("Option B", list_map.get((int)item).get("Option B").toString()); skipped.put("Option C", list_map.get((int)item).get("Option C").toString()); skipped.put("Option D", list_map.get((int)item).get("Option D").toString()); skipped.put("Selected", list_map.get((int)item).get("Selected").toString()); skipped.put("Correct Option", list_map.get((int)item).get("Correct Option").toString()); skipped.put("Position", list_map.get((int)item).get("Position").toString()); if (list_map.get((int)item).containsKey("TextExplanation")) { skipped.put("TextExplanation", list_map.get((int)item).get("TextExplanation").toString()); } else { if (list_map.get((int)item).containsKey("ImageExplanation")) { skipped.put("ImageExplanation", list_map.get((int)item).get("ImageExplanation").toString()); } else { } } if (list_map.get((int)item).containsKey("Image")) { skipped.put("Image", list_map.get((int)item).get("Image").toString()); } else { } skippedList.add(skipped); } } tabIndex = _position; recyclerview1.setVisibility(View.VISIBLE); linear8_overview.setVisibility(View.GONE); androidx.recyclerview.widget.StaggeredGridLayoutManager slmrecyclerview1 = new androidx.recyclerview.widget.StaggeredGridLayoutManager(1, LinearLayoutManager.VERTICAL); recyclerview1.setLayoutManager(slmrecyclerview1); recyclerview1.setAdapter(new Recyclerview1Adapter(skippedList)); } } } } } @Override public void onTabUnselected(TabLayout.Tab tab) { final int _position = tab.getPosition(); } @Override public void onTabReselected(TabLayout.Tab tab) { final int _position = tab.getPosition(); } }); seekbar1.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar _param1, int _param2, boolean _param3) { final int _progressValue = _param2; ((ColorArcProgressBar)linear7.getChildAt((int)0)).setCurrentValues((float)_progressValue); } @Override public void onStartTrackingTouch(SeekBar _param1) { } @Override public void onStopTrackingTouch(SeekBar _param2) { } }); textview23.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View _view) { clkNum = 1; skippedPositionsMap.clear(); skippedPositionsVar = 0; for(int _repeat10 = 0; _repeat10 < (int)(totalQ); _repeat10++) { skippedPositionsVar++; { HashMap<String, Object> _item = new HashMap<>(); _item.put("numbers", String.valueOf((long)(skippedPositionsVar))); skippedPositionsMap.add(_item); } } final AlertDialog dialog1 = new AlertDialog.Builder(MockExamActivity.this).create(); View inflate = getLayoutInflater().inflate(R.layout.cus2,null); dialog1.setView(inflate); final GridView gridview1 = inflate.findViewById(R.id.gridview1); gridview1.setVerticalScrollBarEnabled(false); gridview1.setHorizontalScrollBarEnabled(false); gridview1.setAdapter(new Gridview1Adapter(skippedPositionsMap)); dialog1.show(); /* skipDialogTimer = new TimerTask() { @Override public void run() { runOnUiThread(new Runnable() { @Override public void run() { if (clkNum == 0) { dialog1.dismiss(); skipDialogTimer.cancel(); //block made by CreativeDev textview4.setText(Html.fromHtml(list_map.get((int)skipListClickPosition).get("Question").toString())); //block made by CreativeDev textview_A.setText(Html.fromHtml(list_map.get((int)skipListClickPosition).get("Option A").toString())); //block made by CreativeDev textview_B.setText(Html.fromHtml(list_map.get((int)skipListClickPosition).get("Option B").toString())); //block made by CreativeDev textview_C.setText(Html.fromHtml(list_map.get((int)skipListClickPosition).get("Option C").toString())); //block made by CreativeDev textview_D.setText(Html.fromHtml(list_map.get((int)skipListClickPosition).get("Option D").toString())); textview11.setText("Q.".concat(String.valueOf((long)(skipListClickPosition + 1)).concat(" of ".concat(String.valueOf((long)(list_map.size())).concat(":"))))); if (list_map.get((int)skipListClickPosition).containsKey("Image")) { _circularLoad(imageview5, list_map.get((int)skipListClickPosition).get("Image").toString(), 7, 35); imageview5.setVisibility(View.VISIBLE); } else { imageview5.setVisibility(View.GONE); } textview_A.setTextColor(0xFF000000); textview_B.setTextColor(0xFF000000); textview_C.setTextColor(0xFF000000); textview_D.setTextColor(0xFF000000); A.setTextColor(0xFF000000); B.setTextColor(0xFF000000); C.setTextColor(0xFF000000); D.setTextColor(0xFF000000); linear_A.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); A.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); linear_B.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); B.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); linear_C.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); C.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); linear_D.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); D.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); checkbox1.setChecked(false); checkbox2.setChecked(false); checkbox3.setChecked(false); checkbox4.setChecked(false); if (Submit.getVisibility() == View.VISIBLE) { Submit.setVisibility(View.GONE); Start.setVisibility(View.VISIBLE); Start.setText("Next"); } } } }); } }; _timer.scheduleAtFixedRate(skipDialogTimer, (int)(0), (int)(10)); */ } }); imageview6.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View _view) { i.setClass(getApplicationContext(), ReportActivity.class); i.putExtra("Path", getIntent().getStringExtra("Questions")); i.putExtra("Position", textview11.getText().toString().concat(" (This value - 1 is the actual position of question)")); i.putExtra("Question", textview4.getText().toString()); i.putExtra("Option A", list_map.get((int)position).get("Option A").toString()); i.putExtra("Option B", list_map.get((int)position).get("Option B").toString()); i.putExtra("Option C", list_map.get((int)position).get("Option C").toString()); i.putExtra("Option D", list_map.get((int)position).get("Option D").toString()); if (list_map.get((int)position).containsKey("Image")) { i.putExtra("Image", list_map.get((int)position).get("Image").toString()); } else { } if (list_map.get((int)position).containsKey("TextExplanation")) { i.putExtra("TextExplanation", list_map.get((int)position).get("TextExplanation").toString()); } else { if (list_map.get((int)position).containsKey("ImageExplanation")) { i.putExtra("ImageExplanation", list_map.get((int)position).get("ImageExplanation").toString()); } else { } } startActivity(i); } }); linear_A.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View _view) { checkbox1.performClick(); if (checkbox1.isChecked()) { linear_A.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF4CAF50, 0xFFFFFFFF)); textview_A.setTextColor(0xFF4CAF50); A.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF4CAF50, 0xFFFFFFFF)); A.setTextColor(0xFF4CAF50); linear_B.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); textview_B.setTextColor(0xFF333436); B.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); B.setTextColor(0xFF333436); linear_C.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); textview_C.setTextColor(0xFF333436); C.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); C.setTextColor(0xFF333436); linear_D.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); textview_D.setTextColor(0xFF333436); D.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); D.setTextColor(0xFF333436); selectedOption = "Option A"; if (!selectedOption.equals("")) { if (selectedOption.replace("Option ", "").equals(list_map.get((int)position).get("Correct Option").toString())) { list_map.get((int)position).put("Answer Status", "Correct"); list_map.get((int)position).put("Selected", selectedOption); } else { list_map.get((int)position).put("Answer Status", "Incorrect"); list_map.get((int)position).put("Selected", selectedOption); } } } else { selectedOption = ""; list_map.get((int)position).put("Answer Status", "Unattempted"); list_map.get((int)position).put("Selected", "None"); textview_A.setTextColor(0xFF000000); textview_B.setTextColor(0xFF000000); textview_C.setTextColor(0xFF000000); textview_D.setTextColor(0xFF000000); A.setTextColor(0xFF000000); B.setTextColor(0xFF000000); C.setTextColor(0xFF000000); D.setTextColor(0xFF000000); linear_A.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); A.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); linear_B.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); B.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); linear_C.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); C.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); linear_D.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)100, (int)5, 0xFF333436, 0xFFFFFFFF)); D.setBackground(new GradientDrawable() { public GradientDrawable getIns(int a, int b, int c, int d) { this.setCornerRadius(a); this.setStroke(b, c); this.setColor(d); return this; } }.getIns((int)60, (int)5, 0xFF333436, 0xFFFFFFFF)); } } }); linear_B.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View _view) { checkbox2.performClick();
Editor is loading...
Leave a Comment