Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
20_21-J03
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
20_21-J03
20_21-J03
Commits
c5e22880
Commit
c5e22880
authored
Jul 06, 2021
by
Gamage B.G.N.U
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ProbabilityCalculationIM updated
parent
6f59d398
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
813 additions
and
7 deletions
+813
-7
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/WelcomeTest.java
...babilityandstatisticsanalyserandeducator/WelcomeTest.java
+57
-0
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/DbHelperTest.java
...icsanalyserandeducator/adaptiveLearning/DbHelperTest.java
+27
-0
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/QuizDbHelperTest.java
...nalyserandeducator/adaptiveLearning/QuizDbHelperTest.java
+21
-0
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/StartingScreenTest.java
...lyserandeducator/adaptiveLearning/StartingScreenTest.java
+61
-0
app/src/main/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/QuizDbHelper.java
...icsanalyserandeducator/adaptiveLearning/QuizDbHelper.java
+25
-0
app/src/main/java/com/elearning/probabilityandstatisticsanalyserandeducator/inputMethod/DescriptiveSCinputMethod.java
...yserandeducator/inputMethod/DescriptiveSCinputMethod.java
+0
-4
app/src/main/java/com/elearning/probabilityandstatisticsanalyserandeducator/inputMethod/ProbabilityCalculationIM.java
...yserandeducator/inputMethod/ProbabilityCalculationIM.java
+615
-1
app/src/main/res/layout/activity_probability_calculation_i_m.xml
.../main/res/layout/activity_probability_calculation_i_m.xml
+2
-2
app/src/main/res/values/strings.xml
app/src/main/res/values/strings.xml
+5
-0
No files found.
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/WelcomeTest.java
0 → 100644
View file @
c5e22880
package
com.elearning.probabilityandstatisticsanalyserandeducator
;
import
android.app.Activity
;
import
android.app.Instrumentation
;
import
android.view.View
;
import
androidx.test.rule.ActivityTestRule
;
import
com.elearning.probabilityandstatisticsanalyserandeducator.adaptiveLearning.StartingScreen
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
static
androidx
.
test
.
espresso
.
Espresso
.
onView
;
import
static
androidx
.
test
.
espresso
.
action
.
ViewActions
.
click
;
import
static
androidx
.
test
.
espresso
.
matcher
.
ViewMatchers
.
withId
;
import
static
androidx
.
test
.
platform
.
app
.
InstrumentationRegistry
.
getInstrumentation
;
import
static
org
.
junit
.
Assert
.*;
public
class
WelcomeTest
{
@Rule
public
ActivityTestRule
<
Welcome
>
mActivityTestRule
=
new
ActivityTestRule
<
Welcome
>(
Welcome
.
class
);
Instrumentation
.
ActivityMonitor
monitor
=
getInstrumentation
().
addMonitor
(
StartingScreen
.
class
.
getName
(),
null
,
false
);
private
Welcome
welcome
=
null
;
@Before
public
void
setUp
()
throws
Exception
{
welcome
=
mActivityTestRule
.
getActivity
();
}
@Test
public
void
testLaunch
(){
View
view
=
welcome
.
findViewById
(
R
.
id
.
btn_login
);
assertNotNull
(
view
);
onView
(
withId
(
R
.
id
.
btn_login
)).
perform
(
click
());
Activity
testedFunction
=
getInstrumentation
().
waitForMonitorWithTimeout
(
monitor
,
35000
);
assertNotNull
(
testedFunction
);
testedFunction
.
finish
();
}
@After
public
void
tearDown
()
throws
Exception
{
welcome
=
null
;
}
}
\ No newline at end of file
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/DbHelperTest.java
0 → 100644
View file @
c5e22880
package
com.elearning.probabilityandstatisticsanalyserandeducator.adaptiveLearning
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
public
class
DbHelperTest
{
@Test
public
void
isInitialExamFinished
()
{
int
input
=
2
;
int
output
=
0
;
int
expected
=
0
;
double
delta
=
.
1
;
DbHelper
dbHelper
=
new
DbHelper
();
output
=
dbHelper
.
isInitialExamFinished
(
input
);
assertEquals
(
expected
,
output
);
}
@Test
public
void
userProgressChecker
()
{
}
}
\ No newline at end of file
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/QuizDbHelperTest.java
0 → 100644
View file @
c5e22880
package
com.elearning.probabilityandstatisticsanalyserandeducator.adaptiveLearning
;
import
org.junit.Test
;
import
static
org
.
junit
.
Assert
.*;
public
class
QuizDbHelperTest
{
@Test
public
void
updateIsInitialExamForUsers
()
{
int
input
=
2
;
int
output
=
0
;
int
expected
=
1
;
QuizDbHelper
quizDbHelper
=
new
QuizDbHelper
();
output
=
quizDbHelper
.
UpdateIsInitialExamForUsers
(
input
);
assertEquals
(
expected
,
output
);
}
}
\ No newline at end of file
app/src/androidTest/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/StartingScreenTest.java
0 → 100644
View file @
c5e22880
package
com.elearning.probabilityandstatisticsanalyserandeducator.adaptiveLearning
;
import
android.app.Activity
;
import
android.app.Instrumentation
;
import
android.view.View
;
import
androidx.test.rule.ActivityTestRule
;
import
com.elearning.probabilityandstatisticsanalyserandeducator.R
;
import
com.elearning.probabilityandstatisticsanalyserandeducator.calculationfunction.DescriptiveStatisticsCalcuation
;
import
com.elearning.probabilityandstatisticsanalyserandeducator.inputMethod.DescriptiveSCinputMethod
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Rule
;
import
org.junit.Test
;
import
static
androidx
.
test
.
espresso
.
Espresso
.
onView
;
import
static
androidx
.
test
.
espresso
.
action
.
ViewActions
.
click
;
import
static
androidx
.
test
.
espresso
.
matcher
.
ViewMatchers
.
withId
;
import
static
androidx
.
test
.
platform
.
app
.
InstrumentationRegistry
.
getInstrumentation
;
import
static
org
.
junit
.
Assert
.*;
public
class
StartingScreenTest
{
@Rule
public
ActivityTestRule
<
StartingScreen
>
mActivityTestRule
=
new
ActivityTestRule
<
StartingScreen
>(
StartingScreen
.
class
);
Instrumentation
.
ActivityMonitor
monitor
=
getInstrumentation
().
addMonitor
(
QuizActivity
.
class
.
getName
(),
null
,
false
);
private
StartingScreen
startingScreen
=
null
;
@Before
public
void
setUp
()
throws
Exception
{
startingScreen
=
mActivityTestRule
.
getActivity
();
}
@Test
public
void
testLaunch
(){
View
view
=
startingScreen
.
findViewById
(
R
.
id
.
button_start_quiz
);
assertNotNull
(
view
);
onView
(
withId
(
R
.
id
.
button_start_quiz
)).
perform
(
click
());
Activity
testedFunction
=
getInstrumentation
().
waitForMonitorWithTimeout
(
monitor
,
25000
);
assertNotNull
(
testedFunction
);
testedFunction
.
finish
();
}
@After
public
void
tearDown
()
throws
Exception
{
startingScreen
=
null
;
}
}
\ No newline at end of file
app/src/main/java/com/elearning/probabilityandstatisticsanalyserandeducator/adaptiveLearning/QuizDbHelper.java
View file @
c5e22880
...
...
@@ -1218,6 +1218,31 @@ public class QuizDbHelper {
System
.
out
.
println
(
"NormalDistributionHarddbhelper "
+
questionList
);
return
questionList
;
}
public
int
UpdateIsInitialExamForUsers
(
int
userID
){
try
{
con
=
dbConnection
.
getConnection
();
if
(
con
==
null
){
System
.
out
.
println
(
"Connection Error"
);
}
else
{
String
query
=
"UPDATE User_SupportData SET is_initial_finished = 1 WHERE user_ID = '"
+
userID
+
"'"
;
//new way to take values into DB
Statement
st
=
con
.
createStatement
();
st
.
executeUpdate
(
query
);
st
.
close
();
con
.
close
();
System
.
out
.
println
(
"isInithialExam is Update "
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
1
;
}
}
...
...
app/src/main/java/com/elearning/probabilityandstatisticsanalyserandeducator/inputMethod/DescriptiveSCinputMethod.java
View file @
c5e22880
...
...
@@ -609,8 +609,4 @@ public void showMessege(){
return
StringdescriptiveQuestions
;
}
}
\ No newline at end of file
app/src/main/java/com/elearning/probabilityandstatisticsanalyserandeducator/inputMethod/ProbabilityCalculationIM.java
View file @
c5e22880
This diff is collapsed.
Click to expand it.
app/src/main/res/layout/activity_probability_calculation_i_m.xml
View file @
c5e22880
...
...
@@ -356,12 +356,12 @@
app:layout_constraintVertical_bias=
"0.859"
/>
<Spinner
android:id=
"@+id/spinner"
android:id=
"@+id/spinner
1
"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.
573
"
app:layout_constraintHorizontal_bias=
"0.
705
"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.864"
/>
...
...
app/src/main/res/values/strings.xml
View file @
c5e22880
...
...
@@ -88,4 +88,9 @@
<string
name=
"so_upper_half_is"
>
So upper half is
</string>
<string
name=
"title_activity_new_nav"
>
new_nav
</string>
<string-array
name=
"isDependent"
>
<item>
Dependant
</item>
<item>
Independant
</item>
</string-array>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment