有完整源代码,附上数据库部分代码参考:
CREATE TABLE [dbo].[JudgeProblem](
[ID] [int] IDENTITY(1,1) NOT NULL,
[CourseID] [int] NOT NULL,
[Title] [varchar](1000) NOT NULL,
[Answer] [bit] NOT NULL,
CONSTRAINT [PK_JudgeProblem] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[MultiProblem](
[ID] [int] IDENTITY(1,1) NOT NULL,
[CourseID] [int] NOT NULL,
[Title] [varchar](1000) NOT NULL,
[AnswerA] [varchar](500) NOT NULL,
[AnswerB] [varchar](500) NOT NULL,
[AnswerC] [varchar](500) NOT NULL,
[AnswerD] [varchar](500) NOT NULL,
[Answer] [varchar](50) NOT NULL,
CONSTRAINT [PK_MultiProblem] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[Student](
[ID] [varchar](50) NOT NULL,
[Name] [varchar](20) NULL,
[PWD] [varchar](20) NULL,
[Sex] [varchar](2) NULL,
[JoinTime] [varchar](20) NULL,
[Question] [varchar](50) NULL,
[Answer] [varchar](50) NULL,
[profession] [varchar](50) NULL,
CONSTRAINT [PK_tb_Student] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[Score](
[ID] [int] IDENTITY(1,1) NOT NULL,
[UserID] [varchar](20) NOT NULL,
[PaperID] [int] NOT NULL,
[Score] [int] NOT NULL,
[ExamTime] [datetime] NOT NULL CONSTRAINT [DF_Score_ExamTime] DEFAULT (getdate()),
CONSTRAINT [PK_Score] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE TABLE [dbo].[Course](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [varchar](200) NOT NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
温馨提示:答案为网友推荐,仅供参考