From 1e2d2612726d92d79e13873a159a710464503f0c Mon Sep 17 00:00:00 2001
From: Hui Lan <lanhui@zjnu.edu.cn>
Date: Thu, 11 Feb 2021 18:53:04 +0800
Subject: app/main.py: should always compute text difficulty level.

---
 app/main.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/main.py b/app/main.py
index 2bd903a..9ffe91f 100644
--- a/app/main.py
+++ b/app/main.py
@@ -94,8 +94,8 @@ def get_today_article(user_word_list, articleID):
     user_level = user_difficulty_level(d_user, d3) # more consideration as user's behaviour is dynamic. Time factor should be considered.
     random.shuffle(result) # shuffle list
     d = random.choice(result)
+    text_level = text_difficulty_level(d['text'], d3)
     if articleID == None:
-        text_level = text_difficulty_level(d['text'], d3)    
         for reading in result:
             text_level = text_difficulty_level(reading['text'], d3)
             #print('TEXT_LEVEL %4.2f' % (text_level))
-- 
cgit v1.2.1