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/GradeEvaluation.php $TRACK = "<b>".basename(__FILE__).'</b> <span class="pv_fl">('.__FILE__.")</span>\n<ol>\n"; #setDebugOn(); ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']."/"); // Add the DOCUMENT_ROOT to the include_path. set_time_limit(300); include('application.phpinc'); #if ( isset($_SESSION['userId']) && $_SESSION['userId'] == 1 ) $GradeEvaluationDEBUG = true; if ( !isset($GradeEvaluationDEBUG) ) $GradeEvaluationDEBUG = false; #if ( $GradeEvaluationDEBUG ) { setDebugOn(); } if ( !isset($js) ) $js = ''; $js .= ',form.js,Gradebook/GradeEvaluation.js'; if ( !isset($isGB) ) $isGB = true; #d_Var('$_GET',$_GET,'d'); #d_Var('$_POST',$_POST,'d'); // Get form values. $f_classId = formValue('classId'); include('Class/CourseInfo.phpinc'); $sId = formValue('sId'); $uId = formValue('uId'); $eId = formValue('eId'); $gId = formValue('gId'); $lId = formValue('lId'); $grade = formValue('grade'); $comment = formValue('comment'); $internal = formValue('internal'); $f_FromGradebook = formValue('FromGradebook'); if ( !$f_FromGradebook ) $f_FromGradebook = 0; $f_ReturnFromGrading = formValue('ReturnFromGrading'); if ( !$f_ReturnFromGrading ) $f_ReturnFromGrading = 0; if ( $f_form != 'form_grade' ) { $emailGrade = false; // Turn off email for first loading. if ( $GradeEvaluationDEBUG ) { $emailGradeChange = '$emailGrade set false for first loading.'; } else { $emailGradeChange = ''; } } // Get evaluation info. $query = " SELECT evaluationId, classId, evaluationExtraCredit FROM `evaluation` WHERE evaluationId = ".$eId." "; #d_Var('evaluationInfo',$query,'dq'); $evaluationInfo = query_info($query); #d_Var('$evaluationInfo',$evaluationInfo,'d'); if ( $evaluationInfo ) { $ExtraCredit = $evaluationInfo['evaluationExtraCredit']; } else { $ExtraCredit = 0; } if ( $GradeEvaluationDEBUG ) { printVar('$f_classId',$f_classId); printVar('$sId',$sId); printVar('$uId',$uId); printVar('$eId',$eId); printVar('$gId',$gId); printVar('$lId',$lId); printVar('$grade',$grade); printVar('$comment',$comment); printVar('$internal',$internal); printVar('$emailGradeCheck',$emailGradeCheck); printVar('$f_FromGradebook',$f_FromGradebook); printVar('$f_ReturnFromGrading',$f_ReturnFromGrading); printVar("\$_SESSION['emailGrade']",$_SESSION['emailGrade']); if ( isset($emailGradeChange) ) printLine($emailGradeChange); printVar('$emailGrade',$emailGrade); #d_End(); } #printVar('$f_FromGradebook',$f_FromGradebook); #printVar('$f_ReturnFromGrading',$f_ReturnFromGrading); /**/ /**/ #printVar('$emailGrade',$emailGrade); #if ($GradeEvaluationDEBUG) printVar('$gId',$gId); $gradeG = $grade; $commentG = $comment; $internalG = $internal; $grade_CommentOnly = false; $grade_Error = false; if ( $GradeEvaluationDEBUG ) { printVar('$grade',$grade); printVar('$comment',$comment); printVar('$internal',$internal); printVar('$gradeG',$gradeG); printVar('$commentG',$commentG); printVar('$internalG',$internalG); printVar('$grade_CommentOnly',$grade_CommentOnly); printVar('$grade_Error',$grade_Error); } if ( $f_course == 'CST1021' || $f_course == 'CST1022' || $f_course == 'CST1146' || $f_course == 'CST2146' ) { $courseName = str_replace('CST','CST',$f_course); } else { $courseName = $f_course; } #d_Var('$eId',$eId,'d'); if ( $eId >= 0 ) { // Regular evaluation. $sectionWidth = 1000; $evaluationIdList = $eId; include('Course/studentInClass.phpinc'); include('Gradebook/evaluationInfo.phpinc'); // Check if grade entered. #printVar('$f_task',$f_task); if ( $GradeEvaluationDEBUG ) { printVar('$f_form',$f_form); printVar('$f_task',$f_task); } if ( $f_form == 'form_grade' && ( $f_task == 'Grade' || $f_task == 'Clear comment & grade' ) ) { // Verify grade. if ( $comment != '' && !is_numeric($grade) ) { $grade_CommentOnly = true; } elseif ( !is_numeric($grade) ) { $grade_Error = "Grade ($grade) is not a number."; } elseif ( $grade < 0 ) { $grade_Error = "Grade ($grade) is < 0."; } elseif ( $grade > $eInfo[$eId]['points'] ) { $grade_Error = "Grade ($grade) is larger than possible points (".$eInfo[$eId]['points'].")."; } if ( $GradeEvaluationDEBUG ) printVar('$grade_Error',$grade_Error); if ( !$grade_Error ) { include('Gradebook/GradePerform.phpinc'); #printVar('$emailGrade',$emailGrade); } } if ( $f_form == 'form_grade' && ( $f_task == 'Set ns' || $f_task == 'Set ng' ) ) { $emailGrade = false; switch ($f_task) { case 'Set ns': $gradeSubmitted = 0; $f_gradeGradedOn = currentDateTime(); $query = " DELETE FROM `grade` WHERE gradeId = ".$gId." "; $gradeUpdate = query_do($query); if ( $GradeEvaluationDEBUG ) printVar('gradeUpdate',$query,'/q'); if ( $GradeEvaluationDEBUG ) printVar('$gradeUpdate',$gradeUpdate); $gradeMessage = 'Deleted'; break; case 'Set ng': $gradeSubmitted = 1; $f_gradeGradedOn = currentDateTime(); $query = " UPDATE `grade` SET gradeSubmitted = ".$gradeSubmitted." , gradeGraded = 0 , gradeInactive = 0 WHERE gradeId = ".$gId." "; $gradeUpdate = query_do($query); if ( $GradeEvaluationDEBUG ) printVar('gradeUpdate',$query,'/q'); if ( $GradeEvaluationDEBUG ) printVar('$gradeUpdate',$gradeUpdate); $gradeMessage = 'Updated'; break; } } include('Gradebook/evaluationStudentInfo.phpinc'); $studentTotalPoints = 0; $studentGradedPoints = 0; #printVar('$sInfo',$sInfo); include('Gradebook/ClassGradebookEvaluationData.phpinc'); if ($GradeEvaluationDEBUG) printVar('$gradeResultCount',$gradeResultCount); if ( !$gradeResultCount ) { if ($GradeEvaluationDEBUG) printVar('$gId',$gId); if ( $gId !== false ) { $grade = $gradeG; $comment = $commentG; $internal = $internalG; } else { $gId = 0; if ($GradeEvaluationDEBUG) printVar('$gId',$gId); } } elseif ( !$gId ) { $gId = $gradeRow['gradeId']; if ($GradeEvaluationDEBUG) printVar('$gId',$gId); } if ( $GradeEvaluationDEBUG ) { printVar('$grade_CommentOnly',$grade_CommentOnly); printVar('$grade_Error',$grade_Error); printVar('$emailGrade',$emailGrade); } if ( ( !isset($grade_CommentOnly) || !$grade_CommentOnly ) && ( !isset($grade_Error) || !$grade_Error ) && $emailGrade ) { $emailGrade = true; } else { $emailGrade = false; } if ( $GradeEvaluationDEBUG ) printVar('$emailGrade',$emailGrade); if ( $emailGrade ) { #include('GradeBook/EmailGrade.phpinc'); } if ( isset($grade_Error) && $grade_Error ) $grade = $gradeG; $headTitle = '_CST_ - Grade Evaluation'; $pageTitle = '_CST_<br>Grade Evaluation'; $displayHeader = false; $loginLink = ''; $js .= ',openCenteredWindow,updateHTMLelement'; include('common/pageHeader.phpinc'); #d_Var("\$_SERVER",$_SERVER,'d'); $sectionTitle = $sInfo[$sId]['name'].' - '.$f_course.'-'.$f_classSection.' '.$eInfo[$eId]['title'].' - '.$eInfo[$eId]['description']; $sessionSelectSkip = false; // Do not show loginLink. include('common/sectionHeader.phpinc'); if ( !isset($f_gradeLetter) ) { $f_gradeLetter = gradeLetterAC(gradePercentage($grade,$eInfo[$eId]['points'])); } if ( isset($gradeMessage) ) { if ( isset($grade_CommentOnly) && $grade_CommentOnly && $grade == 'ns' ) { $grade = 'cm'; } ?> <script type="text/javascript"> <!-- // Set the gradebook visible grade to the grade submitted. var openerId = 'id_<?=$f_classId?>_<?=$sId?>_<?=$uId?>_<?=$eId?>_<?=$lId?>'; console.log('openerId='+openerId); if ( window.opener.document.getElementById(openerId) ) { var gbId = window.opener.document.getElementById(openerId); var grade = '<?=$grade?>'; //alert('Grade for '+openerId+' set to '+grade); gbId.innerHTML = '<span class="grade">'+grade+'</span>'; var gbClassName = gbId.className; var gbClassArray = gbClassName.split(" "); gbClassName = ''; //alert('gbId.className='+gbId.className); for (var i=0, len=gbClassArray.length; i<len; ++i){ if ( gbClassArray[i].substr(0,4) != 'eval' ) gbClassName += gbClassArray[i]+' '; } //alert('gbClassName='+gbClassName); //alert('isNaN(Number(grade)) = '+isNaN(Number(grade))); if ( !isNaN(Number(grade)) ) gbId.className = gbClassName+'evalGR'; //alert('gbClassName='+gbId.className); } else { //alert('Not called from Gradebook'); } // --> </script> <span class="attention"><?=$gradeMessage?><? if ( ( !isset($grade_Error) || !$grade_Error ) && $emailGrade ) { ?> and emailed <? } ?> grade (<?=$grade?> point<? if ( $grade != 1 ) { ?>s<? } ?> = <?=$f_gradeLetter?>).</span> <? } ?> <style type="text/css"> textarea { width:30em; } </style> <? if ( !$gradeResultCount ) { // There is no grade. if ( $comment == 'Not submitted' ) $comment = ''; $gIdG = $gId; include('Gradebook/GradeForm.phpinc'); } else {//if ( $gradeResultCount <= 1 ) // There is one or more grades. $gIdArray = listToArray(query_to_list($gradeResult,'gradeId')); $gIdG = $gId; foreach ($gIdArray as $gId) { include('Gradebook/ClassGradebookEvaluationData.phpinc'); #printVar('$gradeResultCount',$gradeResultCount); #if ( !$gradeResultCount ) printVar("\$gradeRow['gradeId']",$gradeRow['gradeId']); #printVar('$gIdG',$gIdG); #printVar('$gradeG',$gradeG); if ( !$gradeResultCount || ( $gradeRow['gradeId'] == $gIdG && $gradeG !== false ) ) { $grade = $gradeG; $comment = $commentG; $internal = $internalG; } if ($GradeEvaluationDEBUG) printVar('$gId',$gId); include('Gradebook/GradeForm.phpinc'); $gId = $gIdG; if ($GradeEvaluationDEBUG) printVar('$gId',$gId); } }//if ( $gradeResultCount <= 1 ) include('common/sectionFooter.phpinc'); } else {// if ( $eId >= 0 ) // SP or CP. //$location = '/'.$InstructorPath.'/'.$f_course.'/?f_userId='.$uId.'&f_classId='.$f_classId.'&f_subtask=Grade&sId='.$sId.'&eId='.$eId.'&f_FromGradebook='.$f_FromGradebook.'&f_ReturnFromGrading='.$f_ReturnFromGrading; $location = '/'.$InstructorPath.'/'.$courseName.'/?f_userId='.$uId.'&f_classId='.$f_classId.'&f_subtask=Grade&sId='.$sId.'&eId='.$eId.'&f_FromGradebook='.$f_FromGradebook; #printVar('$f_FromGradebook',$f_FromGradebook); switch ($eId) { case -2: // SP $location .= '&Course='.$courseName.'&f_task=Student%20Profile&CalledBy='.basename(__FILE__).':'.__LINE__; if ( $GradeEvaluationDEBUG ) printVar('$location',$location); headerLocation($location); break; case -1: // CP $location .= '&f_task=Class%20Profile&CalledBy='.basename(__FILE__).':'.__LINE__; if ( $GradeEvaluationDEBUG ) printVar('$location',$location); headerLocation($location); break; default: $f_messageError = "Incorrect eId (".$eId.")."; include('common/programmingError.phpinc'); break; } }// if ( $eId >= 0 ) $linkBegin = ''; $linkEnd = ''; $linkTitle = ''; $labPath = ''; // Check for Labs/Lab## directory. #printVar("\$_SERVER['HTTP_REFERER']",$_SERVER['HTTP_REFERER']); #printVar("dirname(\$_SERVER['HTTP_REFERER'])",dirname($_SERVER['HTTP_REFERER'])); #printVar("\$_SERVER['HTTP_HOST']",$_SERVER['HTTP_HOST']); if ( isset($_SERVER['HTTP_REFERER']) ) { $labPath = dirname($_SERVER['HTTP_REFERER']); } else { $labPath = '/'.$InstructorPath.'/'.$courseName; } #d_Var('$labPath',$labPath,'d'); $file = $_SESSION['DIRECTORY_ROOT'].str_replace(array('http://'.$_SERVER['HTTP_HOST'],'https://'.$_SERVER['HTTP_HOST']),'',$labPath).'/Labs/'.$eInfo[$eId]['title'].'/index.php'; #printVar('$file',$file); #if ( $_SESSION['userId'] == '1' ) { d_On(); d_Var("file_exists($file)",file_exists($file)); d_Off(); } if ( file_exists($file) ) { $labPath = $labPath.'/Labs/'.$eInfo[$eId]['title'].'/?f_uId='.$uId.'&f_sId='.$sId.'&f_eId='.$eId.'&f_classId='.$f_classId; #d_Var('$labPath',$labPath,'d'); } else { // Check for Assignments/Lab## directory. $file = $_SESSION['DIRECTORY_ROOT'].str_replace(array('http://'.$_SERVER['HTTP_HOST'],'https://'.$_SERVER['HTTP_HOST']),'',$labPath).'/Assignments/'.$eInfo[$eId]['title'].'/index.php'; if ( file_exists($file) ) { $labPath = $labPath.'/Assignments/'.$eInfo[$eId]['title'].'/?f_uId='.$uId.'&f_sId='.$sId.'&f_eId='.$eId.'&f_classId='.$f_classId; #d_Var('$labPath',$labPath,'d'); } else { // Check for Lab##.php file. $file = $_SESSION['DIRECTORY_ROOT'].str_replace(array('http://'.$_SERVER['HTTP_HOST'],'https://'.$_SERVER['HTTP_HOST']),'',$labPath).'/'.$eInfo[$eId]['title'].'.php'; #printVar('$file',$file); #if ( $_SESSION['userId'] == '1' ) { d_On(); d_Var("file_exists($file)",file_exists($file)); d_Off(); } if ( file_exists($file) ) { $labPath = $labPath.'/'.$eInfo[$eId]['title'].'.php'.'/?f_uId='.$uId.'&f_sId='.$sId.'&f_eId='.$eId.'&f_classId='.$f_classId; #d_Var('$labPath',$labPath,'d'); } } } #d_Var('$labPath',$labPath,'d'); #printVar("\$_SESSION",$_SESSION); #printVar("\$_SERVER",$_SERVER); ?> <script> let EvalCritical = <?=$eInfo[$eId]['critical']?>; let Course = '<?=$f_course?>'; let Title = '<?=$eInfo[$eId]['title']?>';'' let gIdG = '<?=$gIdG?>'; let labPath = '<?=$labPath?>'; document.getElementById('id_grade_'+gIdG+'').focus(); document.getElementById('id_grade_'+gIdG+'').select(); </script> <? if ( $GradeEvaluationDEBUG ) { echo "<br>\n"; printGETPOST(); echo "<br>\n"; printVar('$classResultCount',$classResultCount); if ( $classResult ) printVar('$classResult',$classResult); echo "<br>\n"; #include('Gradebook/evaluationInfo.phpinc'); printVar('$f_FromGradebook',$f_FromGradebook); printVar('$classSection',$classSection); printVar('$evaluationResultCount',$evaluationResultCount); if ( $classResult ) printVar('$evaluationResult',$evaluationResult); printVar('$evaluationIdList',$evaluationIdList); printVar('$evaluationIdArray',$evaluationIdArray); printVar('$eInfo',$eInfo); printVar('$evaluationTotalGradedPoints',$evaluationTotalGradedPoints); printVar('$evaluationExtraCreditPoints',$evaluationExtraCreditPoints); printVar('$evaluationTotalPoints',$evaluationTotalPoints); printVar('$evaluationCritical',$evaluationCritical); printVar('$evaluationExtraCredit',$evaluationExtraCredit); echo "<br>\n"; #include('Gradebook/evaluationStudentInfo.phpinc'); 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); echo "<br>\n"; #include('Gradebook/ClassGradebookEvaluationData.phpinc'); if ($gradeResultCount) printVar('$gradeRow',$gradeRow); printVar('$grade',$grade); printVar('$submitted',$submitted); printVar('$graded',$graded); printVar('$comment',$comment); printVar('$entered',$entered); } $GLOBALS['onload'] .= '|TextareaResizeAll(300,200,5);'; if ( $GradeEvaluationDEBUG ) setDebugOn(); #setDebugOff(); ?> <script type="text/javascript"> // <?=basename(__FILE__)?>:<?=__LINE__?>. //_Initialize('<?=basename(__FILE__)?>:<?=__LINE__?>'); //TextareaResizeAll(300,200,5); </script> <? #setDebugOn(); if ( $emailGrade ) { include('GradeBook/EmailGrade.phpinc'); } include('common/pageFooter.phpinc'); ?>