-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add php 8.2 test environment and add support note in readme on php8.2…
… and moodle 4.3
- Loading branch information
1 parent
30d8bbd
commit 0269272
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
import time | ||
import argparse | ||
import requests | ||
from multiprocessing import Process | ||
|
||
|
||
argParser = argparse.ArgumentParser() | ||
argParser.add_argument("-b", "--backupFile", help="", required=True) | ||
argParser.add_argument("-a", "--atfFile", help="", required=True) | ||
argParser.add_argument("-t", "--token", help="auth token", required=True) | ||
argParser.add_argument("-u", "--url", help="moodle url (default: http://localhost)", default="http://localhost") | ||
argParser.add_argument("-c", "--count", help="how often the file will be uploaded", default=10) | ||
argParser.add_argument("-d", "--delay", help="delay between starting uploads", default=5) | ||
|
||
args = argParser.parse_args() | ||
|
||
def upload_file(): | ||
print("Uploading backup file") | ||
backupFile = open(args.backupFile, 'rb') | ||
atfFile = open(args.atfFile, 'rb') | ||
|
||
response = requests.post( | ||
args.url + '/api/Worlds', | ||
files={'backupFile': backupFile.read(), 'atfFile': atfFile.read()}, | ||
headers={'token': args.token}, | ||
) | ||
|
||
print(response.status_code) | ||
print(response.text) | ||
|
||
if __name__ == "__main__": | ||
processes = [] | ||
for i in range(int(args.count)): | ||
p = Process(target=upload_file) | ||
p.start() | ||
processes.append(p) | ||
time.sleep(int(args.delay)) | ||
for p in processes: | ||
p.join() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
@startuml | ||
|
||
!define classdiagram | ||
skinparam classAttributeIconSize 0 | ||
|
||
namespace local_adler { | ||
class adler_score { | ||
-course_module: object | ||
-user_id: int | ||
#score_item: stdClass | ||
#helpers: string | ||
#completion_info: string | ||
#adler_score_helpers: string | ||
|
||
+__construct(course_module: object, user_id: int = null) | ||
+get_cmid(): int | ||
+get_score(): float | ||
-get_h5p_score(): float | ||
-get_primitive_score(): float | ||
-calculate_score(max_score: float, percentage_achieved: float): float | ||
-calculate_percentage_achieved(value: float, max: float, min: float = 0): float | ||
} | ||
|
||
class helpers { | ||
+get_course_from_course_id(course_id: int) | ||
+delete_adler_course_record(course_id: int) | ||
+course_is_adler_course(course_id: int): bool | ||
+is_primitive_learning_element(course_module: object): bool | ||
} | ||
} | ||
|
||
class completion_info { | ||
} | ||
|
||
class context_course { | ||
} | ||
|
||
class dml_exception { | ||
} | ||
|
||
class user_not_enrolled_exception { | ||
} | ||
|
||
class moodle_exception { | ||
} | ||
|
||
class stdClass { | ||
} | ||
|
||
adler_score ..> helpers: <<use>> | ||
adler_score ..> completion_info: <<use>> | ||
adler_score ..> adler_score_helpers: <<use>> | ||
|
||
adler_score .. context_course: <<use>> | ||
adler_score ..> dml_exception: <<use>> | ||
adler_score ..> user_not_enrolled_exception: <<use>> | ||
adler_score ..> moodle_exception: <<use>> | ||
adler_score -- stdClass: <<use>> | ||
|
||
@enduml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@startuml |