Make student's interface look better.

Bug430-Eden2
Lan Hui 2023-08-09 16:40:26 +08:00
parent a4a413f700
commit 89395dbb98
3 changed files with 576 additions and 595 deletions

View File

@ -10,14 +10,14 @@ include 'Header.php';
<div class="container">
<?php
$student_id = $_SESSION["user_student_id"];
$group_id = $_SESSION["user_group_id"];
$c_date = date("Y-m-d H:i");
<?php
$student_id = $_SESSION["user_student_id"];
$group_id = $_SESSION["user_group_id"];
$c_date = date("Y-m-d H:i");
if(!empty($_GET["url"]))
{
if(!empty($_GET["url"]))
{
$course_url = mysqli_real_escape_string($con, $_GET["url"]);
$result = mysqli_query($con,"SELECT `Course_ID`, `Course_Name`, `Academic_Year`, `Faculty`,"
. " `Lecturer_User_ID`, `TA_User_ID`, `Course_Code`, `URL`, `Verify_New_Members` "
@ -41,8 +41,7 @@ if(!empty($_GET["url"]))
$ta_result = mysqli_query($con, "SELECT Full_Name FROM users_table where User_ID in (select TA from course_ta where Course_ID='$course_id');");
if (mysqli_num_rows($ta_result) == 0) {
echo " <div class='alert' style='margin-left:20px;border-bottom:2px solid #1D91EF;'> <a href='~\..\Courses.php?course=$url'>
Courses </a> > ($code) $name > Assignments <br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic &nbsp; Lecturer: $lecturer </span>
</div> ";
Courses </a> > ($code) $name > Assignments <br> <span style='font-size:8pt'>Faculty: $faculty &nbsp; Year: $academic &nbsp; Lecturer: $lecturer </span></div> ";
} else {
$ta_name = "";
while ($row = mysqli_fetch_assoc($ta_result)) {
@ -55,11 +54,18 @@ if(!empty($_GET["url"]))
}
}
}
}
?>
}
?>
<div class="row" style='margin-left:20px;float:left'>
<?php
if( $_SESSION['user_type'] == "Student")
{
?>
<div class="row">
<div class="col-9">
<?php
@ -74,21 +80,6 @@ if(!empty($_GET["url"]))
}
?>
</div>
<?php
if( $_SESSION['user_type'] == "Student")
{
?>
<hr>
<div class="row" style="width:95%;margin:auto; text-align:left;">
<div class="col-md-9">
<!-- Nav tabs -->
<ul class="nav nav-tabs" id="myTab">
@ -107,7 +98,8 @@ if( $_SESSION['user_type'] == "Student")
</ul>
<div class="tab-content">
<div id="menu1" class="tab-pane active"><br>
<div id="menu1" class="tab-pane active">
<?php
@ -187,7 +179,7 @@ if( $_SESSION['user_type'] == "Student")
<div id="menu2" class="tab-pane"><br>
<div id="menu2" class="tab-pane">
<?php
$group_id=$_SESSION['group_id'];
@ -233,21 +225,20 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
if($att4!=""){
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
;
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'><span class='btn btn-sm btn-outline-danger' style='margin-left:0px;'>MISSED</span> $title ($marks Marks) <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:8pt'>Posted: $posted<br> Deadline: $deadline &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> Attachments : $full_link </span>
</div>";
echo "<div class='card' style='word-wrap: break-word;'> <div class='card-body'> <span class='btn btn-sm btn-outline-danger'>MISSED</span> <h5 class='card-title'>$title</h5> <h6 class='card-subtitle'>($marks Marks)</h6> <br/> <p class='card-text'> $ins</p>
<br> <p class='card-text'> <small> Posted: $posted &nbsp;&nbsp;&nbsp; Deadline: $deadline &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br> Attachments: $full_link </small></p>
</div></div><br>";
}}
echo "";
}
}
?>
</div>
<div id="menu3" class="tab-pane"><br>
<div id="menu3" class="tab-pane">
<?php
@ -298,9 +289,9 @@ Lab_Report_ID not in (select Lab_Report_ID from lab_report_submissions where (St
$full_link= $full_link."| <a href='~\..\Lab_Report_Assignments\\$att4'>$att4</a>";
}
echo " <k href='#'> <div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
echo "<div class='btn btn-default break-word' style='dislay:block; word-wrap: break-word; border: 1px solid #F0F0F0;border-left: 4px solid #03407B;'>
$title ($marks Marks) <i class='fa fa-check-circle'></i> Submitted <br> <span style='font-size:8pt'> $ins</span>
<br> <span style='font-size:9pt'>Posted:$posted &nbsp; Deadline:$deadline</span> &nbsp; &nbsp; &nbsp; $submittedx &nbsp;
<br> <span style='font-size:9pt'>Posted: $posted &nbsp; Deadline: $deadline</span> &nbsp; &nbsp; &nbsp; $submittedx &nbsp;
<br> <span style='font-size:9pt'>Submitted files: ";
$Sub_result = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_report_submissions.Lab_Report_ID,
@ -346,7 +337,7 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
}
}
echo "</span></div></k>";
echo "</span></div>";
}}
echo "";
@ -357,8 +348,7 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
<?php
$sqli=mysqli_query($con, "SELECT * from course_groups_table WHERE Course_Group_id=$group_id and Course_id=$course_id");
while($row = mysqli_fetch_assoc($sqli))
{ $Group_Leader=$row['Group_Leader'];
while($row = mysqli_fetch_assoc($sqli)) { $Group_Leader=$row['Group_Leader'];
$Group_Member=$row['Group_Member'];
$Group_Member2=$row['Group_Member2'];
$Group_Member3=$row['Group_Member3'];
@ -367,8 +357,9 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
?>
<div id="menu4" class="tab-pane"><br>
<div id="menu4" class="tab-pane">
<?php
$resultx = mysqli_query($con,"SELECT `Submission_ID`, `Submission_Date`, lab_reports_table.`Lab_Report_ID`, `Student_id`, "
. "`Course_Group_id`, `Notes`, lab_report_submissions.`Marks`,
lab_report_submissions.Remarking_Reason,
@ -387,11 +378,10 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
. " lab_reports_table.Lab_Report_ID in (select Lab_Report_ID from lab_report_submissions"
. " where (Status='Marked' or Status='Remarking') and (Student_id=$student_id or Course_Group_id=$group_id) and Course_ID=$course_id) ORDER by Submission_ID DESC");
if(mysqli_num_rows($resultx)==0)
{
if(mysqli_num_rows($resultx)==0) {
echo '<div class="alert alert-info">You have no marked submissions.</div>';
} else { while($row = mysqli_fetch_assoc($resultx)) {
} else {
while($row = mysqli_fetch_assoc($resultx)) {
$title=$row['Lab_Title'];
$marks=$row['Marks'];
$Originalmarks=$row['Original_marks'];
@ -407,15 +397,14 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
$notes=$row['Notes'];
$status= $row['Status'];
$remarking_reason=$row['Remarking_Reason'];
if($status=='Marked')
{
if($status=='Marked') {
$rm_data="\Script.php?remarking=yes&id=$Submission_ID&url=$url&status=Remarking";
$remarking="<button onclick='remarking(\"$rm_data\")' class='btn btn-sm btn-light'>Request remarking</button>";
}
if($status=='Remarking')
{
$remarking="<span style='color:orange'><i class='fa fa-info-circle'></i> Remarking request sent </span> <br> Reasons for remarking: <i>$remarking_reason </i> <br>";
if($status=='Remarking') {
$remarking="<span style='color:orange'><i class='fa fa-info-circle'></i> Remarking request sent </span> <br> Reasons for remarking: <i>$remarking_reason </i> <br>";
}
@ -430,11 +419,10 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
left JOIN course_group_members_table on course_group_members_table.Course_Group_id=lab_report_submissions.Course_Group_id
where Lab_Report_ID=$id and lab_report_submissions.Student_id='$student_id'");
if(mysqli_num_rows($Sub_result)==0)
{
if(mysqli_num_rows($Sub_result)==0) {
echo "No Attachments found.";
} else { while($row = mysqli_fetch_assoc($Sub_result)) {
} else {
while($row = mysqli_fetch_assoc($Sub_result)) {
$at1=$row['Attachment1'];
$at2=$row['Attachment2'];
$at3=$row['Attachment3'];
@ -442,14 +430,14 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
$full_link="<a href='~\..\Lab_Report_Submisions\\$at1'>$at1</a>";
if($at2!=""){
if($at2!="") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at2'>$at2</a>";
}
if($at3!=""){
if($at3!="") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at3'>$at3</a>";
}
if($at4!=""){
if($at4!="") {
$full_link= $full_link."| <a href='~\..\Lab_Report_Submisions\\$at4'>$at4</a>";
}
@ -458,30 +446,27 @@ where Lab_Report_ID=$lab_repo_id and (lab_report_submissions.Student_id='$studen
}
}
}}
echo "</small></div></div>";
echo "</small></div></div>"; // This statement's position must be correct. Otherwise, the "My groups" part won't be placed correctly.
}
}
?>
</div>
</div> <!-- Closing menu4 -->
</div> <!-- Closing tab-content -->
</div> <!-- Closing col-9 -->
</div>
<div class="col-3">
</div>
<br><br><br><br><br><br><br><br><br>
<div class="col-md-3">
<h3>My groups</h3>
<h1 class="display-6">My groups</h1>
<?php
$resultx1 = mysqli_query($con,"SELECT `Course_Group_id` FROM `course_groups_table` WHERE Course_id=$course_id");
while($row = mysqli_fetch_assoc($resultx1)) {$count_groups=$row['Course_Group_id'];}
echo " <button onclick='createGroup()' class='btn btn-primary'>Create group</button>";
?>
<hr>
<?php
$result = mysqli_query($con," SELECT `ID`, course_group_members_table.Course_Group_id, `Student_ID`,
@ -492,7 +477,8 @@ course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id W
if(mysqli_num_rows($result)==0)
{
echo "You have no group in this course.";
} else { while($row = mysqli_fetch_assoc($result)) {
} else {
while($row = mysqli_fetch_assoc($result)) {
$name=$row['Group_Name'];
$id=$row['Course_Group_id'];
$status=$row['Status'];
@ -510,9 +496,11 @@ course_groups_table.Course_Group_id=course_group_members_table.Course_Group_id W
# Add "delete group" button and allow only group creator to delete it
$extra4 = "<button onclick='deleteGroup($id)' class='btn btn-sm btn-danger'>Delete group</button>";
echo "<div class='btn-default'><small> $name ($status) $extra $extra2 $extra3" .
echo "<ul class='list-group'>";
echo "<li class='list-group-item'><b>$name</b> ($status) $extra $extra2 $extra3" .
(($status == "Created")? "$extra4": "")
."</small></div>";
."</li>";
$rs2=mysqli_query($con,"SELECT `ID`, `Course_Group_id`, course_group_members_table.Student_ID,
course_group_members_table.`Status`,users_table.Full_Name FROM `course_group_members_table`
@ -531,30 +519,27 @@ where course_group_members_table.Course_Group_id=$id");
#Show group members + remove button next to each member except the creator of the group
if($flag){
echo "<li>$name - $Student_ID ($status)&nbsp;".(($status != "Created")?"<button onclick='removeMember($Student_ID, $id)'
echo "<li class='list-group-item'>$name - $Student_ID ($status)&nbsp;".(($status != "Created")?"<button onclick='removeMember($Student_ID, $id)'
class='btn btn-sm btn-warning'>Kick out</button>":"")."</li>";
}else{
echo "<li><small> $name - $Student_ID ($status)</small>";
} else{
echo "<li class='list-group-item'><small> $name - $Student_ID ($status)</small>";
}
}
echo "<ul>";
}
}
?>
</div>
</div>
<?php
}
?>
<?php
}
?>
</div>
<script src="./css/jquery-1.11.1.min.js"></script>
<script src="./css/jquery-ui.min.js"></script>
<link rel="stylesheet" href="./css/jquery-ui.css" />

View File

@ -639,7 +639,7 @@ INNER JOIN course_students_table on course_students_table.Course_ID=courses_tabl
</div>
<div class='col-md-2'> <br>
<input type='submit' class='btn btn-primary' value='Find'>
<button type='submit' class='btn btn-primary'>Find</button>
</div>
</div>
</div>

View File

@ -9,7 +9,7 @@ include 'Header.php';
<div class="container">
<div class='row'>
<div class='row'>
<?php
@ -81,12 +81,12 @@ include 'Header.php';
?>
</div>
</div>
<div>
<div>
<h3>Submit assignment</h3>
<h1 class="display-6">Submit assignment</h1>
<hr>
<div class="row">
@ -99,31 +99,27 @@ include 'Header.php';
<input type='hidden' name='student_id' value='<?php echo $student_id; ?>' required=''/>
<input type='hidden' name='group_id' value='<?php echo $Group_ID; ?>' required=''/>
<input type='hidden' name='url' value='<?php echo $url; ?>' required=''/>
Title
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
Attachment 1
<div class='mb-3'>
<label class='form-label'>Title</label>
<input type='text' name='title' placeholder='Assignment submission title' class='form-control' required=''>
</div>
<div class='mb-3'>
<label class='form-label'>Attachment 1</label>
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control' required=''>
Attachment 2
<label class='form-label'>Attachment 2</label>
<input type='file' name='attachment2' placeholder='Attachment 2' class='form-control'>
Attachment 3
<label class='form-label'>Attachment 3</label>
<input type='file' name='attachment3' placeholder='Attachment 3' class='form-control' >
Attachment 4
<label class='form-label'>Attachment 4</label>
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
<br>
<input type='submit' class='btn btn-primary' value='Submit'><br>
</div>
<button type='submit' class='btn btn-primary'>Submit</button>
</form>
</div>
</div>
</div>
</div>
</div>