Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
门心叼龙
itstack-demo-design
提交
1b283e61
I
itstack-demo-design
项目概览
门心叼龙
/
itstack-demo-design
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
itstack-demo-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
1b283e61
编写于
7月 15, 2020
作者:
小傅哥
⛹
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小傅哥 | 代码更新
上级
c8a66506
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
1 addition
and
115 deletion
+1
-115
itstack-demo-desgin-4-01/pom.xml
itstack-demo-desgin-4-01/pom.xml
+0
-15
itstack-demo-desgin-4-01/src/main/java/org/itstack/demo/design/QuestionBankController.java
.../java/org/itstack/demo/design/QuestionBankController.java
+0
-82
itstack-demo-desgin-4-01/src/test/java/org/itstack/demo/desgin/test/ApiTest.java
...1/src/test/java/org/itstack/demo/desgin/test/ApiTest.java
+0
-16
pom.xml
pom.xml
+1
-2
未找到文件。
itstack-demo-desgin-4-01/pom.xml
已删除
100644 → 0
浏览文件 @
c8a66506
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
itstack-demo-design
</artifactId>
<groupId>
org.itstack
</groupId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
itstack-demo-desgin-4-01
</artifactId>
</project>
\ No newline at end of file
itstack-demo-desgin-4-01/src/main/java/org/itstack/demo/design/QuestionBankController.java
已删除
100755 → 0
浏览文件 @
c8a66506
package
org.itstack.demo.design
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
QuestionBankController
{
public
String
createPaper
(
String
candidate
,
String
number
)
{
List
<
ChoiceQuestion
>
choiceQuestionList
=
new
ArrayList
<
ChoiceQuestion
>();
List
<
AnswerQuestion
>
answerQuestionList
=
new
ArrayList
<
AnswerQuestion
>();
Map
<
String
,
String
>
map01
=
new
HashMap
<
String
,
String
>();
map01
.
put
(
"A"
,
"JAVA2 EE"
);
map01
.
put
(
"B"
,
"JAVA2 Card"
);
map01
.
put
(
"C"
,
"JAVA2 ME"
);
map01
.
put
(
"D"
,
"JAVA2 HE"
);
map01
.
put
(
"E"
,
"JAVA2 SE"
);
Map
<
String
,
String
>
map02
=
new
HashMap
<
String
,
String
>();
map02
.
put
(
"A"
,
"JAVA程序的main方法必须写在类里面"
);
map02
.
put
(
"B"
,
"JAVA程序中可以有多个main方法"
);
map02
.
put
(
"C"
,
"JAVA程序中类名必须与文件名一样"
);
map02
.
put
(
"D"
,
"JAVA程序的main方法中如果只有一条语句,可以不用{}(大括号)括起来"
);
Map
<
String
,
String
>
map03
=
new
HashMap
<
String
,
String
>();
map03
.
put
(
"A"
,
"变量由字母、下划线、数字、$符号随意组成;"
);
map03
.
put
(
"B"
,
"变量不能以数字作为开头;"
);
map03
.
put
(
"C"
,
"A和a在java中是同一个变量;"
);
map03
.
put
(
"D"
,
"不同类型的变量,可以起相同的名字;"
);
Map
<
String
,
String
>
map04
=
new
HashMap
<
String
,
String
>();
map04
.
put
(
"A"
,
"STRING"
);
map04
.
put
(
"B"
,
"x3x;"
);
map04
.
put
(
"C"
,
"void"
);
map04
.
put
(
"D"
,
"de$f"
);
Map
<
String
,
String
>
map05
=
new
HashMap
<
String
,
String
>();
map05
.
put
(
"A"
,
"31"
);
map05
.
put
(
"B"
,
"0"
);
map05
.
put
(
"C"
,
"1"
);
map05
.
put
(
"D"
,
"2"
);
choiceQuestionList
.
add
(
new
ChoiceQuestion
(
"JAVA所定义的版本中不包括"
,
map01
,
"D"
));
choiceQuestionList
.
add
(
new
ChoiceQuestion
(
"下列说法正确的是"
,
map02
,
"A"
));
choiceQuestionList
.
add
(
new
ChoiceQuestion
(
"变量命名规范说法正确的是"
,
map03
,
"B"
));
choiceQuestionList
.
add
(
new
ChoiceQuestion
(
"以下()不是合法的标识符"
,
map04
,
"C"
));
choiceQuestionList
.
add
(
new
ChoiceQuestion
(
"表达式(11+3*8)/4%3的值是"
,
map05
,
"D"
));
answerQuestionList
.
add
(
new
AnswerQuestion
(
"小红马和小黑马生的小马几条腿"
,
"4条腿"
));
answerQuestionList
.
add
(
new
AnswerQuestion
(
"铁棒打头疼还是木棒打头疼"
,
"头最疼"
));
answerQuestionList
.
add
(
new
AnswerQuestion
(
"什么床不能睡觉"
,
"牙床"
));
answerQuestionList
.
add
(
new
AnswerQuestion
(
"为什么好马不吃回头草"
,
"后面的草没了"
));
// 输出结果
StringBuilder
detail
=
new
StringBuilder
(
"考生:"
+
candidate
+
"\r\n"
+
"考号:"
+
number
+
"\r\n"
+
"--------------------------------------------\r\n"
+
"一、选择题"
+
"\r\n\n"
);
for
(
int
idx
=
0
;
idx
<
choiceQuestionList
.
size
();
idx
++)
{
detail
.
append
(
"第"
).
append
(
idx
+
1
).
append
(
"题:"
).
append
(
choiceQuestionList
.
get
(
idx
).
getName
()).
append
(
"\r\n"
);
Map
<
String
,
String
>
option
=
choiceQuestionList
.
get
(
idx
).
getOption
();
for
(
String
key
:
option
.
keySet
())
{
detail
.
append
(
key
).
append
(
":"
).
append
(
option
.
get
(
key
)).
append
(
"\r\n"
);
;
}
detail
.
append
(
"答案:"
).
append
(
choiceQuestionList
.
get
(
idx
).
getKey
()).
append
(
"\r\n\n"
);
}
detail
.
append
(
"二、问答题"
+
"\r\n\n"
);
for
(
int
idx
=
0
;
idx
<
answerQuestionList
.
size
();
idx
++)
{
detail
.
append
(
"第"
).
append
(
idx
+
1
).
append
(
"题:"
).
append
(
answerQuestionList
.
get
(
idx
).
getName
()).
append
(
"\r\n"
);
detail
.
append
(
"答案:"
).
append
(
answerQuestionList
.
get
(
idx
).
getKey
()).
append
(
"\r\n\n"
);
}
return
detail
.
toString
();
}
}
itstack-demo-desgin-4-01/src/test/java/org/itstack/demo/desgin/test/ApiTest.java
已删除
100755 → 0
浏览文件 @
c8a66506
package
org.itstack.demo.desgin.test
;
import
org.itstack.demo.design.QuestionBankController
;
import
org.junit.Test
;
public
class
ApiTest
{
@Test
public
void
test_QuestionBankController
()
{
QuestionBankController
questionBankController
=
new
QuestionBankController
();
System
.
out
.
println
(
questionBankController
.
createPaper
(
"花花"
,
"1000001921032"
));
System
.
out
.
println
(
questionBankController
.
createPaper
(
"豆豆"
,
"1000001921051"
));
System
.
out
.
println
(
questionBankController
.
createPaper
(
"大宝"
,
"1000001921987"
));
}
}
pom.xml
浏览文件 @
1b283e61
...
...
@@ -19,7 +19,7 @@
<module>
itstack-demo-design-3-01
</module>
<module>
itstack-demo-design-3-02
</module>
<module>
itstack-demo-design-4-00
</module>
<module>
itstack-demo-des
gi
n-4-01
</module>
<module>
itstack-demo-des
ig
n-4-01
</module>
<module>
itstack-demo-design-4-02
</module>
<module>
itstack-demo-design-5-00
</module>
<module>
itstack-demo-design-6-00
</module>
...
...
@@ -58,7 +58,6 @@
<module>
itstack-demo-design-20-02
</module>
<module>
itstack-demo-design-21-00
</module>
<module>
itstack-demo-design-22-00
</module>
<module>
itstack-demo-design-4-01
</module>
</modules>
<dependencies>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录