<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>

<VBox prefHeight="355.0" prefWidth="648.0" spacing="10" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.zhangmeng.online.exam.ui.controller.PaperEditController">
    <padding>
        <Insets bottom="10" left="10" right="10" top="10" />
    </padding>

    <GridPane hgap="10" vgap="10">
        <columnConstraints>
            <ColumnConstraints minWidth="80" prefWidth="100" />
            <ColumnConstraints hgrow="ALWAYS" />
        </columnConstraints>

        <!-- 试卷名称 -->
        <Label text="试卷名称:" GridPane.columnIndex="0" GridPane.rowIndex="0" />
        <TextField fx:id="nameField" GridPane.columnIndex="1" GridPane.rowIndex="0" />

        <!-- 试卷描述 -->
        <Label text="试卷描述:" GridPane.columnIndex="0" GridPane.rowIndex="1" />
        <TextArea fx:id="descriptionTextArea" prefHeight="70.0" prefWidth="518.0" GridPane.columnIndex="1" GridPane.rowIndex="1" />

        <!-- 总分 -->
        <Label text="总分:" GridPane.columnIndex="0" GridPane.rowIndex="2" />
        <TextField fx:id="scoreField" GridPane.columnIndex="1" GridPane.rowIndex="2" />

        <!-- 及格分数 -->
        <Label text="及格分数:" GridPane.columnIndex="0" GridPane.rowIndex="3" />
        <TextField fx:id="passScoreField" GridPane.columnIndex="1" GridPane.rowIndex="3" />

        <!-- 考试时间 -->
        <Label text="考试时间:" GridPane.columnIndex="0" GridPane.rowIndex="4" />
        <TextField fx:id="examTimeField" GridPane.columnIndex="1" GridPane.rowIndex="4" />

        <!-- 试卷状态 -->
        <Label text="状态:" GridPane.columnIndex="0" GridPane.rowIndex="5" />
        <ComboBox fx:id="statusComboBox" GridPane.columnIndex="1" GridPane.rowIndex="5" />

        <!-- 所属科目 -->
        <Label text="所属科目:" GridPane.columnIndex="0" GridPane.rowIndex="6" />
        <ComboBox fx:id="subjectBox" GridPane.columnIndex="1" GridPane.rowIndex="6" />

      <rowConstraints>
         <RowConstraints />
         <RowConstraints />
         <RowConstraints />
         <RowConstraints />
         <RowConstraints minHeight="10.0" prefHeight="30.0" />
         <RowConstraints />
         <RowConstraints />
      </rowConstraints>
    </GridPane>

    <HBox alignment="CENTER_RIGHT" spacing="10">
        <Button defaultButton="true" onAction="#handleSave" text="保存" />
        <Button cancelButton="true" onAction="#handleCancel" text="取消" />
    </HBox>
</VBox>
