From b94c95e4c6a1a5b2793bf9b990f8dfc75fbd129b Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Thu, 17 Jul 2025 16:36:15 +0700 Subject: [PATCH 01/24] Test_function_list --- assessment/macros.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/assessment/macros.php b/assessment/macros.php index 6c6f226002..66705957e1 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -716,6 +716,17 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $commands = "setBorder(5); initPicture({$winxmin},{$winxmax},{$ymin},{$ymax});".$commands; $alt = "Graphing window shows horizontal axis: {$winxmin} to {$winxmax}, vertical axis: {$ymin} to {$ymax}. ".$alt; + // Adding function list to $commands(For testing purposes) + $function_names = []; + foreach ($funcs as $f) { + if ($f === '') continue; + $parts = explode(',', $f, 2); + $function_names[] = trim($parts[0]); + } + $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; + $commands = "var function_list = $function_list_str; " . $commands; + // + if ($_SESSION['graphdisp']==0) { return $alt; } else { From 57e5cb3cb81ef9e8207764f9c13b9421f25f57d9 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:16:11 +0700 Subject: [PATCH 02/24] Changes to $commands --- assessment/macros.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/assessment/macros.php b/assessment/macros.php index 66705957e1..27b19dd36d 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -177,6 +177,16 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label //$alt = "Graph, window x {$settings[0]} to {$settings[1]}, y {$settings[2]} to {$settings[3]}."; $commands = ''; $alt = ''; + + //Adding function list to $commands + $function_names = []; + foreach ($funcs as $f) { + if ($f === '') continue; + $parts = explode(',', $f, 2); + $function_names[] = trim($parts[0]); + } + $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; + if (strpos($settings[4],':')) { $lbl = explode(':',$settings[4]); $lbl[0] = evalbasic($lbl[0], true, true); @@ -717,13 +727,6 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $alt = "Graphing window shows horizontal axis: {$winxmin} to {$winxmax}, vertical axis: {$ymin} to {$ymax}. ".$alt; // Adding function list to $commands(For testing purposes) - $function_names = []; - foreach ($funcs as $f) { - if ($f === '') continue; - $parts = explode(',', $f, 2); - $function_names[] = trim($parts[0]); - } - $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; $commands = "var function_list = $function_list_str; " . $commands; // From d08fe3d71ace81c5c9575f495afb3c6513cb375a Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:21:28 +0700 Subject: [PATCH 03/24] Testing --- assessment/macros.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assessment/macros.php b/assessment/macros.php index 27b19dd36d..c367003bb8 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -728,6 +728,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label // Adding function list to $commands(For testing purposes) $commands = "var function_list = $function_list_str; " . $commands; + $commands = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".$commands; // if ($_SESSION['graphdisp']==0) { From ecd4f79791aae6b9d3a92cfc803c0736fb07d6ad Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:25:36 +0700 Subject: [PATCH 04/24] TEST --- assessment/macros.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assessment/macros.php b/assessment/macros.php index c367003bb8..0a6d8c7a72 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -728,7 +728,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label // Adding function list to $commands(For testing purposes) $commands = "var function_list = $function_list_str; " . $commands; - $commands = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".$commands; + // $commands = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".$commands; // if ($_SESSION['graphdisp']==0) { From 7f03741f26db8f95c715284fe60c116be4935abe Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Fri, 18 Jul 2025 11:12:25 +0700 Subject: [PATCH 05/24] Function change --- assessment/macros.php | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/assessment/macros.php b/assessment/macros.php index 0a6d8c7a72..3e9d4206e3 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -177,16 +177,6 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label //$alt = "Graph, window x {$settings[0]} to {$settings[1]}, y {$settings[2]} to {$settings[3]}."; $commands = ''; $alt = ''; - - //Adding function list to $commands - $function_names = []; - foreach ($funcs as $f) { - if ($f === '') continue; - $parts = explode(',', $f, 2); - $function_names[] = trim($parts[0]); - } - $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; - if (strpos($settings[4],':')) { $lbl = explode(':',$settings[4]); $lbl[0] = evalbasic($lbl[0], true, true); @@ -727,14 +717,21 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $alt = "Graphing window shows horizontal axis: {$winxmin} to {$winxmax}, vertical axis: {$ymin} to {$ymax}. ".$alt; // Adding function list to $commands(For testing purposes) - $commands = "var function_list = $function_list_str; " . $commands; - // $commands = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".$commands; + $function_names = []; + foreach ($funcs as $f) { + if ($f === '') continue; + $function_names[] = trim($f); + } + $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; + // $commands = "var function_list = $function_list_str; " . $commands; // + + if ($_SESSION['graphdisp']==0) { return $alt; } else { - return "\n"; + return "\n"; } } From 23a7c5c659283a5947f4baa16cb795ba4e0353e0 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 13:59:16 +0700 Subject: [PATCH 06/24] Beautify function --- assessment/macros.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assessment/macros.php b/assessment/macros.php index 3e9d4206e3..a4e6a4ac49 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -723,6 +723,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_names[] = trim($f); } $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; + $function_list_str = makexxpretty($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; // From 5a1923cfc24d093d112c10bf171dbca4f72a5e68 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:12:05 +0700 Subject: [PATCH 07/24] Testing --- assessment/macros.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assessment/macros.php b/assessment/macros.php index a4e6a4ac49..dd06b3313d 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -725,14 +725,13 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; $function_list_str = makexxpretty($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; - // - + $new_test_only = "THERE IS NOT NOTHING"; if ($_SESSION['graphdisp']==0) { return $alt; } else { - return "\n"; + return "\n"; } } From 73bd3b9dca0028e1f0e5146962406e994fc6ca6d Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:25:04 +0700 Subject: [PATCH 08/24] Beautify function --- assessment/macros.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/assessment/macros.php b/assessment/macros.php index dd06b3313d..f59a7ed1b6 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -723,15 +723,17 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_names[] = trim($f); } $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; + $function_list_str = makepretty($function_list_str); + $function_list_str = makexpretty($function_list_str); $function_list_str = makexxpretty($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; - $new_test_only = "THERE IS NOT NOTHING"; + $new_test_only = "THERE IS NOT NOT NOTHING"; if ($_SESSION['graphdisp']==0) { return $alt; } else { - return "\n"; + return "\n"; } } From 18cbadc14f66a911d1ead309ee9834a9ca539d58 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:33:21 +0700 Subject: [PATCH 09/24] Simplify function --- assessment/macros.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assessment/macros.php b/assessment/macros.php index f59a7ed1b6..943da7fac5 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -726,6 +726,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_list_str = makepretty($function_list_str); $function_list_str = makexpretty($function_list_str); $function_list_str = makexxpretty($function_list_str); + $function_list_str = calclisttoarray($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; $new_test_only = "THERE IS NOT NOT NOTHING"; @@ -733,7 +734,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label if ($_SESSION['graphdisp']==0) { return $alt; } else { - return "\n"; + return "\n"; } } From e29f691158ef0217f3b8bd749a5a235bba41e0fc Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:33:46 +0700 Subject: [PATCH 10/24] Simplify function --- assessment/macros.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assessment/macros.php b/assessment/macros.php index 943da7fac5..e55af0047f 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -728,7 +728,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_list_str = makexxpretty($function_list_str); $function_list_str = calclisttoarray($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; - $new_test_only = "THERE IS NOT NOT NOTHING"; + $new_test_only = "THERE Is NOTHING"; if ($_SESSION['graphdisp']==0) { From 5ec46846d840577506a92852c6de2d470d74dd45 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:55:10 +0700 Subject: [PATCH 11/24] Simplify function 2 --- assessment/macros.php | 1 - 1 file changed, 1 deletion(-) diff --git a/assessment/macros.php b/assessment/macros.php index e55af0047f..7227d52e81 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -726,7 +726,6 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_list_str = makepretty($function_list_str); $function_list_str = makexpretty($function_list_str); $function_list_str = makexxpretty($function_list_str); - $function_list_str = calclisttoarray($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; $new_test_only = "THERE Is NOTHING"; From fb24d33d9b4e9801b8a86ab744d4a99653b605b0 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:09:56 +0700 Subject: [PATCH 12/24] Delete test command --- assessment/macros.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/assessment/macros.php b/assessment/macros.php index 7227d52e81..596552a61f 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -723,17 +723,14 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_names[] = trim($f); } $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; - $function_list_str = makepretty($function_list_str); $function_list_str = makexpretty($function_list_str); $function_list_str = makexxpretty($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; - $new_test_only = "THERE Is NOTHING"; - if ($_SESSION['graphdisp']==0) { return $alt; } else { - return "\n"; + return "\n"; } } From 23a54b9e2ddb6a9dcd4b1cd84a39cc7f3ed3d704 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:48:53 +0700 Subject: [PATCH 13/24] change --- assessment/macros.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/assessment/macros.php b/assessment/macros.php index 596552a61f..bece67f059 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -723,14 +723,15 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label $function_names[] = trim($f); } $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; + // $function_list_str = makepretty($function_list_str); $function_list_str = makexpretty($function_list_str); - $function_list_str = makexxpretty($function_list_str); + // $function_list_str = makexxpretty($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; if ($_SESSION['graphdisp']==0) { return $alt; } else { - return "\n"; + return "\n"; } } From 90cd6dd008fcfc890a7ef6c30932543d7dfa486f Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Tue, 29 Jul 2025 11:07:07 +0700 Subject: [PATCH 14/24] remove test --- assessment/macros.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assessment/macros.php b/assessment/macros.php index bece67f059..1a8a774d38 100644 --- a/assessment/macros.php +++ b/assessment/macros.php @@ -724,7 +724,7 @@ function showplot($funcs) { //optional arguments: $xmin,$xmax,$ymin,$ymax,label } $function_list_str = '["' . implode('","', array_map('addslashes', $function_names)) . '"]'; // $function_list_str = makepretty($function_list_str); - $function_list_str = makexpretty($function_list_str); + // $function_list_str = makexpretty($function_list_str); // $function_list_str = makexxpretty($function_list_str); // $commands = "var function_list = $function_list_str; " . $commands; From f6863fa67f84edc2c6ca589282aeae9c629f58d2 Mon Sep 17 00:00:00 2001 From: Themid1 <127655716+Themid1@users.noreply.github.com> Date: Mon, 4 Aug 2025 10:45:09 +0700 Subject: [PATCH 15/24] First test commit --- assessment/config.php | 89 +++++++++++++++++++++++++++++++++++++++++++ assessment/macros.php | 21 +++++++++- config.php | 19 ++++----- 3 files changed, 118 insertions(+), 11 deletions(-) create mode 100644 assessment/config.php diff --git a/assessment/config.php b/assessment/config.php new file mode 100644 index 0000000000..36fb2c3004 --- /dev/null +++ b/assessment/config.php @@ -0,0 +1,89 @@ +setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING ); + $GLOBALS["DBH"] = $DBH; + } catch(PDOException $e) { + die("
Could not connect to database: " . $e->getMessage() . "