The key change is replacing "d1 = load_freq_history(path_prefix + 'static/frequency/ferquency.p)" with "d1 = load_freq_history(user_word_list)"
in function get_today_article() from Article.py. Now, with a user_word_list of size about 500, the next article can be loaded within 100ms.
The new d1 is much smaller than the old one, therefore the following computation "d3 = get_difficulty_level_for_user(d1, d2)" is much faster.
The students did not feel that loading next article is slow; this is because their frequency.p is quite small.
Also log information in app/log.txt
1. Add jquery.js and word_operation.js to the static folder.
2. Changed the return type of the familiar, unfamiliar and deleteword methods of user_service.py.
```
original: return redirect(url_for('userpage', username=username))
now: return "success"
```
3. In order to get elements in JS to make ajax requests we add ids in userpage_get.html for familiar, unfamiliar, delete buttons and so on.
4. When the user's word book was retrieved, the list returned was already sorted in descending order of frequency, so redundant code was removed in userpage_get.html.
Co-authored-by: PeterQiu <www.1392993990@qq.com>
Co-authored-by: Lan Hui <1348141770@qq.com>
Reviewed-on: http://121.4.94.30:3000/mrlan/EnglishPal/pulls/30
Co-authored-by: 邱忠辉 <1392993990@qq.com>
Co-committed-by: 邱忠辉 <1392993990@qq.com>