diff --git a/Android-Student-Course-Selection-System b/Android-Student-Course-Selection-System
deleted file mode 160000
index 4f78403..0000000
--- a/Android-Student-Course-Selection-System
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 4f78403179f5d5659054cd4ba702fdf6d30d2123
diff --git a/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/创建和精化用例模型.docx b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/创建和精化用例模型.docx
new file mode 100644
index 0000000..7a81826
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/创建和精化用例模型.docx differ
diff --git a/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/构思和分析应用问题.docx b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/构思和分析应用问题.docx
new file mode 100644
index 0000000..59efc35
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/构思和分析应用问题.docx differ
diff --git a/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/构思和导出软件需求.docx b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/构思和导出软件需求.docx
new file mode 100644
index 0000000..b52168b
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/构思和导出软件需求.docx differ
diff --git a/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/课表推荐用例模型.pdf b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/课表推荐用例模型.pdf
new file mode 100644
index 0000000..9d620ef
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/课表推荐用例模型.pdf differ
diff --git a/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/选修课系统用例分析.docx b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/选修课系统用例分析.docx
new file mode 100644
index 0000000..a5c3f6f
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/1.软件需求获取与构思/选修课系统用例分析.docx differ
diff --git a/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/课程推荐用例交互图.pdf b/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/课程推荐用例交互图.pdf
new file mode 100644
index 0000000..261b189
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/课程推荐用例交互图.pdf differ
diff --git a/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/课程推荐类图.pdf b/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/课程推荐类图.pdf
new file mode 100644
index 0000000..799eb56
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/课程推荐类图.pdf differ
diff --git a/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/软件需求建模与分析.docx b/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/软件需求建模与分析.docx
new file mode 100644
index 0000000..f55d33a
Binary files /dev/null and b/detailed documents and figures/RequirementAnalysis/2.软件需求建模与分析/软件需求建模与分析.docx differ
diff --git a/World of our own 软件需求规格说明书--选修课选课系统.docx b/detailed documents and figures/RequirementAnalysis/World of our own 软件需求规格说明书--选修课选课系统.docx
similarity index 100%
rename from World of our own 软件需求规格说明书--选修课选课系统.docx
rename to detailed documents and figures/RequirementAnalysis/World of our own 软件需求规格说明书--选修课选课系统.docx
diff --git a/选修课选课系统说明.docx b/detailed documents and figures/RequirementAnalysis/选修课选课系统说明.docx
similarity index 100%
rename from 选修课选课系统说明.docx
rename to detailed documents and figures/RequirementAnalysis/选修课选课系统说明.docx
diff --git a/软件设计规格说明书-选修课选课系统.doc b/detailed documents and figures/Software_design_and_modeling/软件设计规格说明书-选修课选课系统.doc
similarity index 100%
rename from 软件设计规格说明书-选修课选课系统.doc
rename to detailed documents and figures/Software_design_and_modeling/软件设计规格说明书-选修课选课系统.doc
diff --git a/detailed documents and figures/Software_design_and_modeling/选修课选课系统-界面顺序图.png b/detailed documents and figures/Software_design_and_modeling/选修课选课系统-界面顺序图.png
new file mode 100644
index 0000000..bfa3187
Binary files /dev/null and b/detailed documents and figures/Software_design_and_modeling/选修课选课系统-界面顺序图.png differ
diff --git a/detailed documents and figures/Software_design_and_modeling/选修课选课系统-类图.jpg b/detailed documents and figures/Software_design_and_modeling/选修课选课系统-类图.jpg
new file mode 100644
index 0000000..ec5e3a1
Binary files /dev/null and b/detailed documents and figures/Software_design_and_modeling/选修课选课系统-类图.jpg differ
diff --git a/source_code/SoftEngineering_selectiveCourse/.gitignore b/source_code/SoftEngineering_selectiveCourse/.gitignore
new file mode 100644
index 0000000..ebdd23d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.gitignore
@@ -0,0 +1,14 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/codeStyles/Project.xml b/source_code/SoftEngineering_selectiveCourse/.idea/codeStyles/Project.xml
new file mode 100644
index 0000000..7fb7384
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/codeStyles/Project.xml
@@ -0,0 +1,164 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ xmlns:android
+
+ ^$
+
+
+
+
+
+
+
+
+ xmlns:.*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*:id
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ .*:name
+
+ http://schemas.android.com/apk/res/android
+
+
+
+
+
+
+
+
+ name
+
+ ^$
+
+
+
+
+
+
+
+
+ style
+
+ ^$
+
+
+
+
+
+
+
+
+ .*
+
+ ^$
+
+
+ BY_NAME
+
+
+
+
+
+
+ .*
+
+ http://schemas.android.com/apk/res/android
+
+
+ ANDROID_ATTRIBUTE_ORDER
+
+
+
+
+
+
+ .*
+
+ .*
+
+
+ BY_NAME
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/dbnavigator.xml b/source_code/SoftEngineering_selectiveCourse/.idea/dbnavigator.xml
new file mode 100644
index 0000000..1ca4006
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/dbnavigator.xml
@@ -0,0 +1,461 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/gradle.xml b/source_code/SoftEngineering_selectiveCourse/.idea/gradle.xml
new file mode 100644
index 0000000..8708f9d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/gradle.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/jarRepositories.xml b/source_code/SoftEngineering_selectiveCourse/.idea/jarRepositories.xml
new file mode 100644
index 0000000..17c8136
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/jarRepositories.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/misc.xml b/source_code/SoftEngineering_selectiveCourse/.idea/misc.xml
new file mode 100644
index 0000000..f797995
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/misc.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/runConfigurations.xml b/source_code/SoftEngineering_selectiveCourse/.idea/runConfigurations.xml
new file mode 100644
index 0000000..9b770a6
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml b/source_code/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml
new file mode 100644
index 0000000..33ee760
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml
@@ -0,0 +1,154 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarSettings.xml b/source_code/SoftEngineering_selectiveCourse/.idea/sonarSettings.xml
new file mode 100644
index 0000000..1466328
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarSettings.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/0/a/0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480 b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/0/a/0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480
new file mode 100644
index 0000000..51165d7
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/0/a/0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480
@@ -0,0 +1,19 @@
+
+
+java:S13198"pThe return type of this method should be an interface such as "List" rather than the implementation "ArrayList".(М
+
+java:S1319$"pThe return type of this method should be an interface such as "List" rather than the implementation "ArrayList".(預
+x java:S116"^Rename this field "NumOfCourseSelected" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+q java:S116"\Rename this field "NumOfCourseNeeded" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ᒤ
+t
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(
+w java:S116"]Rename this field "brief_introduction" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+f java:S117a"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ȏ
+t
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(ߥ
+h java:S100M"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ð
+c java:S100a"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ȏ
+
+java:S1319U"sThe type of the "comments" object should be an interface such as "List" rather than the implementation "ArrayList".(Ҩ
+
+java:S1319v"sThe type of the "selected" object should be an interface such as "List" rather than the implementation "ArrayList".(â
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/3/1/312e7b7c35c2dc14d5deccaa212fd733c0443a84 b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/3/1/312e7b7c35c2dc14d5deccaa212fd733c0443a84
new file mode 100644
index 0000000..dab2212
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/3/1/312e7b7c35c2dc14d5deccaa212fd733c0443a84
@@ -0,0 +1,43 @@
+
+c java:S100s"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+| java:S116"bRename this field "humanity_class_NotTaken" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Օ
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+
+java:S1319"pThe return type of this method should be an interface such as "List" rather than the implementation "ArrayList".(預
+k java:S117o"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+f java:S117w"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+
+java:S1319s"zThe type of the "course_selected" object should be an interface such as "List" rather than the implementation "ArrayList".(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ř
+f java:S117s"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+o
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(Ѡ
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+h java:S100{"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Φ
+| java:S116"bRename this field "military_class_NotTaken" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+i java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+t
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(Ә
+
+java:S1319"pThe return type of this method should be an interface such as "List" rather than the implementation "ArrayList".(
+
+java:S1319"pThe return type of this method should be an interface such as "List" rather than the implementation "ArrayList".(
+l java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ř
+ java:S116"hRename this field "naturalScience_class_NotTaken" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+c java:S100w"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+} java:S116"cRename this field "political_class_NotTaken" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+t
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(
+h java:S100o"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+d java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+f java:S117"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+c java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
+
+java:S1319k"sThe type of the "comments" object should be an interface such as "List" rather than the implementation "ArrayList".(
+o java:S116"ZRename this field "course_selected" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ѡ
+k java:S117{"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Φ
+v java:S116"\Rename this field "completed_courses" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ә
+
+java:S1319o"|The type of the "completed_courses" object should be an interface such as "List" rather than the implementation "ArrayList".(
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/5926027da99b6a336fecb3ba9ba36f5fbcf1c959 b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/5926027da99b6a336fecb3ba9ba36f5fbcf1c959
new file mode 100644
index 0000000..263f7e0
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/5926027da99b6a336fecb3ba9ba36f5fbcf1c959
@@ -0,0 +1,30 @@
+
+h
+java:S1450$"RRemove the "add" field and declare it as a local variable in the relevant methods.(
+W
+java:S1128":Remove this unused import 'android.content.ContentValues'.(咵8͌.
+I
+java:S1905")Remove this unnecessary cast to "String".(˃8.
+t
+java:S2293D"YReplace the type specification in this constructor call with the diamond operator ("<>").(Ծ
+b java:S101"MRename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.(
+u
+java:S1450,"SRemove the "item" field and declare it as a local variable in the relevant methods.(8.
+w
+java:S1450-"ZRemove the "listAdapter" field and declare it as a local variable in the relevant methods.(ϔ8.
+w
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(ҝ8.
+n
+java:S1450'"SRemove the "User" field and declare it as a local variable in the relevant methods.(ͱ
+p
+java:S1450#"URemove the "select" field and declare it as a local variable in the relevant methods.(
+d
+java:S1192"FDefine a constant instead of duplicating this literal "cname" 3 times.(8.
+i java:S116'"ORename this field "User" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ͱ
+D
+java:S1905")Remove this unnecessary cast to "String".(8.
+Q java:S110"").(ҝ8.
+h
+java:S1192t"FDefine a constant instead of duplicating this literal "cname" 7 times.(8ٔ.
+^ java:S125"").(ҝ8.
+V java:S110"").(Ծ8ą.
+w
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(ҝ8.
+
+java:S1192<"nDefine a constant instead of duplicating this literal "发生未知错误,显示详细信息失败" 3 times.(8.
+a
+java:S1854">Remove this useless assignment to local variable "updateUser".(͵8惔.
+R
+java:S1481"/Remove this unused "updateUser" local variable.(͵8惔.
+w
+java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(ҝ8.
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/8/c/8c55c3ccc257e5907959013f99656e4c8ec3903e b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/8/c/8c55c3ccc257e5907959013f99656e4c8ec3903e
new file mode 100644
index 0000000..e69de29
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/9/0/90b87721d50a394070e56f8cf6c0f808c0ffa791 b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/9/0/90b87721d50a394070e56f8cf6c0f808c0ffa791
new file mode 100644
index 0000000..544516e
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/9/0/90b87721d50a394070e56f8cf6c0f808c0ffa791
@@ -0,0 +1,2 @@
+
+V java:S110"").(ҝ8.
+
+java:S1450"rRemove the "TextViewUserCreditNotTaken_Humanity" field and declare it as a local variable in the relevant methods.(8.
+u
+java:S1450&"SRemove the "item" field and declare it as a local variable in the relevant methods.(8.
+ java:S116"oRename this field "TextViewUserCreditNotTaken_Political" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ݧ8.
+
+java:S1450"pRemove the "TextViewUserCreditNotTaken_Nature" field and declare it as a local variable in the relevant methods.(8.
+z
+java:S1450"]Remove the "TextViewUserID" field and declare it as a local variable in the relevant methods.(ؔ8.
+
+java:S1450"sRemove the "TextViewUserCreditNotTaken_Political" field and declare it as a local variable in the relevant methods.(ݧ8.
+V java:S110"
+java:S1068)"(Remove this unused "btn1" private field.(
+G
+java:S1128",Remove this unused import 'android.net.Uri'.(
+S
+java:S1128
+">Remove this unused import 'android.content.SharedPreferences'.(r
+S
+java:S1128"8Remove this unused import 'android.content.ContentUris'.(Ź
+?
+java:S1128")Remove this unused import 'java.io.File'.(Х
+n
+java:S1450("SRemove the "back" field and declare it as a local variable in the relevant methods.(
+K
+java:S1128"0Remove this unused import 'java.io.IOException'.(
+Q java:S110""
+java:S1068)"(Remove this unused "btn2" private field.(
+8
+java:S1659)""Declare "btn2" on a separate line.(
+Y
+java:S1128">Remove this unused import 'android.content.pm.PackageManager'.(
+P
+java:S1854M":Remove this useless assignment to local variable "values".(ϱ
+^
+java:S1128
"CRemove this unused import 'android.database.sqlite.SQLiteDatabase'.(
+k java:S117N"QRename this local variable to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/7/b786dc55a2bfe8b15ba666f050505789b29d48ba b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/7/b786dc55a2bfe8b15ba666f050505789b29d48ba
new file mode 100644
index 0000000..57131db
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/7/b786dc55a2bfe8b15ba666f050505789b29d48ba
@@ -0,0 +1,23 @@
+
+c
+java:S1192u"FDefine a constant instead of duplicating this literal "uname" 3 times.(8ϻ.
+X java:S110"").(ҝ8.
+i java:S101"MRename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.(ڌ8搡.
+{
+java:S22939"YReplace the type specification in this constructor call with the diamond operator ("<>").(Ծ8搡.
+w
+java:S1450"URemove the "select" field and declare it as a local variable in the relevant methods.(8搡.
+o
+java:S1450"RRemove the "add" field and declare it as a local variable in the relevant methods.(8搡.
+E
+java:S1905")Remove this unnecessary cast to "String".(o8.
+E
+java:S1905~")Remove this unnecessary cast to "String".(^8.
+u
+java:S1450$"SRemove the "item" field and declare it as a local variable in the relevant methods.(8.
+K
+java:S1905}")Remove this unnecessary cast to "String".(8.
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb
new file mode 100644
index 0000000..b14126a
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb
@@ -0,0 +1,23 @@
+
+P
+ app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
+
+Papp/src/main/java/com/example/softengineering_selectivecourse/LoginActivity.java,7\7\77becc57a2ca9e703b8e6cbda6b052b6473df28b
+w
+Gapp/src/main/java/com/example/softengineering_selectivecourse/User.java,3\1\312e7b7c35c2dc14d5deccaa212fd733c0443a84
+
+Wapp/src/main/java/com/example/softengineering_selectivecourse/User_ManagerActivity.java,b\7\b786dc55a2bfe8b15ba666f050505789b29d48ba
+
+\app/src/main/java/com/example/softengineering_selectivecourse/PersonalBasicInfoActivity.java,b\5\b5fc2407afc1be8c213f2b4c313bad593688c0e2
+
+Sapp/src/main/java/com/example/softengineering_selectivecourse/RegisterActivity.java,b\6\b686a512c2435388bcdce171b5a75e28ac952920
+
+Yapp/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java,5\9\5926027da99b6a336fecb3ba9ba36f5fbcf1c959
+
+\app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java,8\4\84d1e3e0533b35b01f34b2bc6c4a5cabc3b9eded
+y
+Iapp/src/main/java/com/example/softengineering_selectivecourse/Course.java,0\a\0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480
+
+Zapp/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java,5\9\597998839ff8e48a7e7ea9cd947efb862a54fffb
+
+Zapp/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java,9\0\90b87721d50a394070e56f8cf6c0f808c0ffa791
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/.gitignore b/source_code/SoftEngineering_selectiveCourse/app/.gitignore
new file mode 100644
index 0000000..42afabf
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/.gitignore
@@ -0,0 +1 @@
+/build
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/build.gradle b/source_code/SoftEngineering_selectiveCourse/app/build.gradle
new file mode 100644
index 0000000..64e9e9c
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/build.gradle
@@ -0,0 +1,40 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 30
+ buildToolsVersion "30.0.2"
+
+ defaultConfig {
+ applicationId "com.example.softengineering_selectivecourse"
+ minSdkVersion 14
+ targetSdkVersion 30
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ implementation fileTree(dir: "libs", include: ["*.jar"])
+ implementation 'androidx.appcompat:appcompat:1.2.0'
+ implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
+ implementation 'com.google.android.material:material:1.0.0'
+ implementation 'androidx.annotation:annotation:1.1.0'
+ implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.2'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
+ implementation 'org.litepal.android:core:1.5.1'
+ //noinspection GradleCompatible
+ implementation 'com.android.support:appcompat-v7:27.0.1'
+
+
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/proguard-rules.pro b/source_code/SoftEngineering_selectiveCourse/app/proguard-rules.pro
new file mode 100644
index 0000000..64b4a05
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/androidTest/java/com/example/softengineering_selectivecourse/ExampleInstrumentedTest.java b/source_code/SoftEngineering_selectiveCourse/app/src/androidTest/java/com/example/softengineering_selectivecourse/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..4715ef9
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/androidTest/java/com/example/softengineering_selectivecourse/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.example.softengineering_selectivecourse;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+ assertEquals("com.example.softengineering_selectivecourse", appContext.getPackageName());
+ }
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..6a7f41b
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml
new file mode 100644
index 0000000..fcb6824
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java
new file mode 100644
index 0000000..5035bc3
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java
@@ -0,0 +1,40 @@
+package com.example.softengineering_selectivecourse;
+
+import org.litepal.crud.DataSupport;
+
+public class Comments extends DataSupport {
+ private int id;
+ private String comments;
+ private String provider;
+ private String courseName;
+ public String getComments() {
+ return comments;
+ }
+ public void setComments(String comments) {
+ this.comments = comments;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getCourseName() {
+ return courseName;
+ }
+
+ public String getProvider() {
+ return provider;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public void setProvider(String provider) {
+ this.provider = provider;
+ }
+
+ public void setCourseName(String courseName) {
+ this.courseName = courseName;
+ }
+}
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java
new file mode 100644
index 0000000..86eef17
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java
@@ -0,0 +1,126 @@
+package com.example.softengineering_selectivecourse;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+
+public class Course extends DataSupport {
+ private int id;
+
+ private String name;
+ private String teacher;
+ private String classFeature;
+ private int credit;
+ private int classtime;
+ private int classroom;
+ private int NumOfCourseSelected;
+ private int NumOfCourseNeeded;
+ private String brief_introduction;
+ private ArrayList selected = new ArrayList();
+ private ArrayList comments = new ArrayList();
+
+ public int getClassroom() {
+ return classroom;
+ }
+
+ public void setClassroom(int classroom) {
+ this.classroom = classroom;
+ }
+ // private ArrayList numOfStuSelected= new ArrayList();
+// private ArrayList Comments = new ArrayList();
+
+// public class userIdentification{
+// private int id;
+// private String name;
+// }
+ public ArrayList getComments() {
+ return comments;
+ }
+
+ public String getClassFeature() {
+ return classFeature;
+ }
+
+ public void setClassFeature(String classFeature) {
+ this.classFeature = classFeature;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public ArrayList getSelected() {
+ return selected;
+ }
+
+ public int getClasstime() {
+ return classtime;
+ }
+
+ public int getCredit() {
+ return credit;
+ }
+
+
+ public int getNumOfCourseNeeded() {
+ return NumOfCourseNeeded;
+ }
+
+ public int getNumOfCourseSelected() {
+ return NumOfCourseSelected;
+ }
+
+ public String getBrief_introduction() {
+ return brief_introduction;
+ }
+
+ public String getTeacher() {
+ return teacher;
+ }
+
+ public void setComments(ArrayList comments) {
+ this.comments = comments;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setBrief_introduction(String brief_introduction) {
+ this.brief_introduction = brief_introduction;
+ }
+
+ public void setClasstime(int classtime) {
+ this.classtime = classtime;
+ }
+
+ public void setCredit(int credit) {
+ this.credit = credit;
+ }
+
+
+ public void setNumOfCourseNeeded(int numOfCourseNeeded) {
+ NumOfCourseNeeded = numOfCourseNeeded;
+ }
+
+ public void setNumOfCourseSelected(int numOfCourseSelected) {
+ NumOfCourseSelected = numOfCourseSelected;
+ }
+
+ public void setSelected(ArrayList selected) {
+ this.selected = selected;
+ }
+
+ public void setTeacher(String teacher) {
+ this.teacher = teacher;
+ }
+
+}
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java
new file mode 100644
index 0000000..ecd17d7
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java
@@ -0,0 +1,190 @@
+package com.example.softengineering_selectivecourse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CourseBasicInfoActivity extends AppCompatActivity {
+ private TextView courseFeature;
+ private TextView courseName;
+ private TextView courseCredit;
+ private TextView courseTeacher;
+ private TextView courseMaxStudents;
+ private TextView courseClassroom;
+ private TextView courseBriefIntroduce;
+ private Button courseCommentDelete;
+ private Button courseCommentUpdate;
+ private Button courseAdd;
+ Course selCourse;
+ String userName;
+ Comments selComment;
+ private EditText courseComment;
+ private Button courseCommentAdd;
+ private ListView lv;
+
+ private ArrayList> data;//所有记录
+ private Map item; //每一条记录
+ private SimpleAdapter listAdapter; //适配器
+ View view;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_course_basic_info);
+ Intent intent = getIntent();
+ userName = intent.getStringExtra("name");
+ long courseId = intent.getLongExtra("courseId", 0);
+ List courses = DataSupport.where("id = ?", Long.toString(courseId)).find(Course.class);
+ courseFeature = (TextView) findViewById(R.id.couseDetailClassRight);
+ courseName = (TextView) findViewById(R.id.courseDetailNameRight);
+ courseCredit = (TextView) findViewById(R.id.courseDetailCreditRight);
+ courseTeacher = (TextView) findViewById(R.id.courseDetailTeacherRight);
+ courseMaxStudents = (TextView) findViewById(R.id.courseDetailStuNeededRight);
+ courseClassroom = (TextView) findViewById(R.id.courseDetailClassRoomRight);
+ courseBriefIntroduce = (TextView) findViewById(R.id.courseDetailBriefIntroduceRight);
+ courseCommentDelete = (Button) findViewById(R.id.courseDetailcommentDelete);
+ courseCommentUpdate = (Button) findViewById(R.id.courseDetailcommentUpdate);
+ courseAdd = (Button) findViewById(R.id.courseDetailAdd);
+ data = new ArrayList>();//将data实例化
+ lv = (ListView) findViewById(R.id.lvDetail);
+ if(courses.isEmpty())
+ {
+ Toast.makeText(CourseBasicInfoActivity.this, "no course for this", Toast.LENGTH_SHORT);
+ }
+ else
+ {
+ selCourse = courses.get(0);
+ courseFeature.setText(selCourse.getClassFeature());
+ courseName.setText(selCourse.getName());
+ courseCredit.setText(Integer.toString(selCourse.getCredit()));
+ courseTeacher.setText(selCourse.getTeacher());
+ courseMaxStudents.setText(Integer.toString(selCourse.getNumOfCourseNeeded()));
+ courseClassroom.setText(Integer.toString(selCourse.getClassroom()));
+ courseBriefIntroduce.setText(selCourse.getBrief_introduction());
+ dbFindAll();
+ }
+//
+ dbFindAll();
+ courseComment = (EditText) findViewById(R.id.courseDetailCommentInfo);
+ courseCommentAdd = (Button) findViewById(R.id.courseDetailComment);
+ courseCommentAdd.setEnabled(true);
+ courseCommentAdd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dbCommentAdd(courseComment.getText().toString().trim());
+ dbFindAll();
+ courseComment.setText("");
+ }
+ });
+ //鼠标点击数据,可以获取相对应的数据,存入Map中
+ lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ Map listItem = (Map)lv.getItemAtPosition(position);
+ courseComment.setText((String)listItem.get("ucommentInfo"));
+// List courses = DataSupport.where("name = ? and id = ?", inputName.getText().toString(), listItem.get("cid").toString() ).find(Course.class);
+ List commentset = DataSupport.where("id = ? and provider = ?", listItem.get("uid").toString(), listItem.get("uprovider").toString()).find(Comments.class);
+ if(commentset.isEmpty())
+ {
+ Toast.makeText(CourseBasicInfoActivity.this,"you are not the provider of the comment",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ Comments commentItem = commentset.get(0);
+ selComment = commentItem;
+ courseCommentDelete.setEnabled(true);
+ courseCommentUpdate.setEnabled(true);
+ dbFindAll();
+ }
+ }
+ });
+
+ courseCommentDelete.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dbDelete();
+ courseCommentDelete.setEnabled(false);
+ courseCommentUpdate.setEnabled(false);
+ dbFindAll();
+ }
+ });
+ courseCommentUpdate.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dbUpdate();
+ courseCommentUpdate.setEnabled(false);
+ courseCommentDelete.setEnabled(false);
+ dbFindAll();
+ }
+ });
+
+
+ }
+ private void dbDelete()
+ {
+ DataSupport.deleteAll(Comments.class, "id = ?", Long.toString(selComment.getId()) );
+ }
+ private void dbUpdate()
+ {
+ Comments comment = new Comments();
+ comment.setComments(courseComment.getText().toString().trim());
+ comment.updateAll("id = ?", Long.toString(selComment.getId()));
+ }
+ private void dbCommentAdd(String comment)
+ {
+ Comments commentForCourse = new Comments();
+ commentForCourse.setComments(comment);
+ commentForCourse.setCourseName(selCourse.getName());
+ commentForCourse.setProvider(userName);
+ commentForCourse.save();
+
+ }
+
+ private void dbFindAll() {
+ data.clear();//防止重复添加,每次清空
+ List commentset = DataSupport.where("courseName = ?", selCourse.getName()).find(Comments.class);
+ if(commentset.isEmpty())
+ {
+ Toast.makeText(CourseBasicInfoActivity.this, "comments is empty", Toast.LENGTH_SHORT).show();
+ }
+ else{
+ int num = 1;
+ for (Comments commentItem : commentset) {
+ item = new HashMap();
+ item.put("id", num);
+ item.put("uid", commentItem.getId());
+ item.put("ucommentInfo", commentItem.getComments());
+ item.put("uprovider", commentItem.getProvider());
+ data.add(item);
+ num++;
+
+ }
+ showList();
+ }
+ }
+
+ //显示所有的记录
+ public void showList () {
+ listAdapter = new SimpleAdapter(this, data,
+ R.layout.comment_sqlist,
+ new String[]{"id","uid", "ucommentInfo", "uprovider"},
+ new int[]{R.id.textCommentID1, R.id.textCommentCID1, R.id.textCommentInfo1, R.id.textCommentProvider1});
+ lv.setAdapter(listAdapter);
+ }
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java
new file mode 100644
index 0000000..fe2c803
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java
@@ -0,0 +1,289 @@
+package com.example.softengineering_selectivecourse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.litepal.crud.DataSupport;
+import org.litepal.util.DBUtility;
+import org.w3c.dom.Text;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CourseRecommendedActivity extends AppCompatActivity {
+ private TextView textClikedCourse;
+ private Button attendCourse;
+ private Button getCourseDetails;
+ private ListView lv;
+
+
+
+ private ArrayList> data;//所有记录
+ private Map item; //每一条记录
+ private SimpleAdapter listAdapter; //适配器
+ View view;
+ long selCourseId;
+ long selUserId;
+ String selUserName;
+ String selCourseName;
+ Course selCourse;
+ String courseTable = DBUtility.getTableNameByClassName(Course.class.getName());
+ String userTable = DBUtility.getTableNameByClassName(User.class.getName());
+ String commentTable = DBUtility.getTableNameByClassName(Comments.class.getName());
+// classroomTable = DBUtility.getTableNameByClassName(Classroom.class.getName());
+// studentTable = DBUtility.getTableNameByClassName(Student.class.getName());
+// teacherTable = DBUtility.getTableNameByClassName(Teacher.class.getName());
+// idcardTable = DBUtility.getTableNameByClassName(IdCard.class.getName());
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_course_recommended);
+ Intent intent = getIntent();
+ final String userName = intent.getStringExtra("name");
+ List users = DataSupport.where("name = ?", userName).find(User.class);
+
+ if (users.isEmpty())
+ {
+ Toast.makeText(CourseRecommendedActivity.this,"发生未知错误,显示详细信息失败",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ User user = users.get(0);
+ selUserId = user.getId();
+ selUserName = user.getName();
+
+ }
+
+
+
+ getCourseDetails = (Button) findViewById(R.id.buttonCourseRecommendedQueryDetail);
+ getCourseDetails.setEnabled(false);
+ getCourseDetails.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+// Intent intent = new Intent();
+// intent.putExtra("name", userName);
+// intent.putExtra("courseId", selCourseId);
+// intent.setClass(CourseRecommendedActivity.this, CourseBasicInfoActivity.class);
+// startActivity(intent);
+
+ Intent intent = new Intent();
+ intent.putExtra("name", userName);
+ intent.putExtra("courseId", selCourseId);
+ intent.setClass(CourseRecommendedActivity.this, CourseBasicInfoActivity.class);
+ startActivity(intent);
+ CourseRecommendedActivity.this.finish();
+ }
+ });
+
+ lv = (ListView) findViewById(R.id.lv5);
+ data = new ArrayList>();//将data实例化
+
+ dbFindAll(); //查询的方法//查询
+
+
+ attendCourse = (Button) findViewById(R.id.buttonCourseRecommendedSelect);
+ attendCourse.setEnabled(false);
+ attendCourse.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ CourseAdd();
+ dbFindAll();
+ textClikedCourse.setText("");
+ attendCourse.setEnabled(false);
+ Toast.makeText(CourseRecommendedActivity.this,"选课成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+ textClikedCourse = (TextView) findViewById(R.id.textCourseRecommendedClikedCourse);
+//
+ lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ Map listItem = (Map)lv.getItemAtPosition(position);
+ textClikedCourse.setText((String)listItem.get("cname"));
+ List courses = DataSupport.where("name = ? and id = ?", (String)listItem.get("cname"), listItem.get("cid").toString() ).find(Course.class);
+ if(courses.isEmpty())
+ {
+ Toast.makeText(CourseRecommendedActivity.this,"can't find the course, some wrong happened",Toast.LENGTH_SHORT).show();
+ }
+ else {
+ Course course = courses.get(0);
+ selCourse = course;
+ selCourseId = course.getId();
+ selCourseName = course.getName();
+ attendCourse.setEnabled(true);
+ getCourseDetails.setEnabled(true);
+ }
+
+ }
+ });
+ }
+ private void CourseAdd()
+ {
+ User updateUser = new User();
+ List users = DataSupport.where("id = ? and name = ?", Long.toString(selUserId), selUserName).find(User.class);
+ if (users.isEmpty())
+ {
+ Toast.makeText(CourseRecommendedActivity.this,"发生未知错误,显示详细信息失败",Toast.LENGTH_SHORT).show();
+ }
+ else {
+ User user = users.get(0);
+ user.getCourse_selected().add(selCourse);
+ if(user.save())
+ {
+ List userss = DataSupport.where("id = ? and name = ?", Long.toString(selUserId), selUserName).find(User.class);
+ User xuser = userss.get(0);
+
+ List xcourse = xuser.getCourse_selected();
+ if(xcourse.isEmpty())
+ {
+ Log.d("CourseRecommended", Integer.toString(xcourse.size()));
+ }
+ }
+ else
+ {
+ Log.d("CourseRecommended", "update lose");
+ }
+// if (selectedCourse.isEmpty())
+// {
+// Log.d("CourseRecommended", "the selectedCourse is empty");
+// }
+// else
+// {
+// User userUpdate = new User();
+// userUpdate.setCourse_selected(selectedCourse);
+//// for (Course courseHad: selectedCourse)
+//// {
+//// userUpdate.getCourse_selected().add(courseHad);
+//// }
+//// userUpdate.getCourse_selected().add(selCourse);
+//
+// userUpdate.updateAll("name = ? and id = ? ", selUserName, Long.toString(selUserId));
+// List userss = DataSupport.where("id = ? and name = ?", Long.toString(selUserId), selUserName).find(User.class);
+// User xuser = userss.get(0);
+// Log.d("CourseRecommended", xuser.getName());
+// ArrayList tt = xuser.getCourse_selected();
+// if(tt.isEmpty())
+// {
+// Log.d("CourseRecommended", "the tt is empty");
+// }
+// else
+// {
+// Log.d("CourseRecommended", tt.get(0).getName());
+// }
+// }
+ }
+ }
+ private void dbFindAll(){
+ data.clear();//防止重复添加,每次清空
+ List users = DataSupport.where("id = ? and name = ?", Long.toString(selUserId), selUserName).find(User.class);
+ if (users.isEmpty())
+ {
+ Toast.makeText(CourseRecommendedActivity.this,"发生未知错误,显示详细信息失败",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ User user = users.get(0);
+ int militaryNotTaken = user.getMilitary_class_NotTaken();
+ int natureNotTaken = user.getNaturalScience_class_NotTaken();
+ int politicalNotTaken = user.getPolitical_class_NotTaken();
+ int humanityNotTaken = user.getHumanity_class_NotTaken();
+ List courseMilitary = DataSupport.where("classFeature = ? and credit < ?", "Military", Integer.toString(militaryNotTaken)).find(Course.class);
+ List courseNature = DataSupport.where("classFeature = ? and credit < ?", "Nature", Integer.toString(natureNotTaken)).find(Course.class);
+ List coursePolitical = DataSupport.where("classFeature = ? and credit < ?", "Political", Integer.toString(politicalNotTaken)).find(Course.class);
+ List courseHumanity = DataSupport.where("classFeature = ? and credit < ?", "Humanity", Integer.toString(humanityNotTaken)).find(Course.class);
+// List recommendedCourse = ;//TO DO 没有去除已经选择的课程,这是一个重要的不足
+// ArrayList courses = user.getCourse_selected();
+ int num = 1;
+ for (Course course: courseMilitary)
+ {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+ }
+
+ for (Course course: courseNature)
+ {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+ }
+ for (Course course: coursePolitical)
+ {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+ }
+ for (Course course: courseHumanity)
+ {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+ }
+
+ }
+ showList();
+ }
+
+ //显示所有的记录
+ public void showList(){
+ listAdapter = new SimpleAdapter(this,data,
+ R.layout.sqlist,
+ new String[]{"id", "cid", "cclass", "cname", "ccredit"},
+ new int[]{R.id.textID1, R.id.textCID1, R.id.textCourseClass1, R.id.textCourseName1, R.id.textCredit1});
+ lv.setAdapter(listAdapter);
+ }
+
+
+
+
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java
new file mode 100644
index 0000000..d7b438d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java
@@ -0,0 +1,268 @@
+package com.example.softengineering_selectivecourse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class CourseSelectingActivity extends AppCompatActivity {
+ private TextView siftingCourse;
+ private Spinner spinnerclass;
+ private Spinner spinnercredit;
+ private Spinner spinnerclassroom;
+ private Spinner spinnerSift;
+ private EditText editTextTeacher;
+ private String courseFeature;
+ private String courseCredit;
+ private String courseClassroom;
+ private String courseTeacher;
+ private String courseSift = new String();
+ private Button Sifting;
+ private Button courseAdd;
+ private Button getDetail;
+
+ private ListView lv;
+
+
+ private ArrayList> data;//所有记录
+ private Map item; //每一条记录
+ private SimpleAdapter listAdapter; //适配器
+ View view;
+
+ long selId;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_course_selecting);
+ Intent intent = getIntent();
+ final String userName = intent.getStringExtra("name");
+
+ spinnerclass=(Spinner) findViewById(R.id.spinnerCourseSelectingFeature);
+ spinnercredit=(Spinner) findViewById(R.id.spinnerCourseSelectingCredit);
+ spinnerclassroom = (Spinner)findViewById(R.id.spinnerCourseSelectingClassRoom);
+ spinnerSift = (Spinner) findViewById(R.id.spinnerCourseSelectingselItem);
+ editTextTeacher = (EditText) findViewById(R.id.EditCourseSelectingTeacher);
+ siftingCourse = (TextView) findViewById(R.id.textCourseSelectingClikedCourse);
+
+ spinnerclass.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int pos, long id) {
+ String[] courseFeatureItem = getResources().getStringArray(R.array.classOrder);
+ if (pos == 0)
+ {
+ courseFeature = "";
+ }
+ else{
+ courseFeature = courseFeatureItem[pos];
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+ spinnercredit.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int pos, long id) {
+ String[] courseCreditItem = getResources().getStringArray(R.array.classCredit);
+ if (pos == 0)
+ {
+ courseCredit = "";
+ }
+ else{
+ courseCredit = courseCreditItem[pos];
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+ spinnerclassroom.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int pos, long id) {
+ String[] courseClassroomItem = getResources().getStringArray(R.array.classClassroom);
+ if (pos == 0)
+ {
+ courseFeature = "";
+ }
+ else{
+ courseFeature = courseClassroomItem[pos];
+ }
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+ spinnerSift.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+ @Override
+ public void onItemSelected(AdapterView> parent, View view, int pos, long id) {
+ String[] courseSifts = getResources().getStringArray(R.array.classSift);
+ courseSift = courseSifts[pos];
+ }
+
+ @Override
+ public void onNothingSelected(AdapterView> parent) {
+ }
+ });
+ courseTeacher = editTextTeacher.getText().toString();
+ Sifting = (Button) findViewById(R.id.buttonCourseSelectingSifting);
+ Sifting.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ dbFindAll();
+ }
+ });
+
+ courseAdd = (Button) findViewById(R.id.buttonCourseSelectSelect);
+ courseAdd.setEnabled(false);
+ courseAdd.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ CourseAdd();
+ dbFindAll();
+ siftingCourse.setText("");
+ courseAdd.setEnabled(false);
+ Toast.makeText(CourseSelectingActivity.this,"选课成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+ getDetail = (Button) findViewById(R.id.buttonCourseSelectingQueryDetail);
+ getDetail.setEnabled(false);
+ getDetail.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent();
+ intent.putExtra("name", userName);
+ intent.putExtra("courseId", selId);
+ intent.setClass(CourseSelectingActivity.this, CourseBasicInfoActivity.class);
+ startActivity(intent);
+ CourseSelectingActivity.this.finish();
+ }
+ });
+
+
+ lv = (ListView) findViewById(R.id.lv6);
+ data = new ArrayList>();//将data实例化
+
+ dbFindAll(); //查询的方法//查询
+
+ //鼠标点击数据,可以获取相对应的数据,存入Map中
+ lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ Map listItem = (Map)lv.getItemAtPosition(position);
+ siftingCourse.setText((String)listItem.get("cname"));
+ List courses = DataSupport.where("name = ? and id = ?", siftingCourse.getText().toString(), listItem.get("cid").toString() ).find(Course.class);
+ if(courses.isEmpty())
+ {
+ Toast.makeText(CourseSelectingActivity.this,"can't find the course, some wrong happened",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ Course course = courses.get(0);
+ selId = course.getId();
+ siftingCourse.setText((String)course.getName());
+ courseAdd.setEnabled(true);
+ getDetail.setEnabled(true);
+ }
+
+
+ }
+ });
+ }
+
+
+
+ private void CourseAdd()
+ {
+
+ }
+ private void dbFindAll () {
+ data.clear();//防止重复添加,每次清空
+ List courses;
+ if (courseSift.equals("classFeature") && !courseFeature.isEmpty())
+ {
+ courses = DataSupport.where(courseSift + "= ?", courseFeature).find(Course.class);
+ Toast.makeText(CourseSelectingActivity.this, courseSift+" with " + courseFeature, Toast.LENGTH_SHORT).show();
+ }
+ else if (courseSift.equals("credit") && !courseCredit.isEmpty())
+ {
+
+ courses = DataSupport.where(courseSift + "= ?", courseCredit).find(Course.class);
+ Toast.makeText(CourseSelectingActivity.this, courseSift+" with " + courseCredit, Toast.LENGTH_SHORT).show();
+
+ }
+ else if (courseSift.equals("classroom") && !courseClassroom.isEmpty())
+ {
+ courses = DataSupport.where(courseSift + "= ?", courseClassroom).find(Course.class);
+ Toast.makeText(CourseSelectingActivity.this, courseSift+" with " + courseClassroom, Toast.LENGTH_SHORT).show();
+
+ }
+ else if(courseSift.equals("teacher") && !courseTeacher.isEmpty())
+ {
+
+ courses = DataSupport.where(courseSift + "= ?", courseTeacher).find(Course.class);
+ Toast.makeText(CourseSelectingActivity.this, courseSift+" with " +courseTeacher, Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ courses = DataSupport.findAll(Course.class);
+ Toast.makeText(CourseSelectingActivity.this, "without Sifting", Toast.LENGTH_SHORT).show();
+ }
+
+ if(courses.isEmpty())
+ {
+ Toast.makeText(CourseSelectingActivity.this, "No course satisfy the sifting item", Toast.LENGTH_SHORT).show();
+ }
+ else {
+ int num = 1;
+ for (Course course : courses) {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+
+ }
+ showList();
+ }
+ }
+
+ //显示所有的记录
+ public void showList () {
+ listAdapter = new SimpleAdapter(this, data,
+ R.layout.sqlist,
+ new String[]{"id", "cid", "cclass", "cname", "ccredit"},
+ new int[]{R.id.textID1, R.id.textCID1, R.id.textCourseClass1, R.id.textCourseName1, R.id.textCredit1});
+ lv.setAdapter(listAdapter);
+ }
+
+
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java
new file mode 100644
index 0000000..8e481b3
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java
@@ -0,0 +1,272 @@
+package com.example.softengineering_selectivecourse;
+
+
+import android.annotation.SuppressLint;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.database.Cursor;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class Course_ManagerActivity extends AppCompatActivity {
+
+ private EditText inputclass;
+ private EditText inputName;
+ private EditText inputcredit;
+ private EditText professor;
+ private EditText studentNeed;
+ private EditText editClassRoom;
+ private EditText briefIntroduce;
+ private Button select;
+ private Button add;
+ private Button delete;
+ private Button update;
+ private Button User;
+ private ListView lv;
+
+
+ private ArrayList> data;//所有记录
+ private Map item; //每一条记录
+ private SimpleAdapter listAdapter; //适配器
+ View view;
+
+ long selId;
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_course__manager);
+
+ inputclass = (EditText) findViewById(R.id.editClass);
+ inputName = (EditText) findViewById(R.id.inputCouseName);
+ inputcredit = (EditText) findViewById(R.id.editCredit);
+ professor = (EditText) findViewById(R.id.editTeacher);
+ studentNeed = (EditText) findViewById(R.id.editStuNeeded);
+ briefIntroduce = (EditText) findViewById(R.id.editBriefIntroduce);
+ editClassRoom = (EditText) findViewById(R.id.editClassRoom);
+ select = (Button) findViewById(R.id.buttonQuery);
+ add = (Button) findViewById(R.id.buttonAdd);
+ delete = (Button) findViewById(R.id.buttonDelete);
+ update = (Button) findViewById(R.id.buttonUpdate);
+ User = (Button) findViewById(R.id.userManager);
+ lv = (ListView) findViewById(R.id.lv);
+
+ data = new ArrayList>();//将data实例化
+
+ dbFindAll(); //查询的方法//查询
+
+ select.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbFindAll();
+ }
+ });
+
+ User.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent();
+ intent.setClass(Course_ManagerActivity.this, User_ManagerActivity.class);
+ startActivity(intent);
+ }
+ });
+
+
+ //添加
+ add.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbAdd();
+ dbFindAll();
+ inputclass.setText("");
+ inputName.setText("");
+ inputcredit.setText("");
+ professor.setText("");
+ studentNeed.setText("");
+ editClassRoom.setText("");
+ briefIntroduce.setText("");
+
+ }
+ });
+
+ //删除
+ delete.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbDelete();
+ dbFindAll();
+ inputclass.setText("");
+ inputName.setText("");
+ inputcredit.setText("");
+ professor.setText("");
+ studentNeed.setText("");
+ editClassRoom.setText("");
+ briefIntroduce.setText("");
+ delete.setEnabled(false);
+ update.setEnabled(false);
+ Toast.makeText(Course_ManagerActivity.this,"删除成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ //修改
+ update.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbUpdate();
+ dbFindAll();
+ inputclass.setText("");
+ inputName.setText("");
+ inputcredit.setText("");
+ professor.setText("");
+ studentNeed.setText("");
+ editClassRoom.setText("");
+ briefIntroduce.setText("");
+ delete.setEnabled(false);
+ update.setEnabled(false);
+ inputName.setEnabled(true);
+ Toast.makeText(Course_ManagerActivity.this,"修改成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+ /*1.修改代码,实现界面显示连贯序号
+ 2.不能添加已存在的用户名
+ 3.控件内容为空的时候不能实现操作且有对应提示
+ 4.登录时勾选,可以记住用户名和密码*/
+
+ //鼠标点击数据,可以获取相对应的数据,存入Map中
+ lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ Map listItem = (Map)lv.getItemAtPosition(position);
+ inputName.setText((String)listItem.get("cname"));
+ List courses = DataSupport.where("name = ? and id = ?", inputName.getText().toString(), listItem.get("cid").toString() ).find(Course.class);
+ if(courses.isEmpty())
+ {
+ Toast.makeText(Course_ManagerActivity.this,"can't find the course, some wrong happened",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ Course course = courses.get(0);
+ selId = course.getId();
+ inputclass.setText((String)course.getClassFeature());
+ inputName.setText((String)course.getName());
+ inputcredit.setText(Integer.toString(course.getCredit()));
+ professor.setText(course.getTeacher());
+ studentNeed.setText(Integer.toString(course.getNumOfCourseNeeded()));
+ editClassRoom.setText(Integer.toString(course.getClassroom()));
+ briefIntroduce.setText(course.getBrief_introduction());
+ delete.setEnabled(true);
+ update.setEnabled(true);
+ }
+
+
+ }
+ });
+
+ }
+
+ private void dbUpdate(){
+
+ Course course = new Course();
+ course.setClassFeature(inputclass.getText().toString().trim());
+ course.setName(inputName.getText().toString().trim());
+ course.setCredit( Integer.parseInt(inputcredit.getText().toString().trim()));
+
+ course.setBrief_introduction(briefIntroduce.getText().toString().trim());
+ course.setNumOfCourseNeeded(Integer.parseInt(studentNeed.getText().toString().trim()));
+ course.setTeacher(professor.getText().toString().trim());
+ course.setClasstime(Integer.parseInt(inputcredit.getText().toString().trim()) * 16);
+ course.setClassroom(Integer.parseInt(editClassRoom.getText().toString().trim()));
+ course.setNumOfCourseSelected(0);
+ course.updateAll("id = ?", Long.toString(selId));
+ }
+
+ private void dbDelete(){
+ //the basic information is id and name
+ DataSupport.deleteAll(Course.class, "id = ? and name = ?", Long.toString(selId), inputName.getText().toString());
+ }
+
+ private void dbAdd(){
+ if(inputName.getText().toString().isEmpty() || inputclass.getText().toString().isEmpty() || inputcredit.getText().toString().isEmpty() ||
+ studentNeed.getText().toString().isEmpty() || professor.getText().toString().isEmpty())
+ {
+ Toast.makeText(Course_ManagerActivity.this,"添加失败,信息未填完整",Toast.LENGTH_SHORT).show();
+ }
+ else{
+ List courses = DataSupport.where("name = ?", inputName.getText().toString().trim()).find(Course.class);
+ if (!courses.isEmpty())
+ {
+ Toast.makeText(Course_ManagerActivity.this,"课程已存在,增加失败",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ Course course = new Course();
+ course.setClassFeature(inputclass.getText().toString().trim());
+ course.setName(inputName.getText().toString().trim());
+ course.setCredit( Integer.parseInt(inputcredit.getText().toString().trim()));
+
+ course.setBrief_introduction(briefIntroduce.getText().toString().trim());
+ course.setNumOfCourseNeeded(Integer.parseInt(studentNeed.getText().toString().trim()));
+ course.setTeacher(professor.getText().toString().trim());
+ course.setClasstime(Integer.parseInt(inputcredit.getText().toString().trim()) * 16);
+ course.setClassroom(Integer.parseInt(editClassRoom.getText().toString().trim()));
+ course.setNumOfCourseSelected(0);
+ if(course.save())
+ {
+ Toast.makeText(Course_ManagerActivity.this, "增加成功!", Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ Toast.makeText(Course_ManagerActivity.this,"发生未知错误,增加失败",Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
+
+ }
+
+ private void dbFindAll () {
+ data.clear();//防止重复添加,每次清空
+ List courses = DataSupport.findAll(Course.class);
+ int num = 1;
+ for (Course course : courses) {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+
+ }
+ showList();
+ }
+
+ //显示所有的记录
+ public void showList () {
+ listAdapter = new SimpleAdapter(this, data,
+ R.layout.sqlist,
+ new String[]{"id", "cid", "cclass", "cname", "ccredit"},
+ new int[]{R.id.textID1, R.id.textCID1, R.id.textCourseClass1, R.id.textCourseName1, R.id.textCredit1});
+ lv.setAdapter(listAdapter);
+ }
+
+
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/LoginActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/LoginActivity.java
new file mode 100644
index 0000000..769586a
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/LoginActivity.java
@@ -0,0 +1,178 @@
+package com.example.softengineering_selectivecourse;
+
+
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.os.Bundle;
+
+
+import android.content.SharedPreferences;
+import android.view.View;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AlertDialog;
+import androidx.appcompat.app.AppCompatActivity;
+
+import org.litepal.LitePal;
+import org.litepal.crud.DataSupport;
+
+import java.util.List;
+import java.util.Random;
+
+public class LoginActivity extends AppCompatActivity {
+
+ EditText username, pwd;
+ Button login, exit;
+ TextView register, us, showCode, forget;
+
+ CheckBox saveName;
+ String sname;
+ String spwd;
+
+ private int forgetpwd;
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_login);
+
+ username = (EditText) findViewById(R.id.editText);
+ pwd = (EditText) findViewById(R.id.editText2);
+
+ login = (Button) findViewById(R.id.button);
+ exit = (Button) findViewById(R.id.button2);
+
+ register = (TextView) findViewById(R.id.textView4);
+
+ saveName = (CheckBox) findViewById(R.id.saveName);
+ forget = (TextView) findViewById(R.id.textView36);
+
+ //先判断是否存过
+ final SharedPreferences sp = getSharedPreferences("sname", MODE_PRIVATE);
+ final SharedPreferences sp1 = getSharedPreferences("spwd", MODE_PRIVATE);
+
+ sname = sp.getString("sname", "");
+ spwd = sp1.getString("spwd", "");
+ if (!sname.equals("") && !spwd.equals("")) {
+ username.setText(sp.getString("sname", ""));
+ pwd.setText(sp1.getString("spwd", ""));
+ saveName.setChecked(true); //what is the differece?
+ }
+ //创建连接,并打开数据库
+ LitePal.getDatabase();
+
+ saveName.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (username.getText().toString().equals("") || pwd.getText().toString().equals("")) {
+ Toast.makeText(LoginActivity.this, "用户名或密码不能为空", Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+
+ forget.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Toast.makeText(LoginActivity.this, "请联系管理员", Toast.LENGTH_SHORT).show();
+ }
+ });
+
+ login.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ if (username.getText().toString().equals("admin")&&pwd.getText().toString().equals("123")) {
+ Intent intent = new Intent();
+ intent.setClass(LoginActivity.this,Course_ManagerActivity.class);
+ startActivity(intent);
+ }
+ else {
+ List users = DataSupport.findAll(User.class);
+ int flag = 0;
+ for (User user : users) {
+ if (username.getText().toString().trim().equals(user.getName()) && pwd.getText().toString().trim().equals(user.getPwd())) {
+ Toast.makeText(LoginActivity.this, "欢迎回来," + username.getText().toString().trim(), Toast.LENGTH_SHORT).show();
+ flag = 1;
+ Intent intent = new Intent();
+ intent.putExtra("name", username.getText().toString());
+ intent.setClass(LoginActivity.this, PersonalBasicInfoActivity.class);
+ startActivity(intent);
+ //登陆成功时,存saveName
+ if (saveName.isChecked() == true) {
+ sname = username.getText().toString();
+ spwd = pwd.getText().toString();
+ SharedPreferences.Editor editor = sp.edit();
+ editor.putString("sname", sname);
+ SharedPreferences.Editor editor1 = sp1.edit();
+ editor1.putString("spwd", spwd);
+ editor.commit();
+ editor1.commit();
+ } else {
+ SharedPreferences.Editor editor = sp.edit();
+ editor.clear();
+ editor.commit();
+ }
+ }
+
+ }
+ if(flag == 0) {
+ Toast.makeText(LoginActivity.this, "用户名或密码不存在,登录失败!", Toast.LENGTH_SHORT).show();
+ }
+
+ }
+ }
+ });
+//
+ register.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ Intent intent = new Intent();
+ intent.setClass(LoginActivity.this,RegisterActivity.class);
+ startActivity(intent);
+ }
+ });
+//
+ exit.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ AlertDialog.Builder ab = new AlertDialog.Builder(LoginActivity.this);
+ ab.setMessage("您是否要退出?");
+ ab.setPositiveButton("否", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+ Toast.makeText(LoginActivity.this,"明智的选择",Toast.LENGTH_SHORT).show();
+ }
+ });
+ ab.setNegativeButton("是", new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialogInterface, int i) {
+ LoginActivity.this.finish();//返回上一页面
+ android.os.Process.killProcess(android.os.Process.myPid());
+ }
+ });
+ ab.create().show();
+ }
+ });
+ long firstTime = 0;
+// //keyCode按键的编码,KeyEvent事件
+// public boolean onKeyDown(int keyCode,KeyEvent event)
+// {
+// long secondTime = System.currentTimeMillis();//时间间隔
+// //选择返回键
+// if(keyCode==KeyEvent.KEYCODE_BACK){
+// if(secondTime-firstTime<2000){
+// System.exit(0);
+// }else{
+// Toast.makeText(LoginActivity.this,"再按一次,程序退出!",Toast.LENGTH_SHORT).show();
+// firstTime = System.currentTimeMillis();
+// }
+// return true;
+// }
+// return super.onKeyDown(keyCode,event);
+// }
+ }
+}
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/PersonalBasicInfoActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/PersonalBasicInfoActivity.java
new file mode 100644
index 0000000..a20f29e
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/PersonalBasicInfoActivity.java
@@ -0,0 +1,189 @@
+package com.example.softengineering_selectivecourse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class PersonalBasicInfoActivity extends AppCompatActivity {
+
+ private TextView TextViewUserName;
+ private TextView TextViewUserID;
+ private TextView TextViewUserMajor;
+ private TextView TextViewUserCreditNotTaken_Military;
+ private TextView TextViewUserCreditNotTaken_Nature;
+ private TextView TextViewUserCreditNotTaken_Political;
+ private TextView TextViewUserCreditNotTaken_Humanity;
+ private ListView lv;
+ private TextView TextViewUserSelectedCourse;
+ private Button ButtonDropCourse;
+
+
+
+ private ArrayList> data;//所有记录
+ private Map item; //每一条记录
+ private SimpleAdapter listAdapter; //适配器
+ View view;
+ int selCourseId;
+ long selUserId;
+ String selUserName;
+
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_personal_basic_info);
+ Intent intent = getIntent();
+ final String userName = intent.getStringExtra("name");
+ List users = DataSupport.where("name = ?", userName).find(User.class);
+
+ TextViewUserName = (TextView) findViewById(R.id.textBasicInfoName);
+ TextViewUserID = (TextView) findViewById(R.id.textBasicINfoID1);
+ TextViewUserMajor = (TextView) findViewById(R.id.textBasicINfoMajor1);
+ TextViewUserCreditNotTaken_Military = (TextView) findViewById(R.id.textBasicINfoMilitary1);
+ TextViewUserCreditNotTaken_Nature = (TextView) findViewById(R.id.textBasicINfoNature1);
+ TextViewUserCreditNotTaken_Political = (TextView) findViewById(R.id.textBasicINfoPolitical1);
+ TextViewUserCreditNotTaken_Humanity = (TextView) findViewById(R.id.textBasicINfohumanity1);
+ TextViewUserSelectedCourse = (TextView) findViewById(R.id.textBasicINfoClikedCourse);
+ ButtonDropCourse = (Button) findViewById(R.id.buttonBasicInfoDrop);
+ Button buttonRecommend = (Button) findViewById(R.id.buttonBasicInfoRecommend);
+ Button buttonQuery = (Button) findViewById(R.id.buttonBasicInfoSelect);
+
+ buttonRecommend.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent();
+ intent.putExtra("name", userName);
+ intent.setClass(PersonalBasicInfoActivity.this, CourseRecommendedActivity.class);
+ startActivity(intent);
+ }
+ });
+
+ buttonQuery.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent();
+ intent.putExtra("name", userName);
+ intent.setClass(PersonalBasicInfoActivity.this, CourseSelectingActivity.class);
+ startActivity(intent);
+ }
+ });
+
+ lv = (ListView) findViewById(R.id.lv4);
+
+ if (users.isEmpty())
+ {
+ Toast.makeText(PersonalBasicInfoActivity.this,"发生未知错误,显示详细信息失败",Toast.LENGTH_SHORT).show();
+ }
+
+ else
+ {
+ User user = users.get(0);
+ TextViewUserName.setText(userName);
+ selUserId = user.getId();
+ selUserName = user.getName();
+ TextViewUserID.setText(Long.toString(user.getId()));
+ TextViewUserMajor.setText(user.getMajor());
+ TextViewUserCreditNotTaken_Humanity.setText(Integer.toString(user.getHumanity_class_NotTaken()));
+ TextViewUserCreditNotTaken_Political.setText(Integer.toString(user.getPolitical_class_NotTaken()));
+ TextViewUserCreditNotTaken_Nature.setText(Integer.toString(user.getNaturalScience_class_NotTaken()));
+ TextViewUserCreditNotTaken_Military.setText(Integer.toString(user.getMilitary_class_NotTaken()));
+
+ }
+
+ ButtonDropCourse.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ CourseDelete();
+ dbFindAll();
+ TextViewUserSelectedCourse.setText("");
+ ButtonDropCourse.setEnabled(false);
+ Toast.makeText(PersonalBasicInfoActivity.this,"删除成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+// lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+// @Override
+// public void onItemClick(AdapterView> parent, View view, int position, long id) {
+// Map listItem = (Map)lv.getItemAtPosition(position);
+// TextViewUserSelectedCourse.setText((String)listItem.get("cname"));
+// List courses = DataSupport.where("name = ? and id = ?", userName, listItem.get("id").toString() ).find(Course.class);
+// if(courses.isEmpty())
+// {
+// Toast.makeText(PersonalBasicInfoActivity.this,"can't find the course, some wrong happened",Toast.LENGTH_SHORT).show();
+// }
+// Course course = courses.get(0);
+// selCourseId = course.getId();
+// ButtonDropCourse.setEnabled(true);
+// }
+// });
+
+
+
+ }
+ private void CourseDelete()
+ {
+ //TO DO
+ }
+ private void dbFindAll(){
+ data.clear();//防止重复添加,每次清空
+ List users = DataSupport.where("id = ? and name = ?", Long.toString(selUserId), selUserName).find(User.class);
+ if (users.isEmpty())
+ {
+ Toast.makeText(PersonalBasicInfoActivity.this,"发生未知错误,显示详细信息失败",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ User user = users.get(0);
+// ArrayList courses = user.getCourseAttend();
+// int num = 1;
+// for (User.courseIdentification course : courses)
+// {
+//
+// }
+
+ List courses = user.getCourse_selected();
+ int num = 1;
+ for (Course course: courses)
+ {
+ int uid = course.getId();
+ String uclass = course.getClassFeature();
+ String uname = course.getName();
+ int ucredit = course.getCredit();
+ item = new HashMap();
+ item.put("id", num);
+ item.put("cid", uid);
+ item.put("cclass", uclass);
+ item.put("cname", uname);
+ item.put("ccredit", ucredit);
+ data.add(item);
+ num++;
+ }
+ }
+ showList();
+ }
+
+ //显示所有的记录
+ public void showList(){
+ listAdapter = new SimpleAdapter(this,data,
+ R.layout.sqlist,
+ new String[]{"id", "cid", "cclass", "cname", "ccredit"},
+ new int[]{R.id.textID1, R.id.textCID1, R.id.textCourseClass1, R.id.textCourseName1, R.id.textCredit1});
+ lv.setAdapter(listAdapter);
+ }
+
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/RegisterActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/RegisterActivity.java
new file mode 100644
index 0000000..29dfa9c
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/RegisterActivity.java
@@ -0,0 +1,108 @@
+package com.example.softengineering_selectivecourse;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import android.Manifest;
+import android.annotation.TargetApi;
+import android.content.ContentUris;
+import android.content.ContentValues;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.PackageManager;
+import android.database.Cursor;
+import android.database.sqlite.SQLiteDatabase;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.provider.DocumentsContract;
+import android.provider.MediaStore;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.Toast;
+
+import org.litepal.crud.DataSupport;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+
+public class RegisterActivity extends AppCompatActivity {
+
+ private EditText username;
+ private EditText pwd;
+ private EditText major;
+ private Button register;
+ private Button back;
+ private Button btn1, btn2;
+ private ImageView picture;
+
+ //实例化
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_register);
+ username = (EditText) findViewById(R.id.editText);
+ pwd = (EditText) findViewById(R.id.editText2);
+ major = (EditText) findViewById(R.id.editText4);
+ register = (Button) findViewById(R.id.button7);
+ back = (Button) findViewById(R.id.button8);
+
+
+
+ //返回监听
+ back.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ RegisterActivity.this.finish();
+ Intent intent = new Intent();
+ intent.setClass(RegisterActivity.this,LoginActivity.class);
+ startActivity(intent);
+ }
+ });
+
+ //创建连接
+ //打开数据库
+
+ //注册监听
+ register.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ ContentValues values = new ContentValues();
+ List Users = DataSupport.where("name = ?", username.getText().toString().trim()).find(User.class);
+
+ //如果可以注册
+ if(Users.isEmpty()){
+ User user = new User();
+ user.setName(username.getText().toString().trim());
+ user.setPwd(pwd.getText().toString().trim());
+ user.setMajor(major.getText().toString().trim());
+ user.setMilitary_class_NotTaken(4);
+ user.setHumanity_class_NotTaken(2);
+ user.setPolitical_class_NotTaken(3);
+ user.setNaturalScience_class_NotTaken(3);
+ if(user.save()){
+ Toast.makeText(RegisterActivity.this,"注册成功!",Toast.LENGTH_SHORT).show();
+ Intent intent = new Intent();
+ intent.setClass(RegisterActivity.this,LoginActivity.class);
+ startActivity(intent);
+ RegisterActivity.this.finish();//退出之前注销该活动
+ }
+ else
+ {
+ Toast.makeText(RegisterActivity.this,"发生未知错误,注册失败",Toast.LENGTH_SHORT).show();
+ }
+
+ }else{
+ Toast.makeText(RegisterActivity.this,"用户名已存在!",Toast.LENGTH_SHORT).show();
+ }
+ }
+ });
+ }
+}
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java
new file mode 100644
index 0000000..967a4b3
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java
@@ -0,0 +1,180 @@
+package com.example.softengineering_selectivecourse;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class User extends DataSupport {
+ private long id;
+ private String name;
+ private String pwd;
+ private String major;
+ private List course_selected = new ArrayList();
+ private List completed_courses =new ArrayList();
+ private List comments = new ArrayList();
+
+// private ArrayList courseAttend = new ArrayList();
+// private ArrayList courseFinished = new ArrayList();
+// private ArrayList CommentsOF = new ArrayList();
+
+
+ private int military_class_NotTaken;
+ private int humanity_class_NotTaken;
+ private int political_class_NotTaken;
+ private int naturalScience_class_NotTaken;
+
+// public class courseIdentification{
+// private int id;
+// private String name;
+// private String feature;
+// private int credit;
+//
+// public int getCredit() {
+// return credit;
+// }
+//
+// public String getName() {
+// return name;
+// }
+//
+// public int getId() {
+// return id;
+// }
+//
+// public String getFeature() {
+// return feature;
+// }
+//
+// public void setFeature(String feature) {
+// this.feature = feature;
+// }
+//
+// public void setCredit(int credit) {
+// this.credit = credit;
+// }
+//
+// public void setName(String name) {
+// this.name = name;
+// }
+//
+// public void setId(int id) {
+// this.id = id;
+// }
+// }
+
+// public ArrayList getCourseAttend() {
+// return courseAttend;
+// }
+//
+// public ArrayList getCourseFinished() {
+// return courseFinished;
+// }
+//
+// public ArrayList getCommentsOF() {
+// return CommentsOF;
+// }
+//
+// public void setCommentsOF(ArrayList commentsOF) {
+// CommentsOF = commentsOF;
+// }
+//
+// public void setCourseAttend(ArrayList courseAttend) {
+// this.courseAttend = courseAttend;
+// }
+
+// public void setCourseFinished(ArrayList courseFinished) {
+// this.courseFinished = courseFinished;
+// }
+
+ public void setPwd(String pwd) {
+ this.pwd = pwd;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setMajor(String major) {
+ this.major = major;
+ }
+
+ public void setId(long id) {
+ this.id = id;
+ }
+
+ public void setComments(ArrayList comments) {
+ this.comments = comments;
+ }
+
+ public void setCompleted_courses(ArrayList completed_courses) {
+ this.completed_courses = completed_courses;
+ }
+
+ public void setCourse_selected(ArrayList course_selected) {
+ this.course_selected = course_selected;
+ }
+
+ public void setHumanity_class_NotTaken(int humanity_class_NotTaken) {
+ this.humanity_class_NotTaken = humanity_class_NotTaken;
+ }
+
+ public void setMilitary_class_NotTaken(int military_class_NotTaken) {
+ this.military_class_NotTaken = military_class_NotTaken;
+ }
+
+ public void setNaturalScience_class_NotTaken(int naturalScience_class_NotTaken) {
+ this.naturalScience_class_NotTaken = naturalScience_class_NotTaken;
+ }
+
+ public void setPolitical_class_NotTaken(int political_class_NotTaken) {
+ this.political_class_NotTaken = political_class_NotTaken;
+ }
+
+
+ public String getName() {
+ return name;
+ }
+
+ public String getMajor() {
+ return major;
+ }
+
+ public String getPwd() {
+ return pwd;
+ }
+
+ public long getId() {
+ return id;
+ }
+
+ public List getComments() {
+ return comments;
+ }
+
+ public List getCompleted_courses() {
+ return completed_courses;
+ }
+
+ public List getCourse_selected() {
+ return course_selected;
+ }
+
+ public int getHumanity_class_NotTaken() {
+ return humanity_class_NotTaken;
+ }
+
+ public int getMilitary_class_NotTaken() {
+ return military_class_NotTaken;
+ }
+
+ public int getNaturalScience_class_NotTaken() {
+ return naturalScience_class_NotTaken;
+ }
+
+ public int getPolitical_class_NotTaken() {
+ return political_class_NotTaken;
+ }
+
+}
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User_ManagerActivity.java b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User_ManagerActivity.java
new file mode 100644
index 0000000..87f56a0
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User_ManagerActivity.java
@@ -0,0 +1,211 @@
+package com.example.softengineering_selectivecourse;
+
+import android.os.Bundle;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+import android.widget.Toast;
+
+import androidx.appcompat.app.AppCompatActivity;
+
+import org.litepal.crud.DataSupport;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class User_ManagerActivity extends AppCompatActivity {
+
+
+ private EditText inputName;
+ private EditText inputPwd;
+ private EditText inputMajor;
+ private Button select;
+ private Button add;
+ private Button delete;
+ private Button update;
+ private ListView lv;
+
+
+
+ private ArrayList> data;//所有记录
+ private Map item; //每一条记录
+ private SimpleAdapter listAdapter; //适配器
+ View view;
+
+ long selId;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_user__manager);
+
+ inputName = (EditText) findViewById(R.id.editTextName);
+ inputMajor = (EditText) findViewById(R.id.editMajor);
+ inputPwd = (EditText) findViewById(R.id.editPwd);
+ select = (Button) findViewById(R.id.buttonUserQuery);
+ add = (Button) findViewById(R.id.buttonUserAdd);
+ delete = (Button) findViewById(R.id.buttonUSerDelete);
+ update = (Button) findViewById(R.id.buttonUSerUpdate);
+ lv = (ListView) findViewById(R.id.lv2);
+
+
+ data = new ArrayList>();//将data实例化
+
+ dbFindAll(); //查询的方法
+ //查询
+ select.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbFindAll();
+ }
+ });
+
+ //添加
+ add.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbAdd();
+ dbFindAll();
+ inputName.setText("");
+ inputPwd.setText("");
+ inputMajor.setText("");
+ }
+ });
+//
+// //删除
+ delete.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbDelete();
+ dbFindAll();
+ inputName.setText("");
+ inputPwd.setText("");
+ inputMajor.setText("");
+ delete.setEnabled(false);
+ update.setEnabled(false);
+ inputName.setEnabled(true);
+ Toast.makeText(User_ManagerActivity.this,"删除成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+//
+// //修改
+ update.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View view) {
+ dbUpdate();
+ dbFindAll();
+ inputName.setText("");
+ inputPwd.setText("");
+ inputMajor.setText("");
+ delete.setEnabled(false);
+ update.setEnabled(false);
+ inputName.setEnabled(true);
+ Toast.makeText(User_ManagerActivity.this,"修改成功!",Toast.LENGTH_SHORT).show();
+ }
+ });
+//
+// //鼠标点击数据,可以获取相对应的数据,存入Map中
+ lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ @Override
+ public void onItemClick(AdapterView> parent, View view, int position, long id) {
+ Map listItem = (Map)lv.getItemAtPosition(position);
+ inputName.setText((String)listItem.get("uname"));
+ List users = DataSupport.where("name = ? and id = ?", inputName.getText().toString(), listItem.get("uid").toString() ).find(User.class);
+ if(users.isEmpty())
+ {
+ Toast.makeText(User_ManagerActivity.this,"can't find the course, some wrong happened",Toast.LENGTH_SHORT).show();
+ }
+ User user = users.get(0);
+ selId = user.getId();
+ inputName.setText((String)user.getName());
+ inputPwd.setText((String)user.getPwd());
+ inputMajor.setText((String)user.getMajor());
+ delete.setEnabled(true);
+ update.setEnabled(true);
+
+ }
+ });
+
+ }
+
+ private void dbUpdate(){
+ User user = new User();
+ user.setName(inputName.getText().toString().trim());
+ user.setPwd(inputPwd.getText().toString().trim());
+ user.setMajor(inputMajor.getText().toString().trim());
+ user.updateAll("id = ?", Long.toString(selId));
+ }
+//
+ private void dbDelete(){
+ DataSupport.deleteAll(User.class, "id = ? and name = ?", Long.toString(selId), inputName.getText().toString());
+ }
+//
+ private void dbAdd(){
+ if(inputName.getText().toString().isEmpty() || inputMajor.getText().toString().isEmpty() || inputPwd.getText().toString().isEmpty())
+ {
+ Toast.makeText(User_ManagerActivity.this,"添加失败,信息未填完整",Toast.LENGTH_SHORT).show();
+ }
+ else{
+ List users = DataSupport.where("name = ?", inputName.getText().toString().trim()).find(User.class);
+ if (!users.isEmpty())
+ {
+ Toast.makeText(User_ManagerActivity.this,"用户已存在,增加失败",Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ User user = new User();
+ user.setName(inputName.getText().toString().trim());
+ user.setPwd(inputPwd.getText().toString().trim());
+ user.setMajor(inputMajor.getText().toString().trim());
+ user.setMilitary_class_NotTaken(4);
+ user.setHumanity_class_NotTaken(2);
+ user.setPolitical_class_NotTaken(3);
+ user.setNaturalScience_class_NotTaken(3);
+ if(user.save())
+ {
+ Toast.makeText(User_ManagerActivity.this, "增加成功!", Toast.LENGTH_SHORT).show();
+ }
+ else
+ {
+ Toast.makeText(User_ManagerActivity.this,"发生未知错误,增加失败",Toast.LENGTH_SHORT).show();
+ }
+ }
+ }
+ }
+
+ private void dbFindAll(){
+ data.clear();//防止重复添加,每次清空
+ List users = DataSupport.findAll(User.class);
+ int num = 1;
+ for (User user: users) {
+ long uid = user.getId();
+
+ String name = user.getName();
+ String pwd = user.getPwd();
+ String major = user.getMajor();
+ item = new HashMap();
+ item.put("id",num);
+ item.put("uid",uid);
+ item.put("uname",name);
+ item.put("pwd",pwd);
+ item.put("major",major);
+ data.add(item);
+ num++;
+ }
+ showList();
+ }
+
+ //显示所有的记录
+ public void showList(){
+ listAdapter = new SimpleAdapter(this,data,
+ R.layout.user_sqlist,
+ new String[]{"id","uid","uname","pwd","major"},
+ new int[]{R.id.textUserID1,R.id.textUserCID1,R.id.textUserNamelist1,R.id.textUserKeylist1,R.id.textUserMajor1});
+ lv.setAdapter(listAdapter);
+ }
+}
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 0000000..cc14f03
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/drawable/ic_launcher_background.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 0000000..a4f78de
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml
new file mode 100644
index 0000000..9460d7c
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml
new file mode 100644
index 0000000..8f443d7
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml
@@ -0,0 +1,231 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_recommended.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_recommended.xml
new file mode 100644
index 0000000..1c82a5d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_recommended.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_selecting.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_selecting.xml
new file mode 100644
index 0000000..b2637f6
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_selecting.xml
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_login.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_login.xml
new file mode 100644
index 0000000..f97f17e
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_login.xml
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_personal_basic_info.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_personal_basic_info.xml
new file mode 100644
index 0000000..314df8d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_personal_basic_info.xml
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_register.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_register.xml
new file mode 100644
index 0000000..0ac9bb5
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_register.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_user__manager.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_user__manager.xml
new file mode 100644
index 0000000..95a7c54
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_user__manager.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/comment_sqlist.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/comment_sqlist.xml
new file mode 100644
index 0000000..5d310bf
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/comment_sqlist.xml
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/sqlist.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/sqlist.xml
new file mode 100644
index 0000000..8a0bdc7
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/sqlist.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/user_sqlist.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/user_sqlist.xml
new file mode 100644
index 0000000..46b4ee2
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/layout/user_sqlist.xml
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 0000000..a26f6fb
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 0000000..a26f6fb
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-hdpi/ic_launcher.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..a571e60
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..61da551
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-mdpi/ic_launcher.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..c41dd28
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..db5080a
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6dba46d
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..da31a87
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..15ac681
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..b216f2d
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f25a419
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..e96783c
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/colors.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/colors.xml
new file mode 100644
index 0000000..40bdc35
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #6200EE
+ #3700B3
+ #03DAC5
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/dimens.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/dimens.xml
new file mode 100644
index 0000000..0a7d9a5
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/dimens.xml
@@ -0,0 +1,5 @@
+
+
+ 16dp
+ 16dp
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/selectDown.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/selectDown.xml
new file mode 100644
index 0000000..b997d30
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/selectDown.xml
@@ -0,0 +1,32 @@
+
+
+
+ - 请选取
+ - Military
+ - Nature
+ - Humanity
+ - Political
+
+
+ - 请选取
+ - 1
+ - 2
+ - 3
+ - 4
+
+
+ - 请选取
+ - 301
+ - 302
+ - 303
+ - 304
+ - 305
+ - 306
+
+
+ - classFeature
+ - credit
+ - classroom
+ - teacher
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/strings.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/strings.xml
new file mode 100644
index 0000000..389a977
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/strings.xml
@@ -0,0 +1,12 @@
+
+ SoftEngineering_selectiveCourse
+ LoginActivity
+ Email
+ Password
+ Sign in or register
+ Sign in
+ "Welcome !"
+ Not a valid username
+ Password must be >5 characters
+ "Login failed"
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/styles.xml b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/styles.xml
new file mode 100644
index 0000000..c87a4cc
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/main/res/values/styles.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/app/src/test/java/com/example/softengineering_selectivecourse/ExampleUnitTest.java b/source_code/SoftEngineering_selectiveCourse/app/src/test/java/com/example/softengineering_selectivecourse/ExampleUnitTest.java
new file mode 100644
index 0000000..4518672
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/app/src/test/java/com/example/softengineering_selectivecourse/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.example.softengineering_selectivecourse;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/build.gradle b/source_code/SoftEngineering_selectiveCourse/build.gradle
new file mode 100644
index 0000000..d1049a6
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/build.gradle
@@ -0,0 +1,24 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+buildscript {
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath "com.android.tools.build:gradle:4.0.1"
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/gradle.properties b/source_code/SoftEngineering_selectiveCourse/gradle.properties
new file mode 100644
index 0000000..d30de8a
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/gradle.properties
@@ -0,0 +1,19 @@
+# Project-wide Gradle settings.
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx2048m
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
+# AndroidX package structure to make it clearer which packages are bundled with the
+# Android operating system, and which are packaged with your app"s APK
+# https://developer.android.com/topic/libraries/support-library/androidx-rn
+android.useAndroidX=true
+# Automatically convert third-party libraries to use AndroidX
+android.enableJetifier=true
\ No newline at end of file
diff --git a/source_code/SoftEngineering_selectiveCourse/gradle/wrapper/gradle-wrapper.jar b/source_code/SoftEngineering_selectiveCourse/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..f6b961f
Binary files /dev/null and b/source_code/SoftEngineering_selectiveCourse/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/source_code/SoftEngineering_selectiveCourse/gradle/wrapper/gradle-wrapper.properties b/source_code/SoftEngineering_selectiveCourse/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..e69c8cc
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Sun Feb 14 11:27:02 CST 2021
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
diff --git a/source_code/SoftEngineering_selectiveCourse/gradlew b/source_code/SoftEngineering_selectiveCourse/gradlew
new file mode 100644
index 0000000..cccdd3d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/gradlew
@@ -0,0 +1,172 @@
+#!/usr/bin/env sh
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn () {
+ echo "$*"
+}
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+ NONSTOP* )
+ nonstop=true
+ ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Escape application args
+save () {
+ for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
+ echo " "
+}
+APP_ARGS=$(save "$@")
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
+
+exec "$JAVACMD" "$@"
diff --git a/source_code/SoftEngineering_selectiveCourse/gradlew.bat b/source_code/SoftEngineering_selectiveCourse/gradlew.bat
new file mode 100644
index 0000000..e95643d
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/gradlew.bat
@@ -0,0 +1,84 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windows variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/source_code/SoftEngineering_selectiveCourse/settings.gradle b/source_code/SoftEngineering_selectiveCourse/settings.gradle
new file mode 100644
index 0000000..6240227
--- /dev/null
+++ b/source_code/SoftEngineering_selectiveCourse/settings.gradle
@@ -0,0 +1,2 @@
+include ':app'
+rootProject.name = "SoftEngineering_selectiveCourse"
\ No newline at end of file
diff --git a/软件创意--super课表.docx b/软件创意--super课表.docx
new file mode 100644
index 0000000..3e555da
Binary files /dev/null and b/软件创意--super课表.docx differ
diff --git a/选修课选课系统测试用例.docx b/软件测试用例--选修课选课系统.docx
similarity index 100%
rename from 选修课选课系统测试用例.docx
rename to 软件测试用例--选修课选课系统.docx
diff --git a/软件设计规格说明书--选修课选课系统.doc b/软件设计规格说明书--选修课选课系统.doc
new file mode 100644
index 0000000..679dd59
Binary files /dev/null and b/软件设计规格说明书--选修课选课系统.doc differ
diff --git a/软件需求规格说明书--选修课选课系统.docx b/软件需求规格说明书--选修课选课系统.docx
new file mode 100644
index 0000000..7ef3ba4
Binary files /dev/null and b/软件需求规格说明书--选修课选课系统.docx differ