Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Commit

Permalink
Fixed bug with statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
DreierF committed Nov 17, 2014
1 parent b98b4de commit ef3c1e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Binary file modified app/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "de.dreier.mytargets"
minSdkVersion 14
targetSdkVersion 21
versionCode 11
versionName "1.8.2"
versionCode 12
versionName "1.8.3"
}
buildTypes {
release {
Expand Down
10 changes: 6 additions & 4 deletions app/src/main/java/de/dreier/mytargets/TargetOpenHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ public Round getRound(long round) {
res.close();

// Get number of X, 10 and 9 score
Cursor cur = db.rawQuery("SELECT s.points, COUNT(*) " +
"FROM PASSE p, SHOOT s WHERE p.round=" + round + " AND p._id = s.passe " +
"AND s.points<3 AND s.points>-1 GROUP BY s.points", null);
Cursor cur = db.rawQuery("SELECT s.points+(CASE WHEN (r.bow='-2' OR b.type='1') "+
"AND s.points=1 AND r.target=4 THEN 1 ELSE 0 END) AS czone, COUNT(*) " +
"FROM ROUND r, PASSE p, SHOOT s LEFT JOIN BOW b ON b._id=r.bow " +
"WHERE r._id=p.round AND p.round=" + round + " AND s.passe=p._id AND "+
"s.points<3 AND s.points>-1 GROUP BY czone", null);
if (cur.moveToFirst()) {
do {
r.scoreCount[cur.getInt(0)] = cur.getInt(1);
Expand Down Expand Up @@ -554,7 +556,7 @@ public void exportAll(File file) throws IOException {
file.createNewFile();
FileWriter writer = new FileWriter(file);
for (int i = 0; i < names.length-1; i++) {
writer.append("\"" + names[i] + "\";");
writer.append("\"").append(names[i]).append("\";");
}
writer.append("\n");
int distInd = cur.getColumnIndexOrThrow("distance");
Expand Down

0 comments on commit ef3c1e6

Please sign in to comment.