diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 2c7301c70..bc0f68e88 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -46,6 +46,9 @@ class HomeworkCommonController < ApplicationController homework.user_id = User.current.id homework.course_id = @course.id + homework.save_attachments(params[:attachments]) + render_attachment_warning_if_needed(homework) + #匿评作业相关属性 homework_detail_manual = HomeworkDetailManual.new homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index e75646353..896e29053 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -19,7 +19,31 @@ class StudentWorkController < ApplicationController end def create - + if params[:student_work] + stundet_work = StudentWork.new + stundet_work.name = params[:student_work][:name] + stundet_work.description = params[:student_work][:description] + stundet_work.project_id = params[:student_work][:project_id] + stundet_work.homework_common_id = @homework.id + stundet_work.user_id = User.current.id + stundet_work.save_attachments(params[:attachments]) + render_attachment_warning_if_needed(stundet_work) + if stundet_work.save + respond_to do |format| + format.html { + flash[:notice] = l(:notice_successful_create) + redirect_to student_work_index_url(:homework => @homework.id) + } + end + return + end + end + respond_to do |format| + format.html { + flash[:notice] = l(:notice_failed_create) + redirect_to new_student_work_url(:homework => @homework.id) + } + end end def edit diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index bd56629ca..6849f1f13 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -17,7 +17,7 @@ <%= javascript_heads %> <%= heads_for_theme %> <%= call_hook :view_layouts_base_html_head %> - <%= stylesheet_link_tag 'public', 'leftside', 'courses', 'jquery/jquery-ui-1.9.2'%> + <%= stylesheet_link_tag 'public', 'leftside', 'jquery/jquery-ui-1.9.2', 'courses'%> <%= javascript_include_tag "course","header" %> <%= yield :header_tags -%> diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb new file mode 100644 index 000000000..747cfecf8 --- /dev/null +++ b/app/views/student_work/_show.html.erb @@ -0,0 +1,96 @@ +
+
+
+ +
+ + +
    + +
    + jacknudt(教辅) + 评分:85分 + 删除 + 回复 + 一小时前 +
    +

    作品非常好,格式不正确,继续努力!

    +
    + +
    + 程梦雯 + 删除 + 一小时前 +
    +

    谢谢老师!

    +
    +
    +
    +
    + +
    + 程梦雯 + 删除 + 一小时前 +
    +

    谢谢老师!

    +
    +
    +
    + +
    +
    +
+
+ 收起 +
+
+
\ No newline at end of file diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 6137fc31c..44ac58bf7 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -1 +1,143 @@ -作品列表 \ No newline at end of file +
+ +
+
+
+ +
+
+ +
+ + +
+
+ +
+

请以下同学重新提交作业ppt,只要更新附件,不要删除作否则否则否则评分就丢了

+ 编辑 + 开启匿评 + +
+

项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题项目问题个数显示问题

+ [展开] +
+ 截止时间:2015-04-02 +
+
+ 天 + 小时 + 分 + 秒 +
+

作业提交还剩:

