点击学生作品列表中的编程作品,代码会跳到上一个作品的详情

This commit is contained in:
cxt 2016-03-10 11:40:56 +08:00
parent f8f36f9f29
commit 8a4175dc02
5 changed files with 12 additions and 4 deletions

View File

@ -25,7 +25,7 @@
<li >
<span class="tit_fb ">编程代码:</span>
<div class="showHworkP break_word"><pre id="work-src" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code">
<div class="showHworkP break_word"><pre id="work-src" style="display: none;"><%= work.description if work.description%></pre><div class="fontGrey2 font_cus" id="work-code_<%= work.id%>">
</div>
</div>
<div class="cl"></div>

View File

@ -63,7 +63,7 @@
} else if(language==4){
program_name = 'text/x-java';
}
var editor = CodeMirror(document.getElementById("work-code"), {
var editor = CodeMirror(document.getElementById("work-code_<%= work.id%>"), {
mode: {name: program_name,
version: 2,
singleLineStringErrors: false},

View File

@ -17,7 +17,7 @@ else{
program_name = 'text/x-java';
}
var editor = CodeMirror(document.getElementById("work-code"), {
var editor = CodeMirror(document.getElementById("work-code_<%= @work.id%>"), {
mode: {name: program_name,
version: 2,
singleLineStringErrors: false},

View File

@ -0,0 +1,8 @@
class DeleteStudentWorkData < ActiveRecord::Migration
def up
StudentWork.where("homework_common_id = 2604 AND user_id = 10763 AND final_score = 0").destroy_all
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160309024051) do
ActiveRecord::Schema.define(:version => 20160310033019) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false