Skip to content
Developer From Jokela edited this page Nov 20, 2020 · 1 revision

Exams could be fetched by making a call to SDK: getExams()

This will return ExamsResult class, which has exams in exams variable.

Exam dict structure:

{ 
 'id': 20717, 
 'examId': 256, 
 'name': 'test', 
 'date': datetime.datetime(2020, 11, 16, 0, 0), 
 'info': None, 
 'unseen': False, 
 'seenOn': None, 
 'course': {
    'id': 846, 
    'shortName': 
    'FY FY3', 
    'name': 'Fysiikka 9k', 
    'teachers': [
       {'id': 213, 'code': 'AHV', 'name': 'Ahvena Tuen testiope Anssi'}, 
       {'id': 118, 'code': 'HYP', 'name': 'Hypoteesi Heikki'}
     ]
 }, 
 'grade': 
   {
   'grade': '10+', 
   'verbal': None
  }
}

  • seenOn, datetime or None, this datetime is timestamp when exam was seen
  • unseen, if exam is not marked as seen, dict key's value is True. Learn more at the bottom of this doc how to mark it seen.

Example code:

from wilmasdk.sdk import WilmaSDK
sdk = WilmaSDK()

....

exams = sdk.getExams()
for exam in exams.exams:
    print(exam)

Marking exams seen

To mark exam as seen, first, exam's unseen needs to be True. Also, you can mark multiple exams as seen, by supplying many exams in array.

Example code:

# Array could have one, or more exams to mark as seen simultaneously
examsArray = [exam1, exam2, exam3]
sdk.markExamSeen(examsArray)

If request is successful, SDK call will return you with ExamSeenResult class.

Clone this wiki locally