Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KNIGHT
Asyst Moodle Plugin
Commits
2e30eaa7
Commit
2e30eaa7
authored
10 months ago
by
Artem Baranovskyi
Browse files
Options
Download
Email Patches
Plain Diff
Few Moodle coding style fixes.
parent
d0b18af8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
asystgrade/classes/db/quizquery.php
+1
-1
asystgrade/classes/db/quizquery.php
asystgrade/classes/db/quizquery_interface.php
+1
-1
asystgrade/classes/db/quizquery_interface.php
asystgrade/lib.php
+17
-17
asystgrade/lib.php
asystgrade/tests/quiz_api_test.php
+0
-1
asystgrade/tests/quiz_api_test.php
with
19 additions
and
20 deletions
+19
-20
asystgrade/classes/db/
Q
uiz
Q
uery.php
→
asystgrade/classes/db/
q
uiz
q
uery.php
+
1
-
1
View file @
2e30eaa7
<?php
namespace
local_asystgrade\db
;
class
Q
uiz
Q
uery
implements
Q
uiz
Q
uery
I
nterface
class
q
uiz
q
uery
implements
q
uiz
q
uery
_i
nterface
{
private
$db
;
...
...
This diff is collapsed.
Click to expand it.
asystgrade/classes/db/
Q
uiz
Q
uery
I
nterface.php
→
asystgrade/classes/db/
q
uiz
q
uery
_i
nterface.php
+
1
-
1
View file @
2e30eaa7
...
...
@@ -2,7 +2,7 @@
namespace
local_asystgrade\db
;
interface
Q
uiz
Q
uery
I
nterface
interface
q
uiz
q
uery
_i
nterface
{
public
function
get_question_attempts
(
$qid
,
$slot
);
...
...
This diff is collapsed.
Click to expand it.
asystgrade/lib.php
+
17
-
17
View file @
2e30eaa7
...
...
@@ -22,7 +22,7 @@
use
local_asystgrade
\
api\client
;
use
local_asystgrade\api\http_client
;
use
local_asystgrade
\
db\
Q
uiz
Q
uery
;
use
local_asystgrade
\
db\
q
uiz
q
uery
;
defined
(
'MOODLE_INTERNAL'
)
||
die
();
...
...
@@ -41,7 +41,7 @@ function local_asystgrade_before_footer()
$slot
=
optional_param
(
'slot'
,
false
,
PARAM_INT
);
if
(
$PAGE
->
url
->
compare
(
new
moodle_url
(
'/mod/quiz/report.php'
),
URL_MATCH_BASE
)
&&
$slot
)
{
$quizQuery
=
new
Q
uiz
Q
uery
();
$quizQuery
=
new
q
uiz
q
uery
();
if
(
$quizQuery
->
gradesExist
(
$qid
,
$slot
))
{
error_log
(
'Grades already exist in the database.'
);
...
...
@@ -113,12 +113,12 @@ function pasteGradedMarks(array $grades, array $inputNames, float $maxmark): voi
/**
* Processes question attempts and answers to prepare for API a data to estimate answers
*
* @param
Q
uiz
Q
uery $database
* @param
q
uiz
q
uery $database
* @param $question_attempts
* @param $referenceAnswer
* @return array
*/
function
prepare_api_data
(
Q
uiz
Q
uery
$database
,
$question_attempts
,
$referenceAnswer
):
array
function
prepare_api_data
(
q
uiz
q
uery
$database
,
$question_attempts
,
$referenceAnswer
):
array
{
$studentData
=
[];
...
...
@@ -189,16 +189,16 @@ function generate_script(array $grades, array $inputNames, float $maxmark) {
/**
* Autoloader registration
*/
spl_autoload_register
(
function
(
$classname
)
{
// Check if the class name starts with our plugin's namespace
if
(
strpos
(
$classname
,
'local_asystgrade\\'
)
===
0
)
{
// Transforming the Namespace into the Path
$classname
=
str_replace
(
'local_asystgrade\\'
,
''
,
$classname
);
$classname
=
str_replace
(
'\\'
,
DIRECTORY_SEPARATOR
,
$classname
);
$filepath
=
__DIR__
.
DIRECTORY_SEPARATOR
.
'classes'
.
DIRECTORY_SEPARATOR
.
$classname
.
'.php'
;
if
(
file_exists
(
$filepath
))
{
require_once
(
$filepath
);
}
}
});
//
spl_autoload_register(function ($classname) {
//
// Check if the class name starts with our plugin's namespace
//
if (strpos($classname, 'local_asystgrade\\') === 0) {
//
// Transforming the Namespace into the Path
//
$classname = str_replace('local_asystgrade\\', '', $classname);
//
$classname = str_replace('\\', DIRECTORY_SEPARATOR, $classname);
//
$filepath = __DIR__ . DIRECTORY_SEPARATOR . 'classes' . DIRECTORY_SEPARATOR . $classname . '.php';
//
//
if (file_exists($filepath)) {
//
require_once($filepath);
//
}
//
}
//
});
This diff is collapsed.
Click to expand it.
asystgrade/tests/quiz_api_test.php
+
0
-
1
View file @
2e30eaa7
...
...
@@ -227,7 +227,6 @@ class quiz_api_test extends advanced_testcase
'referenceAnswer'
=>
$referenceAnswer
,
'studentAnswers'
=>
$studentAnswers
];
// var_dump($data);
error_log
(
"Data to send to API: "
.
print_r
(
$data
,
true
));
$response
=
$apiClient
->
send_data
(
$data
);
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Explore
Projects
Groups
Snippets