@ -0,0 +1,10 @@
|
||||
.idea/
|
||||
out/
|
||||
.vscode/
|
||||
bin/
|
||||
questions/
|
||||
generated_papers/
|
||||
target/
|
||||
users.json
|
||||
legal/
|
||||
lib/
|
||||
@ -0,0 +1,25 @@
|
||||
package com.mathgenerator;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.stage.Stage;
|
||||
import java.io.IOException;
|
||||
|
||||
public class MainApplication extends Application {
|
||||
|
||||
@Override
|
||||
public void start(Stage primaryStage) throws IOException {
|
||||
// 启动时加载登录界面
|
||||
Parent root = FXMLLoader.load(getClass().getResource("/com/mathgenerator/view/LoginView.fxml"));
|
||||
primaryStage.setTitle("中小学数学学习软件");
|
||||
primaryStage.setScene(new Scene(root));
|
||||
primaryStage.setResizable(false);
|
||||
primaryStage.show();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
launch(args);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,12 @@
|
||||
package com.mathgenerator.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 选择题数据模型。
|
||||
* @param questionText 题干
|
||||
* @param options 四个选项的列表
|
||||
* @param correctOptionIndex 正确答案在列表中的索引 (0-3)
|
||||
*/
|
||||
public record ChoiceQuestion(String questionText, List<String> options, int correctOptionIndex) {
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.PasswordField?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="350.0" prefWidth="400.0" spacing="15.0" style="-fx-background-color: #f4f4f4;" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.mathgenerator.controller.LoginController">
|
||||
<children>
|
||||
<Label text="用户登录">
|
||||
<font>
|
||||
<Font name="System Bold" size="24.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<TextField fx:id="usernameField" maxWidth="250.0" promptText="用户名" />
|
||||
<PasswordField fx:id="passwordField" maxWidth="250.0" promptText="密码" />
|
||||
<Button fx:id="loginButton" mnemonicParsing="false" onAction="#handleLoginButtonAction" prefWidth="100.0" text="登录" />
|
||||
<Button fx:id="registerButton" mnemonicParsing="false" onAction="#handleRegisterButtonAction" style="-fx-background-color: #6c757d;" text="注册新用户" textFill="WHITE" />
|
||||
<Label fx:id="statusLabel" textFill="RED">
|
||||
<VBox.margin>
|
||||
<Insets top="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<VBox alignment="TOP_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="500.0" spacing="20.0" style="-fx-background-color: #f4f4f4;" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.mathgenerator.controller.MainMenuController">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label fx:id="welcomeLabel" text="欢迎, [用户名]!">
|
||||
<font>
|
||||
<Font name="System Bold" size="28.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<VBox alignment="CENTER" spacing="15.0" VBox.vgrow="ALWAYS">
|
||||
<children>
|
||||
<Label text="请选择题目难度">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Button fx:id="primaryButton" mnemonicParsing="false" onAction="#handlePrimaryAction" prefHeight="50.0" prefWidth="200.0" text="小学" />
|
||||
<Button fx:id="juniorHighButton" mnemonicParsing="false" onAction="#handleJuniorHighAction" prefHeight="50.0" prefWidth="200.0" text="初中" />
|
||||
<Button fx:id="seniorHighButton" mnemonicParsing="false" onAction="#handleSeniorHighAction" prefHeight="50.0" prefWidth="200.0" text="高中" />
|
||||
<HBox alignment="CENTER" spacing="10.0">
|
||||
<children>
|
||||
<Label text="题目数量:" />
|
||||
<TextField fx:id="questionCountField" prefWidth="80.0" text="10" />
|
||||
</children>
|
||||
<VBox.margin>
|
||||
<Insets top="20.0" />
|
||||
</VBox.margin>
|
||||
</HBox>
|
||||
<Label fx:id="statusLabel" textFill="RED" />
|
||||
</children>
|
||||
</VBox>
|
||||
<HBox alignment="CENTER_RIGHT" spacing="10.0">
|
||||
<children>
|
||||
<Button fx:id="changePasswordButton" mnemonicParsing="false" onAction="#handleChangePasswordAction" text="修改密码" />
|
||||
<Button fx:id="logoutButton" mnemonicParsing="false" onAction="#handleLogoutAction" style="-fx-background-color: #dc3545;" text="退出登录" textFill="WHITE" />
|
||||
</children>
|
||||
</HBox>
|
||||
</children>
|
||||
</VBox>
|
||||
@ -0,0 +1,68 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.ProgressBar?>
|
||||
<?import javafx.scene.control.RadioButton?>
|
||||
<?import javafx.scene.control.ToggleGroup?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<VBox alignment="TOP_CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="600.0" spacing="20.0" style="-fx-background-color: #f4f4f4;" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.mathgenerator.controller.QuizController">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label fx:id="questionNumberLabel" text="第 1 / 10 题">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<ProgressBar fx:id="progressBar" prefWidth="560.0" progress="0.1" />
|
||||
<Label fx:id="questionTextLabel" style="-fx-font-weight: bold;" text="题目内容: 1 + 1 = ?" wrapText="true">
|
||||
<font>
|
||||
<Font size="24.0" />
|
||||
</font>
|
||||
<VBox.margin>
|
||||
<Insets top="20.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
<VBox fx:id="optionsVBox" alignment="CENTER_LEFT" spacing="15.0">
|
||||
<children>
|
||||
<RadioButton fx:id="option1" mnemonicParsing="false" text="选项1">
|
||||
<toggleGroup>
|
||||
<ToggleGroup fx:id="optionsGroup" />
|
||||
</toggleGroup>
|
||||
<font>
|
||||
<Font size="16.0" />
|
||||
</font>
|
||||
</RadioButton>
|
||||
<RadioButton fx:id="option2" mnemonicParsing="false" text="选项2" toggleGroup="$optionsGroup">
|
||||
<font>
|
||||
<Font size="16.0" />
|
||||
</font>
|
||||
</RadioButton>
|
||||
<RadioButton fx:id="option3" mnemonicParsing="false" text="选项3" toggleGroup="$optionsGroup">
|
||||
<font>
|
||||
<Font size="16.0" />
|
||||
</font>
|
||||
</RadioButton>
|
||||
<RadioButton fx:id="option4" mnemonicParsing="false" text="选项4" toggleGroup="$optionsGroup">
|
||||
<font>
|
||||
<Font size="16.0" />
|
||||
</font>
|
||||
</RadioButton>
|
||||
</children>
|
||||
<VBox.margin>
|
||||
<Insets left="50.0" top="20.0" />
|
||||
</VBox.margin>
|
||||
</VBox>
|
||||
<Button fx:id="submitButton" mnemonicParsing="false" onAction="#handleSubmitButtonAction" prefHeight="40.0" prefWidth="150.0" text="提交答案">
|
||||
<VBox.margin>
|
||||
<Insets top="30.0" />
|
||||
</VBox.margin>
|
||||
</Button>
|
||||
<Label fx:id="statusLabel" textFill="RED" />
|
||||
</children>
|
||||
</VBox>
|
||||
@ -0,0 +1,40 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.PasswordField?>
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.layout.HBox?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="450.0" spacing="15.0" style="-fx-background-color: #f4f4f4;" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.mathgenerator.controller.RegisterController">
|
||||
<children>
|
||||
<Label text="新用户注册">
|
||||
<font>
|
||||
<Font name="System Bold" size="24.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<TextField fx:id="usernameField" maxWidth="300.0" promptText="用户名" />
|
||||
<TextField fx:id="emailField" maxWidth="300.0" promptText="邮箱地址" />
|
||||
<HBox alignment="CENTER" maxWidth="300.0" spacing="10.0">
|
||||
<children>
|
||||
<TextField fx:id="verificationCodeField" promptText="邮箱验证码" HBox.hgrow="ALWAYS" />
|
||||
<Button fx:id="sendCodeButton" mnemonicParsing="false" onAction="#handleSendCodeAction" text="发送验证码" />
|
||||
</children>
|
||||
</HBox>
|
||||
<PasswordField fx:id="passwordField" maxWidth="300.0" promptText="设置密码 (6-10位, 含大小写字母和数字)" />
|
||||
<PasswordField fx:id="confirmPasswordField" maxWidth="300.0" promptText="确认密码" />
|
||||
<Button fx:id="registerButton" mnemonicParsing="false" onAction="#handleRegisterAction" prefWidth="120.0" text="确认注册" />
|
||||
<Button fx:id="backToLoginButton" mnemonicParsing="false" onAction="#handleBackToLoginAction" style="-fx-background-color: #6c757d;" text="返回登录" textFill="WHITE" />
|
||||
<Label fx:id="statusLabel" textFill="RED" wrapText="true">
|
||||
<VBox.margin>
|
||||
<Insets top="10.0" />
|
||||
</VBox.margin>
|
||||
</Label>
|
||||
</children>
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
</VBox>
|
||||
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.geometry.Insets?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.VBox?>
|
||||
<?import javafx.scene.text.Font?>
|
||||
|
||||
<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="500.0" spacing="25.0" style="-fx-background-color: #f4f4f4;" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.mathgenerator.controller.ScoreController">
|
||||
<padding>
|
||||
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
|
||||
</padding>
|
||||
<children>
|
||||
<Label text="答题完成!">
|
||||
<font>
|
||||
<Font name="System Bold" size="36.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<VBox alignment="CENTER" spacing="10.0">
|
||||
<children>
|
||||
<Label text="您的最终得分是:">
|
||||
<font>
|
||||
<Font size="18.0" />
|
||||
</font>
|
||||
</Label>
|
||||
<Label fx:id="scoreLabel" text="100.00" textFill="#007bff">
|
||||
<font>
|
||||
<Font name="System Bold" size="64.0" />
|
||||
</font>
|
||||
</Label>
|
||||
</children>
|
||||
</VBox>
|
||||
<Label fx:id="resultMessageLabel" text="太棒了!你答对了所有题目!" />
|
||||
<VBox alignment="CENTER" spacing="15.0">
|
||||
<VBox.margin>
|
||||
<Insets top="20.0" />
|
||||
</VBox.margin>
|
||||
<children>
|
||||
<Button fx:id="tryAgainButton" mnemonicParsing="false" onAction="#handleTryAgainAction" prefWidth="150.0" text="再做一组" />
|
||||
<Button fx:id="logoutButton" mnemonicParsing="false" onAction="#handleLogoutAction" style="-fx-background-color: #6c757d;" text="退出登录" textFill="WHITE" />
|
||||
</children>
|
||||
</VBox>
|
||||
</children>
|
||||
</VBox>
|
||||
Loading…
Reference in new issue