update the code, finish the basic function of the software

master
langqingjie 5 years ago
parent d184f34a67
commit d4b02f139a

@ -3,6 +3,11 @@
<component name="issues">
<option name="index">
<map>
<entry key="/Dummy.txt">
<value>
<set />
</value>
</entry>
<entry key="D:/ComputerScience/softwareEngineer/git_src/Android-Student-Course-Selection-System/app/src/main/java/com/check_course/Course_ManagerActivity.java">
<value>
<set />
@ -33,11 +38,21 @@
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/java/com/example/softengineering_selectivecourse/CourseBasicInfoActivity.java">
<value>
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/java/com/example/softengineering_selectivecourse/CourseRecommendedActivity.java">
<value>
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/java/com/example/softengineering_selectivecourse/CourseSelectingActivity.java">
<value>
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/java/com/example/softengineering_selectivecourse/Course_ManagerActivity.java">
<value>
<set />
@ -78,6 +93,11 @@
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/res/layout/activity_course_basic_info.xml">
<value>
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/res/layout/activity_course_recommended.xml">
<value>
<set />
@ -108,6 +128,11 @@
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/res/layout/comment_sqlist.xml">
<value>
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/res/layout/sqlist.xml">
<value>
<set />
@ -118,6 +143,11 @@
<set />
</value>
</entry>
<entry key="$PROJECT_DIR$/app/src/main/res/values/selectDown.xml">
<value>
<set />
</value>
</entry>
</map>
</option>
</component>

@ -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".(ùé <C3A9>
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".(½Ñâ

@ -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".(ùé <C3A9>
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]*$'.(×·¡Û
<EFBFBD>
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".(¤¹¢žúÿÿÿÿ

