Commit 8d573c01 authored by Gamage B.G.N.U's avatar Gamage B.G.N.U

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	app/build.gradle
#	app/src/main/AndroidManifest.xml
parents 89b2d186 63a1297d
......@@ -28,6 +28,7 @@ public class SessionManager {
public static final String KRY_STATUS = "status";
public static final String KEY_ANYEXPERIENCE = "anyExperience";
public static final String KEY_RESONTOCHOOSE = "resonToChoose";
public static final String KEY_OTP = "otp";
//creating constructer
public SessionManager(Context context){
......@@ -63,6 +64,8 @@ public class SessionManager {
editor.commit();
}
// funtion to get user details from session
public HashMap<String, String> getUserDetailsFromSession(){
HashMap<String, String> userData = new HashMap<String, String>();
......@@ -100,4 +103,11 @@ public class SessionManager {
editor.commit();
}
public void SetUserOTP(int otp){
editor.putInt(KEY_OTP,otp);
editor.commit();
}
}
......@@ -17,6 +17,7 @@ import com.elearning.probabilityandstatisticsanalyserandeducator.adaptiveLearnin
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.Random;
public class Sign_up_part3 extends AppCompatActivity {
......@@ -50,6 +51,8 @@ public class Sign_up_part3 extends AppCompatActivity {
// class Initialization
dbConnection = new DBConnection();
// find the radiobutton by returned id
/* Intent intent = getIntent();
......@@ -80,6 +83,14 @@ public class Sign_up_part3 extends AppCompatActivity {
int selectId2 = radioGroup1ResonToUse.getCheckedRadioButtonId();
Q3radioButton3 = findViewById(selectId2);
// ------------------------------ Generating OTP number ----------------------------------------
System.out.println("before calling register");
RegisterUser reg = new RegisterUser();
reg.execute("");
......@@ -111,8 +122,10 @@ public class Sign_up_part3 extends AppCompatActivity {
finish();
}
Intent intent = new Intent(Sign_up_part3.this,Welcome.class);
startActivity(intent);
startActivity(intent);
}
......
......@@ -84,7 +84,7 @@ public class UserDashBoard extends AppCompatActivity implements NavigationView.O
startActivity(intent);
break;
case R.id.nav_message:
Intent intent2 = new Intent(UserDashBoard.this, StartingScreen.class);
Intent intent2 = new Intent(UserDashBoard.this, verification_screen.class);
startActivity(intent2);
break;
}
......
......@@ -18,6 +18,7 @@ import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import static android.Manifest.permission.INTERNET;
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
import static android.Manifest.permission.RECORD_AUDIO;
import static android.Manifest.permission.WRITE_EXTERNAL_STORAGE;
......@@ -40,7 +41,7 @@ public class Welcome extends AppCompatActivity {
setContentView(R.layout.activity_welcome);
// Requesting the Initial permission to use the application on first start
ActivityCompat.requestPermissions(this, new String[]{RECORD_AUDIO, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE}, PackageManager.PERMISSION_GRANTED);
ActivityCompat.requestPermissions(this, new String[]{RECORD_AUDIO, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, INTERNET}, PackageManager.PERMISSION_GRANTED);
signUp = findViewById(R.id.btn_signup);
......
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MeanOfDistributionFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.StandardDeviationDistributionFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.VarianceOfDistributionFragment;
import java.util.ArrayList;
import java.util.Arrays;
public class EssayTypeProDistributionActivity extends AppCompatActivity {
String[] extractDatasetForEssayArray;
String extractedKeywordsFromFuzzy;
String[] extractDatasetForEssayArray1;
String extractedKeywordsFromFuzzy1;
//ProbabilityDistribution framelayout
FrameLayout mstdlayout;
FrameLayout mvariancelayout;
FrameLayout mmeanlayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_essay_type_pro_distribution);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
//create bundle for probabilitydistribution calculation
Bundle meanDistributionbundle = new Bundle();
Bundle stdDistributionbundle = new Bundle();
Bundle varianceDistributionbundle = new Bundle();
//intialize the layout probability Distribution calculation
mmeanlayout=findViewById(R.id.fourteenLayout);
mstdlayout=findViewById(R.id.fifteenLayout);
mvariancelayout=findViewById(R.id.sixteenLayout);
//create string arraylisy for store keywords
ArrayList<String> keywordlist = new ArrayList<>();
//create object for probabilitydistribution
ProDistCalculation proDistCalculation = new ProDistCalculation();
ArrayList<Object> meanDlist = new ArrayList<Object>();
ArrayList<Object> varianceDlist = new ArrayList<Object>();
ArrayList<Object> stddistributionlist = new ArrayList<Object>();
Intent intent1 = getIntent();
extractDatasetForEssayArray = intent1.getStringArrayExtra("extractDatasetForEssayArray");
// System.out.println("ProDisextractDatasetForEssayArray:-"+ Arrays.toString(extractDatasetForEssayArray));
// System.out.println("LengthofProDta:"+extractDatasetForEssayArray.length);
extractedKeywordsFromFuzzy =intent1.getStringExtra("extractedKeywordsFromFuzzy");
// System.out.println("ProDisextractedKeywordsFromFuzzy:-"+extractedKeywordsFromFuzzy);
extractDatasetForEssayArray1=intent1.getStringArrayExtra("extractDatasetForEssayArray1");
// System.out.println("ProDisextractDatasetForEssayArray1:-"+Arrays.toString(extractDatasetForEssayArray1));
extractedKeywordsFromFuzzy1=intent1.getStringExtra("extractedKeywordsFromFuzzy1");
// System.out.println("ProDisextractedKeywordsFromFuzzy1:-"+extractedKeywordsFromFuzzy1);
//----------------------Probability Distribution-----------------------------------------------------------------------------------------------------------
if((extractedKeywordsFromFuzzy.contains("Standard" ) && extractedKeywordsFromFuzzy.contains("Deviation")) || (extractedKeywordsFromFuzzy.contains("standard" ) && extractedKeywordsFromFuzzy.contains("deviation")) || extractedKeywordsFromFuzzy.contains("σ") || ((extractedKeywordsFromFuzzy1.contains("Standard" ) && extractedKeywordsFromFuzzy1.contains("Deviation")) || (extractedKeywordsFromFuzzy1.contains("standard" ) && extractedKeywordsFromFuzzy1.contains("deviation")) || extractedKeywordsFromFuzzy1.contains("σ"))) {
stddistributionlist=proDistCalculation.StdOfDistriution(extractDatasetForEssayArray,extractDatasetForEssayArray1);
keywordlist.add("Standard Deviation");
}
if(extractedKeywordsFromFuzzy.contains("Variance") || extractedKeywordsFromFuzzy.contains("variance") || extractedKeywordsFromFuzzy.contains("σ²") ||(extractedKeywordsFromFuzzy1.contains("Variance") || extractedKeywordsFromFuzzy1.contains("variance") || extractedKeywordsFromFuzzy1.contains("σ²"))){
varianceDlist=proDistCalculation.VarianceofDistribution(extractDatasetForEssayArray,extractDatasetForEssayArray1);
keywordlist.add("Variance");
}
if(extractedKeywordsFromFuzzy.contains("Mean") || extractedKeywordsFromFuzzy.contains("mean") ||(extractedKeywordsFromFuzzy1.contains("Mean") || extractedKeywordsFromFuzzy1.contains("mean"))){
meanDlist=proDistCalculation.MeanOfDistribution(extractDatasetForEssayArray,extractDatasetForEssayArray1);
keywordlist.add("Mean");
}
//------------------Probability Distribution------------------------------------------------------------------------
if(keywordlist.contains("Standard Deviation")){
stdDistributionbundle.putDouble("std_Value", (Double) stddistributionlist.get(0));
stdDistributionbundle.putStringArray("Dataset_Values", (String[]) stddistributionlist.get(2));
stdDistributionbundle.putStringArray("Probability_Value", (String[]) stddistributionlist.get(1));
stdDistributionbundle.putDouble("Mean_Distribution", (Double) stddistributionlist.get(3));
StandardDeviationDistributionFragment standardDeviationDistributionFragment = new StandardDeviationDistributionFragment();
standardDeviationDistributionFragment.setArguments(stdDistributionbundle);
fragmentTransaction.add(R.id.fifteenLayout, standardDeviationDistributionFragment);
}
if(keywordlist.contains("Mean")){
meanDistributionbundle.putDouble("Mean_Value", (Double) meanDlist.get(0));
meanDistributionbundle.putStringArray("Dataset_Values", (String[]) meanDlist.get(2));
meanDistributionbundle.putStringArray("Probability_Value", (String[]) meanDlist.get(1));
MeanOfDistributionFragment meanOfDistributionFragment = new MeanOfDistributionFragment();
meanOfDistributionFragment.setArguments(meanDistributionbundle);
fragmentTransaction.add(R.id.fourteenLayout, meanOfDistributionFragment);
}
if(keywordlist.contains("Variance")){
varianceDistributionbundle.putDouble("Variance_Value", (Double) varianceDlist.get(0));
varianceDistributionbundle.putStringArray("Dataset_Values", (String[]) varianceDlist.get(2));
varianceDistributionbundle.putStringArray("Probability_Value", (String[]) varianceDlist.get(1));
varianceDistributionbundle.putDouble("Mean_Distribution", (Double) varianceDlist.get(3));
VarianceOfDistributionFragment varianceOfDistributionFragment = new VarianceOfDistributionFragment();
varianceOfDistributionFragment.setArguments(varianceDistributionbundle);
fragmentTransaction.add(R.id.sixteenLayout, varianceOfDistributionFragment);
}
fragmentTransaction.commit();
}
}
\ No newline at end of file
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.KurtosisFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.PopulationStandardDeviationFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.PopulationVarianceFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.SkewnessFragment;
import java.util.ArrayList;
import java.util.Arrays;
public class EssayTypeStdQuestionActivity extends AppCompatActivity {
String[] extractDatasetForEssayArray;
String extractedKeywordsFromFuzzy;
//standarddeviation framelayout
FrameLayout mtenlayout;
FrameLayout melevenlayout;
FrameLayout mtwelevelayout;
FrameLayout mthirdteenlayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_essay_type_std_question);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
//create bundle for standarddeviation calculation
Bundle stdbundle = new Bundle();
Bundle skewnessbundle = new Bundle();
Bundle variancebundle = new Bundle();
Bundle kurtosisbundle = new Bundle();
//intialize the layout standard deviation calculation
mtenlayout=findViewById(R.id.tenLayout);
melevenlayout=findViewById(R.id.elevenLayout);
mtwelevelayout=findViewById(R.id.tweleveLayout);
mthirdteenlayout=findViewById(R.id.thirdteenLayout);
//create string arraylisy for store keywords
ArrayList<String> keywordlist = new ArrayList<>();
//Create object for StdCalculation
StdCalculation stdCalculation = new StdCalculation();
ArrayList<Object> populationstdlist = new ArrayList<Object>();
ArrayList<Object> skenesslist=new ArrayList<Object>();
ArrayList<Object> kurtosislist=new ArrayList<Object>();
ArrayList<Object> populationvariancelst =new ArrayList<>();
Intent intent1 = getIntent();
extractDatasetForEssayArray = intent1.getStringArrayExtra("extractDatasetForEssayArray");
System.out.println("StandardDeviationextractDatasetForEssayArray"+ Arrays.toString(extractDatasetForEssayArray));
System.out.println("lengthstd:"+extractDatasetForEssayArray.length);
extractedKeywordsFromFuzzy =intent1.getStringExtra("extractedKeywordsFromFuzzy");
System.out.println("StandardDeviationextractedKeywordsFromFuzzy"+extractedKeywordsFromFuzzy);
//---------------------------Standard Deviation Calculation--------------------------------------------------------------------------------
if((extractedKeywordsFromFuzzy.contains("Standard" ) && extractedKeywordsFromFuzzy.contains("Deviation")) || (extractedKeywordsFromFuzzy.contains("standard" ) && extractedKeywordsFromFuzzy.contains("deviation")) || extractedKeywordsFromFuzzy.contains("σ")){
populationstdlist=stdCalculation.Populationstd(extractDatasetForEssayArray);
keywordlist.add("Standard Deviation");
}
if(extractedKeywordsFromFuzzy.contains("Variance") || extractedKeywordsFromFuzzy.contains("variance") || extractedKeywordsFromFuzzy.contains("σ²") || extractedKeywordsFromFuzzy.contains("s²")){
populationvariancelst=stdCalculation.PopulationVariance(extractDatasetForEssayArray);
keywordlist.add("Variance");
}
if(extractedKeywordsFromFuzzy.contains("Skewness") || extractedKeywordsFromFuzzy.contains("skewness")){
skenesslist=stdCalculation.Skewness(extractDatasetForEssayArray);
keywordlist.add("Skewness");
}
if(extractedKeywordsFromFuzzy.contains("Kurtosis") || extractedKeywordsFromFuzzy.contains("kurtosis")){
kurtosislist=stdCalculation.Kurtosis(extractDatasetForEssayArray);
keywordlist.add("Kurtosis");
}
///Standard deviation
if(keywordlist.contains("Variance")){
variancebundle.putStringArray("Dataset_Values", (String[]) populationvariancelst.get(0));
variancebundle.putDouble("Mean_values", (Double) populationvariancelst.get(1));
variancebundle.putDouble("Variance_value", (Double) populationvariancelst.get(2));
variancebundle.putDouble("Sum_of_numbers", (Double) populationvariancelst.get(3));
variancebundle.putInt("No_ele_dataset", (Integer) populationvariancelst.get(4));
PopulationVarianceFragment populationVarianceFragment = new PopulationVarianceFragment();
populationVarianceFragment.setArguments(variancebundle);
fragmentTransaction.add(R.id.elevenLayout, populationVarianceFragment);
}
if(keywordlist.contains("Skewness")){
skewnessbundle.putDouble("Std_values", (Double) skenesslist.get(3));
skewnessbundle.putStringArray("Dataset_Values", (String[]) skenesslist.get(0));
skewnessbundle.putDouble("Mean_values", (Double) skenesslist.get(2));
skewnessbundle.putDouble("Skewness_value", (Double) skenesslist.get(1));
skewnessbundle.putDouble("Sum_of_numbers", (Double) skenesslist.get(4));
skewnessbundle.putDouble("Num_of_elements",(Double) skenesslist.get(5));
skewnessbundle.putInt("Num_of_dataset", (Integer) skenesslist.get(6));
SkewnessFragment skewnessFragment = new SkewnessFragment();
skewnessFragment.setArguments(skewnessbundle);
fragmentTransaction.add(R.id.tweleveLayout, skewnessFragment);
}
if(keywordlist.contains("Kurtosis")){
kurtosisbundle.putDouble("Std_values", (Double) kurtosislist.get(5));
kurtosisbundle.putStringArray("Dataset_Values", (String[]) kurtosislist.get(0));
kurtosisbundle.putDouble("Mean_values", (Double) kurtosislist.get(2));
kurtosisbundle.putDouble("Kurtosis_value", (Double) kurtosislist.get(1));
kurtosisbundle.putDouble("Sum_of_numbers", (Double) kurtosislist.get(3));
kurtosisbundle.putDouble("number_of_elements",(Double) kurtosislist.get(4));
kurtosisbundle.putInt("No_Of_Dataset",(Integer) kurtosislist.get(6));
KurtosisFragment kurtosisFragment = new KurtosisFragment();
kurtosisFragment.setArguments(kurtosisbundle);
fragmentTransaction.add(R.id.thirdteenLayout, kurtosisFragment);
}
if(keywordlist.contains("Standard Deviation")){
stdbundle.putStringArray("Dataset_Values", (String[]) populationstdlist.get(0));
stdbundle.putDouble("Mean_values", (Double) populationstdlist.get(1));
stdbundle.putDouble("Std_values", (Double) populationstdlist.get(2));
stdbundle.putDouble("Sum_of_numbers", (Double) populationstdlist.get(3));
stdbundle.putInt("Num_of_ele", (Integer) populationstdlist.get(4));
PopulationStandardDeviationFragment populationStandardDeviationFragment = new PopulationStandardDeviationFragment();
populationStandardDeviationFragment.setArguments(stdbundle);
fragmentTransaction.add(R.id.tenLayout, populationStandardDeviationFragment);
}
fragmentTransaction.commit();
}
}
\ No newline at end of file
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction;
import com.elearning.probabilityandstatisticsanalyserandeducator.dataExtraction.ExtractValueForRandomVariable;
import java.util.ArrayList;
import java.util.Arrays;
import static java.lang.Math.pow;
import static java.lang.Math.round;
import static java.lang.Math.sqrt;
public class ProDistCalculation {
//----------------------------Mean_Of_Distribution----------------------------------------------------------------------
public ArrayList<Object> MeanOfDistribution(String[] a,String[] b) {
double meanOfProbabilityDistribution=0.0;
//System.out.println("Arrays1 data"+Arrays.toString(a));
//System.out.println("Arrays2 data"+Arrays.toString(b));
ArrayList<Object> list = new ArrayList<>();
int sizeOfRandomVariable=a.length;
int sizeOfProbabilityValue=b.length;
// System.out.println("sizeOfRandomVariable"+sizeOfRandomVariable);
//System.out.println("sizeOfProbabilityValue"+sizeOfProbabilityValue);
int[] randomVariables = new int[sizeOfRandomVariable];
// System.out.println("RVariabe:"+Arrays.toString(randomVariables));
double[] probabilityvalue = new double[sizeOfProbabilityValue];
// System.out.println("PVariabe:"+Arrays.toString(probabilityvalue));
for (int k = 0; k < sizeOfRandomVariable; k++) {
for (int c = 0; c < sizeOfProbabilityValue; c++) {
// System.out.println("a[k]"+a[k]);
// System.out.println("b[c]"+b[c]);
try {
randomVariables[k] = Integer.parseInt(a[k]);
probabilityvalue[c] = Double.parseDouble(b[c]);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
}
// System.out.println("DisplayRandomVariables:"+Arrays.toString(randomVariables));
// System.out.println("DisplayProbabilityValue:"+Arrays.toString(probabilityvalue));
for (int i = 0; i < randomVariables.length; i++) {
// System.out.println("Randomvariable i:" + randomVariables[i]);
// System.out.println("Probabilityvalue c:" + probabilityvalue[i]);
meanOfProbabilityDistribution+= randomVariables[i] * probabilityvalue[i];
double roundedFloat = (double) Math.round(meanOfProbabilityDistribution * 100.0) / 100.0;
// System.out.println("Mean Of Distribution:" + roundedFloat);
list.add(0, roundedFloat);
list.add(1, b);
list.add(2, a);
}
return list;
}
//----------------------------StandardDeviation_Of_Distribution---------------------------------------------------------
public ArrayList<Object> StdOfDistriution(String[] a,String[] b) {
double meanOfProbabilityDistribution=0.0;
double res2=0.0;
// System.out.println("SSArrays1 data"+Arrays.toString(a));
// System.out.println("SSArrays2 data"+Arrays.toString(b));
ArrayList<Object> list = new ArrayList<>();
int sizeOfRandomVariable=a.length;
int sizeOfProbabilityValue=b.length;
// System.out.println("SsizeOfRandomVariable"+sizeOfRandomVariable);
// System.out.println("SsizeOfProbabilityValue"+sizeOfProbabilityValue);
int[] randomVariables = new int[sizeOfRandomVariable];
// System.out.println("SRVariabe:"+Arrays.toString(randomVariables));
double[] probabilityvalue = new double[sizeOfProbabilityValue];
// System.out.println("SPVariabe:"+Arrays.toString(probabilityvalue));
for (int k = 0; k < sizeOfRandomVariable; k++) {
for (int c = 0; c < sizeOfProbabilityValue; c++) {
//System.out.println("a[k]"+a[k]);
// System.out.println("b[c]"+b[c]);
try {
randomVariables[k] = Integer.parseInt(a[k]);
probabilityvalue[c] = Double.parseDouble(b[c]);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
}
// System.out.println("SDisplayRandomVariables:"+Arrays.toString(randomVariables));
// System.out.println("SDisplayProbabilityValue:"+Arrays.toString(probabilityvalue));
for(int i=0; i<randomVariables.length;i++){
// System.out.println("stdRandomvariable i:"+randomVariables[i]);
// System.out.println("stdProbabilityvalue c:"+probabilityvalue[i]);
meanOfProbabilityDistribution=meanOfProbabilityDistribution + randomVariables[i] * probabilityvalue[i];
// System.out.println("std Mean Of Distribution:"+ (meanOfProbabilityDistribution));
double roundedFloatmean = (double) Math.round(meanOfProbabilityDistribution * 100.0) / 100.0;
double res1 = pow((randomVariables[i]),2);
res2 = res2 + res1 * probabilityvalue[i];
// System.out.println("Res2"+ res2);
}
double roundedFloatmean = (double) Math.round(meanOfProbabilityDistribution * 100.0) / 100.0;
double res3 = res2 - pow((meanOfProbabilityDistribution),2);
double finalresult = sqrt(res3);
double roundedFloat = (double) Math.round(finalresult * 10000.0) / 10000.0;
// System.out.println("Stdvalueddd:"+roundedFloat);
list.add(0, roundedFloat);
list.add(1, b);
list.add(2, a);
list.add(3,roundedFloatmean);
return list;
}
//----------------------------Variance_Of_Distribution---------------------------------------------------------
public ArrayList<Object> VarianceofDistribution(String[] a,String[] b) {
double meanOfProbabilityDistribution=0.0;
double res2=0.0;
// System.out.println("VArrays1 data"+Arrays.toString(a));
// System.out.println("VArrays2 data"+Arrays.toString(b));
ArrayList<Object> list = new ArrayList<>();
int sizeOfRandomVariable=a.length;
int sizeOfProbabilityValue=b.length;
// System.out.println("VsizeOfRandomVariable"+sizeOfRandomVariable);
// System.out.println("VsizeOfProbabilityValue"+sizeOfProbabilityValue);
int[] randomVariables = new int[sizeOfRandomVariable];
// System.out.println("VRVariabe:"+Arrays.toString(randomVariables));
double[] probabilityvalue = new double[sizeOfProbabilityValue];
// System.out.println("VPVariabe:"+Arrays.toString(probabilityvalue));
for (int k = 0; k < sizeOfRandomVariable; k++) {
for (int c = 0; c < sizeOfProbabilityValue; c++) {
// System.out.println("Va[k]"+a[k]);
// System.out.println("Vb[c]"+b[c]);
try {
randomVariables[k] = Integer.parseInt(a[k]);
probabilityvalue[c] = Double.parseDouble(b[c]);
} catch (NumberFormatException e) {
e.printStackTrace();
}
}
}
// System.out.println("VDisplayRandomVariables:"+Arrays.toString(randomVariables));
// System.out.println("VDisplayProbabilityValue:"+Arrays.toString(probabilityvalue));
for(int i=0; i<randomVariables.length;i++){
// System.out.println("VRandomvariable i:"+randomVariables[i]);
// System.out.println("VProbabilityvalue c:"+probabilityvalue[i]);
meanOfProbabilityDistribution=meanOfProbabilityDistribution + randomVariables[i] * probabilityvalue[i];
// System.out.println("VMean Of Distribution:"+ (meanOfProbabilityDistribution));
double res1 = pow((randomVariables[i]),2);
res2 = res2 + res1 * probabilityvalue[i];
// System.out.println("Res2"+ res2);
}
double roundedFloatmean = (double) Math.round(meanOfProbabilityDistribution * 100.0) / 100.0;
double res3 = res2 - pow((meanOfProbabilityDistribution),2);
double finalresultstd = sqrt(res3);
double finalresultvariance =pow((finalresultstd),2);
double roundedFloat = (double) Math.round(finalresultvariance * 10000.0) / 10000.0;
// System.out.println("finalresultvariance"+roundedFloat);
list.add(0, roundedFloat);
list.add(1, b);
list.add(2, a);
list.add(3,roundedFloatmean);
return list;
}
}
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MeanFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MeanOfDistributionFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.StandardDeviationDistributionFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.VarianceOfDistributionFragment;
import java.util.ArrayList;
import java.util.Arrays;
public class ProbabilityDistributionCalculation extends AppCompatActivity {
String des_calculation_type;
String[] array1,array2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_probability_distribution_calculation);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
Bundle bundle = new Bundle();
Intent intent = getIntent();
array1 = intent.getStringArrayExtra("dataset");
array2 = intent.getStringArrayExtra("dataset1");
//create proDistCalculation object
ProDistCalculation proDistCalculation = new ProDistCalculation();
ArrayList<Object> meanDlist = new ArrayList<Object>();
ArrayList<Object> varianceDlist = new ArrayList<Object>();
ArrayList<Object> stddistributionlist = new ArrayList<Object>();
meanDlist = proDistCalculation.MeanOfDistribution(array1,array2);
varianceDlist=proDistCalculation.VarianceofDistribution(array1,array2);
stddistributionlist=proDistCalculation.StdOfDistriution(array1,array2);
des_calculation_type = intent.getStringExtra("des_calculation_type");
//switch function
switch (des_calculation_type){
case "Mean (expectation) of a distribution":
bundle.putDouble("Mean_Value", (Double) meanDlist.get(0));
bundle.putStringArray("Dataset_Values", (String[]) meanDlist.get(2));
bundle.putStringArray("Probability_Value", (String[]) meanDlist.get(1));
MeanOfDistributionFragment meanOfDistributionFragment = new MeanOfDistributionFragment();
meanOfDistributionFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, meanOfDistributionFragment);
fragmentTransaction.commit();
break;
case "Variance of a distribution":
bundle.putDouble("Variance_Value", (Double) varianceDlist.get(0));
bundle.putStringArray("Dataset_Values", (String[]) varianceDlist.get(2));
bundle.putStringArray("Probability_Value", (String[]) varianceDlist.get(1));
bundle.putDouble("Mean_Distribution", (Double) varianceDlist.get(3));
VarianceOfDistributionFragment varianceOfDistributionFragment = new VarianceOfDistributionFragment();
varianceOfDistributionFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, varianceOfDistributionFragment);
fragmentTransaction.commit();
break;
case "Standard Deviation of a distribution":
bundle.putDouble("std_Value", (Double) stddistributionlist.get(0));
bundle.putStringArray("Dataset_Values", (String[]) stddistributionlist.get(2));
bundle.putStringArray("Probability_Value",(String[]) stddistributionlist.get(1));
bundle.putDouble("Mean_Distribution", (Double) stddistributionlist.get(3));
StandardDeviationDistributionFragment standardDeviationDistributionFragment = new StandardDeviationDistributionFragment();
standardDeviationDistributionFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, standardDeviationDistributionFragment);
fragmentTransaction.commit();
break;
case "Solve Essay problem":
String [] extractDatasetForEssayArray ;
String extractedKeywordsFromFuzzy;
String [] extractDatasetForEssayArray1 ;
String extractedKeywordsFromFuzzy1;
//get value from extractDatasetForEssayArray and extractedKeywordsFromFuzzy
extractDatasetForEssayArray = intent.getStringArrayExtra("extractDatasetForEssayArray");
extractedKeywordsFromFuzzy=intent.getStringExtra("extractedKeywordsFromFuzzy");
extractDatasetForEssayArray1 = intent.getStringArrayExtra("extractDatasetForEssayArray1");
extractedKeywordsFromFuzzy1=intent.getStringExtra("extractedKeywordsFromFuzzy1");
/*
System.out.println("desansextractDatasetForEssayArray:-"+Arrays.toString(extractDatasetForEssayArray));
System.out.println("extlength:"+extractDatasetForEssayArray.length);
System.out.println("desansextractedKeywordsFromFuzzy:-"+extractedKeywordsFromFuzzy);
System.out.println("desansextractDatasetForEssayArray1:-"+Arrays.toString(extractDatasetForEssayArray1));
System.out.println("extlength1:"+extractDatasetForEssayArray.length);
System.out.println("desansextractedKeywordsFromFuzzy1:-"+extractedKeywordsFromFuzzy1);
*/
//create intent object for parse the value from DescriptiveStatisticsCalcuation class to DisplayEssayQuestionAnsWithStepsActivity class
Intent intent1 =new Intent(ProbabilityDistributionCalculation.this, EssayTypeProDistributionActivity.class);
intent1.putExtra("extractDatasetForEssayArray", extractDatasetForEssayArray);
intent1.putExtra("extractDatasetForEssayArray1", extractDatasetForEssayArray1);
intent1.putExtra("extractedKeywordsFromFuzzy", extractedKeywordsFromFuzzy);
intent1.putExtra("extractedKeywordsFromFuzzy1", extractedKeywordsFromFuzzy1);
//start activity intent1
startActivity(intent1);
}
}}
\ No newline at end of file
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction;
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;
......@@ -6,20 +6,13 @@ import androidx.fragment.app.FragmentTransaction;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.FirstQuartileFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.IQRFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MaximumFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MeanFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MedianFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.MinimumFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.ModeFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.KurtosisFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.PopulationStandardDeviationFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.RangeFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.SampleStandardDeviationFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.ThirdQuartileFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.PopulationVarianceFragment;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment.SkewnessFragment;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -39,16 +32,20 @@ public class StandaradDeviationCalculation extends AppCompatActivity {
Intent intent = getIntent();
array = intent.getStringArrayExtra("dataset");
//create DestatCalculation object
StdCalculation stdCalculation = new StdCalculation();
ArrayList<Object> samplestd = new ArrayList<Object>();
ArrayList<Object> populationstd = new ArrayList<>();
ArrayList<Object> populationstdlist = new ArrayList<Object>();
ArrayList<Object> skenesslist=new ArrayList<Object>();
ArrayList<Object> kurtosislist=new ArrayList<Object>();
ArrayList<Object> populationvariancelst =new ArrayList<>();
samplestd = stdCalculation.StandardDeviationCalTypeOne(array);
populationstd=stdCalculation.Populationstd(array);
populationstdlist=stdCalculation.Populationstd(array);
skenesslist=stdCalculation.Skewness(array);
kurtosislist=stdCalculation.Kurtosis(array);
populationvariancelst=stdCalculation.PopulationVariance(array);
......@@ -60,40 +57,105 @@ public class StandaradDeviationCalculation extends AppCompatActivity {
//switch function
switch (des_calculation_type){
case "Sample":
bundle.putDouble("Std_values", (Double) samplestd.get(2));
bundle.putIntArray("Dataset_Values", (int[]) samplestd.get(0));
bundle.putDouble("Mean_values", (Double) samplestd.get(1));
case "Standarad Deviation":
bundle.putDouble("Std_values", (Double) populationstdlist.get(2));
bundle.putStringArray("Dataset_Values", (String[]) populationstdlist.get(0));
bundle.putDouble("Mean_values", (Double) populationstdlist.get(1));
bundle.putDouble("Sum_of_numbers", (Double) populationstdlist.get(3));
bundle.putInt("Num_of_ele", (Integer) populationstdlist.get(4));
SampleStandardDeviationFragment sampleStandardDeviationFragment = new SampleStandardDeviationFragment();
sampleStandardDeviationFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, sampleStandardDeviationFragment);
PopulationStandardDeviationFragment populationStandardDeviationFragment = new PopulationStandardDeviationFragment();
populationStandardDeviationFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, populationStandardDeviationFragment);
fragmentTransaction.commit();
break;
case "Population":
bundle.putDouble("Std_values", (Double) populationstd.get(2));
bundle.putIntArray("Dataset_Values", (int[]) populationstd.get(0));
bundle.putDouble("Mean_values", (Double) populationstd.get(1));
case "Skewness":
bundle.putDouble("Std_values", (Double) skenesslist.get(3));
bundle.putStringArray("Dataset_Values", (String[]) skenesslist.get(0));
bundle.putDouble("Mean_values", (Double) skenesslist.get(2));
bundle.putDouble("Skewness_value", (Double) skenesslist.get(1));
bundle.putDouble("Sum_of_numbers", (Double) skenesslist.get(4));
bundle.putDouble("Num_of_elements",(Double) skenesslist.get(5));
bundle.putInt("Num_of_dataset", (Integer) skenesslist.get(6));
PopulationStandardDeviationFragment populationStandardDeviationFragment = new PopulationStandardDeviationFragment();
populationStandardDeviationFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, populationStandardDeviationFragment);
SkewnessFragment skewnessFragment = new SkewnessFragment();
skewnessFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, skewnessFragment);
fragmentTransaction.commit();
break;
case "Kurtosis":
bundle.putDouble("Std_values", (Double) kurtosislist.get(5));
bundle.putStringArray("Dataset_Values", (String[]) kurtosislist.get(0));
bundle.putDouble("Mean_values", (Double) kurtosislist.get(2));
bundle.putDouble("Kurtosis_value", (Double) kurtosislist.get(1));
bundle.putDouble("Sum_of_numbers", (Double) kurtosislist.get(3));
bundle.putDouble("number_of_elements",(Double) kurtosislist.get(4));
bundle.putInt("No_Of_Dataset",(Integer) kurtosislist.get(6));
KurtosisFragment kurtosisFragment = new KurtosisFragment();
kurtosisFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, kurtosisFragment);
fragmentTransaction.commit();
break;
case "Variance":
bundle.putStringArray("Dataset_Values", (String[]) populationvariancelst.get(0));
bundle.putDouble("Mean_values", (Double) populationvariancelst.get(1));
bundle.putDouble("Variance_value", (Double) populationvariancelst.get(2));
bundle.putDouble("Sum_of_numbers", (Double) populationvariancelst.get(3));
bundle.putInt("No_ele_dataset", (Integer) populationvariancelst.get(4));
PopulationVarianceFragment populationVarianceFragment = new PopulationVarianceFragment();
populationVarianceFragment.setArguments(bundle);
fragmentTransaction.add(R.id.fragment_container, populationVarianceFragment);
fragmentTransaction.commit();
break;
case "Solve Essay problem":
String [] extractDatasetForEssayArray ;
String extractedKeywordsFromFuzzy;
//get value from extractDatasetForEssayArray and extractedKeywordsFromFuzzy
extractDatasetForEssayArray = intent.getStringArrayExtra("extractDatasetForEssayArray");
extractedKeywordsFromFuzzy=intent.getStringExtra("extractedKeywordsFromFuzzy");
//System.out.println("stdansextractDatasetForEssayArray:-"+Arrays.toString(extractDatasetForEssayArray));
//System.out.println("stdansextractedKeywordsFromFuzzy:-"+extractedKeywordsFromFuzzy);
//create intent object for parse the value from StandaradDeviationCalculation class to DisplayEssayQuestionAnsWithStepsActivity class
Intent intent1 =new Intent(StandaradDeviationCalculation.this, EssayTypeStdQuestionActivity.class);
intent1.putExtra("extractDatasetForEssayArray",extractDatasetForEssayArray);
intent1.putExtra("extractedKeywordsFromFuzzy",extractedKeywordsFromFuzzy);
//start activity intent1
startActivity(intent1);
}
System.out.println("desActivityArray "+Arrays.toString(array));
System.out.println("desActivityArray.length "+ array.length);
//System.out.println("desActivityArray "+Arrays.toString(array));
//System.out.println("desActivityArray.length "+ array.length);
}
......
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -20,7 +21,7 @@ public class FirstQuartileFragment extends Fragment {
TextView mtextviewentereddata;
TextView mtextviewfirstquartile;
TextView mtextviewordereddata;
TextView mtextviewbottomhalf;
// TextView mtextviewbottomhalf;
TextView mtextviewfirstqr;
......@@ -36,7 +37,7 @@ public class FirstQuartileFragment extends Fragment {
mtextviewentereddata = view.findViewById(R.id.textview_entereddataset);
mtextviewfirstquartile =view.findViewById(R.id.textview_thirdquartile);
mtextviewordereddata=view.findViewById(R.id.textorderdata);
mtextviewbottomhalf =view.findViewById(R.id.textview_upperhalf);
// mtextviewbottomhalf =view.findViewById(R.id.textview_upperhalf);
mtextviewfirstqr=view.findViewById(R.id.textview_thirdqr);
Bundle bundle =getArguments();
......@@ -46,7 +47,7 @@ public class FirstQuartileFragment extends Fragment {
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
int[] ordereddata=bundle.getIntArray("Ordered_data");
double[] ordereddata=bundle.getDoubleArray("Ordered_data");
String data7 = Arrays.toString(ordereddata);
String data8 = data7.replace('[',' ' );
String data9 = data8.replace(']',' ');
......@@ -57,6 +58,10 @@ public class FirstQuartileFragment extends Fragment {
mtextviewfirstquartile.setText(firstquartile.toString());
mtextviewordereddata.setText(data9);
mtextviewordereddata.setMovementMethod(new ScrollingMovementMethod());
// mtextviewbottomhalf.setMovementMethod(new ScrollingMovementMethod());
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
return view;
......
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -39,10 +40,9 @@ public class IQRFragment extends Fragment {
mtextviewentereddata = view.findViewById(R.id.textview_entereddataset);
mtextviewiqrrangevalue = view.findViewById(R.id.textview_iqrrange);
mtextviewfinalanswer = view.findViewById(R.id.textviw_finalvalue);
mtextviewthirdqr = view.findViewById(R.id.textview_third);
mtextviewfirstqr = view.findViewById(R.id.textview_first);
mtextviewthirdqr1 =view.findViewById(R.id.textview_thirdvalue);
mtextviewfirstqr1=view.findViewById(R.id.textviw_firstvalue);
mtextviewthirdqr = view.findViewById(R.id.textview_thirrdqr);
mtextviewfirstqr = view.findViewById(R.id.textviw_firstqr);
mtextvieworderdata=view.findViewById(R.id.textView_orderdata);
......@@ -56,14 +56,23 @@ public class IQRFragment extends Fragment {
Double thirdqrvalue = bundle.getDouble("thirdqr_value");
Double firstqrvalue = bundle.getDouble("firstqr_value");
double[] orderdata=bundle.getDoubleArray("Order_value");
String data7 = Arrays.toString(orderdata);
String data8 = data7.replace('[', ' ');
String data9 = data8.replace(']', ' ');
mtextviewentereddata.setText(data6);
mtextviewfirstqr.setText(firstqrvalue.toString());
mtextviewthirdqr.setText(thirdqrvalue.toString());
mtextviewiqrrangevalue.setText(iqr.toString());
mtextviewfinalanswer.setText(iqr.toString());
mtextviewfirstqr1.setText(firstqrvalue.toString());
mtextviewthirdqr1.setText(thirdqrvalue.toString());
// mtextviewfirstqr1.setText(firstqrvalue.toString());
// mtextviewthirdqr1.setText(thirdqrvalue.toString());
mtextvieworderdata.setText(data9);
mtextvieworderdata.setMovementMethod(new ScrollingMovementMethod());
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
return view;
}
......
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import java.util.Arrays;
public class KurtosisFragment extends Fragment {
TextView mdatasetvalues;
TextView mnofvalue;
TextView msumofnumbers;
TextView mfinalanswer;
TextView mtextviewmean;
TextView mkurtosis;
TextView mtextviewstd;
TextView mnofdaaset;
public KurtosisFragment() {
// Required empty public constructor
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_kurtosis,container,false);
mdatasetvalues=view.findViewById(R.id.txtview_datasetvalues);
msumofnumbers=view.findViewById(R.id.textview_sumfnumbers);
mfinalanswer=view.findViewById(R.id.textview_finalanswer);
mtextviewmean =view.findViewById(R.id.textview_mean);
mkurtosis=view.findViewById(R.id.textview_variancepop);
mnofvalue=view.findViewById(R.id.textview_numberofelements);
mtextviewstd=view.findViewById(R.id.textview_stdvalue);
mnofdaaset=view.findViewById(R.id.textview_numberofelement);
Bundle bundle = getArguments();
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
Double standarddeviation =bundle.getDouble("Std_values");
Double mean =bundle.getDouble("Mean_values");
Double kurtosis =bundle.getDouble("Kurtosis_value");
Double sumofnumbers=bundle.getDouble("Sum_of_numbers");
Double nofele=bundle.getDouble("number_of_elements");
Integer noofdataset=bundle.getInt("No_Of_Dataset");
mdatasetvalues.setText(data3);
mnofvalue.setText(nofele.toString());
mfinalanswer.setText(kurtosis.toString());
mtextviewmean.setText(mean.toString());
mkurtosis.setText(kurtosis.toString());
msumofnumbers.setText(sumofnumbers.toString());
mtextviewstd.setText(standarddeviation.toString());
mnofdaaset.setText(noofdataset.toString());
mdatasetvalues.setMovementMethod(new ScrollingMovementMethod());
return view;
}}
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -31,20 +32,29 @@ public class MaximumFragment extends Fragment {
View view =inflater.inflate(R.layout.fragment_maximum,container,false);
mtextviewentereddata = view.findViewById(R.id.textview_entereddataset);
mtextviewmaximum=view.findViewById(R.id.textview_max);
mtextvieworderdata=view.findViewById(R.id.textVieworderdata);
mtextvieworderdata=view.findViewById(R.id.textView_orderdata);
mtextviewfinalanswer=view.findViewById(R.id.textview_finalanswer);
Bundle bundle = getArguments();
Double maximum =bundle.getDouble("Maximum_value");
String[] entereddata = bundle.getStringArray("Entered_Values");
String[] entereddata = bundle.getStringArray("Entered_values");
String data4 = Arrays.toString(entereddata);
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
double[] ascorderdata = bundle.getDoubleArray("Ascending_order");
String data = Arrays.toString(ascorderdata);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
mtextviewentereddata.setText(data6);
mtextviewmaximum.setText(maximum.toString());
mtextviewfinalanswer.setText(maximum.toString());
mtextvieworderdata.setText(data6);
mtextvieworderdata.setText(data3);
mtextvieworderdata.setMovementMethod(new ScrollingMovementMethod());
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
return view;
}
......
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -26,6 +27,7 @@ TextView msofdata;
TextView ms3sofdata;
TextView ms3nofelements;
TextView mmeanAnswer;
public MeanFragment(){
}
......@@ -36,21 +38,23 @@ TextView mmeanAnswer;
mfinalAnswer = view.findViewById(R.id.textview_finalanswer);
mmeanAnswer = view.findViewById(R.id.textview_std);
mmeanAnswer = view.findViewById(R.id.textview_meanvalueansw);
msumOfDataset =view.findViewById(R.id.textview_mean);
mnumOfElements=view.findViewById(R.id.textview_sumofnumbers);
mnumOfElements=view.findViewById(R.id.textview_sumfnumbers);
mdatasetvalues =view.findViewById(R.id.txtview_datasetvalues);
ms3sofdata = view.findViewById(R.id.textview_sum);
ms3nofelements = view.findViewById(R.id.textview_nof);
msofdata=view.findViewById(R.id.textViewstep3nofelements);
Bundle bundle = getArguments();
Double mean = bundle.getDouble("Mean_Value");
Double sumofdataset = bundle.getDouble("Sum_of_Dataset");
Integer numberofelements = bundle.getInt("Number_of_Elements");
int[] datasetValues = bundle.getIntArray("Dataset_Values") ;
double[] datasetValues = bundle.getDoubleArray("Dataset_Values") ;
System.out.println("Dataset_Values"+Arrays.toString(datasetValues));
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
......@@ -68,6 +72,9 @@ TextView mmeanAnswer;
msofdata.setText(sumofdataset.toString());
mdatasetvalues.setMovementMethod(new ScrollingMovementMethod());
msumOfDataset.setMovementMethod(new ScrollingMovementMethod());
......@@ -79,4 +86,7 @@ TextView mmeanAnswer;
return view;
}
}
\ No newline at end of file
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import java.util.Arrays;
public class MeanOfDistributionFragment extends Fragment {
TextView mfinalAnswer;
TextView mdatasetvalues;
TextView mtextviewresultpx;
TextView mtextviewmeananswer;
public MeanOfDistributionFragment(){
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_mean_of_distribution,container,false);
mfinalAnswer = view.findViewById(R.id.textviewfinalanswer);
mdatasetvalues =view.findViewById(R.id.txtview_datasetvalues);
mtextviewresultpx=view.findViewById(R.id.textview_resultpx);
mtextviewmeananswer = view.findViewById(R.id.textview_meanvalueansw);
Bundle bundle = getArguments();
Double meanofdistribution = bundle.getDouble("Mean_Value");
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
System.out.println("Datasetvaluein mean:"+Arrays.toString(datasetValues));
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
String[] probabilityvalue = bundle.getStringArray("Probability_Value");
System.out.println("Datasetvaluein pro:"+Arrays.toString(probabilityvalue));
String data4 = Arrays.toString(probabilityvalue);
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
double sumofProbability=0.0;
/*
for(int i=0; i<probabilityvalue.length;i++){
sumofProbability +=Double.parseDouble(probabilityvalue[i]);
System.out.println(" sumofProbability::"+sumofProbability);
}
*/
for (String element : probabilityvalue) {
sumofProbability += Double.parseDouble(element);
}
double roundedsumofProbability = (double) Math.round(sumofProbability * 100.0) / 100.0;
System.out.println(" sumofProbability::"+roundedsumofProbability);
if(datasetValues.length==probabilityvalue.length && roundedsumofProbability==1) {
mfinalAnswer.setText(meanofdistribution.toString());
mdatasetvalues.setText(data3);
mtextviewmeananswer.setText(meanofdistribution.toString());
mtextviewresultpx.setText(data6);
}else if (datasetValues.length!=probabilityvalue.length || roundedsumofProbability!=1){
mfinalAnswer.setText("Sum Of Probability Value must be one");
mdatasetvalues.setText(data3);
mtextviewmeananswer.setText("Sum Of Probability Value must be one");
mtextviewresultpx.setText(data6);
}
mdatasetvalues.setMovementMethod(new ScrollingMovementMethod());
mtextviewresultpx.setMovementMethod(new ScrollingMovementMethod());
mfinalAnswer.setMovementMethod(new ScrollingMovementMethod());
mtextviewmeananswer.setMovementMethod(new ScrollingMovementMethod());
return view;
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -45,7 +46,7 @@ public class MedianFragment extends Fragment {
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
int[] ascorderdata = bundle.getIntArray("Ascending_order");
double[] ascorderdata = bundle.getDoubleArray("Ascending_order");
String data = Arrays.toString(ascorderdata);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
......@@ -58,6 +59,9 @@ public class MedianFragment extends Fragment {
mtxtviewmedian.setText(median.toString());
mtxtviewfinalans.setText(median.toString());
mtxtviewenterdata.setMovementMethod(new ScrollingMovementMethod());
mtxtviewascorderdata.setMovementMethod(new ScrollingMovementMethod());
return view;
}
......
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -31,22 +32,31 @@ public class MinimumFragment extends Fragment {
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view =inflater.inflate(R.layout.fragment_minimum,container,false);
mtextviewentereddata = view.findViewById(R.id.textview_entereddataset);
mtextviewminimum=view.findViewById(R.id.textview_min);
mtextvieworderdata=view.findViewById(R.id.textVieworderdata);
mtextviewminimum=view.findViewById(R.id.textview_max);
mtextvieworderdata=view.findViewById(R.id.textView_orderdata);
mtextviewfinalanswer=view.findViewById(R.id.textview_finalanswer);
Bundle bundle = getArguments();
Double minimum =bundle.getDouble("Minimum_value");
String[] entereddata = bundle.getStringArray("Entered_Values");
String[] entereddata = bundle.getStringArray("Entered_values");
String data4 = Arrays.toString(entereddata);
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
double[] ascorderdata = bundle.getDoubleArray("Ascending_order");
String data = Arrays.toString(ascorderdata);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
mtextviewentereddata.setText(data6);
mtextviewminimum.setText(minimum.toString());
mtextviewfinalanswer.setText(minimum.toString());
mtextvieworderdata.setText(data6);
mtextvieworderdata.setText(data3);
mtextvieworderdata.setMovementMethod(new ScrollingMovementMethod());
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
return view;
}
......
......@@ -6,13 +6,16 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.DesStatCalculation;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -21,6 +24,7 @@ public class ModeFragment extends Fragment {
TextView mtextviewmode;
TextView mtextviewascendingorder;
TextView mtexviewfinalanswer;
String[] array;
......@@ -39,20 +43,45 @@ public class ModeFragment extends Fragment {
mtexviewfinalanswer=view.findViewById(R.id.textview_finalanswer);
Bundle bundle = getArguments();
int[] ascendingdata =bundle.getIntArray("Ascending_order");
double[] ascendingdata =bundle.getDoubleArray("Ascending_order");
String data4 = Arrays.toString(ascendingdata);
String data5 =data4.replace('[',' ');
String data6 = data5.replace(']',' ');
int[] entereddataset =bundle.getIntArray("Dataset_Values");
String data6 = data5.replace(']',' ');
String[] entereddataset =bundle.getStringArray("Dataset_Values");
String data = Arrays.toString(entereddataset);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
Double mode = bundle.getDouble("Mode_Value");
double[] mode = bundle.getDoubleArray("Mode_Value");
String data7 = Arrays.toString(mode);
String data8 = data7.replace('[',' ' );
String data9 = data8.replace(']',' ');
mtextviewentereddata.setText(data3);
mtextviewmode.setText(mode.toString());
mtexviewfinalanswer.setText(mode.toString());
mtextviewascendingorder.setText(data3);
mtextviewmode.setText(data9);
mtexviewfinalanswer.setText(data9);
mtextviewascendingorder.setText(data6);
if (entereddataset.length > mode.length){
System.out.println("ModesAnswer:"+mode);
System.out.println("Mode value is " + Arrays.toString(mode));
}
else if (entereddataset.length == mode.length){
System.out.println("No mode value");
mtexviewfinalanswer.setText("No Mode");
mtextviewmode.setText("No Mode");
}
mtextviewascendingorder.setMovementMethod(new ScrollingMovementMethod());
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
mtexviewfinalanswer.setMovementMethod(new ScrollingMovementMethod());
mtextviewmode.setMovementMethod(new ScrollingMovementMethod());
return view;
}
......
......@@ -22,6 +22,8 @@ public class PopulationStandardDeviationFragment extends Fragment {
TextView msumofnumbers;
TextView mfinalanswer;
TextView mtextviewmean;
TextView mtextviewnumberpfele;
......@@ -34,27 +36,31 @@ public class PopulationStandardDeviationFragment extends Fragment {
View view = inflater.inflate(R.layout.fragment_population_standard_deviation,container,false);
mdatasetvalues=view.findViewById(R.id.txtview_datasetvalues);
mstdvalue=view.findViewById(R.id.textview_std);
msumofnumbers=view.findViewById(R.id.textview_sumofnumbers);
mstdvalue=view.findViewById(R.id.textview_populationstdvalue);
msumofnumbers=view.findViewById(R.id.textview_sumfnumbers);
mfinalanswer=view.findViewById(R.id.textview_finalanswer);
mtextviewmean =view.findViewById(R.id.textview_mean);
mtextviewnumberpfele=view.findViewById(R.id.textview_numberofelements);
Bundle bundle = getArguments();
int[] datasetValues = bundle.getIntArray("Dataset_Values") ;
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
String data4 = data3.replace(',','+');
Double population =bundle.getDouble("Std_values");
Double mean =bundle.getDouble("Mean_values");
Double sumofnumbersget=bundle.getDouble("Sum_of_numbers");
Integer numberofelements =bundle.getInt("Num_of_ele");
mdatasetvalues.setText(data4);
mdatasetvalues.setText(data3);
mstdvalue.setText(population.toString());
mfinalanswer.setText(population.toString());
mtextviewmean.setText(mean.toString());
msumofnumbers.setText(sumofnumbersget.toString());
mtextviewnumberpfele.setText(numberofelements.toString());
return view;
......
......@@ -16,46 +16,56 @@ import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import java.util.Arrays;
public class SampleStandardDeviationFragment extends Fragment {
TextView mdatasetvalues;
TextView mstdvalue;
TextView msumofnumbers;
TextView mfinalanswer;
TextView mtextviewmean;
public class PopulationVarianceFragment extends Fragment {
TextView mdatasetvalues;
//TextView mstdvalue;
TextView msumofnumbers;
TextView mfinalanswer;
TextView mtextviewmean;
TextView mvariance;
TextView mnoofdataset;
public SampleStandardDeviationFragment() {
public PopulationVarianceFragment() {
// Required empty public constructor
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_sample_standard_deviation,container,false);
View view = inflater.inflate(R.layout.fragment_population_variance,container,false);
mdatasetvalues=view.findViewById(R.id.txtview_datasetvalues);
mstdvalue=view.findViewById(R.id.textview_std);
msumofnumbers=view.findViewById(R.id.textview_sumofnumbers);
msumofnumbers=view.findViewById(R.id.textview_sumfnumbers);
mfinalanswer=view.findViewById(R.id.textview_finalanswer);
mtextviewmean =view.findViewById(R.id.textview_mean);
mvariance=view.findViewById(R.id.textview_variancepop);
mnoofdataset=view.findViewById(R.id.textview_numberofelement);
//mstdvalue=view.findViewById(R.id.textview_stdvalue);
Bundle bundle = getArguments();
int[] datasetValues = bundle.getIntArray("Dataset_Values") ;
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
String data4 = data3.replace(',','+');
Double standarddeviation =bundle.getDouble("Std_values");
Double mean =bundle.getDouble("Mean_values");
Double variance =bundle.getDouble("Variance_value");
Double sumofnumbers=bundle.getDouble("Sum_of_numbers");
Integer noofdata=bundle.getInt("No_ele_dataset");
mdatasetvalues.setText(data3);
mfinalanswer.setText(variance.toString());
mtextviewmean.setText(mean.toString());
mvariance.setText(variance.toString());
msumofnumbers.setText(sumofnumbers.toString());
mnoofdataset.setText(noofdata.toString());
mdatasetvalues.setText(data4);
mstdvalue.setText(standarddeviation.toString());
mfinalanswer.setText(standarddeviation.toString());
mtextviewmean.setText(mean.toString());
return view;
return view;
}}
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -35,11 +36,11 @@ public class RangeFragment extends Fragment {
View view = inflater.inflate(R.layout.fragment_range, container, false);
mtextviewentereddata = view.findViewById(R.id.textview_entereddataset);
mtextviewrangevalue = view.findViewById(R.id.textview_range);
mtextvieworderdata = view.findViewById(R.id.textVieworderdata);
mtextviewrangevalue = view.findViewById(R.id.textview_iqrrange);
mtextvieworderdata = view.findViewById(R.id.textView_orderdata);
mtextviewfinalanswer = view.findViewById(R.id.textviw_finalvalue);
mtextviewmax = view.findViewById(R.id.textview_maxvalue);
mtextviewmin = view.findViewById(R.id.textviw_minvalue);
mtextviewmax = view.findViewById(R.id.textview_thirrdqr);
mtextviewmin = view.findViewById(R.id.textviw_firstqr);
Bundle bundle = getArguments();
Double range = bundle.getDouble("Range_value");
......@@ -48,7 +49,7 @@ public class RangeFragment extends Fragment {
String data5 = data4.replace('[', ' ');
String data6 = data5.replace(']', ' ');
int[] ordereddata = bundle.getIntArray("Order_value");
double[] ordereddata = bundle.getDoubleArray("Order_value");
String data7 = Arrays.toString(ordereddata);
String data8 = data7.replace('[', ' ');
String data9 = data8.replace(']', ' ');
......@@ -64,6 +65,8 @@ public class RangeFragment extends Fragment {
mtextviewfinalanswer.setText(range.toString());
mtextvieworderdata.setText(data9);
mtextvieworderdata.setMovementMethod(new ScrollingMovementMethod());
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
return view;
}
......
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import java.util.Arrays;
public class SkewnessFragment extends Fragment {
TextView mdatasetvalues;
TextView mstdvalue;
TextView msumofnumbers;
TextView mfinalanswer;
TextView mtextviewmean;
TextView mskewness;
TextView mnumofele;
TextView mnoofelements;
public SkewnessFragment() {
// Required empty public constructor
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_skewness,container,false);
mdatasetvalues=view.findViewById(R.id.txtview_datasetvalues);
mstdvalue=view.findViewById(R.id.textview_stdvalue);
msumofnumbers=view.findViewById(R.id.textview_sumfnumbers);
mfinalanswer=view.findViewById(R.id.textview_finalanswer);
mtextviewmean =view.findViewById(R.id.textview_mean);
mskewness=view.findViewById(R.id.textview_variancepop);
mnumofele=view.findViewById(R.id.textview_numberofelements);
mnoofelements=view.findViewById(R.id.textview_numberofelement);
Bundle bundle = getArguments();
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
Double standarddeviation =bundle.getDouble("Std_values");
Double mean =bundle.getDouble("Mean_values");
Double skewness =bundle.getDouble("Skewness_value");
Double sumofnumbers=bundle.getDouble("Sum_of_numbers");
Double numelements=bundle.getDouble("Num_of_elements");
Integer numberofdataset = bundle.getInt("Num_of_dataset");
mdatasetvalues.setText(data3);
mstdvalue.setText(standarddeviation.toString());
mfinalanswer.setText(skewness.toString());
mtextviewmean.setText(mean.toString());
mskewness.setText(skewness.toString());
msumofnumbers.setText(sumofnumbers.toString());
mnumofele.setText(numelements.toString());
mnoofelements.setText(numberofdataset.toString());
mdatasetvalues.setMovementMethod(new ScrollingMovementMethod());
return view;
}}
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import java.util.Arrays;
public class StandardDeviationDistributionFragment extends Fragment {
TextView mfinalAnswer;
TextView mdatasetvalues;
TextView mtextviewresultpx;
TextView mtextviewstdanswer;
TextView mtextviewmeanvalue;
public StandardDeviationDistributionFragment(){
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_standard_deviation_distribution,container,false);
mfinalAnswer = view.findViewById(R.id.textviewfinalanswer);
mdatasetvalues =view.findViewById(R.id.txtview_datasetvalues);
mtextviewresultpx=view.findViewById(R.id.textview_resultpx);
mtextviewstdanswer = view.findViewById(R.id.textview_stdvalueansw);
mtextviewmeanvalue=view.findViewById(R.id.meanvalue);
Bundle bundle = getArguments();
Double stdDistribution = bundle.getDouble("std_Value");
Double meandistribution = bundle.getDouble("Mean_Distribution");
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
String[] probabilityvalue = bundle.getStringArray("Probability_Value");
String data4 = Arrays.toString(probabilityvalue);
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
double sumofProbability=0.0;
for (String element : probabilityvalue) {
sumofProbability += Double.parseDouble(element);
}
double roundedsumofProbability = (double) Math.round(sumofProbability * 100.0) / 100.0;
System.out.println(" sumofProbability::"+roundedsumofProbability);
if(datasetValues.length==probabilityvalue.length && roundedsumofProbability==1) {
mfinalAnswer.setText(stdDistribution.toString());
mdatasetvalues.setText(data3);
mtextviewstdanswer.setText(stdDistribution.toString());
mtextviewresultpx.setText(data6);
mtextviewmeanvalue.setText(meandistribution.toString());
}else if (datasetValues.length!=probabilityvalue.length || roundedsumofProbability!=1){
mfinalAnswer.setText("Sum Of Probability Value must be one");
mdatasetvalues.setText(data3);
mtextviewstdanswer.setText("Sum Of Probability Value must be one");
mtextviewresultpx.setText(data6);
mtextviewmeanvalue.setText(meandistribution.toString());
}
mdatasetvalues.setMovementMethod(new ScrollingMovementMethod());
mtextviewresultpx.setMovementMethod(new ScrollingMovementMethod());
mfinalAnswer.setMovementMethod(new ScrollingMovementMethod());
mtextviewmeanvalue.setMovementMethod(new ScrollingMovementMethod());
mtextviewstdanswer.setMovementMethod(new ScrollingMovementMethod());
return view;
}
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -20,7 +21,7 @@ public class ThirdQuartileFragment extends Fragment {
TextView mtextviewentereddata;
TextView mtextviewthirdquartile;
TextView mtextviewordereddata;
TextView mtextviewbottomhalf;
// TextView mtextviewbottomhalf;
TextView mtextviewthirdqr;
public ThirdQuartileFragment() {
......@@ -31,27 +32,30 @@ public class ThirdQuartileFragment extends Fragment {
mtextviewentereddata = view.findViewById(R.id.textview_entereddataset);
mtextviewthirdquartile =view.findViewById(R.id.textview_thirdquartile);
mtextviewordereddata=view.findViewById(R.id.textorderdata);
mtextviewbottomhalf =view.findViewById(R.id.textview_upperhalf);
//mtextviewbottomhalf =view.findViewById(R.id.textview_upperhalf);
mtextviewthirdqr=view.findViewById(R.id.textview_thirdqr);
Bundle bundle =getArguments();
Double thirdquartile =bundle.getDouble("ThirdQuartile_Value");
String[] entereddata = bundle.getStringArray("Entered_Values");
String[] entereddata = bundle.getStringArray("Entered_values");
String data4 = Arrays.toString(entereddata);
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
int[] ordereddata=bundle.getIntArray("Ordered_data");
String data7 = Arrays.toString(ordereddata);
String data8 = data7.replace('[',' ' );
String data9 = data8.replace(']',' ');
double[] ascorderdata = bundle.getDoubleArray("Ascending_order");
String data = Arrays.toString(ascorderdata);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
mtextviewentereddata.setText(data6);
mtextviewthirdqr.setText(thirdquartile.toString());
mtextviewthirdquartile.setText(thirdquartile.toString());
mtextviewordereddata.setText(data9);
mtextviewordereddata.setText(data3);
mtextviewentereddata.setMovementMethod(new ScrollingMovementMethod());
mtextviewordereddata.setMovementMethod(new ScrollingMovementMethod());
//mtextviewbottomhalf.setMovementMethod(new ScrollingMovementMethod());
......
package com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.StepsFragment;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import java.util.Arrays;
public class VarianceOfDistributionFragment extends Fragment {
TextView mfinalAnswer;
TextView mdatasetvalues;
TextView mtextviewresultpx;
TextView mtextviewvarianceanswer;
TextView mtextviewmeanvalue;
public VarianceOfDistributionFragment(){
}
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_variance_of_distribution,container,false);
mfinalAnswer = view.findViewById(R.id.textviewfinalanswer);
mdatasetvalues =view.findViewById(R.id.txtview_datasetvalues);
mtextviewresultpx=view.findViewById(R.id.textview_resultpx);
mtextviewvarianceanswer = view.findViewById(R.id.textview_variancevalueansw);
mtextviewmeanvalue=view.findViewById(R.id.meanvalue);
Bundle bundle = getArguments();
Double varianceofdistribution = bundle.getDouble("Variance_Value");
String[] datasetValues = bundle.getStringArray("Dataset_Values") ;
String data = Arrays.toString(datasetValues);
String data2 = data.replace('[',' ' );
String data3 = data2.replace(']',' ');
String[] probabilityvalue = bundle.getStringArray("Probability_Value");
String data4 = Arrays.toString(probabilityvalue);
String data5 = data4.replace('[',' ' );
String data6 = data5.replace(']',' ');
Double meandistribution = bundle.getDouble("Mean_Distribution");
System.out.println("Variancedataset:"+Arrays.toString(datasetValues));
double sumofProbability=0.0;
for (String element : probabilityvalue) {
sumofProbability += Double.parseDouble(element);
}
double roundedsumofProbability = (double) Math.round(sumofProbability * 100.0) / 100.0;
System.out.println(" sumofProbability::"+roundedsumofProbability);
if(datasetValues.length==probabilityvalue.length && roundedsumofProbability==1) {
mfinalAnswer.setText(varianceofdistribution.toString());
mdatasetvalues.setText(data3);
mtextviewvarianceanswer.setText(varianceofdistribution.toString());
mtextviewresultpx.setText(data6);
mtextviewmeanvalue.setText(meandistribution.toString());
}else if (datasetValues.length!=probabilityvalue.length || roundedsumofProbability!=1){
mfinalAnswer.setText("Sum Of Probability Value must be one");
mdatasetvalues.setText(data3);
mtextviewvarianceanswer.setText("Sum Of Probability Value must be one");
mtextviewresultpx.setText(data6);
mtextviewmeanvalue.setText(meandistribution.toString());
}
mdatasetvalues.setMovementMethod(new ScrollingMovementMethod());
mtextviewresultpx.setMovementMethod(new ScrollingMovementMethod());
mfinalAnswer.setMovementMethod(new ScrollingMovementMethod());
mtextviewmeanvalue.setMovementMethod(new ScrollingMovementMethod());
mtextviewvarianceanswer.setMovementMethod(new ScrollingMovementMethod());
return view;
}
}
\ No newline at end of file
......@@ -139,11 +139,12 @@ public class DescriptiveStatisticsQuestionComparation {
Matcher matcher1 = pattern1.matcher(question);
boolean value1 = matcher1.matches();
while (matcher1.find()) {
System.out.println("'" + matcher1.group().trim() + "'");
System.out.println("rresult"+matcher1.toString());
extractnumbervalues.add(matcher1.group().trim());
while (matcher1.find()) {
System.out.println("'" + matcher1.group().trim() + "'");
extractnumbervalues.add(matcher1.group().trim());
}
}
//System.out.println("matched data set of extract " + extractnumbervalues);
......@@ -151,6 +152,74 @@ public class DescriptiveStatisticsQuestionComparation {
}
/*public List<String> NumberValuesForKeywords(String question) {
int counting=0;
List<String> dataforkeyword = new ArrayList<>();
List<Pattern> patterns = new ArrayList<>();
//final String example = "1. 21 bricks have a mean mass of 24.2 kg, and 29 similar bricks have a mass of 23.6 kg. Determine the mean mass of the 50 bricks.";
String data = question;
final String regex1 = "mean.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex2 = "median.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex3 = "mode.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex4 = "minimum.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex5 = "maximum.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex6 = "minimum.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex7 = "range.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex8 = "first quartile.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex9 = "third quartile.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex10 = "range.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final String regex11 = "inter quartile range.*?\\d+(?:,\\d+)*(?:\\d+|(\\.\\d+)?)";
final Pattern pattern1 = Pattern.compile(regex1, Pattern.MULTILINE);
//final Matcher matcher = pattern1.matcher(string);
final Pattern pattern2 = Pattern.compile(regex2, Pattern.MULTILINE);
//final Matcher matcher2 = pattern2.matcher(string);
final Pattern pattern3 = Pattern.compile(regex3, Pattern.MULTILINE);
final Pattern pattern4 = Pattern.compile(regex4, Pattern.MULTILINE);
final Pattern pattern5 = Pattern.compile(regex5, Pattern.MULTILINE);
final Pattern pattern6 = Pattern.compile(regex6, Pattern.MULTILINE);
final Pattern pattern7 = Pattern.compile(regex7, Pattern.MULTILINE);
final Pattern pattern8 = Pattern.compile(regex8, Pattern.MULTILINE);
final Pattern pattern9 = Pattern.compile(regex9, Pattern.MULTILINE);
final Pattern pattern10 = Pattern.compile(regex10, Pattern.MULTILINE);
final Pattern pattern11 = Pattern.compile(regex11, Pattern.MULTILINE);
patterns.add(pattern1);
patterns.add(pattern2);
patterns.add(pattern3);
patterns.add(pattern4);
patterns.add(pattern5);
patterns.add(pattern6);
patterns.add(pattern7);
patterns.add(pattern8);
patterns.add(pattern9);
patterns.add(pattern10);
patterns.add(pattern11);
for (Pattern pattern : patterns) {
Matcher matcher = pattern.matcher(data);
//System.out.println("before matcher loop" + pattern.toString());
while (matcher.find()) {
System.out.println("Full match: " + matcher.group(0));
for (int i = 1; i <= matcher.groupCount(); i++) {
System.out.println("Group " + i + ": " + matcher.group(i));
dataforkeyword.add(counting, matcher.group().trim());
counting++;
}
}
}
return dataforkeyword;
}*/
......
......@@ -42,12 +42,12 @@ public class ExtractData {
}
Iterator it = dataSet.iterator();
System.out.println("datset in extract "+ dataSet.toString());
System.out.println("datset in extract size"+ dataSet.size());
System.out.println("datset in extract "+ counter);
//System.out.println("datset in extract "+ dataSet.toString());
//System.out.println("datset in extract size"+ dataSet.size());
//System.out.println("datset in extract "+ counter);
}
System.out.println("values: "+data);
//System.out.println("values: "+data);
return dataSet;
......
package com.elearning.probabilityandstatisticsanalyserandeducator.dataExtraction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ExtractValueForRandomVariable {
List<String> randomVariable = new ArrayList<String>();
List<String> wordlist = new ArrayList<String>();
String word;
String data;
public List<String> InputRandomVariable(String[] question) {
int counter = 0;
wordlist = Arrays.asList(question);
for (String s : question) {
word = s.toString().trim();
String data1 = word;
Pattern pattern1 = Pattern.compile("(\\b(\\d)+(,(\\d)+)*\\b)|(\\b(\\d)+(\\s(\\d)+)*\\b)|(\\b(\\d)+(;(\\d)+)*\\b)|(\\b(\\d)+(:(\\d)+)*\\b)");
s.replaceAll("\\s","");
List<Pattern> patterns = new ArrayList<>();
patterns.add(pattern1);
for (Pattern pattern : patterns) {
Matcher matcher = pattern.matcher(data1);
while (matcher.find()) {
randomVariable.add(counter, matcher.group().trim());
counter++;
}
}
Iterator it = randomVariable.iterator();
//System.out.println("random variable in extract "+ randomVariable.toString());
//System.out.println("random variable in extract size"+ randomVariable.size());
//System.out.println("random variable in extract "+ counter);
}
//System.out.println("values: "+data);
return randomVariable;
}
}
package com.elearning.probabilityandstatisticsanalyserandeducator.dataExtraction;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
import android.util.Log;
import com.chaquo.python.PyObject;
import com.chaquo.python.Python;
import com.elearning.probabilityandstatisticsanalyserandeducator.R;
import com.elearning.probabilityandstatisticsanalyserandeducator.inputMethod.DescriptiveSCinputMethod;
import com.elearning.probabilityandstatisticsanalyserandeducator.inputMethod.ProbabilityDistributionsIM;
import org.w3c.dom.ls.LSOutput;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ProbabilityDistributionQuestionComparation {
Python py=null;
ProbabilityDistributionsIM probabilityDistributionsIM;
String a="Let X and Y be two independent random variables. Suppose that we know Var(2X−Y)=6 and Var(X+2Y)=9. Find Var(X) and Var(Y).";
public String ProbabilityDistributionComparewithCSV(String RandomValues, List<String> reading) {
// System.out.println("reading des questions in dsqc "+reading);
String[] keywordlist = {"Probability","probability","Distribution","distribution","Random","random","Variable","variable","Normal","normal","Exponential","exponential","Element","element","Discrete","discrete","Function","function","P(X = x)̄","ΣP(x)=1","mass","Mass","cumulative","Cumulative","F(x)","P(X≤x)","mean","Mean","Expected","Value","expected","value","E(X)","Variance","variance","var(X)","V(X)","Standard","standard","Deviation","deviation","σ","μ"};
String b="A probability distribution of the number of overtime hours worked in one week per employee is listed below.\n" +
"Overtime hours,0,1,2,3,4,5,6\n" +
"Probability,0.016,0.075,0.134,0.31,0.23,0.155,0.08\n" +
"Find the standard deviation of the probability distribution. (Round to 1 decimal place as needed.)";
List<String> questions ;
List<String> matchprodiskeyword = new ArrayList<>();
questions= reading;
String[] dataReader = new String[questions.size()];
questions.toArray(dataReader);
for (int i=0; i<dataReader.length; i++){
}
String questionlist = "";
for (String s : questions){
questionlist += s + "\t";
}
py = Python.getInstance();
PyObject pyo = py.getModule("probabilitydistribution");
PyObject pyo1 = py.getModule("probabilitydistribution_keywords");
PyObject obj = pyo.callAttr("main",a,dataReader);
PyObject obj1 = pyo1.callAttr("matchkeyword",keywordlist,RandomValues);
String result=obj.toString();
String result1=obj1.toString();
// System.out.println("output matching: "+result);
// System.out.println("matching: "+result1);
matchprodiskeyword = QuestionMatch(result);
return result1;
}
private List<String> readProbDistributionQuestions(InputStream in){
String[] printQuestion = new String[500];
List<ProbabiltyDistributionCSVfile> probDistributionQuestions= new ArrayList<>();
List<String> StringprobdistributionQuestions= new ArrayList<>();
//InputStream is = getResources().openRawResource(R.raw.propabilitydistribution);
BufferedReader reader = new BufferedReader(
new InputStreamReader(in, Charset.forName("UTF-8"))
);
String line = "";
try {
while ((line = reader.readLine()) != null) {
//Split by '"'
String tokens = line;
//Read the csv
ProbabiltyDistributionCSVfile question = new ProbabiltyDistributionCSVfile();
question.setQuestion(tokens);
probDistributionQuestions.add(question);
StringprobdistributionQuestions.add(tokens);
//printQuestion[lines] = line;
// Log.d("MyActivity", "Just created: " + question);
}
} catch (IOException e) {
//Log.wtf("MyActivity", "Error reading data file on line " + line, e);
e.printStackTrace();
}
finally {
try {
reader.close();
}catch (IOException e) {
e.printStackTrace();
}
}
return StringprobdistributionQuestions;
}
String data;
public List<String> QuestionMatch(String highest) {
int counter = 0;
List<String> wordlist = new ArrayList<String>();
List<String> matchword = new ArrayList<String>();
List<String> valueAccordingtoLine = new ArrayList<>();
String word;
return valueAccordingtoLine;
}
public List<String> ExtractRandomvalueFromDistributionQuestion(String randomvalue) {
List<String> extractnumbervalues = new ArrayList<String>();
Pattern pattern1 = Pattern.compile("(?<=,|\\s)\\d++(?!\\.\\b)");
Matcher matcher1 = pattern1.matcher(randomvalue);
boolean value1 = matcher1.matches();
while (matcher1.find()) {
//System.out.println("'" + matcher1.group().trim() + "'");
extractnumbervalues.add(matcher1.group().trim());
}
//System.out.println("matched data set of extract " + extractnumbervalues);
return extractnumbervalues;
}
public List<String> ExtractProbValueFromDistributionQuestion(String probabilityvalue) {
List<String> extractprobabilityvalues = new ArrayList<String>();
Pattern pattern2 = Pattern.compile("(?<=,|\\s)(0(\\.\\d+)?|1\\.0)+(,(0(\\.\\d+)?|1\\.0)+)*(?!\\.\\b)");
Matcher matcher2 = pattern2.matcher(probabilityvalue);
boolean value2 = matcher2.matches();
while (matcher2.find()) {
//System.out.println("'" + matcher2.group().trim() + "'");
extractprobabilityvalues.add(matcher2.group().trim());
}
//System.out.println("matched data set of extract " + extractnumbervalues);
return extractprobabilityvalues;
}
}
package com.elearning.probabilityandstatisticsanalyserandeducator.dataExtraction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ProbabilityValue {
List<String> probabilityvalue = new ArrayList<String>();
List<String> wordlist = new ArrayList<String>();
String word;
String data;
public List<String> ExtractionProbabilityValue(String[] question) {
int counter = 0;
wordlist = Arrays.asList(question);
for (String s : question) {
word = s.toString().trim();
String data1 = word;
Pattern pattern1 = Pattern.compile("(\\b(0(\\.\\d+)?|1\\.0)+(,(0(\\.\\d+)?|1\\.0)+)*\\b)|(\\b(0(\\.\\d+)?|1\\.0)+(\\s(0(\\.\\d+)?|1\\.0)+)*\\b)|(\\b(0(\\.\\d+)?|1\\.0)+(;(0(\\.\\d+)?|1\\.0)+)*\\b)|(\\b(0(\\.\\d+)?|1\\.0)+(:(0(\\.\\d+)?|1\\.0)+)*\\b)");
//s.replaceAll("\\s","");
List<Pattern> patterns = new ArrayList<>();
patterns.add(pattern1);
for (Pattern pattern : patterns) {
Matcher matcher = pattern.matcher(data1);
while (matcher.find()) {
probabilityvalue.add(counter, matcher.group().trim());
counter++;
}
}
Iterator it = probabilityvalue.iterator();
//System.out.println("probability value in extract "+ probabilityvalue.toString());
//System.out.println("probability value in extract size"+ probabilityvalue.size());
// System.out.println("probability value in extract "+ counter);
}
//System.out.println("values: "+data);
return probabilityvalue;
}
}
package com.elearning.probabilityandstatisticsanalyserandeducator.dataExtraction;
public class ProbabiltyDistributionCSVfile {
private String question;
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
}
......@@ -126,7 +126,7 @@ public class StandardDeviationQuestionComparation {
boolean value1 = matcher1.matches();
while (matcher1.find()) {
System.out.println("'" + matcher1.group().trim() + "'");
//System.out.println("'" + matcher1.group().trim() + "'");
extractnumbervalues.add(matcher1.group().trim());
}
......
......@@ -54,6 +54,7 @@ import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
......@@ -316,8 +317,10 @@ public class DescriptiveSCinputMethod extends AppCompatActivity {
DescriptiveStatisticsQuestionComparation dsqc = new DescriptiveStatisticsQuestionComparation();
List<String> reading = readDesQuestions();
List<String> extractDatasetForEssay;
List<String> extractNumbervalue;
String[] extractDatasetForEssayArray = new String[0];
String extractedKeywordsFromFuzzy = null;
if (selectedType.equals("Solve Essay problem")) {
......@@ -329,6 +332,7 @@ public class DescriptiveSCinputMethod extends AppCompatActivity {
extractDatasetForEssay = dsqc.ExtractDatasetFromDescriptiveQuestion(output);
System.out.println("extractDatasetForEssay " + extractDatasetForEssay);
//System.out.println("Common elements == "+common);
// Converting list to array after data extraction function
extractDatasetForEssayArray = new String[extractDatasetForEssay.size()];
extractDatasetForEssayArray = extractDatasetForEssay.toArray(extractDatasetForEssayArray);
......@@ -595,10 +599,10 @@ public void showMessege(){
StringdescriptiveQuestions.add(tokens);
//printQuestion[lines] = line;
Log.d("MyActivity", "Just created: " + question);
//Log.d("MyActivity", "Just created: " + question);
}
} catch (IOException e) {
Log.wtf("MyActivity", "Error reading data file on line " + line, e);
//Log.wtf("MyActivity", "Error reading data file on line " + line, e);
e.printStackTrace();
}
finally {
......
package com.elearning.probabilityandstatisticsanalyserandeducator;
import androidx.appcompat.app.AppCompatActivity;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Html;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.alimuzaffar.lib.pin.PinEntryEditText;
import com.elearning.probabilityandstatisticsanalyserandeducator.adaptiveLearning.QuizDbHelper;
import org.apache.commons.lang3.ObjectUtils;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.HashMap;
import java.util.Properties;
import java.util.Random;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class verification_screen extends AppCompatActivity {
String eSubject, eMessage, sEmail, sPassword, eUserEmail;
PinEntryEditText pinEntry;
int OTP =0;
DBConnection dbConnection;
Connection con;
@SuppressLint("WrongViewCast")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_verification_screen);
//----------- OTP number generate method ------------------------
final Random myRandom = new Random();
OTP = myRandom.nextInt(10000);
System.out.println("OTP"+OTP);
SessionManager sessionManager = new SessionManager(this);
sessionManager.SetUserOTP(OTP);
//------------------------- Creating Hash Map---------------------------------
HashMap<String,String> userDetails = sessionManager.getUserDetailsFromSession();
//tacking userID from session manager and it come as a string
//we convert userID int by using parseInt and asssin it into userID
eUserEmail = userDetails.get(SessionManager.KEY_EMAIL);
//sender(our system) email credential
sEmail = "probabilitystatitcs.corner@gmail.com";
sPassword = "admin121";
eSubject = "Please Confirm Your Email Address for Probability and Statistics analyzer and Educator ";
eMessage = Integer.toString(OTP);
//Initialize Properties
Properties properties = new Properties();
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.host", "smtp.gmail.com");
properties.put("mail.smtp.port", "587");
// properties.put("mail.smtp.ssl.trust", "smtp.gmail.com");
//Initialize session
Session session = Session.getInstance(properties, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(sEmail,sPassword);
}
});
try {
//Initialize email content
Message message = new MimeMessage(session);
//Sender email
message.setFrom(new InternetAddress(sEmail));
//Recipient email
message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(eUserEmail.trim()));
System.out.println("userEmail"+eUserEmail);
//Email subject
message.setSubject(eSubject);
System.out.println("subject "+eSubject);
//Email message
message.setText(eMessage);
System.out.println("eMessage in email"+eMessage);
//send email
new SendMail().execute(message);
} catch (MessagingException e) {
e.printStackTrace();
}
}
public class SendMail extends AsyncTask<Message, String, String>{
//Initialize progress dialog
private ProgressDialog ProgressDialog;
@Override
protected void onPreExecute() {
super.onPreExecute();
//create and show progress dialog
ProgressDialog = ProgressDialog.show(verification_screen.this,"Sending Mail......",
"Confirm Your Verification Message", true, false);
System.out.println("email send"+ProgressDialog);
}
@Override
protected String doInBackground(Message... messages) {
try {
//When success
Transport.send(messages[0]);
System.out.println("success msg.......");
return "Success";
} catch (MessagingException e) {
//When error
e.printStackTrace();
System.out.println("error msg.......");
return "Error";
}
}
@Override
protected void onPostExecute(String s) {
super.onPostExecute(s);
//Dismiss progress dialog
ProgressDialog.dismiss();
if (s.equals("Success")) {
//when success
//Initialize alert dialog
AlertDialog.Builder builder = new AlertDialog.Builder(verification_screen.this);
builder.setCancelable(false);
builder.setTitle(Html.fromHtml("<font color = '#509324'>Success</font>"));
builder.setMessage("Please Check Your Email to Verify User Account");
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
}
});
//show alert dialog
builder.show();
}else{
//when error
Toast.makeText(getApplicationContext(),
"Something went Wrong..........",Toast.LENGTH_LONG).show();
}
pinEntry = (PinEntryEditText) findViewById(R.id.txt_pin_entry);
if (pinEntry != null) {
pinEntry.setOnPinEnteredListener(new PinEntryEditText.OnPinEnteredListener() {
@Override
public void onPinEntered(CharSequence str) {
if (str.toString().equals(eMessage)) {
Toast.makeText(verification_screen.this, "SUCCESS", Toast.LENGTH_SHORT).show();
System.out.println("emessage Success"+eMessage);
QuizDbHelper quizDbHelper = new QuizDbHelper();
try {
//-------- 3rd Try Catch block -----
//Execute SELECT query from DB
String query = "UPDATE dbo.User_Table set is_Active=1 where firstName = ?";
Statement st = con.createStatement();
ResultSet rst = st.executeQuery(query);
while(rst.next()){
// newUserID = rst.getInt("userID");
}
}catch (Exception e){
e.printStackTrace();
}
} else {
Toast.makeText(verification_screen.this, "FAIL", Toast.LENGTH_SHORT).show();
pinEntry.setText(null);
}
}
});
}
}
}
}
\ No newline at end of file
from fuzzywuzzy import process
def main(data,data2):
str2match=data
stroptions=["A probability distribution of the number of overtime hours worked in one week per employee is listed below. Overtime hours,0,1,2,3,4,5,6 Probability,0.016,0.075,0.134,0.31,0.23,0.155,0.08 Find the standard deviation of the probability distribution. (Round to 1 decimal place as needed.)"]
ratio=process.extract(str2match,data2)
highest=process.extractOne(str2match,data2)
#print(ratio)
check_list=isinstance(data2,list)
#print(check_list)
#print(type(data2))
return ""+str(highest)
\ No newline at end of file
def word2vec(word):
from collections import Counter
from math import sqrt
# count the characters in word
cw = Counter(word)
# precomputes a set of the different characters
sw = set(cw)
# precomputes the "length" of the word vector
lw = sqrt(sum(c*c for c in cw.values()))
# return a tuple
return cw, sw, lw
def cosdis(v1, v2):
# which characters are common to the two words?
common = v1[1].intersection(v2[1])
# by definition of cosine distance we have
return sum(v1[0][ch]*v2[0][ch] for ch in common)/v1[2]/v2[2]
def matchkeyword(klist,sen):
matchedkeywordlist=[]
list_of_keywords = klist
Sentence = sen
threshold = 0.90
for key in list_of_keywords:
for word in Sentence.split():
try:
# print(key)
# print(word)
res = cosdis(word2vec(word), word2vec(key))
#print(res)
if res > threshold:
#print("Found a word with cosine distance > 100 : {} with original word: {}".format(word, key))
matchedkeywordlist.append(word)
except IndexError:
pass
return matchedkeywordlist
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/white"/>
<stroke android:width="1dp" android:color="#4fa5d5" />
<padding android:bottom="10dp" android:left="10dp" android:right="10dp" android:top="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".calculationfunction.EssayTypeDescriptiveStaticQuestion">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/LinearLayout_1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/firstLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/secondLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/thirdLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fourthLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fivthLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sixLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/seventhLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/eightLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/nineLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/elevenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tweleveLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/thirdteenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fourteenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fifteenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sixteenLayout">
</FrameLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".calculationfunction.EssayTypeProDistributionActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/LinearLayout_1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fourteenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fifteenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/sixteenLayout">
</FrameLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".calculationfunction.EssayTypeStdQuestionActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:id="@+id/LinearLayout_1">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/elevenLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/tweleveLayout">
</FrameLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/thirdteenLayout">
</FrameLayout>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".calculationfunction.ProbabilityDistributionCalculation">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment_container"/>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
tools:context=".calculationfunction.StandaradDeviationCalculation">
<FrameLayout
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent"
android:id="@+id/fragment_container"/>
tools:context=".calculationfunction.StandaradDeviationCalculation">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/fragment_container"/>
</LinearLayout>
\ No newline at end of file
</ScrollView>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/purple_500"
tools:context=".verification_screen">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="Verification Code"
android:textColor="@color/ic_launcher_uploadPhoto_background"
android:textSize="30dp"
android:textStyle="bold" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="center"
android:text="Please type the verification code sent\n to +7722989"
android:textColor="@color/ic_launcher_uploadPhoto_background"
android:textSize="18dp" />
<com.alimuzaffar.lib.pin.PinEntryEditText
android:id="@+id/txt_pin_entry"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:cursorVisible="false"
android:digits="1234567890"
android:inputType="number"
android:maxLength="4"
android:textIsSelectable="false"
android:textSize="20sp"
app:pinAnimationType="popIn"
/>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
"The random variable X has a binomial distribution with parameters n=100 and p=0.8. Find the mean and the variance of X."
"A manufacturing process produces components which are free from any faults with probability p. Find the probability that in a sample of size 50 from a large batch there are fewer than 4 faulty components when p = 0.95. Find the probability that in a sample of size 50 there are fewer than 10 faulty when p = 0.75."
"Use the table to give a suitable approximation to the probability that 𝑋 ≥ 5 where X is binomial random variable with parameters p = 0.05 and n = 400."
"Which of the following is not a requirement of a binomial distribution?
a. Constant probability of success
b. Only two possible Bernoulli outcomes
c. Fixed number of trials
d. Equally likely outcomes"
"Determine whether the distribution is a discrete probability distribution.
X 0 1 2 3 4
P(x) 0.2 0.2 0.2 0.2 0.2"
"Is the distribution a discrete probability distribution?
A. No, because each probability is not between 0 and 1, inclusive.
B. Yes, because the sum of the probabilities is equal to 1 and each probability is between 0 and 1 comma inclusive.
C. Yes, because the sum of the probabilities is equal to 1.
D. No, because the sum of the probabilities is not equal to 1"
"An insurance company sells insurance policies. Each insurance policy leads to claims with an expected value of $100 and a standard deviation of $3,000.The number of policies sold is normally distributed with a mean of 1,000 and a standard deviation of 150.
(a) What is the expectation of the total of all the claims from policies sold by this company?
(b) What is the variance of the total of all the claims from this company's policies?"
"A probability distribution of the number of overtime hours worked in one week per employee is listed below.
Overtime hours 0,1,2,3,4,5,6
Probability 0.016,0.075,0.134,0.31,0.23,0.155,0.08
Find the standard deviation of the probability distribution. (Round to 1 decimal place as needed.)"
"A probability distribution of the number of overtime hours worked in one week per employee is listed below.
Overtime hours 0,1,2,3,4,5,6
Probability 0.016,0.075,0.134,0.31,0.23,0.155,0.08"
Find the variance of the probability distribution. (Round to 1 decimal place as needed.)"
"A probability distribution gives us:
A. A distribution of probabilities
B. The probability of every possible event in a population
C. The probability of some of the events in the population
D. The probability of obtaining certain probabilities"
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="app_name">Probability and Statistics Analyser and Educator</string>
<string name="home_Title">Probability and Statistics Analyser and Educator</string>
<string name="home_slogan">Learn Smarter</string>
......@@ -30,7 +30,7 @@
<string name="Already_have_an_acc">Already Have an Account ? Login</string>
<string name="please_select_cal_type">Please Select Calculation Type</string>
<string name="descriptive_stat_name">Descriptive Statistics</string>
<string name="descriptive_stat_des">The following calculator will find mean, mode, median, lower and upper quartile, interquartile range... of the given data set.</string>
<string name="descriptive_stat_des">The following calculator will find mean, mode, median, lower and upper quartile, interquartile range of the given data set.</string>
<string name="des_input_messege">Input numbers separated by , : ; or blank space</string>
<string name="des_editText_hint">Enter your data set here</string>
<string name="input_button_takePhoto">Enter your data set here</string>
......@@ -58,6 +58,34 @@
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
<string name="title_activity_dashboard_user">DashboardUser</string>
<string name="to_find_variance_we_use_the_following_formula">variancestring</string>
<string name="the_variance_of_the_dataset_is">variance_value</string>
<string name="you_entered_the_following_dataset">you_following</string>
<string name="population_variance">population variance</string>
<string name="explanation">explaination_population</string>
<string name="equalmark">equalsign</string>
<string name="means">mean</string>
<string name="result">result</string>
<string name="find_the_sum_of_numbers_in_the_last_column_to_get">find_the_sum_of_numbers_in_the_last_column_to_get</string>
<string name="equal">equalsign</string>
<string name="the_first_quartile_or_lower_quartile_or_25_th_percentile_is_the_median_of_the_bottom_half_of_the_numbers">the_first_quartile_or_lower_quartile_or_25_th_percentile_is_the_median_of_the_bottom_half_of_the_numbers</string>
<string name="so_to_find_the_first_quartile_we_need_to_place_the_numbers_in_value_order_and_find_the_bottom_half">so_to_find_the_first_quartile_we_need_to_place_the_numbers_in_value_order_and_find_the_bottom_half</string>
<string name="the_first_quartile_of_dataset_is">the_first_quartile_of_dataset_is</string>
<string name="you_entered_following_dataset">you_entered_following_dataset</string>
<string name="explaination">explanation</string>
<string name="the_median_of_these_numbers_is">the_median_of_these_numbers_is</string>
<string name="so_bottom_half_is">so_bottom_half_is</string>
<string name="resultss">resultss</string>
<string name="minus">minus</string>
<string name="the_third_quartile_is">the_third_quartile_is</string>
<string name="the_first_quartile_is">the_first_quartile_is</string>
<string name="you_entered_following_datasets">You entered following dataset</string>
<string name="the_interquartilerange_of_the_dataset_is">The interquartilerange of the dataset is</string>
<string name="iqr_range">IQR range</string>
<string name="equalmarks">=</string>
<string name="the_third_quartile_iss">The third quartile is</string>
<string name="the_first_quartile_iss">The first quartile is</string>
<string name="so_upper_half_is">So upper half is</string>
<string name="title_activity_new_nav">new_nav</string>
</resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment