Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KNIGHT
Asyst Moodle Plugin
Commits
ea3295d3
Commit
ea3295d3
authored
Apr 30, 2025
by
Kaif Siddique
Browse files
Moodle405 working
parent
139eb260
Changes
4
Hide whitespace changes
Inline
Side-by-side
classes/utils.php
View file @
ea3295d3
...
@@ -37,6 +37,15 @@ class utils {
...
@@ -37,6 +37,15 @@ class utils {
* @throws \dml_exception
* @throws \dml_exception
*/
*/
public
static
function
get_api_endpoint
():
string
{
public
static
function
get_api_endpoint
():
string
{
return
get_config
(
'local_asystgrade'
,
'apiendpoint'
)
??
'http://127.0.0.1:5001/api/autograde'
;
// $apiendpoint1 = get_config('local_asystgrade', 'apiendpoint') ?? 'http://127.0.0.1:5001/api/autograde';
// error_log("API Endpoint: " . $apiendpoint1);
//return get_config('local_asystgrade', 'apiendpoint') ?? 'http://127.0.0.1:5001/api/autograde';
$apiendpoint
=
get_config
(
'local_asystgrade'
,
'apiendpoint'
);
if
(
empty
(
$apiendpoint
))
{
// empty() returns true for empty strings, null, etc.
return
'http://127.0.0.1:5001/api/autograde'
;
}
return
$apiendpoint
;
// return 'http://193.196.54.144:5001/api/autograde';
}
}
}
}
flask_ml_api/asyst/Source/Skript/german/__pycache__/run_LR_SBERT.cpython-311.pyc
View file @
ea3295d3
No preview for this file type
tests/quiz_api_test.php
View file @
ea3295d3
...
@@ -60,7 +60,7 @@ final class quiz_api_test extends advanced_testcase {
...
@@ -60,7 +60,7 @@ final class quiz_api_test extends advanced_testcase {
$this
->
resetAfterTest
();
$this
->
resetAfterTest
();
parent
::
setUp
();
parent
::
setUp
();
// Clear quiz-related tables to ensure a clean test environment.
//
// //
Clear quiz-related tables to ensure a clean test environment.
$DB
->
execute
(
'TRUNCATE TABLE {quiz_attempts}'
);
$DB
->
execute
(
'TRUNCATE TABLE {quiz_attempts}'
);
$DB
->
execute
(
'TRUNCATE TABLE {quiz_slots}'
);
$DB
->
execute
(
'TRUNCATE TABLE {quiz_slots}'
);
}
}
...
@@ -263,11 +263,16 @@ final class quiz_api_test extends advanced_testcase {
...
@@ -263,11 +263,16 @@ final class quiz_api_test extends advanced_testcase {
try
{
try
{
$apiendpoint
=
utils
::
get_api_endpoint
();
$apiendpoint
=
utils
::
get_api_endpoint
();
$httpclient
=
new
http_client
();
$httpclient
=
new
http_client
();
// // Print the API endpoint and HTTP client details.
//echo "API Endpoint: " . $apiendpoint . "\n";
//echo "HTTP Client: " . print_r($httpclient, true) . "\n";
// echo "Request Data: " . print_r($requestdata, true) . "\n";
$apiclient
=
client
::
getInstance
(
$apiendpoint
,
$httpclient
);
$apiclient
=
client
::
getInstance
(
$apiendpoint
,
$httpclient
);
$response
=
$apiclient
->
send_data
(
$requestdata
);
$response
=
$apiclient
->
send_data
(
$requestdata
);
//echo "Response Data: " . print_r($response, true) . "\n";
$grades
=
json_decode
(
$response
,
true
);
$grades
=
json_decode
(
$response
,
true
);
$this
->
assertNotEmpty
(
$grades
,
'API returned empty grades.'
);
$this
->
assertNotEmpty
(
$grades
,
'API returned empty grades.'
);
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
debugging
(
'Error: '
.
$e
->
getMessage
());
debugging
(
'Error: '
.
$e
->
getMessage
());
...
...
update_http_settings.php
View file @
ea3295d3
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
*/
defined
(
'MOODLE_INTERNAL'
)
||
die
();
//
defined('MOODLE_INTERNAL') || die();
define
(
'MOODLE_INTERNAL'
,
true
);
/**
/**
* Define CLI_SCRIPT to indicate this script is being run from the command line.
* Define CLI_SCRIPT to indicate this script is being run from the command line.
*/
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment