Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
00ac79bb34
|
@ -1,7 +1,7 @@
|
|||
class ExerciseController < ApplicationController
|
||||
layout "base_courses"
|
||||
|
||||
before_filter :find_exercise_and_course, :only => [:create_exercise_question, :edit, :update, :show, :destroy, :commit_exercise, :commit_answer,:publish_exercise,:republish_exercise]
|
||||
before_filter :find_exercise_and_course, :only => [:create_exercise_question, :edit, :update, :show, :destroy, :commit_exercise, :commit_answer,:publish_exercise,:republish_exercise,:show_student_result]
|
||||
before_filter :find_course, :only => [:index,:new,:create,:student_exercise_list]
|
||||
include ExerciseHelper
|
||||
|
||||
|
@ -34,7 +34,7 @@ class ExerciseController < ApplicationController
|
|||
render_403
|
||||
return
|
||||
end
|
||||
exercise_end = Time.parse(format_time(@exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") > Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
exercise_end = @exercise.end_time > Time.now
|
||||
if @exercise.time == -1
|
||||
@can_edit_excercise = exercise_end
|
||||
else
|
||||
|
@ -59,6 +59,9 @@ class ExerciseController < ApplicationController
|
|||
# @percent = get_percent(@exercise,User.current)
|
||||
exercise_questions = @exercise.exercise_questions
|
||||
@exercise_questions = paginateHelper exercise_questions,5 #分页
|
||||
score = calculate_student_score(@exercise, User.current)
|
||||
eu = get_exercise_user(@exercise.id, User.current.id)
|
||||
eu.update_attributes(:score => score)
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
|
@ -342,10 +345,10 @@ class ExerciseController < ApplicationController
|
|||
@exercise = Exercise.find params[:id]
|
||||
@all_exercises = @course.exercises.where("exercise_status > 1").order("created_at desc")
|
||||
@exercise_count = @exercise.exercise_users.where('score is not NULL').count
|
||||
if @is_teacher || (!@exercise.exercise_users.where(:user_id => User.current.id).empty? && Time.parse(@exercise.end_time.to_s).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S"))
|
||||
if @is_teacher || (!@exercise.exercise_users.where(:user_id => User.current.id).empty? && @exercise.end_time <= Time.now)
|
||||
@exercise_users_list = @exercise.exercise_users.where('score is not NULL')
|
||||
@show_all = true;
|
||||
elsif !@exercise.exercise_users.where(:user_id => User.current.id).empty? && Time.parse(@exercise.end_time.to_s).strftime("%Y-%m-%d-%H-%M-%S") > Time.now.strftime("%Y-%m-%d-%H-%M-%S")
|
||||
elsif !@exercise.exercise_users.where(:user_id => User.current.id).empty? && @exercise.end_time > Time.now
|
||||
@exercise_users_list = @exercise.exercise_users.where("user_id = ? and score is not NULL",User.current.id)
|
||||
else
|
||||
@exercise_users_list = []
|
||||
|
@ -359,7 +362,7 @@ class ExerciseController < ApplicationController
|
|||
def commit_answer
|
||||
eq = ExerciseQuestion.find(params[:exercise_question_id])
|
||||
# 已提交过的且是限时的则不允许答题
|
||||
if (has_commit_exercise?(@exercise.id,User.current.id) && (!User.current.admin?) && @exercise.time != -1) || Time.parse(format_time(@exercise.end_time)).strftime("%Y-%m-%d %H:%M:%S") < Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
if (has_commit_exercise?(@exercise.id,User.current.id) && (!User.current.admin?) && @exercise.time != -1) || @exercise.end_time < Time.now
|
||||
render :json => {:text => "failure"}
|
||||
return
|
||||
end
|
||||
|
@ -483,7 +486,7 @@ class ExerciseController < ApplicationController
|
|||
@exercise.update_attributes(:publish_time => Time.now)
|
||||
redirect_to exercise_url(@exercise)
|
||||
return
|
||||
elsif Time.parse(@exercise.publish_time.to_s).strftime("%Y-%m-%d-%H-%M-%S") > Time.now.strftime("%Y-%m-%d-%H-%M-%S")
|
||||
elsif @exercise.publish_time > Time.now
|
||||
@exercise.update_attributes(:show_result => params[:show_result])
|
||||
redirect_to exercise_url(@exercise)
|
||||
return
|
||||
|
@ -521,6 +524,20 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
#查看学生的答卷情况
|
||||
def show_student_result
|
||||
@user = User.find params[:user_id]
|
||||
@can_edit_excercise = false
|
||||
@exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", @user.id, @exercise.id).first
|
||||
@exercise_questions = @exercise.exercise_questions
|
||||
score = calculate_student_score(@exercise, @user)
|
||||
eu = get_exercise_user(@exercise.id, @user.id)
|
||||
eu.update_attributes(:score => score)
|
||||
respond_to do |format|
|
||||
format.html {render :layout => 'base_courses'}
|
||||
end
|
||||
end
|
||||
|
||||
# 计算学生得分
|
||||
def calculate_student_score(exercise, user)
|
||||
score = 0
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<% if show_nav?(course_feedback_count) %>
|
||||
<div class="subNav">
|
||||
<%= link_to l(:label_course_feedback), course_feedback_path(@course), :class => "f14 c_blue02 ml10" %>
|
||||
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_message_new)}", :id => "course_jour_count"%>
|
||||
<%= link_to "", course_feedback_path(@course), :class => 'courseMenuSetting', :title =>"#{l(:label_course_feedback)}", :id => "course_jour_count"%>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if show_nav?(course_poll_count) %>
|
||||
|
|
|
@ -30,10 +30,11 @@
|
|||
<script type="text/javascript">
|
||||
function resetHead()
|
||||
{
|
||||
$("#exercise_name").val("<%=@exercise.exercise_name%>");
|
||||
$("#exercise_name").val("<%=exercise.exercise_name%>");
|
||||
$("#exercise_end_time").val("<%= Time.parse(format_time(exercise.end_time)).strftime("%Y-%m-%d") if exercise.end_time %>");
|
||||
$("#exercise_time").val("<%=exercise.time if exercise.time!= -1 %>");
|
||||
$("#exercise_publish_time").val("<%= Time.parse(format_time(exercise.publish_time)).strftime("%Y-%m-%d") if !exercise.publish_time.nil?%>");
|
||||
$("#exercise_description").val("<%=exercise.exercise_description %>");
|
||||
/*$("#exercise_description").text("<%#=exercise.exercise_description.html_safe %>");*/
|
||||
document.getElementById("exercise_description").innerText = <%=exercise.exercise_description.html_safe %>;
|
||||
}
|
||||
</script>
|
|
@ -9,7 +9,7 @@
|
|||
var popWindow ; //弹出框的引用
|
||||
var importPollPopWindow; //选择导入的弹出框引用
|
||||
function edit_head(){
|
||||
$("#polls_description").val($("#polls_description_div").html());
|
||||
$("#exercise_description").val($("#exercise_description_div").html());
|
||||
}
|
||||
$(function(){
|
||||
//点击空白处
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
<div>
|
||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||
<span class="ml15 c_red">
|
||||
<% answer = get_user_answer(exercise_question, User.current)%>
|
||||
<% standard_answer = get_user_standard_answer(exercise_question, User.current)%>
|
||||
<% answer = get_user_answer(exercise_question, user)%>
|
||||
<% standard_answer = get_user_standard_answer(exercise_question, user)%>
|
||||
<% if !answer.empty? && !standard_answer.empty? && answer.first.exercise_choice.choice_position == standard_answer.first.exercise_choice_id %>
|
||||
√
|
||||
<% else %>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<%= radio_button "exercise",exercise_question.id.to_s+"exercise_choice_id",exercise_choice.id,:class=>"ur_radio",:checked => answer_be_selected?(exercise_choice,User.current),:disabled => !@can_edit_excercise %>
|
||||
<%= radio_button "exercise",exercise_question.id.to_s+"exercise_choice_id",exercise_choice.id,:class=>"ur_radio",:checked => answer_be_selected?(exercise_choice,user),:disabled => !@can_edit_excercise %>
|
||||
<%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
|
||||
</label>
|
||||
</td>
|
||||
|
@ -71,9 +71,9 @@
|
|||
<div>
|
||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||
<span class="ml15 c_red">
|
||||
<% answer = get_user_answer(exercise_question, User.current)%>
|
||||
<% standard_answer = get_user_standard_answer(exercise_question, User.current)%>
|
||||
<% if !standard_answer.empty? && get_mulscore(exercise_question, User.current).to_i == standard_answer.first.exercise_choice_id %>
|
||||
<% answer = get_user_answer(exercise_question, user)%>
|
||||
<% standard_answer = get_user_standard_answer(exercise_question, user)%>
|
||||
<% if !standard_answer.empty? && get_mulscore(exercise_question, user).to_i == standard_answer.first.exercise_choice_id %>
|
||||
√
|
||||
<% else %>
|
||||
×
|
||||
|
@ -88,7 +88,7 @@
|
|||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input class="ur_radio" type="checkbox" <%= answer_be_selected?(exercise_choice,User.current) ? "checked":"" %> <%= @can_edit_poll?"":"disabled=disabled" %> >
|
||||
<input class="ur_radio" type="checkbox" <%= answer_be_selected?(exercise_choice,user) ? "checked":"" %> <%= @can_edit_excercise?"":"disabled=disabled" %> >
|
||||
<%= convert_to_char((index+1).to_s)%> <%= exercise_choice.choice_text%>
|
||||
</label>
|
||||
</td>
|
||||
|
@ -110,8 +110,8 @@
|
|||
<div>
|
||||
<div class="testEditTitle"> 第<%= list_index+1%>题:<%= exercise_question.question_title %> (<%= exercise_question.question_score %>分)
|
||||
<span class="ml15 c_red">
|
||||
<% answer = get_user_answer(exercise_question, User.current)%>
|
||||
<% standard_answer = get_user_standard_answer(exercise_question, User.current)%>
|
||||
<% answer = get_user_answer(exercise_question, user)%>
|
||||
<% standard_answer = get_user_standard_answer(exercise_question, user)%>
|
||||
<% if !answer.empty? && !standard_answer.empty? && standard_answer.include?(answer.first.answer_text) %>
|
||||
√
|
||||
<% else %>
|
||||
|
@ -126,7 +126,7 @@
|
|||
<% end %>
|
||||
</div>
|
||||
<div>
|
||||
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(exercise_question.id,User.current.id).html_safe %>" <%= @can_edit_poll?"":"disabled=disabled" %>>
|
||||
<input class="fillInput" placeholder="在此填入答案" type="text" value="<%= get_anwser_vote_text(exercise_question.id,user.id).html_safe %>" <%= @can_edit_excercise?"":"disabled=disabled" %>>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
<span>测验时长:<%= exercise.time %>分钟</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="testDesEdit mt5"><%= exercise.exercise_description.nil? ? "" : exercise.exercise_description.html_safe%></div>
|
||||
<div class="cl"></div>
|
||||
<pre class="fontGrey2 font_cus"><%= exercise.exercise_description.nil? ? "" :exercise.exercise_description.html_safe%></pre>
|
||||
<div class="cl"></div>
|
||||
</div>
|
|
@ -44,7 +44,13 @@
|
|||
<li>
|
||||
<ul class="mt10 fl">
|
||||
<li class="hworkStName mr15 mt16" title="姓名">
|
||||
<%= exercise.user.show_name%>
|
||||
<% name = exercise.user.show_name %>
|
||||
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
|
||||
<%= link_to name,show_student_result_exercise_path(@exercise,:user_id => exercise.user.id) %>
|
||||
<% else %>
|
||||
<span title="截止日期未到,暂不能查看学生答题结果。"><%=name%></span>
|
||||
<%#= link_to name,'',:title=>"截止日期未到,暂不能查看学生答题结果。" %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="hworkStID mr10 mt16" title="学号">
|
||||
<%= exercise.user.user_extensions.nil? ? "--" : exercise.user.user_extensions.student_id%>
|
||||
|
|
|
@ -5,6 +5,6 @@
|
|||
<% if @can_edit_excercise %>
|
||||
<%=render :partial => 'exercise_student', :locals => {:exercise =>@exercise, :exercise_questions => @exercise_questions,:exercise_user => @exercise_user} %>
|
||||
<% else %>
|
||||
<%=render :partial => 'exercise_student_result', :locals => {:exercise =>@exercise, :exercise_questions => @exercise_questions,:exercise_user => @exercise_user} %>
|
||||
<%=render :partial => 'exercise_student_result', :locals => {:exercise =>@exercise, :exercise_questions => @exercise_questions,:exercise_user => @exercise_user,:user=>User.current} %>
|
||||
<% end %>
|
||||
<% end %>
|
|
@ -0,0 +1 @@
|
|||
<%=render :partial => 'exercise_student_result', :locals => {:exercise =>@exercise, :exercise_questions => @exercise_questions,:exercise_user => @exercise_user,:user =>@user} %>
|
|
@ -1,52 +1,52 @@
|
|||
<div class="fl" style="padding-bottom:10px; width:720px;">
|
||||
<span class="c_dark f14 fb fl mr30">
|
||||
作品
|
||||
<font class="f12 c_red">
|
||||
(<%= @student_work_count%>人已交)
|
||||
</font>
|
||||
<% if !@is_teacher && @stundet_works.empty?%>
|
||||
<span class="f12 c_red">您尚未提交作品</span>
|
||||
<% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
||||
<span class="f12 c_red">您已提交且不可再修改,因为截止日期已过</span>
|
||||
<% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
||||
<span class="f12 c_red">您已提交,您还可以修改</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
|
||||
<div class="hworkSearchBox">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</div>
|
||||
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||
<% end%>
|
||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示作业信息 ]</a> </span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
<% if student_work.user == User.current && !@is_evaluation %>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% else %>
|
||||
<%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<div class="fl" style="padding-bottom:10px; width:720px;">
|
||||
<span class="c_dark f14 fb fl mr15">
|
||||
作品
|
||||
<font class="f12 c_red">
|
||||
(<%= @student_work_count%>人已交)
|
||||
</font>
|
||||
<% if !@is_teacher && @stundet_works.empty?%>
|
||||
<span class="f12 c_red">您尚未提交作品</span>
|
||||
<% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
||||
<span class="f12 c_red">您已提交且不可再修改,因为截止日期已过</span>
|
||||
<% elsif !@is_teacher &&Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.parse(Time.now.to_s).strftime("%Y-%m-%d") && !@stundet_works.empty?%>
|
||||
<span class="f12 c_red">您已提交,您还可以修改</span>
|
||||
<% end %>
|
||||
</span>
|
||||
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%>
|
||||
<div class="hworkSearchBox">
|
||||
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/>
|
||||
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
|
||||
</div>
|
||||
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
|
||||
<% end%>
|
||||
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示作业信息 ]</a> </span>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<div class="fl">
|
||||
<% if @is_evaluation && !@stundet_works.empty?%>
|
||||
<%= render :partial => "evaluation_title"%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_title"%>
|
||||
<% end%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% @stundet_works.each do |student_work|%>
|
||||
<% if @is_evaluation%>
|
||||
<%= render :partial => "evaluation_work", :locals => {:student_work => student_work}%>
|
||||
<% else%>
|
||||
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
|
||||
<% end%>
|
||||
<div class="cl"></div>
|
||||
<div id="about_hwork_<%= student_work.id%>">
|
||||
<% if student_work.user == User.current && !@is_evaluation %>
|
||||
<% if @homework.homework_type == 2%>
|
||||
<%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% else %>
|
||||
<%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
|
@ -411,7 +411,9 @@
|
|||
<!-- 创建课程消息 -->
|
||||
<% if ma.course_message_type == "Course" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您成功创建了课程:</span>
|
||||
|
@ -443,7 +445,7 @@
|
|||
<% end %>
|
||||
<% if ma.course_message_type == "JoinCourseRequest" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">您有了新的课程成员申请:</span>
|
||||
|
@ -482,7 +484,7 @@
|
|||
<% end %>
|
||||
<% if ma.course_message_type == "CourseRequestDealResult" %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"></a></li>
|
||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a></li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">
|
||||
|
@ -548,7 +550,7 @@
|
|||
<% if ma.course_message_type == "JoinCourse" and ma.status == 1 %>
|
||||
<ul class="homepageNewsList fl">
|
||||
<li class="homepageNewsPortrait fl">
|
||||
<a href="javascript:void(0);"></a>
|
||||
<a href="javascript:void(0);"><div class="navHomepageLogo fl"><%= image_tag("/images/trustie_logo1.png", width: "30px", height: "30px", class: "mt3") %></div></a>
|
||||
</li>
|
||||
<li class="homepageNewsPubType fl">
|
||||
<span class="newsBlue homepageNewsPublisher">系统提示</span>
|
||||
|
|
|
@ -174,6 +174,7 @@ RedmineApp::Application.routes.draw do
|
|||
get 'export_exercise'
|
||||
get 'publish_exercise'
|
||||
get 'republish_exercise'
|
||||
get 'show_student_result'
|
||||
post 'create_exercise_question'
|
||||
post 'commit_answer'
|
||||
post 'commit_exercise'
|
||||
|
|
|
@ -14,7 +14,7 @@ class AddCourseContributorTotalScore < ActiveRecord::Migration
|
|||
message_reply_count = Message.find_by_sql("select DISTINCT me.* from messages me, boards b where b.id = me.board_id and b.course_id = #{course.id} and b.project_id = '-1' and me.author_id = #{s.student_id} and me.parent_id is not null").count * 1
|
||||
common_reply_count = Comment.find_by_sql("select cm.* from comments cm, news n where cm.author_id = #{s.student_id} and n.course_id = #{course.id} and cm.commented_id = n.id and cm.commented_type ='News'").count * 1
|
||||
# attachment_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "Attachment").count * 5
|
||||
attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.student_id};").count * 5
|
||||
attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and author_id = #{s.student_id} and container_type ='Course'").count * 5
|
||||
journal_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? ", s.student_id, course.id, "Course").count * 1
|
||||
# journal_count = CourseActivity.where("user_id =? and course_id =? and course_act_type =?", s.student_id, course.id, "JournalsForMessage").count * 1
|
||||
# journal_reply_count = JournalsForMessage.where("user_id =? and jour_id =? and jour_type =? and status =?", s.student_id, course.id, "Course",1).count * 1
|
||||
|
|
10
db/schema.rb
10
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20151127011351) do
|
||||
ActiveRecord::Schema.define(:version => 20151126160252) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -605,7 +605,7 @@ ActiveRecord::Schema.define(:version => 20151127011351) do
|
|||
end
|
||||
|
||||
create_table "exercise_questions", :force => true do |t|
|
||||
t.string "question_title"
|
||||
t.text "question_title"
|
||||
t.integer "question_type"
|
||||
t.integer "question_number"
|
||||
t.integer "exercise_id"
|
||||
|
@ -634,7 +634,7 @@ ActiveRecord::Schema.define(:version => 20151127011351) do
|
|||
end
|
||||
|
||||
create_table "exercises", :force => true do |t|
|
||||
t.string "exercise_name"
|
||||
t.text "exercise_name"
|
||||
t.text "exercise_description"
|
||||
t.integer "course_id"
|
||||
t.integer "exercise_status"
|
||||
|
@ -1151,10 +1151,6 @@ ActiveRecord::Schema.define(:version => 20151127011351) do
|
|||
create_table "org_members", :force => true do |t|
|
||||
t.integer "user_id"
|
||||
t.integer "organization_id"
|
||||
<<<<<<< HEAD
|
||||
t.string "role"
|
||||
=======
|
||||
>>>>>>> 1ae514ca4857d7e2ad53b338731c1e01f899fb4d
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
|
|
@ -60,11 +60,11 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;}
|
|||
.hworkStName {width:60px; max-width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
|
||||
.hworkStID {width:80px; max-width:80px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:18px; line-height:18px; font-size:12px; color:#888888; text-align:center;}
|
||||
.hworkDate {max-width:150px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;}
|
||||
.hworkMenu {width:100px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-110px; font-size:12px; color:#888888; display:none; line-height:2;}
|
||||
.hworkMenu {width:100px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-110px; font-size:12px; color:#888888; display:none; line-height:2; z-index:99;}
|
||||
a.hworkExport {background:url(../images/homepage_icon2.png) -10px -401px no-repeat; padding-left:23px;}
|
||||
a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-repeat; padding-left:23px;}
|
||||
.hworkInfor {font-size:12px; color:#269ac9; width:80px; height:40px; vertical-align:middle; float:left; line-height:40px; text-align:center; font-weight:bold;}
|
||||
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px;}
|
||||
.infoNi{ width:100px; padding:5px;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left; line-height:2; position:absolute; margin-top:-24px;margin-left: 40px; z-index:99;}
|
||||
.problemTxt {width:660px; margin-left:10px; color:#777777; position:relative;}
|
||||
.rTxtTit{width:560px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#269ac9; font-size:14px;}
|
||||
.hworkSearchBox {border:1px solid #e6e6e6; width:185px; float:left; background-color:#ffffff;}
|
||||
|
@ -1166,9 +1166,7 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;}
|
|||
.questionEditContainer {border:1px solid #cbcbcb;background:#eeeeee; padding:10px; margin-bottom:10px; margin-top:10px;}
|
||||
.fillInput {border:1px solid #cbcbcb; padding-left:5px; background-color:#ffffff; width:693px; height:30px; color:#888888;}
|
||||
.mr130 {margin-right:130px;}
|
||||
.mr100 {margin-right:100px;}
|
||||
.ur_button_submit{ display:block; width:106px; height:31px; margin:0 auto; background:#15bccf; color:#fff; font-size:16px; text-align:center; padding-top:4px; margin-bottom:10px; }
|
||||
|
||||
/*20151123课程排行榜Tim*/
|
||||
.courseMenuSetting {background:url(../images/homepage_icon2.png) -190px -365px no-repeat; width:15px; height:15px; margin-top:3px; float:right; margin-right:5px;}
|
||||
.courseMenuSetting:hover {background:url(../images/homepage_icon2.png) -190px -407px no-repeat;}
|
||||
|
@ -1176,4 +1174,5 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;}
|
|||
.rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;}
|
||||
.rankList li p {width:100%; overflow:hidden; white-space:normal; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;}
|
||||
.rankPortrait {border-radius:50%; width:35px; height:35px;}
|
||||
.numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;}
|
||||
.numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;}
|
||||
.font_cus {font-family: "微软雅黑","宋体"; font-size: 12px; line-height: 1.5;}
|
||||
|
|
Loading…
Reference in New Issue