1、作业描述、编程作业代码字段改为longtext
2、提交作业界面显示修改 3、编程作业不可以修改和删除control判断
This commit is contained in:
parent
2ed2ba97fa
commit
8f3ac85fec
|
@ -103,10 +103,14 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def edit
|
def edit
|
||||||
|
if @homework.homework_type == 2 #编程作业不能修改作业
|
||||||
|
render_403
|
||||||
|
else
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html
|
format.html
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
if params[:student_work]
|
if params[:student_work]
|
||||||
|
@ -139,7 +143,9 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
if @work.destroy
|
if @homework.homework_type == 2 #编程作业,作品提交后不可以删除
|
||||||
|
render_403
|
||||||
|
elsif @work.destroy
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html {
|
format.html {
|
||||||
redirect_to student_work_index_url(:homework => @homework.id)
|
redirect_to student_work_index_url(:homework => @homework.id)
|
||||||
|
|
|
@ -2,14 +2,6 @@
|
||||||
<h2 class="project_h2">编辑作品</h2>
|
<h2 class="project_h2">编辑作品</h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="Newwork">
|
<div class="Newwork">
|
||||||
<!--<div id="tb_" class="hwork_tb_">-->
|
|
||||||
<!--<ul>-->
|
|
||||||
<!--<li id="tb_1" class="hwork_hovertab" onclick="x:HoverLi(1);" >-->
|
|
||||||
<!--课程名称课程名称课程名</li>-->
|
|
||||||
<!--<li id="tb_2" class="hwork_normaltab" onclick="i:HoverLi(2);">-->
|
|
||||||
<!--成员</li>-->
|
|
||||||
<!--</ul>-->
|
|
||||||
<!--</div>-->
|
|
||||||
<div class="hwork_ctt">
|
<div class="hwork_ctt">
|
||||||
<div class="hwork_dis" id="tbc_01">
|
<div class="hwork_dis" id="tbc_01">
|
||||||
<%= labelled_form_for @work,:html => { :multipart => true } do |f|%>
|
<%= labelled_form_for @work,:html => { :multipart => true } do |f|%>
|
||||||
|
|
|
@ -49,8 +49,12 @@
|
||||||
</p>
|
</p>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p>
|
<p>
|
||||||
<label class="fl"><span class="c_red">*</span> 作品描述 :</label>
|
<label class="fl">
|
||||||
<%= f.text_area "description", :class => "w620 hwork_txt ", :maxlength => 3000, :placeholder => "最多3000个汉字", :onkeyup => "regexStudentWorkDescription();"%>
|
<span class="c_red">*</span>
|
||||||
|
<%= @homework.homework_type == 2 ? "提交代码" : "作品描述"%>
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
<%= f.text_area "description", :class => "w620 hwork_txt ", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();"%>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
<p id="student_work_description_textarea" class="c_red ml90 mb10"></p>
|
<p id="student_work_description_textarea" class="c_red ml90 mb10"></p>
|
||||||
</p>
|
</p>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
class ChangeStudenWorkDesc < ActiveRecord::Migration
|
||||||
|
def up
|
||||||
|
change_column :student_works,:description,:text,:limit => 4294967295
|
||||||
|
end
|
||||||
|
|
||||||
|
def down
|
||||||
|
change_column :student_works,:description,:text
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended to check this file into your version control system.
|
# It's strongly recommended to check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(:version => 20150708025533) do
|
ActiveRecord::Schema.define(:version => 20150708085629) do
|
||||||
|
|
||||||
create_table "activities", :force => true do |t|
|
create_table "activities", :force => true do |t|
|
||||||
t.integer "act_id", :null => false
|
t.integer "act_id", :null => false
|
||||||
|
@ -1222,7 +1222,7 @@ ActiveRecord::Schema.define(:version => 20150708025533) do
|
||||||
|
|
||||||
create_table "student_works", :force => true do |t|
|
create_table "student_works", :force => true do |t|
|
||||||
t.string "name"
|
t.string "name"
|
||||||
t.text "description"
|
t.text "description", :limit => 2147483647
|
||||||
t.integer "homework_common_id"
|
t.integer "homework_common_id"
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.float "final_score"
|
t.float "final_score"
|
||||||
|
|
Loading…
Reference in New Issue