+
+
+
+
+ + + +
+ + +
+
diff --git a/public/images/course/arrow.png b/public/images/course/arrow.png new file mode 100644 index 000000000..2081ddf8d Binary files /dev/null and b/public/images/course/arrow.png differ diff --git a/public/images/course/arrow_up.jpg b/public/images/course/arrow_up.jpg new file mode 100644 index 000000000..6bf285a19 Binary files /dev/null and b/public/images/course/arrow_up.jpg differ diff --git a/public/javascripts/course.js b/public/javascripts/course.js index c1f105c1f..d3588d502 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -650,4 +650,78 @@ function new_student_work() { if(regexStudentWorkName()&®exStudentWorkDescription()) {$("#new_student_work").submit();} -} \ No newline at end of file +} + +//滑动打分 +$.fn.peSlider = function(settings){ + //configurable options (none so far) + var o = $.extend({},settings); + if( !$('body').is('[role]') ){ $('body').attr('role','application'); } + return $(this).each(function(){ + var thisLabel = $('label[for=' + $(this).attr('id') + ']').attr('id', $(this).attr('id') + '-label').attr('id'); + var thisUnits = $(this).attr('data-units') || ''; + var slider = $('
'); + if( $(this).is('input') ){ + var input = $(this); + var thisUnits = input.attr('data-units'); + var friendlyVal = input.val() + ' ' + thisUnits; + var sliderOptions = $.extend(o,{ + min: parseFloat(input.attr('min')), + max: parseFloat(input.attr('max')), + value: parseFloat(input.val()) + }); + slider + .insertBefore(input) + .slider(sliderOptions) + .bind('slide', function(e, ui){ + input.val(ui.value); + friendlyVal = input.val() + ' ' + thisUnits; + slider.find('a').attr({ + 'aria-valuenow': ui.value, + 'aria-valuetext': friendlyVal, + 'title': friendlyVal + }); + }) + .find('a') + .attr({ + 'role': 'slider', + 'aria-valuemin': input.attr('min'), + 'aria-valuemax': input.attr('max'), + 'aria-valuenow': input.val(), + 'aria-valuetext': friendlyVal, + 'title': friendlyVal, + 'aria-labelledby': thisLabel + }); + input + .keyup(function(){ + var inVal = parseFloat(input.val()); + if( !isNaN(inVal) ){ + slider.slider('value', inVal); + input.val(slider.slider('value')); + } + }) + .change(function(){ + var inVal = parseFloat(input.val()); + if( !isNaN(inVal) ){ + slider.slider('value', inVal); + input.val(slider.slider('value')); + } + }) + .blur(function(){ + var inVal = parseFloat(input.val()); + if( isNaN(inVal) ){ + input.val(0); + } + }); + if( !settings.step ){ + var step = Math.round( parseFloat(input.attr('max')) / slider.width()); + if(step > 1){ slider.slider('option','step',step); } + } + } + }); +}; + +$(function(){ + //创建输入滑杆 + $('#score').peSlider({range: 'min'}); +}); \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index d27c0efbc..d29ac1a84 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -127,7 +127,7 @@ a.re_de{ color:#6883b6; margin-left:15px;} /* 作业列表 */ .ttl{ } -.ctt{height:820px;clear:both; } +.ctt{clear:both; } #contentbox{float:right;clear:both;width:670px;/*滑动门的宽度*/} /* TAB 切换效果 */ .tb_{ background-color: #eaeaea; height:40px; } @@ -549,6 +549,20 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px a.files_tag_icon{ background:#e2f3f9; color:#54aeca; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px; } a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #64bdd9; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;} +/* 20150423作业评分*/ +.ml14{ margin-left:14px;} +.w548{ width:552px;} +.w547{ width:544px;} +.w196{ width:182px;} +.w459{ width:459px;} +.hwork_new_set{border:1px dashed #CCC; background:#f5f5f5; text-align:center; padding:10px 0; margin-bottom:10px;} +.hwork_new_grey{background:#dbdbdb; width:610px; padding:10px 20px; margin:0 auto; text-align:left; margin-bottom:5px;} +.hwork_new_left{ width:220px; float:left; } +.hwork_new_right{ width:350px; float:left; margin-left:40px;} +.w305{ width:305px;} +.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} +a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} + /* 20150505讨论区*/ .w664{ width:664px;} .w140{ width:140px;} @@ -596,6 +610,58 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} .icon_add{background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;} a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;} +/* 20150506上传头像*/ +.uppicBox{ width:265px; height:265px; background:#f2f2f5; float:left; color:#666; text-align:center;} +.showpicBox{width:133px; height:250px; background:#f2f2f5; float:left; margin-left:20px; text-align:center; padding-top:15px; color:#666;} +.mr2{ margin-right:2px;} +.uppic_btn{border:none; width:150px; background:none; margin-bottom:5px; color:#666; margin-top:105px;} + +/* 20150512作品展示*/ +.hwork_ul{ height:24px; padding-top:10px;} +.hwork_ul li{ float:left;} +.w300{ width:300px;} +.w80{ width:80px;} +.t_c{ text-align:center;} +.hwork_tit{ width:295px; float:left; } +.hwork_tit a{ width:285px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.hwork_code{ width:60px; text-align:center; margin-right:15px;} +.hwork_code02{ width:32px; text-align:center; margin-right:10px;} +a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;} +a.hwork_name{ display:block;width:65px; text-align:center; margin-right:10px;} +.show_hwork{ border:2px solid #64bdd9; width:646px; padding:10px; color:#666666; padding-bottom:0px; } +.show_hwork ul li{ margin-bottom:5px;} +.show_hwork_arrow{ position:relative; top:2px; left:25px;background:url(../images/course/arrow_up.jpg) 0 0 no-repeat; width:20px; height:11px;} +.tit_fb{ font-weight:bold; width:66px; text-align:right; display:block; float:left;} +.ml160{ margin-left:160px;} +.show_hwork_p{ width:580px; float:left;} +.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:568px; height:35px;} +.ping_box{ width:626px; padding:10px; background:#f5f3f3; } +a.ping_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3;} +a:hover.ping_pic{border:1px solid #64bdd9;} +.ping_box_tit{ float:left; width:575px; margin-left:10px;} +.ping_box_ul{} +.ping_line{ border-bottom:1px dashed #CCCCCC; padding-bottom:8px; margin-bottom:8px;} +.ping_text{border:1px solid #CCCCCC; margin:5px; padding:5px; width:560px; height:20px; } +.ping_back_tit{ float:left; width:523px; margin-left:10px; } +a.down_btn{ border:1px solid #CCC; color:#999; padding:0px 5px; font-size:12px; text-align:center; display:block;} +a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} +.fr{ float:right;} +.min_search{ width:200px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; cursor:pointer;} +.li_min_search{ float:right; margin-right:-10px;} +.info_ni{ width:100px; padding:5px;position: absolute;display:none;-moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; box-shadow:0px 0px 5px #194a81; color:#666; background:#fff; text-align:left;} + + + +/* 评分插件 */ +input#score{ width:40px;} +.ui-slider{position:relative;width:200px;float:left;margin-right:10px;height:14px; margin-top:2px;background:#e2e2e2; } +.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:0.5em;height:1.6em;top:-.2em;margin-left:-.5em;cursor:pointer;background:#64bdd9;} +.ui-slider .ui-slider-handle:hover,.ui-slider .ui-slider-handle:focus{background:#64bdd9;} +.ui-slider .ui-slider-handle:active{background-image:none;} +.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;top:0;height:100%;background:#64bdd9;left:0;} + + +