From ae43e44c3bcd9fe7925da84e9db97d5c6b2fe90f Mon Sep 17 00:00:00 2001 From: xlx-hash <2574280388@qq.com> Date: Tue, 18 May 2021 16:25:04 +0800 Subject: [PATCH 1/5] file changed:add a quiz funtion --- Course.php | 103 ++-- Courses.php | 8 + LRR.iml | 9 + Script.php | 2 +- homepage/overview.html | 33 +- homepage/screenshots.html | 29 +- homepage/screenshots/Lecture_Review_test.png | Bin 0 -> 82920 bytes .../screenshots/Lecture_design_topics.png | Bin 0 -> 66854 bytes .../screenshots/Lecture_release_testing.png | Bin 0 -> 85380 bytes .../screenshots/Student_answer_topics.png | Bin 0 -> 66878 bytes index.php | 3 + onlineTest/LocalRefresh.php | 81 +++ onlineTest/README.md | 65 +++ onlineTest/answerResult.php | 485 ++++++++++++++++++ onlineTest/css/designTopic.css | 80 +++ onlineTest/css/releaseTest.css | 80 +++ onlineTest/css/student.css | 80 +++ onlineTest/designTopic.php | 276 ++++++++++ onlineTest/downLoad.php | 26 + ...41\346\265\213\350\257\225_1619788767.txt" | 12 + ...41\346\265\213\350\257\225_1619702484.txt" | 12 + ...41\346\265\213\350\257\225_1619837457.txt" | 12 + ...41\346\265\213\350\257\225_1619788767.txt" | 4 + ...41\346\265\213\350\257\225_1619702484.txt" | 4 + ...41\346\265\213\350\257\225_1619837457.txt" | 3 + onlineTest/img/add.png | Bin 0 -> 14810 bytes onlineTest/img/delete.png | Bin 0 -> 52104 bytes onlineTest/img/instructions/answer1.png | Bin 0 -> 60858 bytes onlineTest/img/instructions/c.png | Bin 0 -> 229140 bytes onlineTest/img/instructions/c2.png | Bin 0 -> 218908 bytes onlineTest/img/instructions/c3.png | Bin 0 -> 253128 bytes onlineTest/img/instructions/courses.png | Bin 0 -> 223247 bytes onlineTest/img/instructions/release1.png | Bin 0 -> 130930 bytes onlineTest/img/instructions/s1.png | Bin 0 -> 170916 bytes onlineTest/img/instructions/s2.png | Bin 0 -> 101170 bytes onlineTest/img/sub.png | Bin 0 -> 8630 bytes onlineTest/releaseTest.php | 481 +++++++++++++++++ onlineTest/student.php | 339 ++++++++++++ onlineTest/submited.php | 238 +++++++++ onlineTest/successful.php | 183 +++++++ onlineTest/util.php | 79 +++ 41 files changed, 2675 insertions(+), 52 deletions(-) create mode 100644 LRR.iml create mode 100644 homepage/screenshots/Lecture_Review_test.png create mode 100644 homepage/screenshots/Lecture_design_topics.png create mode 100644 homepage/screenshots/Lecture_release_testing.png create mode 100644 homepage/screenshots/Student_answer_topics.png create mode 100644 onlineTest/LocalRefresh.php create mode 100644 onlineTest/README.md create mode 100644 onlineTest/answerResult.php create mode 100644 onlineTest/css/designTopic.css create mode 100644 onlineTest/css/releaseTest.css create mode 100644 onlineTest/css/student.css create mode 100644 onlineTest/designTopic.php create mode 100644 onlineTest/downLoad.php create mode 100644 "onlineTest/file/quizzes/CSC1234_\347\254\2542\346\254\241\346\265\213\350\257\225_1619788767.txt" create mode 100644 "onlineTest/file/quizzes/CSC1234_\347\254\254\344\270\200\346\254\241\346\265\213\350\257\225_1619702484.txt" create mode 100644 "onlineTest/file/quizzes/P.M2019_\347\254\2543\346\254\241\346\265\213\350\257\225_1619837457.txt" create mode 100644 "onlineTest/file/score/answer_CSC1234_\347\254\2542\346\254\241\346\265\213\350\257\225_1619788767.txt" create mode 100644 "onlineTest/file/score/answer_CSC1234_\347\254\254\344\270\200\346\254\241\346\265\213\350\257\225_1619702484.txt" create mode 100644 "onlineTest/file/score/answer_P.M2019_\347\254\2543\346\254\241\346\265\213\350\257\225_1619837457.txt" create mode 100644 onlineTest/img/add.png create mode 100644 onlineTest/img/delete.png create mode 100644 onlineTest/img/instructions/answer1.png create mode 100644 onlineTest/img/instructions/c.png create mode 100644 onlineTest/img/instructions/c2.png create mode 100644 onlineTest/img/instructions/c3.png create mode 100644 onlineTest/img/instructions/courses.png create mode 100644 onlineTest/img/instructions/release1.png create mode 100644 onlineTest/img/instructions/s1.png create mode 100644 onlineTest/img/instructions/s2.png create mode 100644 onlineTest/img/sub.png create mode 100644 onlineTest/releaseTest.php create mode 100644 onlineTest/student.php create mode 100644 onlineTest/submited.php create mode 100644 onlineTest/successful.php create mode 100644 onlineTest/util.php diff --git a/Course.php b/Course.php index 60677ce..0b2dcf1 100644 --- a/Course.php +++ b/Course.php @@ -168,8 +168,21 @@ } echo "
$title ($type)
$ins -
Posted : $posted      Deadline : $deadline     ($Marks Marks)         Submit Lab Report
Attachments : $full_link
+
Posted : $posted      Deadline : $deadline     ($Marks Marks)        "; + + /*修改开始*/ + /** + * 当为测试时不需要添加附件,同时也不需要显示附件 + * 因为测试的附件链接中(Attachment_link_1)存储的是题目的地址,如果添加的话,会有泄漏题目的风险 + */ + if($ins == "quiz"){ + echo " Submit Quiz
"; + }else{ + echo " Submit Lab Report
Attachments : $full_link +"; + } + /*修改结束*/ }} echo ""; @@ -234,9 +247,17 @@ ; echo "
MISSED $title ($marks Marks)
$ins -
Posted: $posted
Deadline: $deadline          
Attachments : $full_link
-
"; - +
Posted: $posted
Deadline: $deadline          "; + + /*修改开始*/ + /** + * 当为测试时不需要添加附件,同时也不需要显示附件 + * 因为测试的附件链接中(Attachment_link_1)存储的是题目的地址,如果添加的话,会有泄漏题目的风险 + */ + if($ins != "quiz"){ + echo "
Attachments : $full_link
"; + } + /*修改结束*/ }} echo ""; ?> @@ -298,52 +319,62 @@ echo "
$title
$ins -
Posted : $posted Deadline : $deadline ($marks Marks)     $submittedx  Submitted -
Submitted files: "; +
Posted : $posted Deadline : $deadline ($marks Marks)     $submittedx  Submitted "; + /*修改开始*/ + /** + * 当要提交的报告不是quiz(测试)的时候,查询数据库,显示学生已提交的文件的信息 + */ + if($ins != "quiz") { + echo "
Submitted files: "; - $Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, + $Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID, lab_report_submissions.Student_id sub_std, lab_report_submissions.Course_Group_id, `Attachment1`, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Marks`, lab_report_submissions.Status, `Title`,users_table.Full_Name,course_group_members_table.Student_ID FROM `lab_report_submissions` Left JOIN users_table on users_table.Student_ID=lab_report_submissions.Student_id left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id -where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$student_id')"); +where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$student_id')"); - if(mysqli_num_rows($Sub_result) == 0) - { - echo "No Attachments found."; - - } else { - while($row = mysqli_fetch_assoc($Sub_result)) { - $at1=$row['Attachment1']; - $at2=$row['Attachment2']; - $at3=$row['Attachment3']; - $at4=$row['Attachment4']; + if(mysqli_num_rows($Sub_result) == 0) + { + echo "No Attachments found."; - $base_at1 = basename($at1); - $base_at2 = basename($at2); - $base_at3 = basename($at3); - $base_at4 = basename($at4); - - $full_link = "$base_at1"; // prevent students from directly accessing their classmates' submissions - - if($at2!=""){ - $full_link= $full_link." | $base_at2"; - } - if($at3!=""){ - $full_link= $full_link." | $base_at3"; - } - - if($at4!=""){ - $full_link= $full_link." | $base_at4"; - } + } else { + while($row = mysqli_fetch_assoc($Sub_result)) { + $at1=$row['Attachment1']; + $at2=$row['Attachment2']; + $at3=$row['Attachment3']; + $at4=$row['Attachment4']; - echo $full_link; + $base_at1 = basename($at1); + $base_at2 = basename($at2); + $base_at3 = basename($at3); + $base_at4 = basename($at4); + + $full_link = "$base_at1"; // prevent students from directly accessing their classmates' submissions + + if($at2!=""){ + $full_link= $full_link." | $base_at2"; + } + if($at3!=""){ + $full_link= $full_link." | $base_at3"; + } + if($at4!=""){ + $full_link= $full_link." | $base_at4"; } + + echo $full_link; + } + } + } + /*修改结束*/ + + + diff --git a/Courses.php b/Courses.php index e7ea2ee..551e726 100644 --- a/Courses.php +++ b/Courses.php @@ -464,6 +464,14 @@ function extend_deadline(id) { + + Create New Quiz +
+ Create Quiz +    + Show Quiz +
+ diff --git a/LRR.iml b/LRR.iml new file mode 100644 index 0000000..d583ac3 --- /dev/null +++ b/LRR.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/Script.php b/Script.php index 851323e..951bc99 100644 --- a/Script.php +++ b/Script.php @@ -132,7 +132,7 @@ function is_valid_student_number($student_id) { if ($con->query($sql) === TRUE) { header("Location: Courses.php"); } else { - echo "Something really bad (SQL insertion error) happened during sign up."; + echo "Something really bad (SQL insertion error) happend during sign up."; } } diff --git a/homepage/overview.html b/homepage/overview.html index 2312fb3..7c39cc8 100644 --- a/homepage/overview.html +++ b/homepage/overview.html @@ -48,7 +48,7 @@

Community

-

About us

+

Contact