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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +