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";
// fwrite($log_file, $string);
$result = $class_instance->insertRecord($_SESSION);
// insert the target lesson and get back the tA_id.
// now get back the tA_id for the target lesson.  Get by assignment_name
// $result = $class_instance->insertRecord($var_array);
require 'one_digit_addition_vertical_clues.php';
Exemple #2
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');
 }