session_destroy();
session_start();
if (is_writable(session_save_path()) === false) {
    echo 'Session path "' . session_save_path() . '" is not writable for PHP!';
}
$_SESSION['session_path'] = session_save_path();
$_SESSION['session_id'] = session_id();
// Must get tA_id for the lesson to be tested.
require_once "/var/www/html/jimfuqua/tutor/lessons/test_lesson_include.php";
// $log_file = fopen('/var/www/html/jimfuqua/tutor/logs/test_one_digit_addition_vertical_clues.log', 'w');
// $v = var_export($_SESSION, true);
// $string = __LINE__.' $_SESSION = '.$v."\n\n";
// fwrite($log_file, $string);
$target_assignment_name = 'gA_one_digit_addition_vertical_clues';
require_once '/var/www/html/jimfuqua/tutor/src/classes/AssignmentsClass.inc';
$class_instance = new tutor\src\classes\AssignmentsClass();
// Get target lesson if it exists.
$result = $class_instance->getSpecificStudentAssignmentFromDbAsArray($_SESSION['tA_S_ID'], $target_assignment_name, $_SESSION['tA_StartRec']);
$_SESSION['tA_id'] = $result['tA_id'];
// $v = var_export($_SESSION['tA_id'], true);
// $string = __LINE__.' $_SESSION["tA_id"] = '.$v."\n\n";
// fwrite($log_file, $string);
// Remove the lesson to be tested.
// Add it back with a 2 second post-date.
//
$class_instance->delRowsByStudentId_AssignmentName($_SESSION['tA_S_ID'], 'gA_one_digit_addition_vertical_clues');
$_SESSION['tG_AssignmentName'] = $target_assignment_name;
$_SESSION['tA_PostDateIncrement'] = 2;
$_SESSION['tA_Post_date'] = round(microtime(true), 3, PHP_ROUND_HALF_EVEN) + $_SESSION['tA_PostDateIncrement'];
// $string = __LINE__.' $_SESSION["tA_Post_date"] = '.$_SESSION['tA_Post_date']."\n\n";
// fwrite($log_file, $string);
Пример #2
0
fwrite($log_file, $string);
$tA_LastModifiedDateTime = time();
$value_array['tA_Post_date'] = $tA_LastModifiedDateTime + $post_date_time;
$string = "\n" . __LINE__ . '$tA_LastModifiedDateTime = ' . $tA_LastModifiedDateTime;
fwrite($log_file, $string);
$v = var_export($value_array, TRUE);
$string = "\n" . __LINE__ . '$value_array["tA_Post_date"] = ' . $v;
fwrite($log_file, $string);
$value_array["tA_RepsTowardM"] = $tA_RepsTowardM;
// Set at lines 75-85
// $value_array['tA_ErrorsMade'] set at line 145
$value_array['tA_LastModifiedDateTime'] = $tA_LastModifiedDateTime;
$v = var_export($value_array, TRUE);
$string = __LINE__ . ' $value_array = ' . "{$v}\n\n";
fwrite($log_file, $string);
$classInstance = new tutor\src\classes\AssignmentsClass();
$returnedValue = $classInstance->updateFields($value_array, $where_array);
$string = __LINE__ . ' $returnedValue = ' . $returnedValue . "\n\n";
fwrite($log_file, $string);
$string = __LINE__ . ' gettype($returnedValue) = ' . gettype($returnedValue) . "\n\n";
fwrite($log_file, $string);
// Returns count of rows affected.
if ($returnedValue !== 1) {
    // Serious Error..
    $string = "\n" . __LINE__ . " update_tA_TC.php failed to record data in tAssignments.";
    fwrite($log_file, $string);
}
/**
 * Clone and instert a lesson incremented by one in some lessons.
 *
 * Applies to Spelling or typing or some types of math with many parameters.
session_destroy();
session_start();
if (is_writable(session_save_path()) === false) {
    echo 'Session path "' . session_save_path() . '" is not writable for PHP!';
}
$_SESSION['session_path'] = session_save_path();
$_SESSION['session_id'] = session_id();
// Must get tA_id for the lesson to be tested.
require_once "/var/www/html/jimfuqua/tutor/lessons/test_lesson_include.php";
// $log_file = fopen('/var/www/html/jimfuqua/tutor/logs/test_GearsRotationDirection.log', 'w');
// $v = var_export($_SESSION, true);
// $string = __LINE__.' $_SESSION = '.$v."\n\n";
// fwrite($log_file, $string);
$target_assignment_name = 'gA_GearsRotationDirection';
require_once '/var/www/html/jimfuqua/tutor/src/classes/AssignmentsClass.inc';
$class_instance = new tutor\src\classes\AssignmentsClass();
// Get target lesson if it exists.
$result = $class_instance->getSpecificStudentAssignmentFromDbAsArray($_SESSION['tA_S_ID'], $target_assignment_name, $_SESSION['tA_StartRec']);
$_SESSION['tA_id'] = $result['tA_id'];
// $v = var_export($_SESSION['tA_id'], true);
// $string = __LINE__.' $_SESSION["tA_id"] = '.$v."\n\n";
// fwrite($log_file, $string);
// Remove the lesson to be tested.
// Add it back with a 2 second post-date.
//
$class_instance->delRowsByStudentId_AssignmentName($_SESSION['tA_S_ID'], 'gA_GearsRotationDirection');
$_SESSION['tG_AssignmentName'] = $target_assignment_name;
$_SESSION['tA_PostDateIncrement'] = 2;
$_SESSION['tA_Post_date'] = round(microtime(true), 3, PHP_ROUND_HALF_EVEN) + $_SESSION['tA_PostDateIncrement'];
// $string = __LINE__.' $_SESSION["tA_Post_date"] = '.$_SESSION['tA_Post_date']."\n\n";
// fwrite($log_file, $string);
Пример #4
0
$where_array = array('tA_S_ID' => $_SESSION['tA_S_ID'], 'tA_id' => $_SESSION['tA_id']);
if (isset($_POST['tA_RepsTowardM']) === TRUE) {
    if ($_POST['tA_RepsTowardM'] === 'Plus1') {
        $value_array['tA_RepsTowardM'] = 'tA_RepsTowardM + 1';
    } else {
        $value_array['tA_RepsTowardM'] = 0;
    }
}
if (isset($_POST['tA_ErrorsMade']) === 'Plus1') {
    $value_array['tA_ErrorsMade'] = 'tA_ErrorsMade + 1';
}
if (isset($_POST['tA_LocalDateTime']) === TRUE) {
    $value_array['tA_LocalDateTime'] = $_POST['tA_LocalDateTime'];
}
$value_array['tA_Post_date'] = time() + 20;
// Add seconds to now.
$sender = $_POST['sender'];
// Sender is not a field in tA and should not be in the query.
// Sender is a good source of info to detect tampering with input data.;
$v = var_export($value_array, true);
$string = __LINE__ . ' $value_array = ' . "{$v}\n\n";
fwrite($logFile, $string);
$v = var_export($where_array, true);
$string = __LINE__ . ' $where_array = ' . "{$v}\n\n";
fwrite($logFile, $string);
$result = $classInstance = new tutor\src\classes\AssignmentsClass();
$result = $classInstance->updateFields($value_array, $where_array);
$v = var_export($result, true);
$string = __LINE__ . ' $result = ' . "{$v}\n\n";
fwrite($logFile, $string);
return $result;
session_destroy();
session_start();
if (is_writable(session_save_path()) === false) {
    echo 'Session path "' . session_save_path() . '" is not writable for PHP!';
}
$_SESSION['session_path'] = session_save_path();
$_SESSION['session_id'] = session_id();
// Must get tA_id for the lesson to be tested.
require_once "/var/www/html/jimfuqua/tutor/lessons/test_lesson_include.php";
//$log_file = fopen('/var/www/html/jimfuqua/tutor/logs/test_horizontal_vertical_diagonal.php.log', 'w');
//$v = var_export($_SESSION, true);
//$string = __LINE__.' $_SESSION = '.$v."\n\n";
//fwrite($log_file, $string);
$target_assignment_name = 'gA_horizontal_vertical_diagonal';
require_once '/var/www/html/jimfuqua/tutor/src/classes/AssignmentsClass.inc';
$class_instance = new tutor\src\classes\AssignmentsClass();
// Get target lesson if it exists.
$result = $class_instance->getSpecificStudentAssignmentFromDbAsArray($_SESSION['tA_S_ID'], $target_assignment_name, $_SESSION['tA_StartRec']);
$_SESSION['tA_id'] = $result['tA_id'];
// $v = var_export($_SESSION['tA_id'], true);
// $string = __LINE__.' $_SESSION["tA_id"] = '.$v."\n\n";
// fwrite($log_file, $string);
// Remove the lesson to be tested.
// Add it back with a 2 second post-date.
//
$class_instance->delRowsByStudentId_AssignmentName($_SESSION['tA_S_ID'], 'gA_horizontal_vertical_diagonal');
$_SESSION['tG_AssignmentName'] = $target_assignment_name;
$_SESSION['tA_PostDateIncrement'] = 2;
$_SESSION['tA_Post_date'] = round(microtime(true), 3, PHP_ROUND_HALF_EVEN) + $_SESSION['tA_PostDateIncrement'];
// $string = __LINE__.' $_SESSION["tA_Post_date"] = '.$_SESSION['tA_Post_date']."\n\n";
// fwrite($log_file, $string);
Пример #6
0
session_start();
if (is_writable(session_save_path()) === false) {
    //echo 'Session path "' . session_save_path() . '" is not writable for PHP!'."<br/><br/>";
}
$_SESSION['session_path'] = session_save_path();
$_SESSION['session_id'] = session_id();
// Must get tA_id for the lesson to be tested.
$lesson_path = "/hsphere/local/home/jimfuqua/jim-fuqua.com/tutorW";
require_once "../test_lesson_include.php";
// $log_file = fopen('/var/www/html/jimfuqua/tutor/logs/test_left_right_blocks.php.log', 'w');
// $v = var_export($_SESSION, true);
// $string = __LINE__.' $_SESSION = '.$v."\n\n";
// fwrite($log_file, $string);
$target_assignment_name = 'gA_left_right_blocks';
require_once '../../src/classes/AssignmentsClass.inc';
$class_instance = new \tutor\src\classes\AssignmentsClass();
// Get target lesson if it exists.
$result = $class_instance->getSpecificStudentAssignmentFromDbAsArray($_SESSION['tA_S_ID'], $target_assignment_name, $_SESSION['tA_StartRec']);
$_SESSION['tA_id'] = $result['tA_id'];
// $v = var_export($_SESSION['tA_id'], true);
// $string = __LINE__.' $_SESSION["tA_id"] = '.$v."\n\n";
// fwrite($log_file, $string);
//echo (90."<br/>");
// Remove the lesson to be tested.
// Add it back with a 2 second post-date.
//
$class_instance->delRowsByStudentId_AssignmentName($_SESSION['tA_S_ID'], 'gA_left_right_blocks');
$_SESSION['tG_AssignmentName'] = $target_assignment_name;
$_SESSION['tA_PostDateIncrement'] = 2;
$_SESSION['tA_Post_date'] = round(microtime(true), 3, PHP_ROUND_HALF_EVEN) + $_SESSION['tA_PostDateIncrement'];
// $string = __LINE__.' $_SESSION["tA_Post_date"] = '.$_SESSION['tA_Post_date']."\n\n";
Пример #7
0
 /**
  *   Test cAssignmentGetNextLesson()
  * @return void
  */
 public function testcAssignmentGetNextLesson()
 {
     /*
         Tests cAssignment_get_next_lesson.php Does not show up on missing
         tests because cAssignments is not in assignments.class
         Function cAssignments_get_next_lesson is called from javascript.
     */
     // Next reset myArray to origninal values.
     $this->testbuildArray();
     // Add a new row to delete.
     $classInstance = new tutor\src\classes\AssignmentsClass();
     $this->assertTrue(isset($classInstance));
     $classInstance->delRowsByStudentId($this->myArray['tA_S_ID']);
     $tempStudent = 'abcdefg';
     $this->myArray['tA_S_ID'] = $tempStudent;
     // Set to a different value.
     $classInstance->delRowsByStudentId($tempStudent);
     // Insure no previous lessons for this student.
     $result = $classInstance->insertRecord($this->myArray);
     $this->assertTrue($result == 1);
     $_SESSION['tA_S_ID'] = $tempStudent;
     $classInstance->delRowsByStudentId('abcdefg');
 }
 $_data['last_gA'] = NULL;
 if (isset($_data['lesson_id']) === TRUE) {
     $last_lesson_id = $_data['lesson_id'];
 } else {
     $last_lesson_id = '';
 }
 // START NEW session with the existing relevant data.
 $v = var_export($_data, TRUE);
 $string = "\n" . __LINE__ . ' $_data = ' . $v . "\n\n";
 fwrite($log_file, $string . "\n");
 $_SESSION = $_data;
 $v = var_export($_SESSION, TRUE);
 $string = "\n" . __LINE__ . ' $_SESSION = ' . $v . "\n\n";
 fwrite($log_file, $string . "\n");
 // Get next assignment to do from the login data.
 $next_lesson = new tutor\src\classes\AssignmentsClass();
 // Return a single lesson as a tAssignments row.
 $lesson = $next_lesson->getNextAssignmentToDo($_data['tA_S_ID'], $last_lesson_id);
 $v = var_export($lesson, TRUE);
 $string = "\n" . __LINE__ . ' $lesson = ' . $v . "\n\n";
 fwrite($log_file, $string . "\n");
 // Assign the lessons variables to the $_SESSION variable.
 // $next_lesson->setSessionVariablesFromLesson($lesson);
 // From the assignment name retrieve the generic assignment and assign
 // its variables  to the $_SESSION variable.
 console . log('116');
 require_once '../src/classes/GenericAClass.inc';
 console . error(message);
 console . log('118');
 $my_next_ga = new tutor\src\classes\GenericAClass();
 $my_next_ga->setSessionVariablesFromTGAssignmentName($lesson['tG_AssignmentName']);