Add API call to get testings

master
Markus Bauer 2023-02-23 16:10:07 +01:00
parent 465668f282
commit 3763ceefd3
1 changed files with 9 additions and 1 deletions

View File

@ -242,6 +242,14 @@ class CakeCMS:
if value is False: value = 0
return self.post('notes_entries/change', {'NotesEntry': {'student_id': student_id, 'note_id': note_id, 'value': value}}, course=course)
def testings_index(self, course=None):
"""
Get all testings in nested tree structure
:param course:
:return:
"""
return self.get('testings/index', course=course).json()['testings']
def testingresults_change(self, testing_id, student_id, points, course=None):
"""
Edit the points of a student.
@ -251,7 +259,7 @@ class CakeCMS:
:param course:
:return:
"""
return self.post('testingresults/change', {'Testingresult': {'student_id': student_id, 'testing_id': testing_id, 'points': points}}, course=course)
return self.post('testingresults/change', {'Testingresult': {'student_id': student_id, 'testing_id': testing_id, 'points': points}}, course=course).json()
def materials_index(self, course=None):
"""