|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
## More background information
### More on `get_classification()`
* It takes a `list` of `list` representing the exam record of a student for three years, with each sub-list representing an attempt at a course in the form `[<course name>, <unit>, <year>, <attempt>, <mark>]`. See the section `Exam record format` for more details
* It returns the corresponding classification (type: `str`, possible values: `'First Class Honours'`, `'Upper Second Class Honours'`, `'Lower Second Class Honours'`, `'Third Class Honours'`, `'Pass'` (if penalty rule considered) and `'Fail'`) the student will get based on the given exam record
### Exam record format
The exam record is in the form of a `list` of `list`, with each sub-list representing an attempt at a course in the form `[<course name>, <unit>, <year>, <attempt>, <mark>]`. Here is an example of a record:
```
[['ST101A', 0.5, 1, 1, 92],
['MA100', 1, 1, 1, 39],
['MA100', 1, 1, 2, 54],
['EC1A3', 0.5, 1, 1, 22],
['EC1A3', 0.5, 1, 2, 34],
['EC1A3', 0.5, 1, 3, 32],
...
['MA222', 0.5, 2, 1, 30],
['MA222', 0.5, 2, 2, 38],
...
['ST310', 0.5, 3, 1, 88],
['ST311', 0.5, 3, 1, 67]]
```
Some explanation:
* `['ST101A', 0.5, 1, 1, 92]` means the student took the course 'ST101A' which is a half-unit in year 1. The record is for the first attempt with a mark of 92
* `['MA100', 1, 1, 1, 39]` means the student took the course 'MA100' which is a full-unit in year 1. The record is for the first attempt with a mark of 39
* `['MA100', 1, 1, 2, 54]` means the student took the course 'MA100' which is a full-unit in year 1. The record is for the second attempt with a mark of 54
* `['EC1A3', 0.5, 1, 3, 32]` means the student took the course 'EC1A3' which is a half-unit in year 1. The record is for the third attempt with a mark of 32
* `['MA222', 0.5, 2, 2, 38]` means the student took the course 'MA222' which is a half-unit in year 2. The record is for the second attempt with a mark of 38
* `['ST311', 0.5, 3, 1, 67]` means the student took the course 'ST311' which is a half-unit in year 3. The record is for the first attempt with mark 67
## Instructions
Describe how you will implement `get_classification()` via _decomposition_. Please also state what function(s) you will define, what they do to help you solve the original problem and implement `get_classification()`. In [src/lse_classification.py](src/lse_classification.py), implement as far as you can towards implementing `get_classification()`.
* Your answer: _________
---
## Assumptions on the function argument
* All marks are `int`, with each mark between 0 and 100
* Assume the exam record is complete, with no further re-attempt or resit is needed
* For simplicity, if "LSE100" is in the record, it bears 0.5 units
* You may ignore the penalty rule of LSE listed in part (a)
---
## Other requirements
* Use `lse_classification` as a _module_. Please do NOT copy the function definitions into `test_lse_classification.py` |
|