@ -87,18 +87,7 @@
< div id = "text-content" >
< div id = "text-content" >
< div id = "found" >
< div id = "found" >
{% if today_article and today_article["ratio"] is not none %}
< div class = "alert alert-success" role = "alert" > According to your word list, your level is < span class = "text-decoration-underline" id = "user_level" > {{ today_article["user_level"] }}< / span > and we have chosen an article with a difficulty level of < span class = "text-decoration-underline" id = "text_level" > {{ today_article["text_level"] }}< / span > for you. The Oxford word coverage is < span class = "text-decoration-underline" id = "ratio" > {{ (today_article["ratio"] * 100) | int }}%.< / span > < / div >
< div class = "alert alert-success" role = "alert" >
According to your word list, your level is
< span class = "text-decoration-underline" id = "user_level" > {{ today_article["user_level"] }}< / span >
and we have chosen an article with a difficulty level of
< span class = "text-decoration-underline" id = "text_level" > {{ today_article["text_level"] }}< / span >
for you. The Oxford word coverage is
< span class = "text-decoration-underline" id = "ratio" > {{ (today_article["ratio"] * 100) | int }}%.< / span >
< / div >
{% else %}
< div class = "alert alert-warning" > No article or article is incomplete.< / div >
{% endif %}
< p class = "text-muted" id = "date" > Article added on: {{ today_article["date"] }}< / p > < br / >
< p class = "text-muted" id = "date" > Article added on: {{ today_article["date"] }}< / p > < br / >
< button onclick = "saveArticle()" > 标记文章< / button >
< button onclick = "saveArticle()" > 标记文章< / button >
@ -125,13 +114,11 @@
}
}
< / script >
< / script >
< button onclick = "toggle_visibility('answer');" > ANSWER< / button >
< button onclick = "toggle_visibility('answer');" > ANSWER< / button >
< div id = "answer" style = "display:none;" >
< div id = "answer" style = "display:none;" > {{ today_article['answer'] }}< / div > < br / >
{{ today_article['answer'] }}
< / div > < br / >
< / div >
< / div >
< div id = "tooltip" > < / div >
< div id = "tooltip" > < / div >
< / div >
< / div >
< div class = "alert alert-success" role = "alert" id = "not_found" style = "display:none;" >
< div class = "alert alert-success" role = "alert" id = "not_found" style = "display:none;" >
< p class = "text-muted" > < span class = "badge bg-success" > Notes:< / span > < br > No article is currently available for you. You can try again a few times or mark new words in the passage to improve your level.< / p >
< p class = "text-muted" > < span class = "badge bg-success" > Notes:< / span > < br > No article is currently available for you. You can try again a few times or mark new words in the passage to improve your level.< / p >
< / div >
< / div >
< div class = "alert alert-success" role = "alert" id = "read_all" style = "display:none;" >
< div class = "alert alert-success" role = "alert" id = "read_all" style = "display:none;" >
@ -380,7 +367,7 @@
savedArticlesDropdown.appendChild(option);
savedArticlesDropdown.appendChild(option);
localStorage.setItem(articleTitle, articleJSON); // 以文章标题为键, 序列化的JSON字符串为值存储
localStorage.setItem(articleTitle, articleJSON); // 以文章标题为键, 序列化的JSON字符串为值存储
}
}
function loadSelectedArticle() {
function loadSelectedArticle() {
const selectedOption = document.getElementById('saved_articles_dropdown');
const selectedOption = document.getElementById('saved_articles_dropdown');
const selectedTitle = selectedOption.options[selectedOption.selectedIndex].text;
const selectedTitle = selectedOption.options[selectedOption.selectedIndex].text;
const articleJSON = localStorage.getItem(selectedTitle);
const articleJSON = localStorage.getItem(selectedTitle);
@ -391,7 +378,7 @@ function loadSelectedArticle() {
}
}
}
}
window.onload = function() {
window.onload = function() {
const savedArticlesDropdown = document.getElementById('saved_articles_dropdown');
const savedArticlesDropdown = document.getElementById('saved_articles_dropdown');
savedArticlesDropdown.addEventListener('change', loadSelectedArticle);
savedArticlesDropdown.addEventListener('change', loadSelectedArticle);