Skip to content

Commit

Permalink
README.md: Rectified the conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Mary-Ak committed Apr 25, 2020
2 parents 36313a6 + ec80d4c commit eb520a1
Show file tree
Hide file tree
Showing 10 changed files with 547 additions and 294 deletions.
43 changes: 27 additions & 16 deletions Course.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@

$resultx1 = mysqli_query($con,$sql);

while($row = mysqli_fetch_assoc($resultx1)) {$group_id=$row['Course_Group_id'];}
while($row = mysqli_fetch_assoc($resultx1)) {$_SESSION['group_id']=$row['Course_Group_id'];}

if($group_id==""){$group_id=-1;}


$group_id=$_SESSION['group_id'];


$var="SELECT Type,Lab_Report_ID,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`
Expand Down Expand Up @@ -169,6 +169,7 @@

<div id="menu2" class="container tab-pane"><br>
<?php
$group_id=$_SESSION['group_id'];
$result = mysqli_query($con,"SELECT Lab_Report_ID,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`
FROM `lab_reports_table`
where
Expand Down Expand Up @@ -236,6 +237,7 @@
</div>
<div id="menu3" class="container tab-pane"><br>
<?php
$group_id=$_SESSION['group_id'];
$resultx = mysqli_query($con,"SELECT Lab_Report_ID,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, lab_reports_table.Title, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, `Attachment_link_4`
FROM `lab_reports_table`
Expand Down Expand Up @@ -293,7 +295,8 @@
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')");
// or lab_report_submissions.Course_Group_id='$group_id'

if(mysqli_num_rows($Sub_result)==0)
{
Expand Down Expand Up @@ -341,30 +344,38 @@










<?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'];
$Group_Member=$row['Group_Member'];
$Group_Member2=$row['Group_Member2'];
$Group_Member3=$row['Group_Member3'];
$Group_Member4=$row['Group_Member4'];
}
?>



<div id="menu4" class="container tab-pane"><br>
<?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,
`Status`, lab_reports_table.Title Lab_Title,lab_reports_table.Marks Original_marks FROM `lab_report_submissions` "
. "INNER JOIN lab_reports_table on lab_reports_table.Lab_Report_ID=lab_report_submissions.Lab_Report_ID "
. "WHERE lab_report_submissions.Student_id='$student_id' and"
. "WHERE (lab_report_submissions.Student_id='$student_id'
or (lab_report_submissions.Student_id='$Group_Leader' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member2' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member3' and lab_report_submissions.Course_Group_id='$group_id')
or (lab_report_submissions.Student_id='$Group_Member4' and lab_report_submissions.Course_Group_id='$group_id')
)and"
. ""
. ""
. ""
. " 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) and Course_ID=$course_id) ORDER by Submission_ID DESC");
. " 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");



Expand Down Expand Up @@ -641,11 +652,11 @@
?>


<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="css/jquery-1.11.1.min.js"></script>

<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<script src="css/jquery-ui.min.js"></script>

<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="css/jquery-ui.css" />
<script>
function CreateGroup() {

Expand Down
145 changes: 124 additions & 21 deletions Courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
<div class="row" style="width:80%;margin:auto; text-align:left;">


<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="css/jquery-1.11.1.min.js"></script>

<script src="https://code.jquery.com/ui/1.11.1/jquery-ui.min.js"></script>
<script src="css/jquery-ui.min.js"></script>

<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="css/jquery-ui.css" />
<script>


Expand Down Expand Up @@ -106,27 +106,124 @@ function extend_deadline(id) {
";

echo "<div class='col-md-5'>";



if( $_SESSION['user_type']=="Lecturer"){
echo "<h3> Post new Lab Assignment </h3><form method='post' enctype='multipart/form-data' action='Script.php'>
}

// ------------------------------Editing Lab Assignment by Lecture------------------------------------


if($_GET['act']=="edit"){
$getid = $_GET["cid"];
$result1 = mysqli_query($con, "SELECT * from lab_reports_table WHERE Lab_Report_ID = '$getid'");

while($row1 = mysqli_fetch_assoc($result1)) {
$Deadline = $row1['Deadline'];
// $datetime = explode(" ", $Deadline); explode() is another famous way of spliting a string from the database
// $_SESSION['Date'] = $datetime[0];
// $_SESSION['Time'] = $datetime[1];
$_SESSION['Date'] = strstr($Deadline, ' ', true);
$_SESSION['Time'] = strstr($Deadline, ' ');
$_SESSION['Instructions']=$row1['Instructions'];
$_SESSION['Title']=$row1['Title'];
$_SESSION['Marks']=$row1['Marks'];
$_SESSION['Type']=$row1['Type'];

}
if(isset($_POST['frm_uploadlab'])){
$deadlinedate=$_POST["deadlinedate"];
$deadlinetime=$_POST["deadlinetime"];
$instructions=$_POST["instructions"];
$title=$_POST["title"];
$marks=$_POST["marks"];
$Deadline = $deadlinedate." ".$deadlinetime;
$date= date("Y-m-d H:i");

$sql = "UPDATE `lab_reports_table` SET `Deadline` = ('" . $Deadline . "'), `Instructions` = ('" . $instructions . "'), `Title` = ('" . $title . "'), `Marks` = ('" . $marks . "') WHERE `lab_reports_table`.`Lab_Report_ID` = '$getid'";
if ($con->query($sql) === TRUE) {
$_SESSION["info_updated"]="Assignment information updated successfully.";

} else {
echo "Error: " . $sql . "<br>" . $con->error;
}
}
if( $_SESSION['user_type']=="Lecturer"){
$Date=$_SESSION['Date'];
$Time=$_SESSION['Time'];
$Instructions=$_SESSION['Instructions'];
$Title=$_SESSION['Title'];
$Marks=$_SESSION['Marks'];

echo " <h3><a href='Courses.php?course=".$url."'> Editing Lab Assignment </a></h3>";
?>
<form method='post' enctype='multipart/form-data' action=''>
<input type='hidden' name='frm_uploadlab' value='true' required=''/>
<input type='hidden' name='course_id' value='<?php echo "$id" ?>' required=''/>
<input type='hidden' name='url' value='<?php echo ".$course_url." ?>' required=''/>

Dealine Date/Time
<div class='row'>
<div class='col-md-7'><input type='date' id='date' name='deadlinedate' placeholder='' class='form-control' required='' value="<?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $Date : ""; ?>"> </div>
<div class='col-md-5'> <input type='text' id='time' class='form-control' name='deadlinetime' value="<?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $Time : ""; ?>"> </div>
</div>

Title
<input type='text' name='title' placeholder='Ttle' class='form-control' required='' value="<?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $Title : ""; ?>">
Instructions
<textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required='' ><?php echo isset($_GET['act']) && $_GET['act']=='edit' ? $Instructions : ''; ?></textarea>
Marks
<input type='text' name='marks' placeholder='Marks' class='form-control' required='' value="<?php echo isset($_GET['act']) && $_GET['act']=="edit" ? $Marks : ""; ?>">
Attachment 1
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control'>

Attachment 2
<input type='file' name='attachment2' placeholder='Attachment 1' class='form-control'>

Attachment 3
<input type='file' name='attachment3' placeholder='Attachment 1' class='form-control' >


Attachment 4
<input type='file' name='attachment4' placeholder='Attachment 4' class='form-control' >
<br>
Submission Type <input type='radio' name='type' value='Individual' required=''> Invidual

<input type='radio' name='type' required='' value='Group'> Group
<hr>
<input type='submit' class='btn btn-primary' value='Post Lab Assignment'><br>
</form><br><br><br><br>
<?php
}}else{

// ------------------------------Posting New Lab Assignment------------------------------------

// Mysql to split 1 string into 2 similar to the tsrstr in php
// SELECT SUBSTRING_INDEX(Deadline, ' ', 1) as Date, SUBSTRING_INDEX(Deadline, ' ', -1) as Time from lab_reports_table

if( $_SESSION['user_type']=="Lecturer"){

?>

<h3> Post new Lab Assignment </a></h3>

<form method='post' enctype='multipart/form-data' action='Script.php'>
<?php
$_SESSION['url']=$url;
?>
<input type='hidden' name='frm_uploadlab' value='true' required=''/>
<input type='hidden' name='course_id' value='".$id."' required=''/>
<input type='hidden' name='url' value='".$course_url."' required=''/>
<input type='hidden' name='course_id' value='<?php echo "$id" ?>' required=''/>
<input type='hidden' name='url' value='<?php echo ".$course_url." ?>' required=''/>

Dealine Date/Time
<div class='row'>
<div class='col-md-7'><input type='date' id='date' name='deadlinedate' placeholder='' class='form-control' required=''> </div>
<div class='col-md-5'> <input type='time' class='form-control' name='deadlinetime'> </div>
<div class='col-md-7'><input type='date' id='date' name='deadlinedate' placeholder='' class='form-control' required='' value=""> </div>
<div class='col-md-5'> <input type='time' class='form-control' name='deadlinetime' value=""> </div>
</div>

Title
<input type='text' name='title' placeholder='Ttle' class='form-control' required=''>
<input type='text' name='title' placeholder='Ttle' class='form-control' required='' value="">
Instructions
<textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required=''></textarea>
<textarea name='instructions' placeholder='Assignment Instructions' class='form-control' required='' value=""></textarea>
Marks
<input type='text' name='marks' placeholder='Marks' class='form-control' required=''>
<input type='text' name='marks' placeholder='Marks' class='form-control' required='' value="">
Attachment 1
<input type='file' name='attachment1' placeholder='Attachment 1' class='form-control'>

Expand All @@ -146,16 +243,20 @@ function extend_deadline(id) {
<hr>
<input type='submit' class='btn btn-primary' value='Post Lab Assignment'><br>
</form><br><br><br><br>
";
}
}
<?php
}
}

}
echo "</div>";

echo "<div class='col-md-7'> <h3> Lab Report Assignment list </h3>";

error_reporting(0);
if(isset($_SESSION["info_updated"])){
echo '<hr><div class="alert alert-info" role="alert">' . $_SESSION['info_updated'] . '</div>';
$_SESSION['info_updated'] = null;
}
if (isset($_SESSION['info_courses'])) {
echo '<hr><div class="alert alert-info" role="alert">' . $_SESSION['info_courses'] . '</div>';
$_SESSION['info_courses'] = null;
Expand All @@ -171,7 +272,7 @@ function extend_deadline(id) {
$result = mysqli_query($con," SELECT `Lab_Report_ID`,Type,Marks, `Course_ID`, `Posted_Date`, `Deadline`, `Instructions`, `Title`, `Attachment_link_1`, `Attachment_link_2`, `Attachment_link_3`, "
. "`Attachment_link_4` FROM `lab_reports_table` WHERE Course_ID=$id ORDER by Lab_Report_ID DESC");


if( $_SESSION['user_type']=="TA")
{
echo "<b style='color:orange'>* Only Lecturers can Post new Lab report Assignments </b><br>";
Expand All @@ -191,6 +292,7 @@ function extend_deadline(id) {
$att3=$row['Attachment_link_3'];
$att4=$row['Attachment_link_4'];
$id=$row['Lab_Report_ID'];
$cours_id=$row['Course_ID'];
$as_type=$row['Type'];
$full_link="<a href='~\..\Lab_Report_Assignments\\$att1'>$att1</a>";

Expand Down Expand Up @@ -219,10 +321,11 @@ function extend_deadline(id) {

echo " <div class='break-word btn btn-default' style='word-wrap: break-word;border-color:grey;'>
$title ($as_type) <br> $ins
<br> <span style='font-size:8pt'>Posted : $posted Deadline : <b> $deadline </b> &nbsp; ($marks Marks) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "
. "<br>"

. "<span class='btn-default'> &nbsp;&nbsp; $count_subs Submissions ( $count_marked Marked ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='~\..\Submissions.php?id=$id&header=$header&total=$marks' onclick=''> View </a> &nbsp;&nbsp; |&nbsp;&nbsp; <a href='#' onclick='extend_deadline($id)'> Extend Deadline </a> </span> <hr> Attachments : $full_link </span>"
. "<span class='btn-default'> &nbsp;&nbsp; $count_subs Submissions ( $count_marked Marked ) &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='Courses.php?course=".$url."&act=edit&cid=".$id."'>Edit</a>&nbsp;&nbsp; |&nbsp;&nbsp;<a href='~\..\Submissions.php?id=$id&header=$header&total=$marks' onclick=''> View </a> &nbsp;&nbsp; |&nbsp;&nbsp; <a href='#' onclick='extend_deadline($id)'> Extend Deadline </a> </span> <hr> Attachments : $full_link </span>"
. "&nbsp;&nbsp;</div>
";

Expand Down
4 changes: 1 addition & 3 deletions Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@


<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css"/>

<!--<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/> -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/fontawesome.min.css" />
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
<script src="http://118.25.96.118/nor/css/jquery.min.js" type="text/javascript"></script>
<script src="http://118.25.96.118/nor/css/bootsrap.min.js" type="text/javascript"></script>
<link href="http://118.25.96.118/nor/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,31 @@ WhyteAsamoah - Yeboah Martha Asamoah - 201732120135

xiaoyusoil - ZhengXiaoyu - 201732120110


Benny123-cell - ZhangBin - 201732120127

421281726 - LiJiaxing - 201732120118

zhenghongyu-david - ZhengHongyu - 201732120128

wkytz - YeHantao - 201732120125

zego000 - GaoZeng - 201732120117

Richard1427 - XieJiacong - 201732120123

yutengYing - YingYuteng - 201732120126

Samrusike - Samantha Rusike - 201632120140

Teecloudy - Ashly Tafadzwa Dhani - 201632120150

GuedaliaBonheurSPM - Guedalia Youma - 201925800221

ACorneille - Alimasi Corneille - 201925800168

Tabithakipanga - Kipanga Dorcas - 201925800170

Mary-AK - Mary Akussah Doe - 201925800173

pkkumson - Kumson Princewill Kum - 201925800166
Loading

2 comments on commit eb520a1

@spm2020spring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mary-Ak

It seems that your local branch is way behind the master branch on the central repo.

Hui

@spm2020spring
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mary-Ak @Twizere

But this diff should not happen as you've just changed README.md.

Other files should not be affected.

Hui

Please sign in to comment.