|
|
|
@ -227,7 +227,7 @@ class HomeworkAttachController < ApplicationController
|
|
|
|
|
def create
|
|
|
|
|
bid = Bid.find params[:bid_id]
|
|
|
|
|
if User.current.admin? || User.current.member_of_course?(bid.courses.first) # modify by nwb
|
|
|
|
|
if bid.homeworks.where("user_id = ?",User.current).count == 0
|
|
|
|
|
if bid.homeworks.where("user_id = ?",User.current).empty?
|
|
|
|
|
user_id = params[:user_id]
|
|
|
|
|
bid_id = params[:bid_id]
|
|
|
|
|
if params[:homework_attach]
|
|
|
|
|