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);
// $s = ' round(microtime(true), 3, PHP_ROUND_HALF_EVEN) = ';
// $string =  __LINE__. $s . round(microtime(true), 3, PHP_ROUND_HALF_EVEN)."\n\n";
Exemple #2
0
 /**
  * Test test "normalizePercentTimeTo100Percent()" in Assignments.class.inc
  *
  * A *description*, that can span multiple lines, to go _in-depth_ into the details of this element
  * and to provide some background information or textual references.
  *
  * @return void
  */
 public function testgetSpecificStudentAssignmentFromDbAsArray()
 {
     $this->testbuildArray();
     // reset myArray to origninal values.
     $classInstance = new tutor\src\classes\AssignmentsClass();
     $result = $classInstance->delRowsByStudentId($this->myArray['tA_S_ID']);
     $this->assertTrue($result === 0);
     $this->myArray['tA_S_ID'] = 'ghghgh';
     $this->myArray['tG_AssignmentName'] = 'TestAssignment';
     $this->myArray['tA_StartRec'] = '77';
     $result = $classInstance->delRowsByStudentId('ghghgh');
     // insure clean start
     $this->assertTrue($result === 0);
     $result = $classInstance->insertRecord($this->myArray);
     $this->assertTrue($result === 1);
     $row = $classInstance->getSpecificStudentAssignmentFromDbAsArray('ghghgh', $this->myArray['tG_AssignmentName'], $this->myArray['tA_StartRec']);
     $this->assertTrue(is_array($row));
     $this->assertTrue($row['tA_S_ID'] === 'ghghgh');
     $this->assertTrue($row['tG_AssignmentName'] === 'TestAssignment');
     $this->assertTrue($row['tA_StartRec'] === '77');
     $classInstance->delRowsByStudentId('ghghgh');
     $classInstance->delRowsByStudentId($this->myArray['tA_S_ID']);
 }