Esempio n. 1
0
def publish_res(tid, idInfo, detail, title):
    """教师发布课程 资源"""

    if not getTeacher(tid):
        return 't nt exist'

    # 需要加入判断内容长度的部分,防止内容转换后过长
    detail = text2Html(detail)
    title = clean(title)

    sql = '''insert into Info (tid,idInfo,detail,t‎itle,type) values  ('%s','%s','%s','%s','%s');''' \
          % (clean(tid), clean(idInfo), detail, title, 'res');

    db.execute(sql)
Esempio n. 2
0
def update_comment(hid, comment):
    """添加/修改作业的评语"""

    sql = 'update Homework set comment="%s" where idHomework="%s";' % (text2Html(comment), clean(hid))
    return db.execute(sql)
Esempio n. 3
0
def update_comment(hid, comment):
    """添加/修改作业的评语"""

    sql = 'update Homework set comment="%s" where idHomework="%s";' % (
        text2Html(comment), clean(hid))
    return db.execute(sql)
Esempio n. 4
0
def update_notif(idInfo, detail, title):
    """更新消息"""

    detail = text2Html(detail)
    sql = "update Info set detail='%s',t‎itle='%s' where idInfo='%s';" % (detail, title, idInfo)
    db.execute(sql)