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,title,type) values ('%s','%s','%s','%s','%s');''' \ % (clean(tid), clean(idInfo), detail, title, 'res'); db.execute(sql)
def update_comment(hid, comment): """添加/修改作业的评语""" sql = 'update Homework set comment="%s" where idHomework="%s";' % (text2Html(comment), clean(hid)) return db.execute(sql)
def update_comment(hid, comment): """添加/修改作业的评语""" sql = 'update Homework set comment="%s" where idHomework="%s";' % ( text2Html(comment), clean(hid)) return db.execute(sql)
def update_notif(idInfo, detail, title): """更新消息""" detail = text2Html(detail) sql = "update Info set detail='%s',title='%s' where idInfo='%s';" % (detail, title, idInfo) db.execute(sql)