├── xcode.jpg ├── ManualTextEnglish.pdf ├── ManualTextGerman.pdf ├── DuesseldorferSchuelerinventarInEnglish.pdf ├── DuesseldorferSchuelerinventarInGerman..pdf ├── deleteProfile.php ├── getProfiles.php ├── PersonalityTestApp.java ├── readNormTable.php ├── NormTableItem.java ├── User.java ├── item_norm_table.xml ├── fragment_competence_result.xml ├── AndroidManifest.xml ├── BaseActivity.java ├── activity_admin.xml ├── updateNormTable.php ├── activity_questionnaire.xml ├── fragment_question.xml ├── activity_login.xml ├── CompetenceResultFragment.java ├── saveProfile.php ├── PreferencesHelper.java ├── ProfileActivity.java ├── MainMenuActivity.java ├── register.php ├── login.php ├── Profile.java ├── ProfileAdapter.java ├── QuestionFragment.java ├── DatenbankAnlegen.sql ├── QuestionPagerAdapter.java ├── activity_profile.xml ├── README.md ├── QuestionnaireActivity.java ├── RegisterActivity.java ├── DatabaseHelper.java ├── ApiClient.java ├── NormTableAdapter.java ├── LoginActivity.java └── ProfileListActivity.java /xcode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkoopongithub/duesseldorfer-schuelerinventar-android-studio/main/xcode.jpg -------------------------------------------------------------------------------- /ManualTextEnglish.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkoopongithub/duesseldorfer-schuelerinventar-android-studio/main/ManualTextEnglish.pdf -------------------------------------------------------------------------------- /ManualTextGerman.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkoopongithub/duesseldorfer-schuelerinventar-android-studio/main/ManualTextGerman.pdf -------------------------------------------------------------------------------- /DuesseldorferSchuelerinventarInEnglish.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkoopongithub/duesseldorfer-schuelerinventar-android-studio/main/DuesseldorferSchuelerinventarInEnglish.pdf -------------------------------------------------------------------------------- /DuesseldorferSchuelerinventarInGerman..pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pkoopongithub/duesseldorfer-schuelerinventar-android-studio/main/DuesseldorferSchuelerinventarInGerman..pdf -------------------------------------------------------------------------------- /deleteProfile.php: -------------------------------------------------------------------------------- 1 | connect_error) { 14 | die(json_encode(["status" => "error", "message" => "Datenbankverbindung fehlgeschlagen"])); 15 | } 16 | 17 | // Profil-ID erhalten 18 | $profileId = (int)$_GET['profile_id']; 19 | 20 | // Profil löschen 21 | $stmt = $conn->prepare("DELETE FROM profiles WHERE id = ?"); 22 | $stmt->bind_param("i", $profileId); 23 | 24 | if ($stmt->execute()) { 25 | $response = ["status" => "success"]; 26 | } else { 27 | $response = ["status" => "error", "message" => "Profil konnte nicht gelöscht werden"]; 28 | } 29 | 30 | $stmt->close(); 31 | $conn->close(); 32 | 33 | echo json_encode($response); 34 | ?> -------------------------------------------------------------------------------- /getProfiles.php: -------------------------------------------------------------------------------- 1 | connect_error) { 14 | die(json_encode(["status" => "error", "message" => "Datenbankverbindung fehlgeschlagen"])); 15 | } 16 | 17 | // Benutzer-ID erhalten 18 | $userId = (int)$_GET['user_id']; 19 | 20 | // Profile abfragen 21 | $stmt = $conn->prepare("SELECT id, name, created_at FROM profiles WHERE user_id = ? ORDER BY created_at DESC"); 22 | $stmt->bind_param("i", $userId); 23 | $stmt->execute(); 24 | $result = $stmt->get_result(); 25 | 26 | $profiles = []; 27 | while ($row = $result->fetch_assoc()) { 28 | $profiles[] = $row; 29 | } 30 | 31 | $response = [ 32 | "status" => "success", 33 | "data" => $profiles 34 | ]; 35 | 36 | $stmt->close(); 37 | $conn->close(); 38 | 39 | echo json_encode($response); 40 | ?> -------------------------------------------------------------------------------- /PersonalityTestApp.java: -------------------------------------------------------------------------------- 1 | package com.example.personalitytest; 2 | 3 | import android.app.Application; 4 | 5 | import com.example.personalitytest.models.Profile; 6 | import com.example.personalitytest.models.User; 7 | 8 | public class PersonalityTestApp extends Application { 9 | private User currentUser; 10 | private Profile currentProfile; 11 | private double[][] normTable; 12 | private String apiBaseUrl = "https://mein-duesk.org/"; 13 | 14 | @Override 15 | public void onCreate() { 16 | super.onCreate(); 17 | // Hier könnten Sie Initialisierungen durchführen 18 | } 19 | 20 | // Getter und Setter 21 | public User getCurrentUser() { return currentUser; } 22 | public void setCurrentUser(User user) { this.currentUser = user; } 23 | 24 | public Profile getCurrentProfile() { return currentProfile; } 25 | public void setCurrentProfile(Profile profile) { this.currentProfile = profile; } 26 | 27 | public double[][] getNormTable() { return normTable; } 28 | public void setNormTable(double[][] normTable) { this.normTable = normTable; } 29 | 30 | public String getApiBaseUrl() { return apiBaseUrl; } 31 | } -------------------------------------------------------------------------------- /readNormTable.php: -------------------------------------------------------------------------------- 1 | connect_error) { 14 | die(json_encode(["status" => "error", "message" => "Datenbankverbindung fehlgeschlagen"])); 15 | } 16 | 17 | // Normtabelle abfragen 18 | $query = "SELECT kompetenzID, p1, p2, p3, p4, p5 FROM normSEhs ORDER BY kompetenzID"; 19 | $result = $conn->query($query); 20 | 21 | if ($result->num_rows === 0) { 22 | echo json_encode(["status" => "error", "message" => "Keine Normdaten gefunden"]); 23 | exit; 24 | } 25 | 26 | $normTable = []; 27 | while ($row = $result->fetch_assoc()) { 28 | $normTable[] = [ 29 | (float)$row['p1'], 30 | (float)$row['p2'], 31 | (float)$row['p3'], 32 | (float)$row['p4'], 33 | (float)$row['p5'] 34 | ]; 35 | } 36 | 37 | $response = [ 38 | "status" => "success", 39 | "data" => $normTable 40 | ]; 41 | 42 | $conn->close(); 43 | echo json_encode($response); 44 | ?> -------------------------------------------------------------------------------- /NormTableItem.java: -------------------------------------------------------------------------------- 1 | package com.example.personalitytest.models; 2 | 3 | public class NormTableItem { 4 | private int id; 5 | private String competenceName; 6 | private double p1, p2, p3, p4, p5; 7 | private boolean modified; 8 | 9 | public NormTableItem(int id, String competenceName, double p1, double p2, double p3, double p4, double p5) { 10 | this.id = id; 11 | this.competenceName = competenceName; 12 | this.p1 = p1; 13 | this.p2 = p2; 14 | this.p3 = p3; 15 | this.p4 = p4; 16 | this.p5 = p5; 17 | this.modified = false; 18 | } 19 | 20 | // Getter 21 | public int getId() { return id; } 22 | public String getCompetenceName() { return competenceName; } 23 | public double getP1() { return p1; } 24 | public double getP2() { return p2; } 25 | public double getP3() { return p3; } 26 | public double getP4() { return p4; } 27 | public double getP5() { return p5; } 28 | public boolean isModified() { return modified; } 29 | 30 | // Setter mit modified-Flag 31 | public void setP1(double p1) { 32 | if (this.p1 != p1) modified = true; 33 | this.p1 = p1; 34 | } 35 | // ... gleiches für p2 bis p5 36 | } -------------------------------------------------------------------------------- /User.java: -------------------------------------------------------------------------------- 1 | package com.example.personalitytest.models; 2 | 3 | import java.util.Date; 4 | 5 | public class User { 6 | private int id; 7 | private String username; 8 | private String email; 9 | private String passwordHash; 10 | private boolean isAdmin; 11 | private Date createdAt; 12 | private Date lastLogin; 13 | 14 | // Konstruktor 15 | public User(int id, String username, String email, boolean isAdmin) { 16 | this.id = id; 17 | this.username = username; 18 | this.email = email; 19 | this.isAdmin = isAdmin; 20 | this.createdAt = new Date(); 21 | } 22 | 23 | // Getter und Setter 24 | public int getId() { return id; } 25 | public String getUsername() { return username; } 26 | public String getEmail() { return email; } 27 | public boolean isAdmin() { return isAdmin; } 28 | public Date getCreatedAt() { return createdAt; } 29 | public Date getLastLogin() { return lastLogin; } 30 | 31 | public void setLastLogin(Date lastLogin) { this.lastLogin = lastLogin; } 32 | public void setPasswordHash(String hash) { this.passwordHash = hash; } 33 | 34 | // Weitere Methoden 35 | public boolean checkPassword(String password) { 36 | return BCrypt.checkpw(password, this.passwordHash); 37 | } 38 | } -------------------------------------------------------------------------------- /item_norm_table.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 21 | 22 | 27 | 28 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /fragment_competence_result.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 21 | 22 | 29 | 30 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.example.personalitytest; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.widget.Toast; 6 | 7 | import androidx.annotation.Nullable; 8 | import androidx.appcompat.app.AppCompatActivity; 9 | 10 | import com.example.personalitytest.utils.PreferencesHelper; 11 | 12 | public abstract class BaseActivity extends AppCompatActivity { 13 | protected PreferencesHelper preferencesHelper; 14 | 15 | @Override 16 | protected void onCreate(@Nullable Bundle savedInstanceState) { 17 | super.onCreate(savedInstanceState); 18 | preferencesHelper = new PreferencesHelper(this); 19 | } 20 | 21 | @Override 22 | protected void onStart() { 23 | super.onStart(); 24 | checkAuthentication(); 25 | } 26 | 27 | protected void checkAuthentication() { 28 | if (!(this instanceof LoginActivity || this instanceof RegisterActivity)) { 29 | if (!preferencesHelper.isLoggedIn()) { 30 | redirectToLogin(); 31 | } 32 | } 33 | } 34 | 35 | protected void redirectToLogin() { 36 | Intent intent = new Intent(this, LoginActivity.class); 37 | intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); 38 | startActivity(intent); 39 | finish(); 40 | } 41 | 42 | protected void showToast(String message) { 43 | Toast.makeText(this, message, Toast.LENGTH_SHORT).show(); 44 | } 45 | 46 | protected void showLongToast(String message) { 47 | Toast.makeText(this, message, Toast.LENGTH_LONG).show(); 48 | } 49 | } -------------------------------------------------------------------------------- /activity_admin.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | 22 | 23 | 28 | 29 |