<commit_before><?php
include_once('../one_connection.php');

$SelectCourse = $_POST['SelectCourse'];
$SelectYear = $_POST['SelectYear'];
$SelectSemester = $_POST['SelectSemester'];
$SelectAssignment = $_POST['SelectAssignment'];

//get assignment deadline
$sql = "SELECT distinct DATE_FORMAT(  `DueDate` ,  '%Y%m%d%H' ) dueDate 
from event
where `CourseName`='{$SelectCourse}' and `SchoolYear`='{$SelectYear}' and `Semester`='{$SelectSemester}' and `AssignmentName`='{$SelectAssignment}' and `DataSourceType`=2";

$query = mysql_query($sql);
while($row=mysql_fetch_array($query)){
	$DueDate = $row['dueDate'];//yyyymmdd

	
}
//Convert $DueDate to time
$timeDueDate= strtotime($DueDate);

//the 5th day before deadline
$DueDateMinus5=date('Ymd',strtotime("$DueDate -5 day"));
//the 6th day after deadline
$DueDatePlus6=date('Ymd',strtotime("$DueDate +6 day"));


$sql = "SELECT DATE_FORMAT(  `EventTime` ,  '%Y%m%d' ) days, COUNT(  `Id` ) count
from event
where `CourseName`='{$SelectCourse}' and `SchoolYear`='{$SelectYear}' and `Semester`='{$SelectSemester}' and `AssignmentName`='{$SelectAssignment}' and `DataSourceType`=2 and `FKEventTypeId`=5
GROUP BY days
having days between '{$DueDateMinus5}' and '{$DueDatePlus6}'";

//the main purpose of the following code is to add those days with 0
//submission to array, since the query result will not include them
$i=-5;<commit_msg>Undo the mis-edit in another php #71<commit_after><?php
include_once('../one_connection.php');

$SelectCourse = $_POST['SelectCourse'];
$SelectYear = $_POST['SelectYear'];
$SelectSemester = $_POST['SelectSemester'];
$SelectAssignment = $_POST['SelectAssignment'];

//get assignment deadline
$sql = "SELECT distinct DATE_FORMAT(  `DueDate` ,  '%Y%m%d' ) dueDate 
from event
where `CourseName`='{$SelectCourse}' and `SchoolYear`='{$SelectYear}' and `Semester`='{$SelectSemester}' and `AssignmentName`='{$SelectAssignment}' and `DataSourceType`=2";

$query = mysql_query($sql);
while($row=mysql_fetch_array($query)){
	$DueDate = $row['dueDate'];//yyyymmdd

	
}
//Convert $DueDate to time
$timeDueDate= strtotime($DueDate);

//the 5th day before deadline
$DueDateMinus5=date('Ymd',strtotime("$DueDate -5 day"));
//the 6th day after deadline
$DueDatePlus6=date('Ymd',strtotime("$DueDate +6 day"));


$sql = "SELECT DATE_FORMAT(  `EventTime` ,  '%Y%m%d' ) days, COUNT(  `Id` ) count
from event
where `CourseName`='{$SelectCourse}' and `SchoolYear`='{$SelectYear}' and `Semester`='{$SelectSemester}' and `AssignmentName`='{$SelectAssignment}' and `DataSourceType`=2 and `FKEventTypeId`=5
GROUP BY days
having days between '{$DueDateMinus5}' and '{$DueDatePlus6}'";

//the main purpose of the following code is to add those days with 0
//submission to array, since the query result will not include them
$i=-5;
{'fraction_non_alphanumeric': 0.1742723679482573, 'fraction_numerical': 0.01006108515989939, 'mean_word_length': 7.140350877192983, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '367904', 'n_tokens_mistral': 967, 'n_tokens_neox': 921, 'n_words': 239}