Browse Source

update description

tree
欧醚 3 years ago
parent
commit
ba84084f8c
2 changed files with 11 additions and 8 deletions
  1. +9
    -3
      app.py
  2. +2
    -5
      templates/story.html

+ 9
- 3
app.py View File

@ -22,6 +22,9 @@ WRONG_ANS_HTML = '''
</html> </html>
''' '''
MIN_LIKE_NUM = 10
app = Flask(__name__) app = Flask(__name__)
app.config.from_object('config.C') app.config.from_object('config.C')
app.secret_key = C.session_key app.secret_key = C.session_key
@ -92,7 +95,7 @@ class Reaction(db.Model):
user = db.Column(db.String(30)) # username of user user = db.Column(db.String(30)) # username of user
def choose_new_next(min_like_num=10):
def choose_new_next(min_like_num=MIN_LIKE_NUM):
for story in Story.query.filter_by(is_tree=False).all(): for story in Story.query.filter_by(is_tree=False).all():
last_paragraph_id = story.tail last_paragraph_id = story.tail
next_one = Paragraph.query.filter_by(parent_id=last_paragraph_id, is_hidden=False)\ next_one = Paragraph.query.filter_by(parent_id=last_paragraph_id, is_hidden=False)\
@ -199,6 +202,9 @@ def story(story_id):
guest_login_url = url_for('main_bp.guest_login') guest_login_url = url_for('main_bp.guest_login')
verify_questions = sample_question(C.verify_questions) verify_questions = sample_question(C.verify_questions)
min_like_num = MIN_LIKE_NUM
email = C.email
return render_template('story.html', **locals()) return render_template('story.html', **locals())
@ -260,8 +266,8 @@ def react():
@bp.route('/choose') @bp.route('/choose')
def choose_next(): def choose_next():
min_like = request.args.get('min_like', type=int)
choose_new_next(min_like)
min_like_num = request.args.get('min_like', type=int)
choose_new_next(min_like_num)
return 'ok' return 'ok'
app.register_blueprint(bp) app.register_blueprint(bp)

+ 2
- 5
templates/story.html View File

@ -48,12 +48,9 @@
<div style="font-size:90%;"> <div style="font-size:90%;">
<ul> <ul>
<li>我们将每六小时划分为一个时段,每个时段结束后,该时段获得赞同票数最高(且不小于 10)的条目将入选,成为这个角色最终故事的一部分。</li>
<li>具体时段为:6:00-12:00, 12:00-18:00,18:00-24:00,0:00-6:00</li>
<li>当前时段剩余时间:<span id="timeleft" data-period="{{period}}" style="font-weight: bold"></span></li>
<li>如果某个时间段内没有条目获得了不小于 10 个赞,所有的条目都会被保留下来进入下一时段。</li>
<li>在每天的10:00/16:00/22:00,赞数最高且不小于{{min_like_num}}的续写将入选,成为这个角色最终故事的一部分。如果没有,所有都会被保留进入下一时段。</li>
<li>参与创作需要回答几个简单的问题以验证学生身份,或者通过<a href="https://thu.closed.social/">闭社清华站</a>账号登录。</li> <li>参与创作需要回答几个简单的问题以验证学生身份,或者通过<a href="https://thu.closed.social/">闭社清华站</a>账号登录。</li>
<li>联系邮箱:tsinghua_ordinary@protonmail.com</li>
<li>联系邮箱:<a href="mailto:{{email}}">{{email}}</a></li>
</ul> </ul>
</div> </div>
</div> </div>

Loading…
Cancel
Save