模拟答题页面增加返回按钮,页面的layout改成课程相关

This commit is contained in:
cxt 2016-02-25 10:23:38 +08:00
parent 758b044986
commit c6e7e2e83b
3 changed files with 13 additions and 4 deletions

View File

@ -532,9 +532,10 @@ class UsersController < ApplicationController
if @student_work.nil? if @student_work.nil?
@student_work = StudentWork.new @student_work = StudentWork.new
end end
@course = @homework.course
respond_to do |format| respond_to do |format|
format.js format.js
format.html {render :layout => 'new_base_user'} format.html {render :layout => 'base_courses'}
end end
else else
render_403 render_403

View File

@ -4,7 +4,12 @@
<%= stylesheet_link_tag "/assets/codemirror/codemirror" %> <%= stylesheet_link_tag "/assets/codemirror/codemirror" %>
<% end %> <% end %>
<script type="text/javascript">
$(function(){
$("#RSide").removeAttr("id");
$("#Container").css("width","1000px");
});
</script>
<!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 --> <!-- 模板1开始可以使用scripttype设置为text/html来存放模板片段并且用id标示 -->
<script id="t:result-list" type="text/html"> <script id="t:result-list" type="text/html">
<div class="ProResultTop"> <div class="ProResultTop">
@ -40,7 +45,7 @@
</script> </script>
<!-- 模板1结束 --> <!-- 模板1结束 -->
<div class="ProgramHomework"> <div class="ProgramHomework ml10">
<div class="homepageRightBanner mb10"> <div class="homepageRightBanner mb10">
@ -91,7 +96,9 @@
</div> </div>
<div class="mt10"> <div class="mt10">
<a href="javascript:void(0);" class="BlueCirBtn fl" data-homework-id="<%=@homework.id%>" data-student-work-id="<%=@student_work.id%>" id="test-program-btn">测试代码</a> <a href="javascript:void(0);" class="BlueCirBtn fl" data-homework-id="<%=@homework.id%>" data-student-work-id="<%=@student_work.id%>" id="test-program-btn">测试代码</a>
<% unless @is_test %> <% if @is_test %>
<%=link_to '返 回',course_path(@course),:class=>'fr mt6' %>
<% else @is_test %>
<a href="javascript:void(0);" class="BlueCirBtn fr" id="commit-program-work-btn">提交代码</a> <a href="javascript:void(0);" class="BlueCirBtn fr" id="commit-program-work-btn">提交代码</a>
<% end %> <% end %>
<div class="cl"></div> <div class="cl"></div>

View File

@ -113,6 +113,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt0 {margin-top:0px !important;} .mt0 {margin-top:0px !important;}
.mt3{ margin-top:3px;} .mt3{ margin-top:3px;}
.mt5{ margin-top:5px;} .mt5{ margin-top:5px;}
.mt6{ margin-top:6px;}
.mt8{ margin-top:8px;} .mt8{ margin-top:8px;}
.mt10{ margin-top:10px !important;} .mt10{ margin-top:10px !important;}
.mt20{margin-top: 20px;} .mt20{margin-top: 20px;}