Skip to content

Commit

Permalink
add php 8.2 test environment and add support note in readme on php8.2…
Browse files Browse the repository at this point in the history
… and moodle 4.3
  • Loading branch information
Glutamat42 committed Jan 12, 2024
1 parent 30d8bbd commit 0269272
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 0 deletions.
40 changes: 40 additions & 0 deletions dev_utils/load_test.py
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()
60 changes: 60 additions & 0 deletions test.plantuml
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
1 change: 1 addition & 0 deletions test2.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@startuml

0 comments on commit 0269272

Please sign in to comment.