@ -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ÍŒ<C38D>Óú.
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.(•²<E280A2>µüÿÿÿÿ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 ("<>").(ùãÒ<C3A3>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"<This class has 9 parents which is greater than 5 authorized.(ù­¬£
^
java:S1128"<Remove this unused import 'android.annotation.SuppressLint'.(ÕƒóÏûÿÿÿÿ8¡Ò™ú.
V
java:S1128"4Remove this unused import 'android.database.Cursor'.(ŽÔäåúÿÿÿÿ8™¥Ïú.

@ -0,0 +1,2 @@
Q java:S110"<This class has 9 parents which is greater than 5 authorized.(ÞÒð

@ -0,0 +1,25 @@
?
java:S1659"$Declare "forget" on a separate line.(ð–ŒÅüÿÿÿÿ
Q
java:S1481 ".Remove this unused "firstTime" local variable.(‘°á¹ýÿÿÿÿ·×ú.
=
java:S1659""Declare "exit" on a separate line.(Ú¢è®øÿÿÿÿ
Y java:S125£"<This block of commented-out lines of code should be removed.(Ú°à¬8ùê½×ú.
V java:S110"<This class has 9 parents which is greater than 5 authorized.(·¡ïõøÿÿÿÿ
E
java:S1125i"(Remove the literal "true" boolean value.(Œýž„8Õ®×ú.
A
java:S1659"&Declare "showCode" on a separate line.(ð–ŒÅüÿÿÿÿ
H
java:S1068$"-Remove this unused "forgetpwd" private field.(ƒœÛ³ÿÿÿÿÿ
H
java:S1128"-Remove this unused import 'java.util.Random'.(èøÉ›ùÿÿÿÿ
t
java:S3776("RRefactor this method to reduce its Cognitive Complexity from 26 to the 15 allowed.(<28>ž¨Œþÿÿÿÿ8‡áôÖú.
a
java:S11928"FDefine a constant instead of duplicating this literal "sname" 4 times.(žÎôÌýÿÿÿÿ
;
java:S1659" Declare "us" on a separate line.(ð–ŒÅüÿÿÿÿ
<
java:S1659"!Declare "pwd" on a separate line.(º€Š·ùÿÿÿÿ

@ -0,0 +1,36 @@
<EFBFBD>
java:S1450"_Remove the "getCourseDetails" field and declare it as a local variable in the relevant methods.(³éÔ•ÿÿÿÿÿ8¢áë…û.
e
java:S1192Ü"GDefine a constant instead of duplicating this literal "cclass" 5 times.(‚ÍÄû.
u
java:S1450""SRemove the "item" field and declare it as a local variable in the relevant methods.(•²<E280A2>µüÿÿÿÿ8ê딀û.
w
java:S1450#"ZRemove the "listAdapter" field and declare it as a local variable in the relevant methods.(Ï”¨·8ê딀û.
O
java:S1128"-Remove this unused import 'org.w3c.dom.Text'.(¶Äè‹þÿÿÿÿ8ç£åÿú.
w
java:S2293"YReplace the type specification in this constructor call with the diamond operator ("<>").(ùãÒ<C3A3>8Åþý“û.
h
java:S1192t"FDefine a constant instead of duplicating this literal "cname" 7 times.(½äÿŒþÿÿÿÿ8ÄÙ”û.
^ java:S125Ñ"<This block of commented-out lines of code should be removed.(<28>êïöùÿÿÿÿ8Åþý“û.
k java:S100"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¾ð¸â8Åþý“û.
~
java:S1192Ì"`Define a constant instead of duplicating this literal "classFeature = ? and credit < ?" 4 times.(Ìôœ±8„ª·…û.
w
java:S2293é"YReplace the type specification in this constructor call with the diamond operator ("<>").(ùãÒ<C3A3>8Åþý“û.
V java:S110"<This class has 9 parents which is greater than 5 authorized.(û©Ÿ™úÿÿÿÿ
f
java:S1192Þ"HDefine a constant instead of duplicating this literal "ccredit" 5 times.(í¾•î8„ª·…û.
{
java:S2293]"YReplace the type specification in this constructor call with the diamond operator ("<>").(ÖÔ¾Ÿúÿÿÿÿ8í¾Ä…û.
w
java:S2293ø"YReplace the type specification in this constructor call with the diamond operator ("<>").(ùãÒ<C3A3>8Åþý“û.

java:S1192<"nDefine a constant instead of duplicating this literal "å<>生未知错误,显示详细信æ<C2A1>¯å¤±è´¥" 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 ("<>").(ùãÒ<C3A3>8Åþý“û.

@ -0,0 +1,2 @@
V java:S110"<This class has 9 parents which is greater than 5 authorized.(À¬” ÿÿÿÿÿ

@ -0,0 +1,34 @@
x java:S116"\Rename this field "TextViewUserMajor" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÊŠ ¾8Œ©ÄÛú.

java:S1450"rRemove the "TextViewUserCreditNotTaken_Military" field and declare it as a local variable in the relevant methods.(ɽôÛûÿÿÿÿ8»ôÊÛú.
ˆ java:S116"lRename this field "TextViewUserCreditNotTaken_Nature" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ù·…Ê8Œ©ÄÛú.
 java:S116 "eRename this field "TextViewUserSelectedCourse" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ééí°ÿÿÿÿÿ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 ("<>").(ùãÒ<C3A3><38>óÜú.
<EFBFBD>
java:S1450"rRemove the "TextViewUserCreditNotTaken_Humanity" field and declare it as a local variable in the relevant methods.(ã‚æÅÍÛú.
u
java:S1450&"SRemove the "item" field and declare it as a local variable in the relevant methods.(•²<E280A2>µüÿÿÿÿ8ûÛú.
<EFBFBD> java:S116"oRename this field "TextViewUserCreditNotTaken_Political" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(Ìêݧøÿÿÿÿ8Œ©ÄÛú.
<EFBFBD>
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"<This class has 9 parents which is greater than 5 authorized.(¬«ÇÎýÿÿÿÿ
<EFBFBD>
java:S1450"_Remove the "TextViewUserName" field and declare it as a local variable in the relevant methods.(³ÄÍÄÿÿÿÿÿ8²èÈÛú.
u java:S116"YRename this field "TextViewUserID" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ÁØ”Ÿ8Œ©ÄÛú.
<EFBFBD> java:S116"nRename this field "TextViewUserCreditNotTaken_Military" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ɽôÛûÿÿÿÿ8Œ©ÄÛú.
}
java:S1450"`Remove the "TextViewUserMajor" field and declare it as a local variable in the relevant methods.(ÊŠ ¾8²èÈÛú.
Š java:S116"nRename this field "TextViewUserCreditNotTaken_Humanity" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(ã‚æÅ8Œ©ÄÛú.
p java:S100Š"NRename this method name to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(à€Ë¾þÿÿÿÿ<38>óÜú.
| java:S116"[Rename this field "TextViewUserName" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(³ÄÍÄÿÿÿÿÿ8ò²ÃÛú.
c
java:S1192{"FDefine a constant instead of duplicating this literal "cname" 3 times.(öÂö<38>óÜú.
| java:S116!"[Rename this field "ButtonDropCourse" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.(¶Ç³üÿÿÿÿ8¢•¸Üú.

@ -0,0 +1,52 @@
H
java:S1128"-Remove this unused import 'android.Manifest'.(¦øïŽúÿÿÿÿ
H
java:S1128"-Remove this unused import 'android.os.Build'.(ãǤÚýÿÿÿÿ
U
java:S1128":Remove this unused import 'java.io.FileNotFoundException'.(·î™<C3AE>ùÿÿÿÿ
O
java:S1128"9Remove this unused import 'android.annotation.TargetApi'.(¥Îì‘
O
java:S1128 "4Remove this unused import 'android.database.Cursor'.(ŽÔäåúÿÿÿÿ
>
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""<This class has 9 parents which is greater than 5 authorized.(ʨ¹<C2A8>
U
java:S1128"?Remove this unused import 'android.provider.DocumentsContract'.(匎Ò
m
java:S1450'"WRemove the "register" field and declare it as a local variable in the relevant methods.(†çæ½
V
java:S1128";Remove this unused import 'android.graphics.BitmapFactory'.(âàºÍûÿÿÿÿ
F
java:S1068*"+Remove this unused "picture" private field.(ôŽ«”úÿÿÿÿ
N
java:S1128"8Remove this unused import 'android.provider.MediaStore'.(ãçšþ
A
java:S1481M"+Remove this unused "values" local variable.(ϱøæ
I
java:S1128"4Remove this unused import 'android.graphics.Bitmap'.(¾ì<C2BE>
>
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]*$'.(²ª¶¹úÿÿÿÿ

@ -0,0 +1,23 @@
c
java:S1192u"FDefine a constant instead of duplicating this literal "uname" 3 times.(·äùã8Ï»¾Öú.
X java:S110"<This class has 9 parents which is greater than 5 authorized.(öòÚŒ8Åí¢Õú.
w
java:S1450%"ZRemove the "listAdapter" field and declare it as a local variable in the relevant methods.(Ï”¨·<38>¡Õú.
w
java:S2293¿"YReplace the type specification in this constructor call with the diamond operator ("<>").(ùãÒ<C3A3><38>´Öú.
i java:S101"MRename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.(öòÚŒ<38>¡Õú.
{
java:S22939"YReplace the type specification in this constructor call with the diamond operator ("<>").(ÖÔ¾Ÿúÿÿÿÿ<38>¡Õú.
w
java:S1450"URemove the "select" field and declare it as a local variable in the relevant methods.(®ùç¶þÿÿÿÿ<38>¡Õú.
o
java:S1450"RRemove the "add" field and declare it as a local variable in the relevant methods.(‚ò ¶<38>¡Õú.
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.(•²<E280A2>µüÿÿÿÿ8•ñ¼Õú.
K
java:S1905}")Remove this unnecessary cast to "String".(ç†Üòúÿÿÿÿ8£©ÇÖú.

@ -1,3 +1,23 @@
P
app/src/main/AndroidManifest.xml,8\c\8c55c3ccc257e5907959013f99656e4c8ec3903e
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
<EFBFBD>
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

@ -10,7 +10,6 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".CourseReviewActivity"></activity>
<activity android:name=".CourseBasicInfoActivity" />
<activity android:name=".CourseSelectingActivity" />
<activity android:name=".CourseRecommendedActivity" />

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<litepal>
<dbname value = "CourseSelctionData"></dbname>
<version value = "4"></version>
<version value = "6"></version>
<list>
<mapping class="com.example.softengineering_selectivecourse.User"></mapping>
<mapping class="com.example.softengineering_selectivecourse.Course"></mapping>

@ -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;
}
}

@ -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<com.example.softengineering_selectivecourse.User> selected = new ArrayList<com.example.softengineering_selectivecourse.User>();
private ArrayList<Comments> comments = new ArrayList<Comments>();
private ArrayList<userIdentification> numOfStuSelected= new ArrayList<userIdentification>();
private ArrayList<Integer> Comments = new ArrayList<Integer>();
public class userIdentification{
private int id;
private String name;
public int getClassroom() {
return classroom;
}
public void setClassroom(int classroom) {
this.classroom = classroom;
}
// private ArrayList<userIdentification> numOfStuSelected= new ArrayList<userIdentification>();
// private ArrayList<Integer> Comments = new ArrayList<Integer>();
// public class userIdentification{
// private int id;
// private String name;
// }
public ArrayList<com.example.softengineering_selectivecourse.Comments> getComments() {
return comments;
}

@ -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<Map<String,Object>> data;//所有记录
private Map<String,Object> 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<Course> 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<Map<String, Object>>();//将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<String,Object> listItem = (Map<String,Object>)lv.getItemAtPosition(position);
courseComment.setText((String)listItem.get("ucommentInfo"));
// List<Course> courses = DataSupport.where("name = ? and id = ?", inputName.getText().toString(), listItem.get("cid").toString() ).find(Course.class);
List<Comments> 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<Comments> 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<String, Object>();
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);
}
}

@ -34,7 +34,7 @@ public class CourseRecommendedActivity extends AppCompatActivity {
private Map<String,Object> 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);
}
}

