From d4b02f139a3d02c894c639c7fe7801246e5f6ef6 Mon Sep 17 00:00:00 2001 From: langqingjie <1154192803@qq.com> Date: Fri, 19 Feb 2021 16:11:21 +0800 Subject: [PATCH] update the code, finish the basic function of the software --- .../.idea/sonarIssues.xml | 30 +++ .../0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480 | 19 ++ .../312e7b7c35c2dc14d5deccaa212fd733c0443a84 | 43 +++ .../5926027da99b6a336fecb3ba9ba36f5fbcf1c959 | 30 +++ .../597998839ff8e48a7e7ea9cd947efb862a54fffb | 2 + .../77becc57a2ca9e703b8e6cbda6b052b6473df28b | 25 ++ .../84d1e3e0533b35b01f34b2bc6c4a5cabc3b9eded | 36 +++ .../90b87721d50a394070e56f8cf6c0f808c0ffa791 | 2 + .../b5fc2407afc1be8c213f2b4c313bad593688c0e2 | 34 +++ .../b686a512c2435388bcdce171b5a75e28ac952920 | 52 ++++ .../b786dc55a2bfe8b15ba666f050505789b29d48ba | 23 ++ .../.idea/sonarlint/issuestore/index.pb | 22 +- .../app/src/main/AndroidManifest.xml | 1 - .../app/src/main/assets/litepal.xml | 2 +- .../Comments.java | 42 ++- .../Course.java | 20 +- .../CourseBasicInfoActivity.java | 177 ++++++++++++ .../CourseRecommendedActivity.java | 13 +- .../CourseReviewActivity.java | 14 - .../CourseSelectingActivity.java | 254 ++++++++++++++++++ .../Course_ManagerActivity.java | 34 ++- .../softengineering_selectivecourse/User.java | 130 ++++----- .../res/layout/activity_course__manager.xml | 26 +- .../res/layout/activity_course_basic_info.xml | 228 +++++++++++++++- .../res/layout/activity_course_review.xml | 9 - .../res/layout/activity_course_selecting.xml | 151 +++++++++-- .../src/main/res/layout/comment_sqlist.xml | 87 ++++++ .../app/src/main/res/values/selectDown.xml | 32 +++ 28 files changed, 1382 insertions(+), 156 deletions(-) create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/0/a/0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480 create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/3/1/312e7b7c35c2dc14d5deccaa212fd733c0443a84 create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/5926027da99b6a336fecb3ba9ba36f5fbcf1c959 create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/597998839ff8e48a7e7ea9cd947efb862a54fffb create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/7/7/77becc57a2ca9e703b8e6cbda6b052b6473df28b create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/8/4/84d1e3e0533b35b01f34b2bc6c4a5cabc3b9eded create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/9/0/90b87721d50a394070e56f8cf6c0f808c0ffa791 create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/5/b5fc2407afc1be8c213f2b4c313bad593688c0e2 create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/6/b686a512c2435388bcdce171b5a75e28ac952920 create mode 100644 SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/7/b786dc55a2bfe8b15ba666f050505789b29d48ba delete mode 100644 SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseReviewActivity.java delete mode 100644 SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_review.xml create mode 100644 SoftEngineering_selectiveCourse/app/src/main/res/layout/comment_sqlist.xml create mode 100644 SoftEngineering_selectiveCourse/app/src/main/res/values/selectDown.xml diff --git a/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml b/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml index e719ebb..33ee760 100644 --- a/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml +++ b/SoftEngineering_selectiveCourse/.idea/sonarIssues.xml @@ -3,6 +3,11 @@ diff --git a/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/0/a/0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480 b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/0/a/0a3ec6a74641d91051bb8ffb2bfb8f7d10b30480 new file mode 100644 index 0000000..51165d7 --- /dev/null +++ b/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/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/3/1/312e7b7c35c2dc14d5deccaa212fd733c0443a84 b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/3/1/312e7b7c35c2dc14d5deccaa212fd733c0443a84 new file mode 100644 index 0000000..dab2212 --- /dev/null +++ b/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/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/5926027da99b6a336fecb3ba9ba36f5fbcf1c959 b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/5/9/5926027da99b6a336fecb3ba9ba36f5fbcf1c959 new file mode 100644 index 0000000..263f7e0 --- /dev/null +++ b/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/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/9/0/90b87721d50a394070e56f8cf6c0f808c0ffa791 b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/9/0/90b87721d50a394070e56f8cf6c0f808c0ffa791 new file mode 100644 index 0000000..544516e --- /dev/null +++ b/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/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/7/b786dc55a2bfe8b15ba666f050505789b29d48ba b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/b/7/b786dc55a2bfe8b15ba666f050505789b29d48ba new file mode 100644 index 0000000..57131db --- /dev/null +++ b/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/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb index 1193101..b14126a 100644 --- a/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb +++ b/SoftEngineering_selectiveCourse/.idea/sonarlint/issuestore/index.pb @@ -1,3 +1,23 @@ P - app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e \ No newline at end of file + 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/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml b/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml index a6f3c00..6a7f41b 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml +++ b/SoftEngineering_selectiveCourse/app/src/main/AndroidManifest.xml @@ -10,7 +10,6 @@ android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> - diff --git a/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml b/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml index 3c5b078..fcb6824 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml +++ b/SoftEngineering_selectiveCourse/app/src/main/assets/litepal.xml @@ -1,7 +1,7 @@ - + diff --git a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java index 5a65ce5..5035bc3 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Comments.java @@ -5,42 +5,36 @@ import org.litepal.crud.DataSupport; public class Comments extends DataSupport { private int id; private String comments; - private User provider = new User(); - private Course course = new Course(); - private User.courseIdentification CourseOf; - private Course.userIdentification UserOf; - private float point; - - public Course getCourse() { - return course; - } - - public float getPoint() { - return point; - } - + private String provider; + private String courseName; public String getComments() { return comments; } - - public User getProvider() { - return provider; - } - public void setComments(String comments) { this.comments = comments; } - public void setCourse(Course course) { - this.course = course; + public int getId() { + return id; } + public String getCourseName() { + return courseName; + } - public void setPoint(float point) { - this.point = point; + public String getProvider() { + return provider; } - public void setProvider(User 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/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java index 85a6e57..86eef17 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course.java @@ -12,19 +12,27 @@ public class Course extends DataSupport { 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(); - private ArrayList numOfStuSelected= new ArrayList(); - private ArrayList Comments = new ArrayList(); - - public class userIdentification{ - private int id; - private String name; + 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; } diff --git a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java index 17066ac..3ad8837 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java @@ -2,13 +2,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/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java index a9cd600..fe2c803 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java @@ -34,7 +34,7 @@ public class CourseRecommendedActivity extends AppCompatActivity { private Map item; //每一条记录 private SimpleAdapter listAdapter; //适配器 View view; - int selCourseId; + long selCourseId; long selUserId; String selUserName; String selCourseName; @@ -70,14 +70,22 @@ public class CourseRecommendedActivity extends AppCompatActivity { 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("course", selCourseId); + intent.putExtra("courseId", selCourseId); intent.setClass(CourseRecommendedActivity.this, CourseBasicInfoActivity.class); startActivity(intent); + CourseRecommendedActivity.this.finish(); } }); @@ -117,6 +125,7 @@ public class CourseRecommendedActivity extends AppCompatActivity { selCourseId = course.getId(); selCourseName = course.getName(); attendCourse.setEnabled(true); + getCourseDetails.setEnabled(true); } } diff --git a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseReviewActivity.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseReviewActivity.java deleted file mode 100644 index f089d42..0000000 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseReviewActivity.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.example.softengineering_selectivecourse; - -import androidx.appcompat.app.AppCompatActivity; - -import android.os.Bundle; - -public class CourseReviewActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_course_review); - } -} \ No newline at end of file diff --git a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java index c2d6f55..d7b438d 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java @@ -2,13 +2,267 @@ 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/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java index 6c32939..8e481b3 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java @@ -30,6 +30,7 @@ public class Course_ManagerActivity extends AppCompatActivity { private EditText inputcredit; private EditText professor; private EditText studentNeed; + private EditText editClassRoom; private EditText briefIntroduce; private Button select; private Button add; @@ -56,6 +57,7 @@ public class Course_ManagerActivity extends AppCompatActivity { 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); @@ -95,6 +97,7 @@ public class Course_ManagerActivity extends AppCompatActivity { inputcredit.setText(""); professor.setText(""); studentNeed.setText(""); + editClassRoom.setText(""); briefIntroduce.setText(""); } @@ -111,6 +114,7 @@ public class Course_ManagerActivity extends AppCompatActivity { inputcredit.setText(""); professor.setText(""); studentNeed.setText(""); + editClassRoom.setText(""); briefIntroduce.setText(""); delete.setEnabled(false); update.setEnabled(false); @@ -129,6 +133,7 @@ public class Course_ManagerActivity extends AppCompatActivity { inputcredit.setText(""); professor.setText(""); studentNeed.setText(""); + editClassRoom.setText(""); briefIntroduce.setText(""); delete.setEnabled(false); update.setEnabled(false); @@ -147,21 +152,26 @@ public class Course_ManagerActivity extends AppCompatActivity { 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("id").toString() ).find(Course.class); + 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(); } - 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())); - briefIntroduce.setText(course.getBrief_introduction()); - delete.setEnabled(true); - update.setEnabled(true); + 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); + } + } }); @@ -179,6 +189,7 @@ public class Course_ManagerActivity extends AppCompatActivity { 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)); } @@ -211,6 +222,7 @@ public class Course_ManagerActivity extends AppCompatActivity { 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()) { diff --git a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java index af107e4..967a4b3 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java +++ b/SoftEngineering_selectiveCourse/app/src/main/java/com/example/softengineering_selectivecourse/User.java @@ -15,9 +15,9 @@ public class User extends DataSupport { 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 ArrayList courseAttend = new ArrayList(); +// private ArrayList courseFinished = new ArrayList(); +// private ArrayList CommentsOF = new ArrayList(); private int military_class_NotTaken; @@ -25,68 +25,68 @@ public class User extends DataSupport { 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 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; diff --git a/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml b/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml index 30af0ed..9460d7c 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml +++ b/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course__manager.xml @@ -139,6 +139,28 @@ android:layout_below="@+id/editTeacher" android:layout_toRightOf="@+id/couseStuNeeded" android:text="" /> + + @@ -158,7 +180,7 @@ android:hint="请输入课程简介(选填)" android:gravity="center" android:inputType="text" - android:layout_below="@+id/editStuNeeded" + android:layout_below="@+id/couseClassRoom" android:layout_toRightOf="@+id/couseBriefIntroduce" android:text="" android:maxLines="2"/> diff --git a/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml b/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml index bd62c18..8f443d7 100644 --- a/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml +++ b/SoftEngineering_selectiveCourse/app/src/main/res/layout/activity_course_basic_info.xml @@ -1,9 +1,231 @@ - + tools:context="com.example.softengineering_selectivecourse.CourseBasicInfoActivity" + > - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +