Skip to content

Commit

Permalink
Merge pull request #33 from lanlab-org/Hui-bugfix-65
Browse files Browse the repository at this point in the history
Hui bugfix 65 "Students unable to submit assignment after a recent change"
  • Loading branch information
spm2020spring authored Apr 23, 2020
2 parents 058eb2a + a89b8f4 commit ec80d4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Courses.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function extend_deadline(id) {

$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"]="Information Updated Successfull";
$_SESSION["info_updated"]="Assignment information updated successfully.";

} else {
echo "Error: " . $sql . "<br>" . $con->error;
Expand Down Expand Up @@ -253,9 +253,9 @@ function extend_deadline(id) {
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_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>';
Expand Down
8 changes: 7 additions & 1 deletion Script.php
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,13 @@ function checksize($file)
if ($con->query($sql1) === TRUE) {
}



// When $group_id is not properly initialized, use integer 0 as its value.
// This temporarily fixed the "Students unable to submit assignment after a recent change" bug at http://118.25.96.118/bugzilla/show_bug.cgi?id=65
if (trim($group_id) === '') { // when $group_id is an empty string or contains only whitespace characters.
$group_id = 0; // FIXME
}

$sql="INSERT INTO `lab_report_submissions`(`Submission_Date`, `Lab_Report_ID`, `Student_id`,"
. " `Course_Group_id`, `Attachment1`, `Notes`, `Attachment2`, `Attachment3`, `Attachment4`, `Status`, `Title`,`Remarking_Reason`)"
. " VALUES ('$date',$lab_id,$student_id,$group_id,'$targetfile','$instructions','$targetfile2','$targetfile3','$targetfile4',"
Expand Down

0 comments on commit ec80d4c

Please sign in to comment.