@ -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);
}
}

@ -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<Map<String,Object>> data;//所有记录
private Map<String,Object> 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<Map<String, Object>>();//将data实例化
dbFindAll(); //查询的方法//查询
//鼠标点击数据可以获取相对应的数据存入Map中
lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Map<String,Object> listItem = (Map<String,Object>)lv.getItemAtPosition(position);
siftingCourse.setText((String)listItem.get("cname"));
List<Course> 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<Course> 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<String, Object>();
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);
}
}

@ -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<String,Object> listItem = (Map<String,Object>)lv.getItemAtPosition(position);
inputName.setText((String)listItem.get("cname"));
List<Course> courses = DataSupport.where("name = ? and id = ?", inputName.getText().toString(), listItem.get("id").toString() ).find(Course.class);
List<Course> 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())
{

@ -15,9 +15,9 @@ public class User extends DataSupport {
private List<Course> completed_courses =new ArrayList<Course>();
private List<Comments> comments = new ArrayList<Comments>();
private ArrayList<courseIdentification> courseAttend = new ArrayList<courseIdentification>();
private ArrayList<courseIdentification> courseFinished = new ArrayList<courseIdentification>();
private ArrayList<Integer> CommentsOF = new ArrayList<Integer>();
// private ArrayList<courseIdentification> courseAttend = new ArrayList<courseIdentification>();
// private ArrayList<courseIdentification> courseFinished = new ArrayList<courseIdentification>();
// private ArrayList<Integer> CommentsOF = new ArrayList<Integer>();
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<courseIdentification> getCourseAttend() {
return courseAttend;
}
public ArrayList<courseIdentification> getCourseFinished() {
return courseFinished;
}
public ArrayList<Integer> getCommentsOF() {
return CommentsOF;
}
public void setCommentsOF(ArrayList<Integer> commentsOF) {
CommentsOF = commentsOF;
}
public void setCourseAttend(ArrayList<courseIdentification> courseAttend) {
this.courseAttend = courseAttend;
}
public void setCourseFinished(ArrayList<courseIdentification> 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<courseIdentification> getCourseAttend() {
// return courseAttend;
// }
//
// public ArrayList<courseIdentification> getCourseFinished() {
// return courseFinished;
// }
//
// public ArrayList<Integer> getCommentsOF() {
// return CommentsOF;
// }
//
// public void setCommentsOF(ArrayList<Integer> commentsOF) {
// CommentsOF = commentsOF;
// }
//
// public void setCourseAttend(ArrayList<courseIdentification> courseAttend) {
// this.courseAttend = courseAttend;
// }
// public void setCourseFinished(ArrayList<courseIdentification> courseFinished) {
// this.courseFinished = courseFinished;
// }
public void setPwd(String pwd) {
this.pwd = pwd;

@ -139,6 +139,28 @@
android:layout_below="@+id/editTeacher"
android:layout_toRightOf="@+id/couseStuNeeded"
android:text="" />
<TextView
android:id="@+id/couseClassRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18dp"
android:text=" 授课教室:"
android:layout_alignBaseline="@+id/editClassRoom"
android:layout_below="@+id/couseStuNeeded"
android:layout_marginTop="9dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"/>
<EditText
android:id="@+id/editClassRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入授课教室"
android:gravity="center"
android:inputType="number"
android:layout_below="@+id/editStuNeeded"
android:layout_toRightOf="@+id/couseStuNeeded"
android:text="" />
<TextView
android:id="@+id/couseBriefIntroduce"
android:layout_width="wrap_content"
@ -146,7 +168,7 @@
android:textSize="18dp"
android:text=" 简 介:"
android:layout_alignBaseline="@+id/editBriefIntroduce"
android:layout_below="@+id/couseStuNeeded"
android:layout_below="@+id/couseClassRoom"
android:layout_marginTop="9dp"
android:layout_alignParentLeft="true"
android:layout_marginLeft="20dp"/>
@ -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"/>

@ -1,9 +1,231 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CourseBasicInfoActivity">
tools:context="com.example.softengineering_selectivecourse.CourseBasicInfoActivity"
>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id="@+id/couseDetailInfo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:text="课 程 详 细 信 息"
android:textSize="25dp"
android:layout_marginTop="5dp"/>
<TextView
android:id="@+id/couseDetailClassLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginTop="60dp"
android:text="课程类别:"
android:textSize="20dp"
android:layout_marginLeft="20dp" />
<TextView
android:id="@+id/couseDetailClassRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入课程类别"
android:textSize="20dp"
android:layout_alignBaseline="@+id/couseDetailClassLeft"
android:layout_alignBottom="@+id/couseDetailClassLeft"
android:layout_toRightOf="@+id/couseDetailClassLeft"/>
<TextView
android:id="@+id/courseDetailNameLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="课 程 名:"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/couseDetailClassLeft"
android:layout_alignLeft="@+id/couseDetailClassLeft"
/>
<TextView
android:id="@+id/courseDetailNameRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入课程名"
android:textSize="20dp"
android:layout_alignBaseline="@+id/courseDetailNameLeft"
android:layout_alignBottom="@+id/courseDetailNameLeft"
android:layout_toRightOf="@+id/courseDetailNameLeft"/>
<TextView
android:id="@+id/courseDetailCreditLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 学 分:"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailNameLeft"
android:layout_alignLeft="@+id/courseDetailNameLeft"/>
<TextView
android:id="@+id/courseDetailCreditRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入学分"
android:textSize="20dp"
android:layout_alignBaseline="@+id/courseDetailCreditLeft"
android:layout_alignBottom="@+id/courseDetailCreditLeft"
android:layout_toRightOf="@+id/courseDetailCreditLeft" />
<TextView
android:id="@+id/courseDetailTeacherLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 授课教师:"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailCreditLeft"
android:layout_alignLeft="@+id/courseDetailCreditLeft"
/>
<TextView
android:id="@+id/courseDetailTeacherRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入授课教师"
android:textSize="20dp"
android:layout_alignBaseline="@+id/courseDetailTeacherLeft"
android:layout_alignBottom="@+id/courseDetailTeacherLeft"
android:layout_toRightOf="@+id/courseDetailTeacherLeft"
/>
<TextView
android:id="@+id/courseDetailStuNeededLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 课程人数:"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailTeacherLeft"
android:layout_alignLeft="@+id/courseDetailTeacherLeft"/>
<TextView
android:id="@+id/courseDetailStuNeededRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入课程人数"
android:textSize="20dp"
android:layout_alignBaseline="@+id/courseDetailStuNeededLeft"
android:layout_alignBottom="@+id/courseDetailStuNeededLeft"
android:layout_toRightOf="@+id/courseDetailStuNeededLeft"
/>
<TextView
android:id="@+id/courseDetailClassRoomLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 授课教室:"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailStuNeededLeft"
android:layout_alignLeft="@+id/courseDetailStuNeededLeft"/>
<TextView
android:id="@+id/courseDetailClassRoomRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入授课教室"
android:textSize="20dp"
android:layout_alignBaseline="@+id/courseDetailClassRoomLeft"
android:layout_alignBottom="@+id/courseDetailClassRoomLeft"
android:layout_toRightOf="@+id/courseDetailClassRoomLeft"/>
<TextView
android:id="@+id/courseDetailBriefIntroduceLeft"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=" 简 介:"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailClassRoomLeft"
android:layout_alignLeft="@+id/courseDetailClassRoomLeft"/>
<TextView
android:id="@+id/courseDetailBriefIntroduceRight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ems="10"
android:hint="请输入课程简介"
android:textSize="20dp"
android:layout_alignBaseline="@+id/courseDetailBriefIntroduceLeft"
android:layout_alignBottom="@+id/courseDetailBriefIntroduceLeft"
android:layout_toRightOf="@+id/courseDetailBriefIntroduceLeft"
android:maxLines="2"/>
<EditText
android:id="@+id/courseDetailCommentInfo"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:textSize="20dp"
android:hint="请输入评论"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailBriefIntroduceLeft"
android:layout_alignLeft="@+id/courseDetailBriefIntroduceLeft"
/>
<Button
android:id="@+id/courseDetailComment"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="评论"
android:textSize="20dp"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailBriefIntroduceLeft"
android:layout_alignParentRight="true"/>
<Button
android:id="@+id/courseDetailcommentDelete"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="删除评论"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailComment"
android:layout_alignLeft="@+id/courseDetailClassRoomLeft"/>
<Button
android:id="@+id/courseDetailcommentUpdate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="更新评论"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailComment"
android:layout_alignParentRight="true"/>
<Button
android:id="@+id/courseDetailAdd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=" 选课"
android:layout_marginTop="9dp"
android:layout_below="@+id/courseDetailcommentDelete"
android:layout_alignLeft="@+id/courseDetailClassRoomLeft"
/>
<ListView
android:id="@+id/lvDetail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/courseDetailAdd"
android:layout_alignParentLeft="true" />
</RelativeLayout>

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".CourseReviewActivity">
</androidx.constraintlayout.widget.ConstraintLayout>

@ -7,7 +7,7 @@
tools:context="com.example.softengineering_selectivecourse.CourseRecommendedActivity"
>
<TextView
android:id="@+id/textRecommendedWelcome0"
android:id="@+id/textCourseSelectingWelcome0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
@ -15,8 +15,117 @@
android:layout_marginTop="35dp"
android:text="请根据关键词进行查询"
android:textSize="30dp" />
<TextView
android:id="@+id/textCourseSelectingFeature"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="课程类型"
android:textSize="20dp"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="40dp"
android:layout_marginTop="100dp" />
<Spinner
android:entries="@array/classOrder"
android:id="@+id/spinnerCourseSelectingFeature"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_alignBaseline="@+id/textCourseSelectingFeature"
android:layout_alignBottom="@id/textCourseSelectingFeature"
android:layout_toRightOf="@id/textCourseSelectingFeature"
android:layout_marginLeft="160dp"/>
<TextView
android:id="@+id/textCourseSelectingCredit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="课程学分"
android:textSize="20dp"
android:layout_below="@id/textCourseSelectingFeature"
android:layout_alignLeft="@+id/textCourseSelectingFeature"
android:layout_marginTop="10dp"/>
<Spinner
android:entries="@array/classCredit"
android:id="@+id/spinnerCourseSelectingCredit"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_alignBaseline="@+id/textCourseSelectingCredit"
android:layout_alignBottom="@id/textCourseSelectingCredit"
android:layout_toRightOf="@id/textCourseSelectingCredit"
android:layout_marginLeft="160dp"/>
<TextView
android:id="@+id/textCourseSelectingclassRoom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="课程教学楼"
android:textSize="20dp"
android:layout_below="@id/textCourseSelectingCredit"
android:layout_alignLeft="@+id/textCourseSelectingCredit"
android:layout_marginTop="10dp"/>
<Spinner
android:entries="@array/classClassroom"
android:id="@+id/spinnerCourseSelectingClassRoom"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_alignBaseline="@+id/textCourseSelectingclassRoom"
android:layout_alignBottom="@id/textCourseSelectingclassRoom"
android:layout_alignLeft="@+id/spinnerCourseSelectingCredit"/>
<TextView
android:id="@+id/textCourseRecommendedCliked"
android:id="@+id/textCourseSelectingTeacher"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="课程老师"
android:textSize="20dp"
android:layout_below="@id/textCourseSelectingclassRoom"
android:layout_alignLeft="@+id/textCourseSelectingclassRoom"
android:layout_marginTop="10dp"/>
<EditText
android:id="@+id/EditCourseSelectingTeacher"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:hint="请输入"
android:layout_alignBaseline="@+id/textCourseSelectingTeacher"
android:layout_alignBottom="@id/textCourseSelectingTeacher"
android:layout_toRightOf="@id/textCourseSelectingTeacher"
android:layout_marginLeft="160dp"/>
<TextView
android:id="@+id/textCourseSelectingItem"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="筛选选项"
android:textSize="20dp"
android:layout_below="@id/textCourseSelectingTeacher"
android:layout_alignLeft="@+id/textCourseSelectingTeacher"
android:layout_marginTop="10dp"/>
<Spinner
android:entries="@array/classSift"
android:id="@+id/spinnerCourseSelectingselItem"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_alignBaseline="@+id/textCourseSelectingItem"
android:layout_alignBottom="@id/textCourseSelectingItem"
android:layout_alignLeft="@+id/spinnerCourseSelectingCredit"/>
<TextView
android:id="@+id/textCourseSelectingCliked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="选定课程"
@ -24,44 +133,52 @@
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="40dp"
android:layout_marginTop="150dp" />
android:layout_marginTop="300dp" />
<TextView
android:id="@+id/textCourseRecommendedClikedCourse"
android:id="@+id/textCourseSelectingClikedCourse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="courseName"
android:textSize="20dp"
android:layout_alignBaseline="@+id/textCourseRecommendedCliked"
android:layout_alignBottom="@id/textCourseRecommendedCliked"
android:layout_toRightOf="@id/textCourseRecommendedCliked"
android:layout_alignBaseline="@+id/textCourseSelectingCliked"
android:layout_alignBottom="@id/textCourseSelectingCliked"
android:layout_toRightOf="@id/textCourseSelectingCliked"
android:layout_marginLeft="160dp"/>
<Button
android:id="@+id/buttonCourseRecommendedSelect"
android:id="@+id/buttonCourseSelectSelect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:text="选课"
android:layout_below="@+id/textCourseRecommendedCliked"
android:layout_alignLeft="@+id/textCourseRecommendedCliked"
android:layout_below="@+id/textCourseSelectingCliked"
android:layout_alignLeft="@+id/textCourseSelectingCliked"
android:layout_marginRight="16dp" />
<Button
android:id="@+id/buttonCourseRecommendedQueryDetail"
android:id="@+id/buttonCourseSelectingSifting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="查询"
android:layout_alignBaseline="@+id/buttonCourseSelectSelect"
android:layout_alignBottom="@id/buttonCourseSelectSelect"
android:layout_toRightOf="@+id/buttonCourseSelectSelect"
android:layout_marginLeft="30dp" />
<Button
android:id="@+id/buttonCourseSelectingQueryDetail"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="课程详情"
android:layout_alignBaseline="@+id/buttonCourseRecommendedSelect"
android:layout_alignBottom="@id/buttonCourseRecommendedSelect"
android:layout_toRightOf="@+id/buttonCourseRecommendedSelect"
android:layout_alignBaseline="@+id/buttonCourseSelectSelect"
android:layout_alignBottom="@id/buttonCourseSelectSelect"
android:layout_toRightOf="@+id/buttonCourseSelectSelect"
android:layout_marginLeft="160dp" />
<ListView
android:id="@+id/lv5"
android:id="@+id/lv6"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/buttonCourseRecommendedSelect"
android:layout_below="@+id/buttonCourseSelectSelect"
android:layout_marginTop="22dp"
android:layout_alignParentLeft="true" />

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textCommentID1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="序号"
android:layout_marginTop="35dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true" />
<TextView
android:id="@+id/textCommentCID1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ID"
android:layout_alignBaseline="@+id/textCommentID1"
android:layout_alignBottom="@+id/textCommentID1"
android:layout_alignLeft="@+id/textCommentCID0"
/>
<TextView
android:id="@+id/textCommentInfo1"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:text="评论"
android:layout_alignBaseline="@+id/textCommentID1"
android:layout_alignBottom="@+id/textCommentID1"
android:layout_alignLeft="@+id/textCommentInfo0"
/>
<TextView
android:id="@+id/textCommentProvider1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="评论者"
android:layout_alignBaseline="@+id/textCommentID1"
android:layout_alignBottom="@+id/textCommentID1"
android:layout_alignLeft="@+id/textCommentProvider0"></TextView>
<TextView
android:id="@+id/textCommnentID0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:text="序号"
/>
<TextView
android:id="@+id/textCommentCID0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textCommnentID0"
android:layout_alignBottom="@+id/textCommnentID0"
android:text="ID"
android:layout_toRightOf="@+id/textCommnentID0"
android:layout_marginLeft="5dp"
/>
<TextView
android:id="@+id/textCommentInfo0"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/textCommnentID0"
android:layout_alignBottom="@+id/textCommnentID0"
android:text="评论"
android:layout_toRightOf="@+id/textCommentCID0"
android:layout_marginLeft="5dp"
/>
<TextView
android:id="@+id/textCommentProvider0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="评论者"
android:layout_alignBaseline="@+id/textCommnentID0"
android:layout_alignBottom="@+id/textCommnentID0"
android:layout_toRightOf="@+id/textCommentInfo0"
android:layout_marginLeft="10dp"></TextView>
</RelativeLayout>

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string-array name="classOrder">
<item>请选取</item>
<item>Military</item>
<item>Nature</item>
<item>Humanity</item>
<item>Political</item>
</string-array>
<string-array name="classCredit">
<item>请选取</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
<string-array name="classClassroom">
<item>请选取</item>
<item>301</item>
<item>302</item>
<item>303</item>
<item>304</item>
<item>305</item>
<item>306</item>
</string-array>
<string-array name="classSift">
<item>classFeature</item>
<item>credit</item>
<item>classroom</item>
<item>teacher</item>
</string-array>
</resources>
Loading…
Cancel
Save