-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c34051d
commit 23cae1b
Showing
81 changed files
with
2,035 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
ASGI config for Time2Learn project. | ||
It exposes the ASGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Time2Learn.settings') | ||
|
||
application = get_asgi_application() |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class QuizzesConfig(AppConfig): | ||
default_auto_field = 'django.db.models.BigAutoField' | ||
name = 'quizzes' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.db import models | ||
|
||
# Create your models here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.test import TestCase | ||
|
||
# Create your tests here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.shortcuts import render | ||
|
||
# Create your views here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
DATABASES = { | ||
'default': { | ||
'ENGINE': 'django.db.backends.postgresql', | ||
'NAME': 'time2learn', | ||
'USER': 'postgres', | ||
'PASSWORD': 'your_password_here', | ||
'HOST': 'localhost', | ||
'PORT': '5432', | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
""" | ||
URL configuration for Time2Learn project. | ||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/5.1/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: path('', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Import the include() function: from django.urls import include, path | ||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
from django.contrib import admin | ||
from django.urls import path | ||
|
||
urlpatterns = [ | ||
path('admin/', admin.site.urls), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
""" | ||
WSGI config for Time2Learn project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
|
||
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Time2Learn.settings') | ||
|
||
application = get_wsgi_application() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="java-gradle" name="Java-Gradle"> | ||
<configuration> | ||
<option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<excludeFolder url="file://$MODULE_DIR$/.gradle" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="Time2Learn" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> | ||
<component name="FacetManager"> | ||
<facet type="android-gradle" name="Android-Gradle"> | ||
<configuration> | ||
<option name="GRADLE_PROJECT_PATH" value=":app" /> | ||
</configuration> | ||
</facet> | ||
<facet type="android" name="Android"> | ||
<configuration> | ||
<option name="SELECTED_BUILD_VARIANT" value="debug" /> | ||
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" /> | ||
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugJava" /> | ||
<option name="ASSEMBLE_TEST_TASK_NAME" value="assembleDebugTest" /> | ||
<option name="SOURCE_GEN_TASK_NAME" value="generateDebugSources" /> | ||
<option name="TEST_SOURCE_GEN_TASK_NAME" value="generateDebugTestSources" /> | ||
<option name="ALLOW_USER_CONFIGURATION" value="false" /> | ||
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" /> | ||
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" /> | ||
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" /> | ||
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" /> | ||
</configuration> | ||
</facet> | ||
</component> | ||
<component name="NewModuleRootManager" inherit-compiler-output="false"> | ||
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" /> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/test/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/test/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/test/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/test/debug" isTestSource="true" generated="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/test/debug" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> | ||
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> | ||
</content> | ||
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 21 | ||
buildToolsVersion "21.0.2" | ||
|
||
defaultConfig { | ||
applicationId "nl.npipf.tgh.time2learn" | ||
minSdkVersion 16 | ||
targetSdkVersion 21 | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
buildTypes { | ||
release { | ||
runProguard false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in C:\Program Files (x86)\Android\android-studio\sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} |
13 changes: 13 additions & 0 deletions
13
Time2LearnApp/app/src/androidTest/java/nl/npipf/tgh/time2learn/ApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package nl.npipf.tgh.time2learn; | ||
|
||
import android.app.Application; | ||
import android.test.ApplicationTestCase; | ||
|
||
/** | ||
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> | ||
*/ | ||
public class ApplicationTest extends ApplicationTestCase<Application> { | ||
public ApplicationTest() { | ||
super(Application.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="nl.npipf.tgh.time2learn"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme"> | ||
<activity | ||
android:name=".MainMenu" | ||
android:label="@string/app_name" | ||
android:screenOrientation="portrait"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity | ||
android:name=".Game" | ||
android:label="@string/title_activity_game" | ||
android:screenOrientation="portrait"></activity> | ||
<activity | ||
android:name=".EndScreen" | ||
android:label="@string/title_activity_end_screen" | ||
android:screenOrientation="portrait"></activity> | ||
<activity | ||
android:name=".Game5min" | ||
android:label="@string/title_activity_game5min" | ||
android:screenOrientation="portrait"></activity> | ||
<activity | ||
android:name=".Credits" | ||
android:label="@string/title_activity_credits"></activity> | ||
</application> | ||
|
||
</manifest> |
36 changes: 36 additions & 0 deletions
36
Time2LearnApp/app/src/main/java/nl/npipf/tgh/time2learn/Credits.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package nl.npipf.tgh.time2learn; | ||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
|
||
|
||
public class Credits extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_credits); | ||
} | ||
|
||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.credits, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
int id = item.getItemId(); | ||
if (id == R.id.action_settings) { | ||
return true; | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
Time2LearnApp/app/src/main/java/nl/npipf/tgh/time2learn/EndScreen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package nl.npipf.tgh.time2learn; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.content.SharedPreferences; | ||
import android.os.Bundle; | ||
import android.view.Menu; | ||
import android.view.MenuItem; | ||
import android.view.View; | ||
import android.widget.Button; | ||
import android.widget.TextView; | ||
|
||
import org.w3c.dom.Text; | ||
|
||
|
||
public class EndScreen extends Activity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_end_screen); | ||
|
||
SharedPreferences prefs = getSharedPreferences("time_scores", 0); | ||
String highscore = prefs.getString("highscore", "0"); | ||
TextView txtHighscore = (TextView) findViewById(R.id.textHighscoreEnd); | ||
txtHighscore.setText("Highscore: " + highscore); | ||
|
||
Intent intent = getIntent(); | ||
|
||
String correctAnswer = intent.getStringExtra("correct_answer"); | ||
TextView txtCorrectAnswer = (TextView) findViewById(R.id.textCorrectAnswer); | ||
txtCorrectAnswer.setText(correctAnswer); | ||
|
||
int currentScore = intent.getIntExtra("current_score", 0); | ||
TextView txtCurrentScore = (TextView) findViewById(R.id.textGottenScore); | ||
txtCurrentScore.setText(this.getString(R.string.current_score) + " " + currentScore); | ||
|
||
Button butTryAgain = (Button) findViewById(R.id.butTryAgain); | ||
butTryAgain.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
finish(); | ||
} | ||
}); | ||
} | ||
|
||
|
||
@Override | ||
public boolean onCreateOptionsMenu(Menu menu) { | ||
// Inflate the menu; this adds items to the action bar if it is present. | ||
getMenuInflater().inflate(R.menu.end_screen, menu); | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onOptionsItemSelected(MenuItem item) { | ||
// Handle action bar item clicks here. The action bar will | ||
// automatically handle clicks on the Home/Up button, so long | ||
// as you specify a parent activity in AndroidManifest.xml. | ||
int id = item.getItemId(); | ||
if (id == R.id.menuCredits) { | ||
Intent intent = new Intent(getApplicationContext(), Credits.class); | ||
startActivity(intent); | ||
return true; | ||
} | ||
return super.onOptionsItemSelected(item); | ||
} | ||
} |
Oops, something went wrong.