From fa00285529b42f928270cbd8ac9b084b40de7524 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 16 Sep 2015 15:30:08 +0800 Subject: [PATCH 01/26] =?UTF-8?q?css=E6=96=87=E4=BB=B6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/courses.css | 128 ++++++++-- public/stylesheets/public.css | 426 ++++++++++++++++++++++++++++++++- 2 files changed, 518 insertions(+), 36 deletions(-) diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index d810c4891..073eaf56b 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -23,9 +23,44 @@ a:hover.project_txt{ color:#066e9a;} .noline{ border-bottom:none;} .news_description{max-height: 360px;overflow:hidden; } .news_description_none{max-height: none;} +.wrapper {position:relative;} +.attachmentContainer {display:inline-block;} +.deadline {position:absolute; bottom:0px; display:inline-block; right:0px;} a.news_foot{ border:1px solid #e8eef2; color: #929598; text-align:center; width:600px; height:20px; padding-top:3px; cursor:pointer;} a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} +/*右侧内容新*/ +.ctt2{clear:both; } +.hworkListBanner {width:720px; height:40px; background:#eaeaea; margin-bottom:10px; margin-left:5px;} +.hworkListContainer {float:left; clear:both; width:720px; margin-left:5px;} +.showHwork{ border:2px solid #269ac9; width:696px; padding:10px; color:#666666; padding-bottom:0px; } +.showHworkP{ width:630px; float:left;} +.showHwork ul li {margin-bottom: 5px;} +.hworkPingText{ float:left; border:1px solid #e4e4e4; padding:5px; width:618px; height:35px;} +.pingBox{ width:676px; padding:10px; background:#f5f3f3;} +.pingBoxTit{ float:left; width:625px; margin-left:10px;} +.pingText{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; } +.pingBackTit{ float:left; width:573px; margin-left:10px; } +.hworkUl{ height:50px; border-bottom:1px solid #eaeaea; line-height:50px; vertical-align:middle;} +.hworkListRow {height:65px; border-bottom:1px solid #eaeaea; line-height:65px; vertical-align:middle;} +.hworkListRow:hover {background-color:#f6f6f7; cursor:pointer;} +.hworkUl li{ float:left;} +.hworkListRow li{ float:left;} +.hworkList380 {width:375px; text-align:left; height:50px; line-height:50px;padding-left:5px;} +.hworkList80 {width:80px; text-align:center;} +.hworkList50 {width:50px; text-align:center;} +.codeList{ float:right; font-size:12px; color:#484848; padding:0px 3px; width:714px; margin-bottom:10px; } +.hworkName {width:380px; max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;} +.hworkDetail {max-width:100px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;} +.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;} +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;} +.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;} + /*邮件邀请*/ .box_main{ width:345px; margin:0 auto;} @@ -78,7 +113,7 @@ a:hover.talk_pic{border:1px solid #64bdd9;} a.talk_btn{ background:#64bdd9; width:50px; height:20px; color:#fff; text-align:center; margin-top:12px; padding-top:3px;} a:hover.talk_btn{ background:#2a9dc1;} /****讨论区内页***/ -.mt0{ margin-top:0px;} +.mt0{ margin-top:0px !important;} .talk_info{ color:#7d7d7d; margin-left:60px; margin-top:10px;} a.talk_edit{ color:#269ac9; margin-right:5px;} a:hover.talk_edit{ color:#297fb8;} @@ -101,6 +136,7 @@ a:hover.grey_btn{ background:#717171; color:#fff;} .f_b{ font-weight: bold;} .c_blue{ color:#64bdd9;} .c_grey{ color:#999999;} +a.c_grey{ color:#999999;} .c_grey02{ color:#666666;} .f_14{ font-size:14px;} .c_dblue{ color:#3e6d8e;} @@ -149,6 +185,7 @@ a.un_work_edit{color: white; display:block; padding:1px 5px; background-color: d .dis{display:block; } .undis{display:none;} .c_red{ color:#de030d;} +input.c_red {padding:0px; text-align:center; border:0;} .f_12{ font-size:12px;} .w_40{ width:40px; border:1px solid red;} .dis_ul{ height:70px; border-bottom:1px dashed #d4d4d4; margin-bottom:10px;} @@ -300,7 +337,7 @@ a:hover.tijiao{ background:#0f99a9;} .c_pink{ color:#e65d5e;} .ni_con_work { width:300px; margin:25px 20px;} .ni_con_work p{ color:#808181; } - +a.xls{ margin-left:5px; color:#136b3b;} /* 学生列表*/ .st_list{ width:670px;} .st_search{ } @@ -521,11 +558,10 @@ img.ui-datepicker-trigger { /*作业批次下拉*/ div#menu_r {height:41px; font-size:14px; font-weight:bold; margin-bottom:10px;} div#menu_r ul {float: left;} -div#menu_r ul.menu_r { background: #64bdd9; padding:0 10px; height:40px; } +div#menu_r ul.menu_r { background: #269ac9; padding:0 10px; height:40px; } div#menu_r li {position: relative; z-index: 9; margin: 0; display: block; float: left; } div#menu_r li:hover>ul { left: -2px;} div#menu_r a {position: relative;z-index: 10; height: 41px; display: block; float: left;line-height: 41px; text-decoration: none; font-size:14px; } -div#menu_r {display: block; cursor: pointer; background-repeat: no-repeat;background-position: 95% 0;padding-right: 15px; _padding-right: 20px;} div#menu_r ul a.parent {background: url(../images/item.png) -20px -30px no-repeat; width:60px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} div#menu_r ul a.parent:hover {background: url(../images/item.png) -20px -60px no-repeat;} div#menu_r ul ul a.parent {background: url(../images/item.png) -20px 6px no-repeat;} @@ -536,9 +572,9 @@ div#menu_r a { padding: 5px 12px 0 10px;line-height: 30px; color: #fff;} div#menu_r li.last { background: none; } /* menu::level2 */ div#menu_r ul ul li { background: none; } -div#menu_r ul ul { position: absolute;top: 38px; left: -999em; width: 90px; padding: 5px 0 0 0; background:#fff; border:1px solid #15bccf; margin-top:1px;} -div#menu_r ul ul a {padding: 0 0 0 15px; height: auto; float: none;display: block; line-height: 24px; font-size:12px; font-weight:normal;color:#15bccf;} -div#menu_r ul ul a:hover { background:#64bdd9; color:#fff;} +div#menu_r ul ul { position: absolute;top: 38px; left: -999em; width: 90px; padding: 5px 0 0 0; background:#fff; border:1px solid #269ac9; margin-top:1px;} +div#menu_r ul ul a {padding: 0 0 0 15px; height: auto; float: none;display: block; line-height: 24px; font-size:12px; font-weight:normal;color:#269ac9;} +div#menu_r ul ul a:hover { background:#297fb8; color:#fff;} div#menu_r ul ul li.last { margin-left:15px; } div#menu_r ul ul li {width: 100%;} @@ -553,7 +589,7 @@ a.wzan_visited{background:url(../images/new_project/public_icon.png) 0px -503px .newwork_btn a:hover{ background:#329cbd;} .files_tag{ width:670px; height:22px; overflow:hidden; margin-bottom:10px;} 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;} +a.files_tag_select{ background:#64bdd9; color:#fff; border:1px solid #bbe2ef; padding:1px 10px; float:left; margin-right:10px;margin-bottom:10px;} /* 20150423作业评分*/ .ml14{ margin-left:14px;} @@ -636,40 +672,40 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .t_c{ text-align:center;} .hwork_tit{ width:210px; float:left; } -.hwork_tit a{ width:205px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } -.hwork_tit_une{ width:270px; float:left; } -.hwork_tit_une a{ width:265px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.hwork_tit a{ width:255px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.hwork_tit02{ width:235px; float:left; } +.hwork_tit02 a{ width:230px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .hwork_code{ width:56px; text-align:center; } -.hwork_code02{ width:60px; text-align:center; } +.hwork_code02{ width:32px; text-align:center; } .hwork_tit_e{ width:420px; float:left; } .hwork_tit_e a{ width:405px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } .hwork_num{ width:90px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} .mr18{ margin-right:18px;} -a.hwork_center{ display:block; width:60px; margin-right:5px;overflow: hidden; white-space: nowrap; text-overflow:ellipsis;} -.hwork_name{ display:block;width:80px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} -.absence_penalty{ display:block;width:45px; overflow: hidden;white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} -.border_ce {border: 1px solid #e4e4e4;} +a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;} .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;} +.show_hwork_arrow{ position:relative; top:2px; left:165px;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:50px;} +.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:50px; } +.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;} -.min_search{ width:140px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/public_icon.png) 185px -193px no-repeat; } +.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_download{ 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;margin-left: 200px;margin-top: 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;margin-left: 50px;margin-top: -5px;} +.info_ni{ 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;} +.hwork_num{ width:90px; text-align:center; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.hwork_name{width:80px; text-align:center;} +.mr18{ margin-right:18px;} /*返回顶部*/ .to_top{width: 19px;height: 74px;position: fixed;top: 50px;right: 1px;color: white;background: #15bccf; line-height: 1.2; padding-top: 10px;padding-left: 5px;font-size: 14px;cursor: pointer;} .hwork_num_ab{ width:120px; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;min-height: 1px;} @@ -678,6 +714,7 @@ a:hover.down_btn{ background:#14ad5a; color:#fff; border:1px solid #14ad5a;} .hwork_time_c{width:40px;color: #6d6d6d} .hwork_score{ width:62px; text-align:center; } .absence{width: 50px;text-align: center;} + /* 评分插件 */ input#score{ width:40px;} .ui-slider{position:relative;width:200px;float:left;margin-right:10px;height:14px; margin-top:2px;background:#e2e2e2; } @@ -685,12 +722,11 @@ input#score{ width:40px;} .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;} - /* 编程作品 */ .border_ce{ border:1px solid #e4e4e4; } .border_ce tr td{ height:26px; } -.td_tit{width:170px; text-align:center;} -.td_50{width:60px; text-align:center;} +.td_tit{width:155px; text-align:center;} +.td_50{width:50px; text-align:center;} a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; font-weight:bold; white-space: nowrap; text-overflow:ellipsis;} .work_list_pro{ width:670px;} .border_l{border-left:1px solid #e4e4e4;} @@ -769,3 +805,45 @@ a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflo .ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; } .DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;} .mb50{margin-bottom: 50px;} + +/* 课程主页 */ +.rside_nav{ background:#eaebec; padding:10px 10px;} +.rside_box{ width:730px; border:1px solid #e7edf0;} +.rside_top{ height:24px; background:#f5f8fa; border-bottom:1px solid #e7edf0; padding:8px 10px;} +.rside_work_list{margin:10px; border-bottom:1px dashed #e5e5e5;} +.imageWrapper {width:50px; height:auto; float:left; color:#999999; text-align:center;} +.img_blue_icon{ background:url(../images/course/icons.png) 0 -400px no-repeat; width:37px; height:18px; color:#fff; font-size:12px; padding-left:7px; color:#fff; } +.img_green_icon{ background:url(../images/course/icons.png) 0 -425px no-repeat; width:37px; height:18px; color:#fff; font-size:12px; padding-left:7px; color:#fff; } +a.rside_work_tit{ font-size:14px; font-weight:bold; color:#3e4040; max-width:430px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +a:hover.rside_work_tit{ color:#0781b4;} +.bgrey_icon{ color:#9b9b9b; border:1px solid #b6b6b6; background:#f0f0f0; font-size:12px; padding:0px 3px; } +.dgrey_icon{ color:#717171; border:1px solid #717171; font-size:12px; padding:0px 3px;} +.yellow_icon{ color:#ff5c60; border:1px solid #ff5c60; background:#ffffd5; font-size:12px; padding:0px 3px;} +.arrow_r{background:url(../images/course/icons.png) 0 -450px no-repeat; width:22px; height:13px; } +.c_dgreen{ color:#0e9e4f;} +.list_more{ text-align:center; margin:10px 0;} +.rside_massage_txt{ width:650px; margin-left:10px; } +a.massage_tit{ max-width:530px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +a.rside_name{ display:block; max-width:80px;} +.rside_talk_txt{ width:650px; margin-left:10px; color:#333;} +.rside_talk_tit{ color:#0781b4; width:490px; display:block; } +.rside_talkWrapArrow{ display:block; float:right; margin-right:10px;background:url(../images/course/arrow.png) 0 0 no-repeat; height:7px; width:13px;} +.rside_talkWrapBox{ width:650px; margin-left:60px; } +.rside_Msg_txt{ float:left; width:580px; margin-left:10px;} +.rside_talkWrapMsg{ background:#f2f2f2; padding:10px;} +.rside_talkWrapMsg ul li{} +.rside_inputFeint{ border:1px solid #d9d9d9; background:#fff; width:623px; height:40px; margin:10px; margin-bottom:5px;color:#666;} +a.icon_face{background:url(../images/public_icon.png) 0px -671px no-repeat; display:block; height:25px; width:40px; padding-left:25px; padding-top:3px; } +a:hover.icon_face{background:url(../images/public_icon.png) -79px -671px no-repeat; } +a.pro_mes_w{ height:20px; display:block; color:#999999;} +.info_list{ border-top:1px solid #F2F2F2; padding:5px 0;} +.info_list_r li{ height:20px;} +.pai_box{background:#fff; padding:10px 0 10px 10px;width:230px; color:#3e4040; } + +.rside_work_con{ width:650px;} +a.c_grey{ color:#999999;} +a:hover.c_grey{ color:#333;} +.link_file{ display:block; max-width:300px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.last_time{width:auto; text-align:right; margin-right:70px;} +.link_file_box{ width:360px;} + diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index e291e503a..4c5261e02 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -1,4 +1,5 @@ /* CSS Document */ +/* 2015-06-26 */ body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{ margin:0; padding:0;} body,table,input,textarea,select,button { font-family: "微软雅黑","宋体"; font-size:12px;line-height:1.5; background:#eaebec;} div,img,tr,td,table{ border:0;} @@ -8,9 +9,10 @@ a:link,a:visited{color:#7f7f7f;text-decoration:none;} a:hover,a:active{color:#000;} a:hover {text-decoration: none; } textarea {resize: none;} +.pInline {margin:0px; padding:0px; display:inline-block;} /*常用*/ -select,input,textarea{ border:1px solid #64bdd9; background:#fff; color:#000; padding-left:5px; } +select,input,textarea{ border:1px solid #269ac9; background:#fff; color:#000; padding-left:5px; } .sub_btn{ cursor:pointer; -moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #707070; color:#000; border-radius:3px; padding:1px 10px; margin-bottom:10px; background:#dbdbdb;} .sub_btn:hover{ background:#b5e2fa; color:#000; border:1px solid #3c7fb1;} table{ background:#fff;} @@ -20,6 +22,7 @@ table{ background:#fff;} .no_border{ border:none;} .min_search{ width:150px; height:20px; border:1px solid #d0d0d0; color:#666; background:url(../images/new_project/public_icon.png) 135px -193px no-repeat;} a.btn_message_free{ background:#ff5722; display:block; text-align:center; color:#fff; padding:3px 0; width:80px; margin-bottom:10px;} +.db {display:block;} /* font & color */ h2{ font-size:18px; color:#15bccf;} h3{ font-size:14px; color:#e8770d;} @@ -28,6 +31,7 @@ h4{ font-size:14px; color:#3b3b3b;} .f14{font-size:14px;} .f16{font-size:16px;} .f18{font-size:18px;} +.f20{font-size:20px;} .fb{font-weight:bold;} .lh20{line-height:20px;} .lh22{line-height:22px;} @@ -49,6 +53,8 @@ h4{ font-size:14px; color:#3b3b3b;} .break_word{ word-break:break-all; word-wrap: break-word;} .hidden{overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .flow_hidden{ width:300px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.white_space{white-space:nowrap;} +.pr {position:relative;} /* Spacing */ .ml2{ margin-left:2px;} @@ -71,10 +77,15 @@ h4{ font-size:14px; color:#3b3b3b;} .ml100{ margin-left:100px;} .ml110{ margin-left:110px;} .ml320{ margin-left:320px;} +.ml150 { margin-left:150px;} +.mr-5 {margin-right:-5px;} .mr5{ margin-right:5px;} +.mr45 {margin-right:45px;} +.mr55{ margin-right:55px;} .mr10{ margin-right:10px;} -.mr15 {margin-right: 15px;} +.mr15 {margin-right:15px;} .mr20{ margin-right:20px;} +.mr25 {margin-right:25px;} .mr30{ margin-right:30px;} .mr40{ margin-right:40px;} .mr45{margin-right: 45px;} @@ -82,22 +93,28 @@ h4{ font-size:14px; color:#3b3b3b;} .mr55{margin-right: 55px;} .mr70{margin-right: 70px;} .mw15{margin:0 15px;} -.mw20{margin:0 20px;} +.mw20{ margin: 0 20px;} .mt1{margin-top: 1px;} +.mt-4 {margin-top:-4px;} +.mt0 {margin-top:0px !important;} .mt3{ margin-top:3px;} .mt5{ margin-top:5px;} .mt8{ margin-top:8px;} -.mt10{ margin-top:10px;} +.mt10{ margin-top:10px !important;} .mt30{ margin-top: 30px;} +.mt12 { margin-top:12px;} +.mt15 {margin-top:15px;} +.mt19 {margin-top:19px !important;} +.mb4{ margin-bottom:4px;} .mb5{ margin-bottom:5px;} -.mb8{ margin-bottom:8px;} -.mb10{ margin-bottom:10px;} +.mb8 {margin-bottom:8px;} +.mb10{ margin-bottom:10px !important;} .mb20{ margin-bottom:20px;} .pl15{ padding-left:15px;} .w20{ width:20px;} .w40{width: 40px;} .w45{ width: 45px;} -.w50{ width:50px;} +.w50 {width:50px;} .w60{ width:60px;} .w70{ width:70px;} .w90{ width:90px;} @@ -107,6 +124,7 @@ h4{ font-size:14px; color:#3b3b3b;} .w280{ width:280px;} .w265{ width: 265px;} .w270{ width: 270px;} +.w350 {width:350px;} .w430{ width:470px;} .w520{ width:520px;} .w543{ width:543px;} @@ -122,6 +140,7 @@ h4{ font-size:14px; color:#3b3b3b;} .h50{ height:50px;} .h70{ height:70px;} .h150{ height:150px;} +.p10 {padding-left:10px; padding-right:10px;} /* Font & background Color */ a.b_grey{ background: #F5F5F5;} @@ -165,10 +184,46 @@ a.c_green{ color:#28be6c;} .b_green{background:#28be6c;} .b_w{ background:#fff;} +/*add by Tim*/ +.fontGrey {color:#cecece;} +.fontGrey2 {color:#888888;} +.fontGrey3 {color:#484848;} +.fontBlue {color:#3498db;} +a.underline {text-decoration:underline;} +a.fontBlue {color:#297fb8;} +a.fontGrey {color:#cecece;} +a.fontGrey2 {color:#888888;} +a.linkOrange {color:#ff7143;} +a.linkBlue {color:#269ac9;} +a.linkBlue:hover {color:#297fb8;} +a.linkBlue2 {color:#3498db;} +a.linkBlue2:hover {color:#297fb8;} +a.buttonBlue {background-color:#269ac9;} +a.buttonBlue:hover {background-color:#297fb8;} +a.linkGrey {color:#484848;} +a.linkGrey:hover {color:#269ac9;} +a.linkGrey2 {color:#888888;} +a.linkGrey2:hover {color:#484848;} +a.linkGrey3 {color:#484848;} +a.linkGrey3:hover {color:#000000;} +a.linkGrey4 {color:#484848;} +a.linkGrey4:hover {color:#297fb8;} +a.linkGrey5 {color:#484848;} +a.linkGrey5:hover {color:#3498db;} +a.linkGrey6 {color:#484848 !important;} +a.linkGrey6:hover {color:#ffffff !important;} +a.bBlue {background-color:#3498db;} +a.bBlue:hover {background-color:#297fb8;} +a.submit_btn {border:1px solid #3498db; padding:3px 10px; border-radius:3px; color:#3498db;} +a.submit_btn:hover {background-color:#3498db; color:#ffffff;} + /* commonBtn */ .grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;} a.grey_btn{ background:#d9d9d9; color:#656565;font-size:14px; font-weight:normal; text-align:center;padding:2px 10px;} a:hover.grey_btn{ background:#717171; color:#fff;} +.grey_n_btn{ background:#d9d9d9; color:#656565; font-weight:normal;padding:2px 10px; text-align:center;} +a.grey_n_btn{background:#d9d9d9; color:#656565;font-weight:normal; padding:2px 10px; text-align:center;} +a:hover.grey_n_btn{ background:#717171; color:#fff;} .green_btn{ background:#28be6c; color:#fff; font-size:14px; font-weight:normal;padding:2px 8px; text-align:center;} a.green_btn{background:#28be6c;color:#fff;font-size:14px; font-weight:normal; padding:2px 8px; text-align:center;cursor: pointer;} a:hover.green_btn{ background:#14ad5a;} @@ -196,6 +251,15 @@ a:hover.blue_u_btn{background:#64bdd9; color:#fff;} .blue_n_btn{ background:#64bdd9; color:#fff; font-weight:normal;padding:2px 10px; text-align:center;} a.blue_n_btn{background:#64bdd9;color:#fff;font-weight:normal; padding:2px 10px; text-align:center;} a:hover.blue_n_btn{ background:#329cbd;} +.green_n_btn{background:#3cb761; padding:2px 10px; color:#fff;} +a.green_n_btn{background:#3cb761; padding:2px 10px; color:#fff;} +a:hover.green_n_btn{ background:#14ad5a;} +.orange_n_btn{background:#ff5d31; padding:2px 10px; color:#fff;} +a.orange_n_btn{background:#ff5d31; padding:2px 10px; color:#fff;} +a:hover.orange_n_btn{background:#d63502;} +.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;} +a.bgreen_n_btn{background:#1abc9c; padding:2px 10px; color:#fff;} +a:hover.bgreen_n_btn{background:#08a384;} .nolink_btn{ background:#BCBCBC; color: #fff; padding:2px 5px;} .more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;} @@ -225,7 +289,7 @@ a:hover.blue_n_btn{ background:#329cbd;} /*框架主类容*/ -#Container{ width:940px; margin:0 auto; } +#Container{ width:1000px; margin:0 auto; } /*头部导航*/ #Header{ margin:10px 0; background:#15bccf; height:40px; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; } @@ -234,6 +298,18 @@ a:hover.blue_n_btn{ background:#329cbd;} #TopNav ul li{ margin-top:8px;} .topnav_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;} .topnav_a a:hover{color: #a1ebff;} +#userInfo {float:right; display:inline-block; width:130px; padding-top:5px;} +.userInfoRow2 {margin-top:-5px;} +.myPractice {display:inline-block;} +a.parent {background: url(../images/arrowList.png) -30px 3px no-repeat; width:95px; padding-right:50px;} +a.parent:hover {background: url(../images/arrowList.png) -30px -14px no-repeat; width:95px; padding-right:50px; color:#fe7d68;} +a.linkToOrange:hover {color:#fe7d68;} +#userInfo ul li {positon: relative;} +#userInfo ul li ul {display:none;} +#userInfo ul li:hover ul {display:block; position:absolute;} +#userInfo ul li:hover ul li ul {display:none;} +#userInfo ul li:hover ul li:hover ul {display:block; position:absolute; left:110px; top:6px; width:148px; border:1px solid #15bccf; background-color:#ffffff; padding:5px 0px;} +#userInfo ul li:hover ul li:hover ul li {max-width:148px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block; padding: 0 10px; line-height:1.5; color:#15bccf;} #TopUser{} #TopUser ul li{ margin-top:8px;} .topuser_a a{ font-size:14px; font-weight:bold; color:#fff; margin-right:10px;} @@ -275,6 +351,22 @@ div#menu ul ul li {width: 100%;} div#menu ul ul ul {padding: 0;margin: -38px 0 0 90px !important; width:200px; } div#menu ul ul ul li a{ width:185px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf;} +/*myctrip*/ +.userImage{position:absolute; right:140px; top:5px; width:30px;height:30px; background: url(../images/item.png) 2px 4px no-repeat; line-height:1.4;} +a.topnav_login_a{color:#fff; display:inline-block;} +a.topnav_login_a:hover {color:#a1ebff;} +a.topnav_login_mes{color:#fff; width:10px;height:20px; padding-left:15px; background: url(../images/item.png) -84px -145px no-repeat; display:inline-block; vertical-align:top;} +a.topnav_login_mes:hover {color:#a1ebff;} +a.topnav_login_box{ color:#fff; font-size:14px; font-weight:bold; width:90px; display:inline-block;} +.menuArrow {background:url(../images/item.png) -20px -40px no-repeat;} +li.menuArrow:hover {background:url(../images/item.png) -20px -70px no-repeat;} +a.topnav_login_box:hover {color:#a1ebff;} +.navRow1 {margin:0; padding:0;} +.navRow2 {margin:0; padding:0;} +.topnav_login_list{ border:1px solid #269ac9; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-7px; position:absolute; z-index:9999; line-height:2;} +.topnav_login_list a{color:#15bccf;} +.topnav_login_list li{ } + /*主类容*/ #Main{ background:#fff; margin-bottom:10px;} #content{} @@ -294,10 +386,322 @@ a:hover.search_btn{ background: #0fa9bb;} #RSide{ width:670px; margin-left:10px; background:#fff; padding:10px; margin-bottom:10px;} +/*资源库*/ +.resources {width:728px; background-color:#ffffff; padding:10px 10px 20px 10px; border:1px solid #dddddd;} +.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;} +.bannerName {background:#64bdd9; color:#ffffff; height:40px; line-height:40px; width:90px; text-align:center; font-weight:normal; vertical-align:middle; font-size: 16px; float:left;} +.resourcesSelect {width:30px; height:34px; float:right; position:relative; margin-top:-6px;} +.resourcesSelected {width:25px; height:20px; position:relative; background:url(../images/resource_icon_list.png) 0px 0px no-repeat;} +.resourcesSelected:hover { background:url(../images/resource_icon_list.png) 0px -25px no-repeat;} +.resourcesIcon {margin-top:15px; display:block; width:25px; height:20px;} +.resourcesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:10px 20px; left:-90px; font-size:12px; color:#888888; display:none; line-height:2;} +a.resourcesTypeAll {background:url(../images/homepage_icon.png) -180px -89px no-repeat; padding-left:23px;} +a.resourcesTypeAtt {background:url(../images/homepage_icon.png) -180px -49px no-repeat; padding-left:23px;} +a.resourcesGrey {font-size:12px; color:#888888;} +a.resourcesGrey:hover {font-size:12px; color:#269ac9;} +.resourcesBanner ul li:hover ul.resourcesType {display:block;} +ul li:hover ul {display:block;} +.resourcesUploadBox {float:right; width:103px; height:34px; background-color:#269ac9; line-height:34px; vertical-align:middle; text-align:center; margin-left:12px;} +.resourcesUploadBox:hover {background-color:#297fb8;} +a.uploadBoxIcon {background:url(../images/resource_icon_list.png) -35px 10px no-repeat; float:left; display:block; width:81px; height:30px; padding-left:22px; font-size:14px; color:#ffffff;} +.resourcesSearchloadBox {border:1px solid #e6e6e6; width:225px; float:left; background-color:#ffffff;} +.searchResource {border:none; outline:none; background-color:#ffffff; width:184px; height:32px; padding-left:10px; display:block; float:left;} +.searchIcon{width:31px; height:32px; background-color:#ffffff; background:url(../images/resource_icon_list.png) -40px -15px no-repeat; display:block; float:left;} +.resourcesSearchBanner {width:710px; height:34px; margin-bottom:10px; margin-top:15px; margin-left:auto; margin-right:auto;} +.resourcesListTab {width:710px; height:40px; background-color:#f6f6f6; border-bottom:1px solid #eaeaea; font-size:14px; color:#7a7a7a; margin-left:auto; margin-right:auto;} +.resourcesListCheckbox {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle;} +.resourcesCheckbox {padding:0px; margin:0px; margin-top:14px; width:12px; height:12px;} +.resourcesListName {width:160px; height:40px; line-height:40px; text-align:left;} +.resourcesListSize {width:105px; height:40px; line-height:40px; text-align:center;} +.resourcesListType {width:150px; height:40px; line-height:40px; text-align:center;} +.resourcesListUploader {width:180px; height:40px; line-height:40px; text-align:center;} +.resourcesListTime {width:95px; height:40px; line-height:40px; text-align:center;} +.resourcesList {width:710px; height:39px; background-color:#ffffff; border-bottom:1px dashed #eaeaea; color:#9a9a9a; font-size:12px; margin-left:auto; margin-right:auto;} +.resourcesListOption {width:710px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;} +.resourcesCheckAll {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;} +.resourcesSelectSend {float:right;} +.resourcesSelectSendButton {width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; margin-top:5px; margin-right:10px; margin-left:15px; text-align:center; border:1px solid #269ac9; border-radius:5px; float:right;} +a.sendButtonBlue {color:#269ac9;} +a.sendButtonBlue:hover {color:#ffffff;} +.resourcesSelectSendButton:hover {background-color:#297fb8;} +a.resourcesBlack {font-size:12px; color:#4c4c4c;} +a.resourcesBlack:hover {font-size:12px; color:#000000;} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 80px; + padding: 5px 0; + margin: 2px 0 0; + font-size: 12px; + text-align: left; + background-color: #fff; + -webkit-background-clip: padding-box; + background-clip: padding-box; + border: 1px solid #ccc; + border-radius: 4px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); +} +.dropdown-menu > li > a { + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 1.5; + color:#616060; + white-space: nowrap; +} +.dropdown-menu > li > a:hover{ + color: #ffffff; + text-decoration: none; + background-color: #64bdd9; + outline:none; +} + +/*发送资源弹窗*/ +/*.resourceShareContainer {width:100%; height:100%; background:#666; filter:alpha(opacity=50); opacity:0.5; -moz-opacity:0.5; position:absolute; left:0; top:0; z-index:-999;}*/ +.resourceSharePopup {width:300px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-150px; z-index:1000;} +.sendText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:100px; display:inline-block; font-weight:bold;} +.resourcesSendTo {float:left; height:20px; margin-top:15px;} +.resourcesSendType {border:1px solid #e6e6e6; width:60px; height:24px; outline:none; font-size:14px; color:#888888;} +.resourcePopupClose {width:20px; height:20px; display:inline-block; float:right;} +.resourceClose {background:url(../images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block;} +.resourcesSearchBox {border:1px solid #e6e6e6; width:225px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} +.searchResourcePopup {border:none; outline:none; background-color:#ffffff; width:184px; height:25px; padding-left:10px; display:inline-block; float:left;} +.courseSend {width:260px; height:15px; line-height:15px; margin-bottom:10px;} +.courseSendCheckbox {padding:0px; margin:0px; width:12px; height:12px; margin-right:10px; display:inline-block; margin-top:2px;} +.sendCourseName {font-size:12px; color:#5f6060;} +.courseSendSubmit {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#269ac9; margin-right:25px; float:left;} +.courseSendSubmit:hover {background-color:#297fb8;} +.courseSendCancel {width:50px; height:25px; line-height:25px; text-align:center; vertical-align:middle; background-color:#c1c1c1; float:left} +.courseSendCancel:hover {background-color:#717171;} +.courseReferContainer {float:left; max-height:120px; overflow:scroll; overflow-x:hidden; margin-right:16px; margin-bottom:10px;} +a.sendSourceText {font-size:14px; color:#ffffff; display:block;} + +/*上传资源弹窗*/ +.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;} +.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:15px; width:140px; display:inline-block;} +.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;} +.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;} +.uploadBox:hover {background-color:#297fb8;} +a.uploadIcon {background:url(../images/resource_icon_list.png) 8px -60px no-repeat; width:100px; height:33px; display:block;} +.chooseFile {color:#ffffff; display:block; margin-left:32px;} +.uploadResourceIntr {width:250px; height:33px; float:left; line-height:33px; font-size:12px;} +.uploadResourceName {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444; margin-bottom:2px;} +.uploadResourceIntr2 {width:250px; display:inline-block; line-height:15px; font-size:12px; color:#444444;} +.uploadType {margin:10px 0; border:1px solid #e6e6e6; width:100px; height:30px; outline:none; font-size:12px; color:#888888;} +.uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;} + +/*评分设置弹窗*/ +.markPopup {width:290px; height:auto; border:3px solid #269ac9; padding:0px 0px 15px 15px; background-color:#ffffff; z-index:1000;} +.markInput {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:95px; color:#3d3c3c;} +.markPercentage {margin:10px 0; border:1px solid #e6e6e6; width:60px; height:30px; outline:none; font-size:12px; color:#3d3c3c;} + + +/*新个人主页框架css*/ +.navContainer {width:100%; margin:0 auto; background-color:#269ac9;} +.homepageContentContainer {width:100%; margin:0 auto; background-color:#eaebed;} +.homepageContent {width:1000px; background-color:#eaebed; margin:0 auto;} +.navHomepage {width:1000px; height:54px; background-color:#269ac9; margin:0 auto;} +.navHomepageLogo {width:60px; height:54px; line-height:54px; vertical-align:middle; margin-left:2px; margin-right:30px;} +.navHomepageMenu {margin-right:20px; display:inline-block;height:54px; line-height:54px; vertical-align:middle;} +.navHomepageMenu:hover {background-color:#297fb8;} +.navHomepageSearchBoxcontainer {margin-top:11px; } +.navHomepageSearchBox {width:380px; border:none; outline:none; height:32px; background-color:#ffffff;} +.navHomepageSearchInput {width:345px; height:32px; outline:none; border:none; float:left; padding-left:5px;; margin:0;} +.homepageSearchIcon {width:30px; height:32px; background:url(../images/nav_icon.png) -8px 3px no-repeat; float:left;} +a.homepageSearchIcon:hover {background:url(../images/nav_icon.png) -49px 3px no-repeat;} +.navSearchTypeBox {width:368px; height:35px; line-height:35px; vertical-align:middle; position:absolute; border:1px solid #98a1a6; background-color:#ffffff; padding-left:10px; display:none; color:#3e3e3e; font-size:14px; top:43px;} +#navSearchAlert {display:none;} +.navHomepageNews {width:30px; display:block; float:right; margin-top:8px; position:relative;} +.homepageNewsIcon {background:url(../images/nav_icon.png) -5px -85px no-repeat; width:30px; height:35px; display:block;} +.newsActive {width:8px; height:8px; border-radius:50%; border:2px solid #ffffff; background-color:#ff0000; position:absolute; left:17px; top:5px;} +.navHomepageProfile {width:65px; display:block; float:right; margin-left:33px;} +.homepageProfileMenuIcon {background:url(../images/nav_icon.png) 30px -155px no-repeat; width:65px; height:54px; position:relative; display:inline-block;} +.homepageProfileMenuIcon:hover {background:url(../images/nav_icon.png) 30px -122px no-repeat;} +.navHomepageProfile ul li ul {display:none;} +.navHomepageProfile ul li:hover ul {display:block;} +.homepageLeft {width:240px; float:left; margin-right:10px; margin-bottom:10px; margin-top:15px;} +.homepageRight {width:750px; float:left; margin-top:15px; margin-bottom:10px;} +.homepagePortraitContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; padding-bottom:15px;} +.homepagePortraitImage {width:206px; height:206px; padding:2px; margin:15px 14px 10px 14px; position:relative; border:1px solid #cbcbcb;} +.homepagePortraitImage:hover {border:1px solid #297fb8;} +.homepageFollow {background:url(../images/homepage_icon.png) -10px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} +.homepageFollowCancel {background:url(../images/homepage_icon.png) -178px -8px no-repeat; width:20px; height:20px; position:absolute; right:9px; top:9px;} +.homepageEditProfile {width:16px; height:16px; border-radius:2px; background-color:#888888; position:absolute; right:5px; bottom:5px; font-size:12px; filter:alpha(opacity=50); -moz-opacity:0.5; opacity: 0.5;} +.homepageEditProfileIcon {background:url(../images/homepage_icon.png) -14px -37px no-repeat; width:16px; height:16px; display:block;} +.homepageImageName {font-size:16px; color:#484848; margin-left:15px; margin-right:8px; height:25px; float:left;} +.homepageImageSex {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -112px no-repeat; float:left;} +.homepageImageSex2 {top:116px; left:5px; width:20px; height:20px; background:url(../images/homepage_icon.png) -10px -150px no-repeat; float:left;} +.homepageSignature {font-size:12px; color:#888888; margin-left:15px; margin-top:10px; margin-bottom:12px; width:208px;} +.homepageImageBlock {margin:0 auto; width:68px; float:left; text-align:center; display:inline-block;} +.homepageImageNumber {font-size:12px; color:#484848; font-weight:bold;} +a.homepageImageNumber:hover {color:#15bccf;} +.homepageImageText {font-size:12px; color:#888888;} +.homepageVerDiv {height:28px; vertical-align:middle; width:1px; float:left; display:inline-block; background-color:#d1d1d1; margin-top:3px;} +.homepageLeftMenuContainer {width:238px; border:1px solid #dddddd; border-bottom:none; background-color:#ffffff; margin-top:10px;} +.homepageLeftMenuBlock {border-bottom:1px solid #dddddd; height:50px; line-height:50px; vertical-align:middle;} +.homepageLeftMenuCourses {font-size:14px; border-bottom:1px solid #dddddd;} +.homepageLeftMenuCoursesLine {padding-left:25px; height:38px; line-height:38px; vertical-align:middle;} +.homepageLeftMenuCoursesLine:hover {background-color:#b3e0ee;} +a.coursesLineGrey {color:#15bccf; display:block;} +a.coursesLineGrey:hover {color:#ffffff;} +.homepageLeftMenuMore {height:18px;} +.homepageLeftMenuMore:hover {background-color:#b3e0ee;} +.homepageLeftMenuMoreIcon {background:url(../images/homepage_icon.png) -74px -240px no-repeat; display:block; height:18px;} +.homepageMenuSetting {display:inline-block; margin-left:155px;} +a.homepageMenuText {color:#484848; font-size:16px; margin-left:20px;} +.homepageLeftLabelContainer {width:238px; border:1px solid #dddddd; background-color:#ffffff; margin-top:10px;} +.homepageLabelText {color:#484848; font-size:16px; margin-left:10px; margin-bottom:12px; display:block;} +.homepageRightBanner {width:720px; height:34px; margin:0px auto; border-bottom:1px solid #e9e9e9;} +.NewsBannerName {font-size:16px; color:#4b4b4b; display:block; width:150px; float:left; margin-top:4px;} +.newsType {width:60px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-40px; font-size:12px; color:#888888; display:none; line-height:2; z-index:9999;} +.newsReadSetting {width:700px; background-color:#f6f6f6; border-bottom:1px solid #eeeeee; margin:10px auto; height:39px; line-height:39px; vertical-align:middle; font-size:14px; color:#7a7a7a; padding-left:10px;} +.homepageNewsList {width:710px; height:49px; line-height:49px; vertical-align:middle; border-bottom:1px dashed #eaeaea; margin-left:10px;} +.homepageNewsPortrait {width:40px; display:block; margin-top:7px;} +.homepageNewsPublisher {width:80px; max-width:80px; margin-right:10px; font-size:12px; color:#15bccf; display:block; padding-left:5px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.homepageNewsType {width:95px; font-size:12px; color:#888888; display:block;} +.homepageNewsContent {width:395px; max-width:395px; margin-right:10px; font-size:12px; color:#4b4b4b; display:block; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; } +.homepageNewsTime {width:75px; font-size:12px; color:#888888; display:block; text-align:right;} +a.homepageWhite {color:#ffffff;} +a.homepageWhite:hover {color:#a1ebff} +a.newsGrey {color:#4b4b4b;} +a.newsGrey:hover {color:#000000;} +a.replyGrey {color:#888888; display:inline-block;} +a.replyGrey:hover {color:#4b4b4b;} +a.newsBlue {color:#269ac9;} +a.newsBlue:hover {color:#297fb8;} +a.menuGrey {color:#808080;} +a.menuGrey:hover {color:#fe7d68;} + +/*个人主页右部分*/ +.homepagePostType {width:180px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-170px; font-size:12px; color:#4b4b4b; line-height:2; z-index:9999; display:none;} +.homepagePostTypeHomework {width:100px;} +.homepagePostTypeProject {width:80px;} +a.homepagePostTypeAssignment {background:url(../images/homepage_icon.png) -93px -318px no-repeat; padding-left:23px;} +a.homepagePostTypeNotice {background:url(../images/homepage_icon.png) -87px -280px no-repeat; padding-left:23px;} +a.homepagePostTypeForum {background:url(../images/homepage_icon.png) -10px -310px no-repeat; padding-left:23px;} +a.homepagePostTypeQuiz {background:url(../images/homepage_icon.png) -90px -124px no-repeat; padding-left:23px;} +a.homepagePostTypeQuestion {background:url(../images/homepage_icon.png) -10px -273px no-repeat; padding-left:23px;} +a.homepagePostTypeAll {background:url(../images/homepage_icon.png) -10px -360px no-repeat; padding-left:23px;} +a.postTypeGrey {color:#888888;} +a.postTypeGrey:hover {color:#269ac9;} +.homepagePostBrief {width:710px; margin:20px auto 0px auto; position:relative;} +.homepagePostPortrait {float:left; width:90px;} +.homepagePostDes {float:left; width:600px; margin-left:20px;} +.homepagePostTo {font-size:14px; color:#484848; margin-bottom:8px;} +.homepagePostTitle {font-size:14px; color:#484848; margin-bottom:10px; font-weight:bold;} +.homepagePostSubmitContainer {height:30px; margin-bottom:10px;} +.homepagePostSubmit {font-size:14px; color:#888888; width:80px; height:30px; text-align:center; vertical-align:middle; line-height:30px; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px;} +.homepagePostSubmit:hover {background-color:#d8d8d8;} +.homepagePostIntro {font-size:14px; color:#484848;} +.homepagePostDeadline {font-size:12px; color:#888888; float:left; height:30px; line-height:30px; vertical-align:middle;} +.homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;} +.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;} +.borderBottomNone {border-bottom:none !important;} +.homepagePostReplyBannerCount{width:255px; display:inline-block; margin-left:20px;} +.homepagePostReplyBannerTime{width:85px; display:inline-block;} +.homepagePostReplyBannerMore{width:330px; display:inline-block; text-align:right;} +.homepagePostReplyInputContainer {width:690px; margin:0px auto;} +.homepagePostReplyInput {width:680px; height:40px; max-width:680px; max-height:40px; border:1px solid #d9d9d9; outline:none; margin:15px auto 10px auto; padding-left:8px; padding-top:5px;} +.homepagePostReplyEmotion {background:url(../images/homepage_icon.png) -90px -88px no-repeat; width:50px; height:24px; float:left; padding-left:30px;} +.homepagePostReplySubmit {float:right; width:45px; height:24px; text-align:center; line-height:24px; vertical-align:middle; font-size:12px; color:#ffffff; background-color:#269ac9;} +.homepagePostReplySubmit:hover {background-color:#297fb8;} +a.postReplySubmit {color:#ffffff; display:block;} +.homepagePostReplyCancel {float:right; width:45px; height:24px; text-align:center; line-height:24px; vertical-align:middle; font-size:12px; color:#888888; background-color:#cecece; margin-left:8px;} +.homepagePostReplyCancel:hover {background-color:#717171;} +a.postReplyCancel {color:#888888; display:block;} +a.postReplyCancel:hover {color:#ffffff;} +.homepagePostReplyInputContainer2 {width:620px; margin:0px auto;} +.homepagePostReplyInput2 {width:610px; height:25px; max-width:610px; max-height:25px; border:1px solid #d9d9d9; outline:none; margin:0px auto 10px auto; padding-left:8px; padding-top:5px;} +.homepagePostReplyContainer {border-bottom:1px solid #e3e3e3; width:690px; margin:0px auto; margin-top:15px; min-height:60px;} +.homepagePostSetting {position:absolute; width:20px; height:20px; right:0px; top:0px;} +.homepagePostSettingIcon {background:url(../images/homepage_icon.png) -93px -5px no-repeat; width:20px; height:20px;} +.homepagePostSettiongText {width:85px; line-height:2; font-size:12px; color:#616060; background-color:#ffffff; border:1px solid #eaeaea; border-radius:3px; position:absolute; left:-68px; top:20px; padding:5px 0px; display:none;} +.homepagePostSettingIcon:hover {background:url(../images/homepage_icon.png) -93px -44px no-repeat;} +a.postOptionLink {color:#616060; display:block; width:55px; padding:0px 15px;} +a.postOptionLink:hover {color:#ffffff; background-color:#15bccf;} +.homepagePostReplyPortrait {float:left; width:45px;} +.homepagePostReplyDes {float:left; width:620px; margin-left:15px;} +.homepagePostReplyPublisher {font-size:12px; color:#484848; margin-bottom:5px;} +.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;} +.homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;} +.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf; height:30px; line-height:30px; vertical-align:middle;} +.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} +.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;} +.postAttSize {color:#888888; font-size:12px;} +a.postGrey {color:#484848;} +a.postGrey:hover {color:#000000;} + +/*课程主页css*/ +.homepageCoursesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-65px; font-size:12px; color:#4b4b4b; line-height:2; z-index:9999; display:none;} + +/*注册登陆页面*/ +#loginInBox {display:block; margin-top:143px;} +#signUpBox {display:none; margin-top:79px;} +#loginSignButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;} +#loginInButton {height:54px; padding-left:10px; padding-right:10px; text-align:center; line-height:54px; vertical-align:middle; color:#ffffff; font-size:16px;} +#loginSignButton:hover {background-color:#297fb8;} +#loginInButton:hover {background-color:#297fb8;} +.loginContentContainer {width:100%; background-color:#269ac9; margin-top:1px; height:580px;} +.loginContent {width:1000px; margin:0px auto;} +.loginLeft {width:595px; float:left;} +.loginLogo {padding-left:208px; padding-top:155px;} +.loginInro {width:465px; padding-top:55px; padding-left:50px; font-size:16px; color:#ffffff;} +.loginRight {width:405px; float:left;} +.loginChooseBox {width:405px; height:54px; background-color:#ffffff; padding-top:18px;} +.loginChooseList {width:350px; height:30px; font-size:14px; margin:0px auto;} +.loginChoose {width:55px; height:30px; border-bottom:1px solid #269ac9; text-align:center; font-weight:bold;} +a.loginChooseTab {color:#484848; height:30px; display:block;} +.loginInButton {width:315px; height:40px; background-color:#269ac9; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:20px;} +.loginInButton:hover {background-color:#297fb8;} +.loginUpButton {width:315px; height:40px; background-color:#269ac9; margin-left:46px; font-size:14px; text-align:center; line-height:40px; vertical-align:middle; margin-top:30px;} +.loginUpButton:hover {background-color:#297fb8;} +.loginChooseBorder {width:295px; height:30px; border-bottom:1px solid #e3e3e3;} +.loginSign {width:405px; background-color:#ffffff;} +.loginSignBox {width:308px; height:38px; margin-left:46px; border:1px solid #98a1a6; outline:none;} +.loginSignOption {margin-left:46px; margin-top:15px;} +.loginIn {width:405px; background-color:#ffffff; padding-bottom:30px;} +.loginSignAlert {font-size:12px; color:#fc0000; margin-left:60px;} +.loginSignRow {height:60px; min-height:60px;} + +/*课程选择弹窗*/ +.coursesChoosePopup {width:530px; height:auto; border:3px solid #269ac9; padding-left:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:0; left:0; z-index:1000;} +.coursesSearchBox {border:1px solid #e6e6e6; width:515px; height:25px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} +.searchCoursesPopup {border:none; outline:none; background-color:#ffffff; width:470px; height:25px; padding-left:10px; display:inline-block; float:left;} +.searchIconPopup{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -273px no-repeat; display:inline-block; float:left;} +.searchIconPopup:hover {background:url(../images/homepage_icon.png) -180px -314px no-repeat;} + +/*导入作业弹窗*/ +.homeworkPublish {width:260px; height:15px; line-height:15px;} +.homeworkPublishTime {font-size:12px; color:#b1b1b1; margin-left:22px; margin-bottom:8px;} + +/*引用资源库弹窗*/ +.referenceResourcesPopup {width:710px; height:auto; border:3px solid #269ac9; padding-left:20px; padding-right:20px; padding-bottom:35px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-375px; z-index:1000;} +.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} +.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} +.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} +.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -170px -135px no-repeat; display:inline-block; float:left;} +.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -170px -190px no-repeat;} +.referenceResourceType {font-size:14px; width:355px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} +.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} +a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} + + + /*底部*/ -#Footer{ padding-top:10px; background:#fff; margin-bottom:10px;} -.copyright{ width:780px; margin:0 auto;height:30px; } -.footlogo{ width:580px; margin:0 auto;height:50px; } +#Footer{background-color:#ffffff; margin-bottom:10px; padding-bottom:15px; color:#666666;} +.footerAboutContainer {width:auto; border-bottom:1px solid #efefef;} +.footerAbout{ width:585px; margin:0 auto;height:35px; line-height:35px; border-bottom:1px solid #efefef; } +.languageBox {width:55px; height:20px; margin-left:5px; outline:none; color:#666666; border:1px solid #d9d9d9;} +.departments{ width:890px; margin:5px auto 0 auto;height:30px;line-height:30px;} +.copyright{ width:375px; margin:0 auto;height:20px;line-height:20px;} +a.f_grey {color:#666666;} +a.f_grey:hover {color:#000000;} /*意见反馈*/ html{ overflow-x:hidden;} .scrollsidebar{ position: fixed; bottom:1px; right:1px; background:none; } From 939a010adbe488daf0c35d13f15d9c96e2f43f22 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 16 Sep 2015 15:51:35 +0800 Subject: [PATCH 02/26] =?UTF-8?q?=E9=9D=99=E6=80=81=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 103 +---- app/views/layouts/base_courses.html.erb | 6 +- app/views/student_work/index.html.erb | 435 ++++++++++++--------- 3 files changed, 252 insertions(+), 292 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 474fb81bc..d570a31fc 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -72,80 +72,12 @@ class StudentWorkController < ApplicationController query.update_attributes(:viewed => true) end end - @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] - @is_teacher = User.current.allowed_to?(:as_teacher,@course) - course_group = CourseGroup.find_by_id(@group) if @group - if course_group - group_students = course_group.users - if group_students.empty? - student_in_group = '(0)' - else - student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')' - end - #老师 || 非匿评作业 || 匿评结束 显示所有的作品 - @show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin? - if @show_all - if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品 - if @order == "name" - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name - else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name - end - else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品 - my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) - if my_work.empty? - @stundet_works = [] - else - if @order == "name" - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name - else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name - end - end - end - else #学生 - if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品 - @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) - elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品 - @is_evaluation = true - my_work = @homework.student_works.where(:user_id => User.current.id) - @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} - end - end - else - #老师 || 非匿评作业 || 匿评结束 显示所有的作品 - @show_all = @is_teacher || @homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3 || User.current.admin? - if @show_all - if @homework.homework_type == 1 || @is_teacher || User.current.admin? #超级管理员 || 老师 || 匿评结束 显示所有的作品 - if @order == "name" - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name - else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name - end - else #剩余情况: 学生 && 非匿评作业 如果未提交作品,只能看到自己的,提交了作品,能看到所有作品 - my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) - if my_work.empty? - @stundet_works = [] - else - if @order == "name" - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).order("users.lastname #{@b_sort}, users.firstname #{@b_sort}"),@name - else - @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name - end - end - end - else #学生 - if @homework.homework_detail_manual.comment_status == 1 #未开启匿评,只显示我的作品 - @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) - elsif @homework.homework_detail_manual.comment_status == 2 #匿评列表,显示匿评作品和我的作品 - @is_evaluation = true - my_work = @homework.student_works.where(:user_id => User.current.id) - @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} - end - end - end + + ################################################################################################################## + @stundet_works = @homework.student_works @homework_commons = @course.homework_commons.order("created_at desc") - @score = @b_sort == "desc" ? "asc" : "desc" + @is_teacher = User.current.allowed_to?(:as_teacher,@course) + respond_to do |format| format.html format.xls { @@ -264,7 +196,7 @@ class StudentWorkController < ApplicationController render_403 and return if User.current == @work.user #不可以匿评自己的作品 @is_teacher = User.current.allowed_to?(:as_teacher,@course) #老师、教辅可以随时评分,学生只能在匿评作业的匿评阶段进行评分 - render_403 and return unless @is_teacher || (@homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2) + render_403 and return unless @is_teacher || @homework.homework_detail_manual.comment_status == 2 @score = student_work_score @work,User.current if @score @score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" @@ -298,33 +230,10 @@ class StudentWorkController < ApplicationController case @score.reviewer_role when 1 #教师评分:最后一个教师评分为最终评分 @work.teacher_score = @score.score - @work.final_score = @score.score when 2 #教辅评分 教辅评分显示平均分 @work.teaching_asistant_score = @work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f - if @work.teacher_score.nil? - if @work.student_score.nil? - @work.final_score = @work.teaching_asistant_score - else - ta_proportion = @homework.homework_detail_manual.ta_proportion if @homework.homework_detail_manual - ta_proportion = @homework.homework_detail_programing.ta_proportion if @homework.homework_detail_programing - final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}") - final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) - final_score = final_ta_score + final_s_score - @work.final_score = format("%.2f",final_score.to_f) - end - end when 3 #学生评分 学生评分显示平均分 @work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f - if @work.teacher_score.nil? - if @work.teaching_asistant_score.nil? - @work.final_score = @work.student_score - else - final_ta_score = BigDecimal.new("#{@work.teaching_asistant_score}") * BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}") - final_s_score = BigDecimal.new("#{@work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{@homework.homework_detail_manual.ta_proportion}")) - final_score = final_ta_score + final_s_score - @work.final_score = format("%.2f",final_score.to_f) - end - end end if @work.save diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 4830431a0..800f2ff9d 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -145,12 +145,12 @@
- <%= render_flash_messages %> <%= yield %> - <%= call_hook :view_layouts_base_content %> + <%#= render_flash_messages %> + <%#= call_hook :view_layouts_base_content %>
-
+
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index d128eab67..a5c7c3486 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -1,5 +1,11 @@ -
- -
- - -
-
-
- -
-
- -
-
-
- - <%= link_to "所有作品(#{@stundet_works.count})".html_safe,student_work_index_path(:homework => @homework.id), :class => "fl"%> - - <% if @show_all%> - - <%= select_tag(:late_penalty,options_for_select(course_group_list(@course),@group), {:class => "fl h22 w100 ml10"}) if(@is_teacher && course_group_list(@course).count > 0) %> - 搜索 - <%= link_to("缺评情况",student_work_absence_penalty_student_work_index_path(:homework => @homework.id), :class => "student_work_search fl", :target => "_blank") if((@is_teacher || User.current.admin?) && @homework.homework_type == 1) %> - <% end%> - <% if @is_teacher%> -
- <% unless @homework.homework_type == 2%> - <% if @homework.student_works.empty?%> - <%= link_to "附件", "javascript:void(0)", class: "down_btn fr zip_download_alert", :onclick => "alert('没有学生提交作业,无法下载附件')" %> - <% else%> - <%= link_to "附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), - remote: true, class: "down_btn fr zip_download_alert", :id => "download_homework_attachments" %> - <% end%> -
- 使用 - winzip - 工具进行解压可能会导致 - 下载文件乱码 - ,建议您使用 - winrar - 工具进行解压 -
- <% end%> - <%= link_to("匿评", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%> - <%= link_to("缺评", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'down_btn fr') if @homework.homework_type == 1%> - <%= link_to l(:label_list), student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'down_btn fr'%> - 导出全部: -
- <% end%> + +
+ +
-
-
- - <% if @is_evaluation%> - -
- <% @stundet_works.each do |student_work|%> - <%= render :partial => "evaluation_work",:locals => {:student_work => student_work}%> -
- <% end%> - <% else %> - <% if @homework.homework_type == 1 || @homework.homework_type == 2%> - +
+
+
+
+
+ + 所有作品 + [共199份] + + +
+ + +
- <% @stundet_works.each do |student_work|%> - <%= render :partial => "evaluation_student_work",:locals => {:student_work => student_work}%> -
- <% end%> - <% else%> -
    - <%= render :partial => 'student_work_title'%> -
+
+ +
+
    +
  • + 作品信息 +
  • +
  • + 教师评分 + +
  • +
  • + 教辅评分 + +
  • +
  • + 系统评分 + +
  • +
  • + 匿评 + +
  • +
  • + 成绩 + +
  • +
+
+ +
+
    +
  • + +
  • +
  • 90
  • +
  • --
  • +
  • --
  • +
  • 100(3) +
  • +
  • 90
  • - <% @stundet_works.each do |student_work|%> - <%= render :partial => "student_work",:locals => {:student_work => student_work}%> -
    - <% end%> - <% end%> - <% end%> -
    -
+ + +
-
-
- <%= link_to(image_tag(url_to_avatar(@homework.user), :width => "42", :height => "42"), user_path(@homework.user), :class => "problem_pic fl") %> -
-

- <%= @homework.name%> -

- <% if @is_teacher%> - <%#= homework_anonymous_comment(@homework)%> - <% else%> - <%= student_anonymous_comment @homework %> - <%= student_new_homework @homework %> - <% end %> -
- -
- <%= @homework.description.html_safe %> + +
+ + + +
+
-
+ - <% if @homework.homework_type == 2 && @homework.homework_detail_programing%> - <% if @is_teacher%> - - - "> - - - - <% @homework.homework_tests.each do |test|%> - "> - - - - <% end%> - -
- 输入 - - 输出 -
- <%=test.input%> - - <%= test.output%> -
-
- <% end%> - -
- 开发语言: -
- <% if @homework.homework_detail_programing.language.to_i == 1%> - C - <% elsif @homework.homework_detail_programing.language.to_i == 2%> - C++ - <% end%> +
+
+
+

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

+
+ +
+
+

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

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

作业提交还剩:

+
- <% end%> - -
- <% unless @homework.attachments.empty?%> - 附件: -
- <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => @homework.attachments} %> -
- <% end%> -
-
- - -
- 截止时间:<%= @homework.end_time%> -
- <% if betweentime(@homework.end_time) < 0 %> - - <%= l(:label_commit_limit)%> - - <% else %> - -
+ + +
-
-
-
-
+ +
+ +
+
+ +
+ -
-
+
+ + +
\ No newline at end of file From 9a859d28bf24e516ebbc3bc76f0f35742d8dc1c2 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 09:20:35 +0800 Subject: [PATCH 03/26] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E6=97=B6=E4=BD=9C=E5=93=81=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 1 + .../_evaluation_student_work_title.html.erb | 47 ---- .../student_work/_evaluation_title.html.erb | 8 + .../_evaluation_un_title.html.erb | 27 +++ .../student_work/_evaluation_un_work.html.erb | 0 .../student_work/_evaluation_work.html.erb | 70 ++++-- .../_evaluation_work_title.html.erb | 12 - .../student_work/_student_work_title.html.erb | 37 --- app/views/student_work/index.html.erb | 214 ++---------------- public/stylesheets/courses.css | 5 +- 10 files changed, 106 insertions(+), 315 deletions(-) delete mode 100644 app/views/student_work/_evaluation_student_work_title.html.erb create mode 100644 app/views/student_work/_evaluation_title.html.erb create mode 100644 app/views/student_work/_evaluation_un_title.html.erb create mode 100644 app/views/student_work/_evaluation_un_work.html.erb delete mode 100644 app/views/student_work/_evaluation_work_title.html.erb delete mode 100644 app/views/student_work/_student_work_title.html.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index d570a31fc..a039038e2 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -77,6 +77,7 @@ class StudentWorkController < ApplicationController @stundet_works = @homework.student_works @homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) + @is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 respond_to do |format| format.html diff --git a/app/views/student_work/_evaluation_student_work_title.html.erb b/app/views/student_work/_evaluation_student_work_title.html.erb deleted file mode 100644 index f19438f78..000000000 --- a/app/views/student_work/_evaluation_student_work_title.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -
  • - 学号 -
  • -
  • - <%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "name"%> - <%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - 作品名称 -
  • -
  • - <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "created_at"%> - <%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "teacher_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "teaching_asistant_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - - <% end%> -
  • -
  • - <% if @homework.homework_type == 1%> - <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% elsif @homework.homework_type == 2%> - <%= link_to "系统",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% end %> - <% if @show_all && @order == "student_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • \ No newline at end of file diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb new file mode 100644 index 000000000..f7d2904a7 --- /dev/null +++ b/app/views/student_work/_evaluation_title.html.erb @@ -0,0 +1,8 @@ +
      +
    • + 作品信息 +
    • +
    • + 我的评分 +
    • +
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb new file mode 100644 index 000000000..fa2383d48 --- /dev/null +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -0,0 +1,27 @@ +
      +
    • + 作品信息 +
    • +
    • + 教师评分 + +
    • +
    • + 教辅评分 + +
    • + <% if @homework.homework_type == 2%> +
    • + 系统评分 + +
    • + <% end%> +
    • + 匿评 + +
    • +
    • + 成绩 + +
    • +
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb new file mode 100644 index 000000000..e69de29bb diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index be07269c3..b428d79f8 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -1,29 +1,51 @@ -
      " id="student_work_<%= student_work.id%>"> +
        <% is_my_work = student_work.user == User.current%> -
      • - <% if is_my_work%> - - <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> - - <% else%> - -- - <% end%> -
      • -
      • - <% if is_my_work%> - <%= link_to student_work.user.show_name,user_path(student_work.user),:title => student_work.user.show_name, :class => "c_blue02" %> - <% else%> - <%= link_to "匿名","javascript:void(0)", :class => "c_blue02"%> - <% end%> -
      • -
      • - <% student_work_name = student_work.name.nil? || student_work.name.empty? ? '匿名的作品' : student_work.name%> - <%= link_to student_work_name, student_work_path(student_work),:remote => true, :title => student_work.name, :class => "c_blue02"%> +
      • +
          +
        • + <% if is_my_work%> + <% student_work_name = student_work.name.nil? || student_work.name.empty? ? student_work.user.show_name + '的作品' : student_work.name%> + <%= link_to student_work_name, student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%> + <% else%> + <%= link_to "匿名的作品", student_work_path(student_work),:remote => true,:title => student_work_name, :class => "linkGrey f14"%> + <% end%> +
        • +
          +
        • +
            +
          • + 姓名: + <% if is_my_work%> + <%= student_work.user.show_name%> + <% else%> + 匿名 + <% end%> +
          • +
          • + 学号: + <% if is_my_work%> + + <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> + + <% else%> + -- + <% end%> +
          • +
          • + 时间: + <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> + 迟交 + <% else%> + <%= format_time student_work.created_at%> + <% end %> +
          • +
          +
        • +
      • <% my_score = student_work_score(student_work,User.current) %> -
      • - <%= my_score.nil? ? "--" : format("%.2f",my_score.score)%> +
      • + <%= my_score.nil? ? "--" : format("%.1f",my_score.score)%>
      • -
        -
      \ No newline at end of file +
    \ No newline at end of file diff --git a/app/views/student_work/_evaluation_work_title.html.erb b/app/views/student_work/_evaluation_work_title.html.erb deleted file mode 100644 index 0be6228bb..000000000 --- a/app/views/student_work/_evaluation_work_title.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -
  • - 学号 -
  • -
  • - 学生姓名 -
  • -
  • - 作品名称 -
  • -
  • - <%= link_to "我的评分","javascript:void(0)",:class => "c_dark f14 fb fl"%> -
  • \ No newline at end of file diff --git a/app/views/student_work/_student_work_title.html.erb b/app/views/student_work/_student_work_title.html.erb deleted file mode 100644 index 24e6a1b37..000000000 --- a/app/views/student_work/_student_work_title.html.erb +++ /dev/null @@ -1,37 +0,0 @@ -
  • - 学号 -
  • -
  • - <%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "name"%> - <%= link_to "",student_work_index_path(:homework => @homework.id,:order => "name", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - 作品名称 -
  • -
  • - <%= link_to "时间",@show_all ? student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "created_at"%> - <%= link_to "",student_work_index_path(:homework => @homework.id,:order => "created_at", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - <%= link_to "教师",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "teacher_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • -
  • - <%= link_to "教辅",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "teaching_asistant_score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - - <% end%> -
  • -
  • - <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "f14 f_b c_dark fl"%> - <% if @show_all && @order == "score"%> - <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => @score == 'desc' ? 'st_up' : 'st_down'%> - <% end%> -
  • \ 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 a5c7c3486..665cbc0f7 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -1,11 +1,12 @@
    -
    +
    -
      -
    • - 作品信息 -
    • -
    • - 教师评分 - -
    • -
    • - 教辅评分 - -
    • -
    • - 系统评分 - -
    • -
    • - 匿评 - -
    • -
    • - 成绩 - -
    • -
    + <% if @is_evaluation && !@stundet_works.empty?%> + <%= render :partial => "evaluation_title"%> + <% else%> + <%= render :partial => "evaluation_un_title"%> + <% end%>
    - - -
    - - -
    - - - -
    - + <% @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%> +
    + +
    +
    + <% end%>
    - - -
    -
    -
    -

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

    -
    - -
    -
    -

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

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

    作业提交还剩:

    -
    -
    - -
    -
    - - - - - -
    - -
    -
    -
    - -
    - -
    \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 073eaf56b..f46607967 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -50,7 +50,7 @@ a:hover.news_foot{ color:#787b7e; border:1px solid #d4d4d4;} .hworkList80 {width:80px; text-align:center;} .hworkList50 {width:50px; text-align:center;} .codeList{ float:right; font-size:12px; color:#484848; padding:0px 3px; width:714px; margin-bottom:10px; } -.hworkName {width:380px; max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;} +.hworkName {max-width:380px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:16px; line-height:16px;} .hworkDetail {max-width:100px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis; float:left; height:14px; line-height:14px; font-size:12px; color:#888888;} .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;} @@ -60,6 +60,9 @@ a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-rep .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;} .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;} +.width620{width: 620px;} +.width455{width: 455px;} +.m_width620{max-width: 620px;} /*邮件邀请*/ From fa9008d396acdae53e3688a16ebb8e58636c59dd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 10:00:41 +0800 Subject: [PATCH 04/26] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=9C=A8=E9=9D=9E?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E9=98=B6=E6=AE=B5=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_un_work.html.erb | 62 +++++++++++++++++++ .../student_work/_evaluation_work.html.erb | 2 +- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index e69de29bb..4a70015de 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -0,0 +1,62 @@ + + \ No newline at end of file diff --git a/app/views/student_work/_evaluation_work.html.erb b/app/views/student_work/_evaluation_work.html.erb index b428d79f8..f8b9addbd 100644 --- a/app/views/student_work/_evaluation_work.html.erb +++ b/app/views/student_work/_evaluation_work.html.erb @@ -29,7 +29,7 @@ <%= student_work.user.user_extensions.nil? ? "--" : student_work.user.user_extensions.student_id%> <% else%> - -- + -- <% end%>
  • From 22d4499f8f7a7db48f02b4b0c8b04d1f14e068c1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 10:06:04 +0800 Subject: [PATCH 05/26] =?UTF-8?q?=E7=BC=BA=E8=AF=84=E3=80=81=E8=BF=9F?= =?UTF-8?q?=E4=BA=A4=E6=89=A3=E5=88=86=E8=BF=98=E6=98=AF=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=20=E7=9B=B4=E6=8E=A5=E6=89=A3=E5=A4=9A=E5=B0=91=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 4 ++-- app/controllers/student_work_controller.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 293346365..bab2cbf12 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -218,11 +218,11 @@ class HomeworkCommonController < ApplicationController #关闭匿评 def stop_anonymous_comment @homework_detail_manual.update_column('comment_status', 3) - #计算缺评扣分---->计算缺评数量 + #计算缺评扣分 work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" @homework.student_works.each do |student_work| absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count - student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count : 0 + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 student_work.save end diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index a039038e2..cc51e5cf7 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -116,7 +116,7 @@ class StudentWorkController < ApplicationController render_attachment_warning_if_needed(student_work) #提交作品时,计算是否迟交 if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(Time.now.to_s).strftime("%Y-%m-%d") - student_work.late_penalty = 1 + student_work.late_penalty = @homework.late_penalty else student_work.late_penalty = 0 end From 1ed1957899ff2aac8d6ff572ea67bb0a51bd7cdd Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 10:21:01 +0800 Subject: [PATCH 06/26] =?UTF-8?q?=E6=95=99=E8=BE=85=E8=AF=84=E5=88=86?= =?UTF-8?q?=E3=80=81=E7=B3=BB=E7=BB=9F=E8=AF=84=E5=88=86=E3=80=81=E5=AD=A6?= =?UTF-8?q?=E7=94=9F=E5=8C=BF=E8=AF=84=20=E6=AF=94=E4=BE=8B=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 1 - app/controllers/users_controller.rb | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index bab2cbf12..fa2ce04cf 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -156,7 +156,6 @@ class HomeworkCommonController < ApplicationController if @homework.homework_type == 2 @homework.homework_detail_programing ||= HomeworkDetailPrograming.new @homework_detail_programing = @homework.homework_detail_programing - @homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6 @homework_detail_programing.language = params[:language_type].to_i @homework.homework_tests.delete_all diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 4796d0c0c..59a50a904 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -444,7 +444,7 @@ class UsersController < ApplicationController homework.end_time = params[:homework_common][:end_time] || Time.now homework.publish_time = Time.now homework.homework_type = params[:homework_type].to_i || 1 - homework.late_penalty = 2 + homework.late_penalty = 10 homework.user_id = User.current.id homework.course_id = params[:course_id] @@ -452,19 +452,19 @@ class UsersController < ApplicationController render_attachment_warning_if_needed(homework) homework_detail_manual = HomeworkDetailManual.new - homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6 + homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.2 homework_detail_manual.comment_status = 1 homework_detail_manual.evaluation_start = Time.now homework_detail_manual.evaluation_end = Time.now homework_detail_manual.evaluation_num = params[:evaluation_num] || 3 - homework_detail_manual.absence_penalty = 2 + homework_detail_manual.absence_penalty = 5 homework.homework_detail_manual = homework_detail_manual #编程作业相关属性 if homework.homework_type == 2 homework_detail_programing = HomeworkDetailPrograming.new homework.homework_detail_programing = homework_detail_programing - homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6 + homework_detail_programing.ta_proportion = 0.5 homework_detail_programing.language = params[:language_type].to_i inputs = params[:program][:input] From 84bb5af86f3252cc0ec8c900407d8e07bdebc371 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 10:24:37 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=95=99=E5=B8=88?= =?UTF-8?q?=E4=BC=98=E5=85=88=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 1 + .../20150917022239_add_teacher_priority_to_homework.rb | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 db/migrate/20150917022239_add_teacher_priority_to_homework.rb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 59a50a904..cf6305e4d 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -445,6 +445,7 @@ class UsersController < ApplicationController homework.publish_time = Time.now homework.homework_type = params[:homework_type].to_i || 1 homework.late_penalty = 10 + homework.teacher_priority = 1 homework.user_id = User.current.id homework.course_id = params[:course_id] diff --git a/db/migrate/20150917022239_add_teacher_priority_to_homework.rb b/db/migrate/20150917022239_add_teacher_priority_to_homework.rb new file mode 100644 index 000000000..20ab421bc --- /dev/null +++ b/db/migrate/20150917022239_add_teacher_priority_to_homework.rb @@ -0,0 +1,5 @@ +class AddTeacherPriorityToHomework < ActiveRecord::Migration + def change + add_column :homework_commons,:teacher_priority,:integer,:default => 1 + end +end From 3573179403b53eb0dd3b30ed4927c8064a804f57 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 10:32:41 +0800 Subject: [PATCH 08/26] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E5=88=97=E8=A1=A8=20=20=E6=A0=87=E9=A2=98=E5=A4=B4=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AF=B9=E9=BD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_title.html.erb | 2 +- public/stylesheets/courses.css | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/student_work/_evaluation_title.html.erb b/app/views/student_work/_evaluation_title.html.erb index f7d2904a7..bb1919472 100644 --- a/app/views/student_work/_evaluation_title.html.erb +++ b/app/views/student_work/_evaluation_title.html.erb @@ -1,5 +1,5 @@
      -
    • +
    • 作品信息
    • diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index f46607967..adad76d3d 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -61,6 +61,7 @@ a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-rep .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;} .width620{width: 620px;} +.width625{width: 625px;} .width455{width: 455px;} .m_width620{max-width: 620px;} From efdd717c3c555c2d7c9317b4992c7d5bd7c19c75 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 11:41:24 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E6=88=90=E7=BB=A9=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E7=AE=97=E6=B3=95=E7=9A=84=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 101 +++++++++++++++++++++ app/views/student_work/index.html.erb | 2 +- 2 files changed, 102 insertions(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index cc51e5cf7..cf61f7d12 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -580,4 +580,105 @@ class StudentWorkController < ApplicationController end JSON.parse(res.body) end + + #成绩计算 + def set_final_score + homework = HomeworkCommon.first + student_work = StudentWork.first + if homework && homework.homework_detail_manual + if homework.homework_type == 1 #匿评作业 + if homework.teacher_priority == 1 #教师优先 + if student_work.teacher_score + student_work.final_score = student_work.teacher_score + else + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.student_score + elsif student_work.student_score.nil? + student_work.final_score = student_work.teaching_asistant_score + else + ta_proportion = homework.homework_detail_manual.ta_proportion + final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}") + final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_ta_score + final_s_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + else #不考虑教师评分 + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.student_score + elsif student_work.student_score.nil? + student_work.final_score = student_work.teaching_asistant_score + else + ta_proportion = homework.homework_detail_manual.ta_proportion + final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}") + final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_ta_score + final_s_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空 + if homework.teacher_priority == 1 #教师优先 + if student_work.teacher_score + student_work.final_score = student_work.teacher_score + else + if student_work.teaching_asistant_score.nil? #教辅未评分 + if student_work.student_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + elsif student_work.student_score.nil? #学生未评分 + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_ts_score + student_work.final_score = format("%.2f",final_score.to_f) + end + else + final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")) + final_score = final_sy_score + final_ts_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + else #不考虑教师评分 + if student_work.teaching_asistant_score.nil? #教辅未评分 + if student_work.student_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + elsif student_work.student_score.nil? #学生未评分 + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_ts_score + student_work.final_score = format("%.2f",final_score.to_f) + end + else + final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")) + final_score = final_sy_score + final_ts_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + end + end + end end \ 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 665cbc0f7..409c064c8 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -86,7 +86,7 @@ <% end%>
      -
      +
      <% end%>
  • From 53d6c6853d769df57c20c88e5befea71079040a1 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 14:16:13 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 39 ++++++++++++++------ app/views/student_work/index.html.erb | 41 ++++++++++++---------- 2 files changed, 51 insertions(+), 29 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index cf61f7d12..a3f02cbb9 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -72,12 +72,29 @@ class StudentWorkController < ApplicationController query.update_attributes(:viewed => true) end end - ################################################################################################################## - @stundet_works = @homework.student_works + @order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group] @homework_commons = @course.homework_commons.order("created_at desc") - @is_teacher = User.current.allowed_to?(:as_teacher,@course) + @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? @is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 + if @is_teacher #老师 || 超级管理员 显示所有列表 + @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 + @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) + elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 + my_work = @homework.student_works.where(:user_id => User.current.id) + @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} + elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前只看到自己的,提交了作品看到所有的 + my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) + if my_work.empty? + @stundet_works = [] + else + @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + end + else + @stundet_works = [] + end + @score = @b_sort == "desc" ? "asc" : "desc" respond_to do |format| format.html @@ -415,10 +432,14 @@ class StudentWorkController < ApplicationController #根据条件过滤作业结果 def search_homework_member homeworks,name - name = name.downcase - select_homework = homeworks.select{ |homework| - homework.user[:login].to_s.downcase.include?(name) || homework.user.user_extensions[:student_id].to_s.downcase.include?(name) || (homework.user[:lastname].to_s.downcase + homework.user[:firstname].to_s.downcase).include?(name) - } + if name == "" + select_homework = homeworks + else + name = name.downcase + select_homework = homeworks.select{ |homework| + homework.user[:login].to_s.downcase.include?(name) || homework.user.user_extensions[:student_id].to_s.downcase.include?(name) || (homework.user[:lastname].to_s.downcase + homework.user[:firstname].to_s.downcase).include?(name) + } + end select_homework end @@ -582,9 +603,7 @@ class StudentWorkController < ApplicationController end #成绩计算 - def set_final_score - homework = HomeworkCommon.first - student_work = StudentWork.first + def set_final_score homework,student_work if homework && homework.homework_detail_manual if homework.homework_type == 1 #匿评作业 if homework.teacher_priority == 1 #教师优先 diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 409c064c8..4979c5c95 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -38,19 +38,22 @@
    -
    -
    + + <% end%>
    @@ -58,14 +61,14 @@
    - 所有作品 - [共199份] - + <%= link_to "所有作品[共#{@homework.student_works.count}份]".html_safe,student_work_index_path(:homework => @homework.id),:class => "fl f14"%> -
    - - -
    + <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3%> +
    + + +
    + <% end%>
    From 47cdf1231d8d748c6cdb78767666cb2995267265 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 14:26:41 +0800 Subject: [PATCH 11/26] =?UTF-8?q?=E5=8C=BF=E8=AF=84=E8=AF=84=E5=88=86?= =?UTF-8?q?=EF=BC=8C=E6=88=90=E7=BB=A9=E6=8F=90=E7=A4=BA=E6=A1=86=E7=9A=84?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_un_work.html.erb | 28 ++++++++++++++----- public/javascripts/course.js | 24 ++++------------ 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 4a70015de..232edc908 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -41,13 +41,12 @@ <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> <% end%> - -
  • +
  • <%= student_work.student_score.nil? ? "--" : format("%.1f",student_work.student_score)%> - <% unless student_work.student_score.nil? || student_work.homework_common.homework_type == 2%> - - (<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>) - + <% unless student_work.student_score.nil?%> + + (<%= student_work.student_works_scores.where(:reviewer_role => 3).count%>) +
    现共有  <%= student_work.student_works_scores.where(:reviewer_role => 3).count%>  @@ -58,5 +57,20 @@
  • -
  • 90
  • + <% score = student_work.respond_to?("score") ? student_work.score : student_work.final_score - student_work.absence_penalty - student_work.late_penalty%> +
  • + <%= score.nil? ? "--" : format("%.1f",score)%> + <% unless score.nil?%> +
    + 作品最终评分为 +  <%= student_work.final_score%> 分。 + 迟交扣分 +  <%= student_work.late_penalty%> 分, + 缺评扣分 +  <%= student_work.absence_penalty%> 分, + 最终成绩为 +  <%= format("%.1f",score)%> 分。 +
    + <% end%> +
  • \ No newline at end of file diff --git a/public/javascripts/course.js b/public/javascripts/course.js index fc52ef87a..ea9501371 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -881,39 +881,27 @@ function goTopEx() { $(function(){ //匿评评分提示 - $(".student_score_info").bind("mouseover",function(e){ - //alert($(this).html()); + $(".student_score_info").live("mouseover",function(){ $(this).find("div").show(); - //$(this).find("div").css("top",e.pageY); - //$(this).find("div").css("left",e.pageX); }); - $(".student_score_info").bind("mouseout",function(e){ - //alert($(this).html()); + $(".student_score_info").live("mouseout",function(){ $(this).find("div").hide(); }); //最终成绩提示 - $(".student_final_scor_info").bind("mouseover",function(e){ - //alert($(this).html()); + $(".student_final_scor_info").live("mouseover",function(){ $(this).find("div").show(); - //$(this).find("div").css("top",e.pageY); - //$(this).find("div").css("left",e.pageX); }); - $(".student_final_scor_info").bind("mouseout",function(e){ - //alert($(this).html()); + $(".student_final_scor_info").live("mouseout",function(){ $(this).find("div").hide(); }); $("#about_project label").eq(1).remove(); //附件下载提示 - $(".zip_download_alert").bind("mouseover",function(e){ - //alert($(this).html()); + $(".zip_download_alert").bind("mouseover",function(){ $(this).next("div").show(); - //$(this).next("div").css("top",e.pageY); - //$(this).next("div").css("left",e.pageX); }); - $(".zip_download_alert").bind("mouseout",function(e){ - //alert($(this).html()); + $(".zip_download_alert").bind("mouseout",function(){ $(this).next("div").hide(); }); }); From c4abe6b413451aceac79560997fbad19e9275ca8 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 16:04:16 +0800 Subject: [PATCH 12/26] =?UTF-8?q?shou=E9=A1=B5=E9=9D=A2=E7=9A=84=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BB=A5=E5=8F=8A=E7=95=99=E8=A8=80=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 3 +- app/views/student_work/_jour_replay.html.erb | 4 +- app/views/student_work/_show.html.erb | 134 +++++++++--------- .../student_work/_student_work_score.html.erb | 29 ++-- .../student_work/_work_attachments.html.erb | 6 +- app/views/student_work/index.html.erb | 4 + app/views/student_work/show.js.erb | 22 +-- public/stylesheets/courses.css | 14 +- 8 files changed, 115 insertions(+), 101 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index a3f02cbb9..91a6fb706 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -191,7 +191,8 @@ class StudentWorkController < ApplicationController def show @score = student_work_score @work,User.current - @is_teacher = User.current.allowed_to?(:as_teacher,@course) + @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? + @student_work_scores = @work.student_works_scores.order("updated_at desc") respond_to do |format| format.js end diff --git a/app/views/student_work/_jour_replay.html.erb b/app/views/student_work/_jour_replay.html.erb index 77fb476bf..4b594d7f4 100644 --- a/app/views/student_work/_jour_replay.html.erb +++ b/app/views/student_work/_jour_replay.html.erb @@ -6,9 +6,9 @@ <% if jour.user==User.current || User.current.admin? %> <%= link_to(l(:label_bid_respond_delete), destroy_score_reply_student_work_index_path(:jour_id => jour.id), - :remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete), :class => "fr c_purple") %> + :remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete), :class => "fr linkBlue mr5") %> <% end %> - + <%=format_time jour.created_on %>
    diff --git a/app/views/student_work/_show.html.erb b/app/views/student_work/_show.html.erb index f6580659e..2aa14be71 100644 --- a/app/views/student_work/_show.html.erb +++ b/app/views/student_work/_show.html.erb @@ -1,72 +1,74 @@
    -
    -
      -
    • - 上交时间: - <%=format_time @work.created_at %> -
    • +
      +
        +
      • + 上交时间: + <%=format_time @work.created_at %> +
      • - <% if !@is_teacher && @work.user == User.current && (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 1) %> - -
      • - <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> -
      • -
      • - <%= link_to "",edit_student_work_path(@work),:class => "pic_edit"%> -
      • - <% end%> - <% if (@homework.homework_type != 1 || @homework.homework_detail_manual.comment_status == 3) && @work.user != User.current%> - -
      • - <%= render :partial => 'student_work_praise' %> -
      • - <% end%> -
        - - - - - - <% if @work.project%> -
      • - 关联项目: - <%= link_to( @work.project.name, project_path(@work.project.id), :class => "c_blue02" )%> -
      • - <% end%> -
      • - 内容: -
        - <%= text_format(@work.description) if @work.description%> -
        + <% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %> + +
      • + <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> +
      • +
      • + <%= link_to "",edit_student_work_path(@work),:class => "pic_edit"%> +
      • + <% end%> + <% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%> + +
      • + <%= render :partial => 'student_work_praise' %> +
      • + <% end%>
        - -
      • - 附件: - <% if @work.attachments.empty?%> - 尚未提交附件 - <% else%> -
        - <%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %> + + + + <% if @work.project%> +
      • + 关联项目: + <%= link_to( @work.project.name, project_path(@work.project.id), :class => "linkBlue" )%> +
      • + <% end%> + +
      • + 内容: +
        + <%= text_format(@work.description) if @work.description%> +
        +
        +
      • +
      • + 附件: + <% if @work.attachments.empty?%> + 尚未提交附件 + <% else%> +
        + <%= render :partial => 'work_attachments', :locals => {:attachments => @work.attachments} %> +
        + <% end%> +
        +
      • +
      • + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> + +
        + <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> +
        + <% end%> +
        +
      • +
      + +
      + <%@student_work_scores.each do |score|%> +
      + <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%>
      <% end%> - +
      + + 收起
      - - <% if @is_teacher || (@homework.homework_type == 1 && @homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> - -
      - <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> -
      - <% end%> -
    - -
    - <%@work.student_works_scores.order("updated_at desc").each do |score|%> -
    - <%= render :partial => 'student_work_score',:locals => {:score => score}%> -
    - <% end%> -
    -收起 -
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index 8d10853f8..d4d319fa2 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -1,22 +1,29 @@ - diff --git a/app/views/student_work/_work_attachments.html.erb b/app/views/student_work/_work_attachments.html.erb index f303897bc..a75f68f70 100644 --- a/app/views/student_work/_work_attachments.html.erb +++ b/app/views/student_work/_work_attachments.html.erb @@ -1,8 +1,8 @@ <% attachments.each_with_index do |attachment,i| %>
    - <%= link_to_short_attachment attachment, :class => 'link_file', :download => true -%> - <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author %> - (<%= number_to_human_size attachment.filesize %>) + <%= link_to_short_attachment attachment, :class => 'link_file_a fl', :download => true -%> + <%= link_to(' '.html_safe, attachment_path(attachment, :format => 'js'), :method => 'delete', :remote => true, :title => '删除', :class => 'remove-upload fl', :confirm => l(:text_are_you_sure)) if attachment.id && User.current == attachment.author %> + (<%= number_to_human_size attachment.filesize %>)
    <% end -%> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index 4979c5c95..fee601b5f 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -17,6 +17,10 @@ $('#ajax-modal').parent().addClass("anonymos"); }); <% end%> + +// $(function(){ +// $('.animated').autosize(); +// });
    diff --git a/app/views/student_work/show.js.erb b/app/views/student_work/show.js.erb index 1c8874c2f..e6b99c146 100644 --- a/app/views/student_work/show.js.erb +++ b/app/views/student_work/show.js.erb @@ -1,11 +1,11 @@ -if($("#about_hwork_<%= @work.id%>").children().length > 0) - {$("#about_hwork_<%= @work.id%>").html("");} -else - { - <% if @homework.homework_type == 2%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>"); - <% else%> - $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>"); - <% end%> - $('#score_<%= @work.id%>').peSlider({range: 'min'}); - } \ No newline at end of file +if($("#about_hwork_<%= @work.id%>").children().length > 0){ + $("#about_hwork_<%= @work.id%>").html(""); +} +else{ + <% if @homework.homework_type == 2%> + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show') %>"); + <% else%> + $("#about_hwork_<%= @work.id%>").html("<%= escape_javascript(render :partial => 'show') %>"); + <% end%> + $('#score_<%= @work.id%>').peSlider({range: 'min'}); +} \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index adad76d3d..72ccc33c1 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -692,15 +692,15 @@ a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;} .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; } +.hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:615px; height:35px;} +.ping_box{ width:676px; 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; } +.ping_text{border:1px solid #CCCCCC; margin:5px; padding:5px; width:610px; height:20px; } +.ping_back_tit{ float:left; width:578px; 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;} @@ -800,8 +800,8 @@ a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;} .T_C{ text-align:center;} .SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; } .SearchIcon:hover{background:url(../images/homepage_icon2.png) 676px -419px no-repeat; } -a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } -a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } +a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;} a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;} @@ -847,7 +847,7 @@ a.pro_mes_w{ height:20px; display:block; color:#999999;} .rside_work_con{ width:650px;} a.c_grey{ color:#999999;} a:hover.c_grey{ color:#333;} -.link_file{ display:block; max-width:300px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} +.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} .last_time{width:auto; text-align:right; margin-right:70px;} .link_file_box{ width:360px;} From f6f3d83c5ec93a37f5793b1b3024b8416ebdbd26 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 16:31:32 +0800 Subject: [PATCH 13/26] =?UTF-8?q?1=E3=80=81=E8=80=81=E5=B8=88=E3=80=81?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=89=93=E5=88=86=202=E3=80=81=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E5=8F=8A=E8=AF=84=E8=AE=BA=E7=9A=84=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 6 +- .../student_work/_add_score_reply.html.erb | 1 + .../student_work/_evaluation_un_work.html.erb | 2 +- .../student_work/_student_work_score.html.erb | 2 +- app/views/student_work/add_score.js.erb | 31 +----- app/views/student_work/add_score_reply.js.erb | 2 +- db/schema.rb | 99 +++++++------------ public/stylesheets/courses.css | 1 + 8 files changed, 49 insertions(+), 95 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 91a6fb706..ffec0a282 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -212,8 +212,9 @@ class StudentWorkController < ApplicationController #添加评分,已评分则为修改评分 def add_score + @is_last = params[:is_last] == "true" render_403 and return if User.current == @work.user #不可以匿评自己的作品 - @is_teacher = User.current.allowed_to?(:as_teacher,@course) + @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? #老师、教辅可以随时评分,学生只能在匿评作业的匿评阶段进行评分 render_403 and return unless @is_teacher || @homework.homework_detail_manual.comment_status == 2 @score = student_work_score @work,User.current @@ -254,7 +255,7 @@ class StudentWorkController < ApplicationController when 3 #学生评分 学生评分显示平均分 @work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f end - + set_final_score @homework,@work if @work.save respond_to do |format| format.js @@ -266,6 +267,7 @@ class StudentWorkController < ApplicationController #添加评分的回复 def add_score_reply @score = StudentWorksScore.find params[:score_id] + @is_last = params[:is_last] == "true" @jour = @score.journals_for_messages.new(:user_id => User.current.id,:notes =>params[:message], :reply_id => 0) if @jour.save @status = 1 diff --git a/app/views/student_work/_add_score_reply.html.erb b/app/views/student_work/_add_score_reply.html.erb index 2866b2da6..417d3d2c1 100644 --- a/app/views/student_work/_add_score_reply.html.erb +++ b/app/views/student_work/_add_score_reply.html.erb @@ -1,4 +1,5 @@ <%= form_for('', :remote => true, :method => :post,:url => add_score_reply_student_work_index_path(:score_id => score.id)) do |f|%> <%= f.text_area 'message', :class => 'ping_text', :placeholder => l(:text_caracters_maximum,:count=>250),:maxlength => 250 %> + 回复 <% end%> \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index 232edc908..a170f39ab 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -61,7 +61,7 @@
  • <%= score.nil? ? "--" : format("%.1f",score)%> <% unless score.nil?%> -
    +
    作品最终评分为  <%= student_work.final_score%> 分。 迟交扣分 diff --git a/app/views/student_work/_student_work_score.html.erb b/app/views/student_work/_student_work_score.html.erb index d4d319fa2..c800ae8d0 100644 --- a/app/views/student_work/_student_work_score.html.erb +++ b/app/views/student_work/_student_work_score.html.erb @@ -25,7 +25,7 @@
    - <%= render :partial => 'add_score_reply',:locals => {:score => score}%> + <%= render :partial => 'add_score_reply',:locals => {:score => score,:is_last => is_last}%>
    diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb index 1de92b51a..6cb5bd6d8 100644 --- a/app/views/student_work/add_score.js.erb +++ b/app/views/student_work/add_score.js.erb @@ -2,39 +2,16 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti $('#score_<%= @work.id%>').peSlider({range: 'min'}); <% if @is_new%> - $("#score_list_<%= @work.id%>").prepend("
    <%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>
    "); + $("#score_list_<%= @work.id%>").find("div:last").find("ul").addClass("ping_line"); + $("#score_list_<%= @work.id%>").prepend("
    <%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => true}) %>
    "); <% else %> - $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score}) %>"); + $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>"); <% end%> $("#score_list_<%= @work.id%>").removeAttr("style"); <% if @is_teacher %> - <% if @homework.homework_type == 1%> - $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>"); - <% elsif @homework.homework_type == 2%> - $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_student_work',:locals => {:student_work => @work}) %>"); - <% else%> - $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'student_work',:locals => {:student_work => @work}) %>"); - <% end%> + $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_un_work',:locals => {:student_work => @work}) %>"); <% else %> $("#student_work_<%= @work.id%>").replaceWith("<%= escape_javascript(render :partial => 'evaluation_work',:locals => {:student_work => @work}) %>"); <% end%> - - -$(function(){ - //匿评评分提示 - $(".student_score_info").bind("mouseover",function(e){ - $(this).find("div").show(); - }); - $(".student_score_info").bind("mouseout",function(e){ - $(this).find("div").hide(); - }); - //最终成绩提示 - $(".student_final_scor_info").bind("mouseover",function(e){ - $(this).find("div").show(); - }); - $(".student_final_scor_info").bind("mouseout",function(e){ - $(this).find("div").hide(); - }); -}); diff --git a/app/views/student_work/add_score_reply.js.erb b/app/views/student_work/add_score_reply.js.erb index 28704630f..f21870cd5 100644 --- a/app/views/student_work/add_score_reply.js.erb +++ b/app/views/student_work/add_score_reply.js.erb @@ -1,4 +1,4 @@ -$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score}) %>"); +$("#add_score_reply_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'add_score_reply', :locals => {:score => @score,:is_last => @is_last}) %>"); <% if @status && @status == 1%> $("#replay_histroy_<%= @score.id%>").prepend("<%= escape_javascript(render :partial => 'jour_replay', :locals => {:jour => @jour}) %>"); $("#add_score_reply_<%= @score.id%>").hide(); diff --git a/db/schema.rb b/db/schema.rb index b696765f8..772c68cf5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150911064528) do +ActiveRecord::Schema.define(:version => 20150917022239) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -236,13 +236,6 @@ ActiveRecord::Schema.define(:version => 20150911064528) do t.boolean "tracker_in_review_dialog", :default => false end - create_table "code_review_user_settings", :force => true do |t| - t.integer "user_id", :default => 0, :null => false - t.integer "mail_notification", :default => 0, :null => false - t.datetime "created_at" - t.datetime "updated_at" - end - create_table "code_reviews", :force => true do |t| t.integer "project_id" t.integer "change_id" @@ -476,13 +469,6 @@ ActiveRecord::Schema.define(:version => 20150911064528) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" - create_table "discuss_demos", :force => true do |t| - t.string "title" - t.text "body" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -497,26 +483,23 @@ ActiveRecord::Schema.define(:version => 20150911064528) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :primary_key => "Num", :force => true do |t| - t.string "Defect", :limit => 50 - t.string "Category", :limit => 50 - t.string "File" - t.string "Method" - t.string "Module", :limit => 20 - t.string "Variable", :limit => 50 - t.integer "StartLine" - t.integer "IPLine" - t.string "IPLineCode", :limit => 200 - t.string "Judge", :limit => 15 - t.integer "Review", :limit => 1 + create_table "dts", :force => true do |t| + t.string "IPLineCode" t.string "Description" - t.text "PreConditions", :limit => 2147483647 - t.text "TraceInfo", :limit => 2147483647 - t.text "Code", :limit => 2147483647 + t.string "Num" + t.string "Variable" + t.string "TraceInfo" + t.string "Method" + t.string "File" + t.string "IPLine" + t.string "Review" + t.string "Category" + t.string "Defect" + t.string "PreConditions" + t.string "StartLine" t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "id", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false end create_table "enabled_modules", :force => true do |t| @@ -619,11 +602,12 @@ ActiveRecord::Schema.define(:version => 20150911064528) do t.text "description" t.date "publish_time" t.date "end_time" - t.integer "homework_type", :default => 1 + t.integer "homework_type", :default => 1 t.string "late_penalty" t.integer "course_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "teacher_priority", :default => 1 end create_table "homework_detail_manuals", :force => true do |t| @@ -1179,18 +1163,18 @@ ActiveRecord::Schema.define(:version => 20150911064528) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :limit => 16777215, :null => false + t.string "subject", :null => false + t.text "content", :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -1215,19 +1199,6 @@ ActiveRecord::Schema.define(:version => 20150911064528) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" - create_table "rich_rich_files", :force => true do |t| - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.string "rich_file_file_name" - t.string "rich_file_content_type" - t.integer "rich_file_file_size" - t.datetime "rich_file_updated_at" - t.string "owner_type" - t.integer "owner_id" - t.text "uri_cache" - t.string "simplified_type", :default => "file" - end - create_table "roles", :force => true do |t| t.string "name", :limit => 30, :default => "", :null => false t.integer "position", :default => 1 @@ -1279,11 +1250,10 @@ ActiveRecord::Schema.define(:version => 20150911064528) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "project_id" t.integer "user_id" - t.string "description" end create_table "softapplications", :force => true do |t| @@ -1453,8 +1423,8 @@ ActiveRecord::Schema.define(:version => 20150911064528) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.string "technical_title" t.integer "identity" + t.string "technical_title" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1522,6 +1492,9 @@ ActiveRecord::Schema.define(:version => 20150911064528) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false + t.integer "level" + t.integer "file" + t.integer "issue" end create_table "user_statuses", :force => true do |t| diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 72ccc33c1..125016994 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -64,6 +64,7 @@ a.hworkSetting {background:url(../images/homepage_icon2.png) -10px -450px no-rep .width625{width: 625px;} .width455{width: 455px;} .m_width620{max-width: 620px;} +.width180{width: 180px;} /*邮件邀请*/ From 9c20368274f1ff54f4d9e67153db42a64db24c97 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 16:53:38 +0800 Subject: [PATCH 14/26] =?UTF-8?q?1=E3=80=81=E7=B3=BB=E7=BB=9F=E8=AF=84?= =?UTF-8?q?=E5=88=86=E7=9A=84=E6=97=B6=E5=80=99=E5=AF=B9=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E8=B5=8B=E5=80=BC=202=E3=80=81=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E9=94=99=E8=AF=AF=E7=9A=84=E7=BC=96=E7=A8=8B=E5=BE=97?= =?UTF-8?q?=E5=88=86=E8=AE=A1=E7=AE=97=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 41 ---------------------- app/models/student_work.rb | 1 + config/routes.rb | 2 +- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index ffec0a282..d076481d3 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -8,7 +8,6 @@ class StudentWorkController < ApplicationController before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work] before_filter :author_of_work, :only => [:edit, :update, :destroy] before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list] - protect_from_forgery :except => :set_program_score ### def program_test @@ -360,46 +359,6 @@ class StudentWorkController < ApplicationController end end - #设置编程作业得分 - def set_program_score - stundet_work = StudentWork.find_by_id params[:student_work_id] - @course = stundet_work.homework_common.course - student_score_count = 0 - if stundet_work && params[:results] && params[:results].class.to_s == "Array" - homework_common = stundet_work.homework_common - params[:results].each do |result| - homework_tests = homework_common.homework_tests.where("input = '#{result[:input]}' AND output = '#{result[:output]}'") - homework_tests.each do |homework_test| - student_work_test = StudentWorkTest.new - student_work_test.student_work = stundet_work - student_work_test.homework_test = homework_test - student_work_test.result = result[:status] - if student_work_test.result == 0 - student_score_count += 1 - end - student_work_test.error_msg = params[:compile_error_msg] - student_work_test.save! - end - end - unless homework_common.homework_tests.empty? - stundet_work.student_score = student_score_count * 100.0 / homework_common.homework_tests.count - - if stundet_work.teacher_score.nil? - if stundet_work.teaching_asistant_score.nil? - stundet_work.final_score = stundet_work.student_score - else - final_ta_score = BigDecimal.new("#{stundet_work.teaching_asistant_score}") * BigDecimal.new("#{homework_common.homework_detail_programing.ta_proportion}") - final_s_score = BigDecimal.new("#{stundet_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework_common.homework_detail_programing.ta_proportion}")) - final_score = final_ta_score + final_s_score - stundet_work.final_score = format("%.1f",final_score.to_f) - end - end - - stundet_work.save! - end - end - end - private #获取作业 def find_homework diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 0a5c1b65c..83a701f43 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -31,6 +31,7 @@ class StudentWork < ActiveRecord::Base else self.system_score = last_test.test_score end + self.final_score = self.system_score end end diff --git a/config/routes.rb b/config/routes.rb index 1d2393764..96b193862 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -119,7 +119,7 @@ RedmineApp::Application.routes.draw do get 'student_work_absence_penalty' get 'absence_penalty_list' get 'evaluation_list' - post 'set_program_score' + # post 'set_program_score' post 'program_test' end end From b8cb422268fa43482531d4185f001e0113a66305 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 17:06:08 +0800 Subject: [PATCH 15/26] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +++- .../_evaluation_un_title.html.erb | 30 ++++++++++++------- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index d076481d3..4264f1439 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -76,19 +76,22 @@ class StudentWorkController < ApplicationController @homework_commons = @course.homework_commons.order("created_at desc") @is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin? @is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评 + @show_all = false if @is_teacher #老师 || 超级管理员 显示所有列表 @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + @show_all = true elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的 @stundet_works = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) elsif @homework.homework_detail_manual.comment_status == 2 #学生 && 开启匿评 看到匿评列表 my_work = @homework.student_works.where(:user_id => User.current.id) @stundet_works = my_work + User.current.student_works_evaluation_distributions.map(&:student_work).select { |work| work.homework_common_id == @homework.id} - elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前只看到自己的,提交了作品看到所有的 + elsif @homework.homework_detail_manual.comment_status == 3 #学生 && 关闭匿评 未提交作品之前列表为空,提交了作品看到所有的 my_work = @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").where(:user_id => User.current.id) if my_work.empty? @stundet_works = [] else @stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name + @show_all = true end else @stundet_works = [] diff --git a/app/views/student_work/_evaluation_un_title.html.erb b/app/views/student_work/_evaluation_un_title.html.erb index fa2383d48..8ca855e9b 100644 --- a/app/views/student_work/_evaluation_un_title.html.erb +++ b/app/views/student_work/_evaluation_un_title.html.erb @@ -3,25 +3,35 @@ 作品信息
  • - 教师评分 - + <%= link_to "教师评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <% if @show_all && @order == "teacher_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teacher_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%> + <% end%>
  • - 教辅评分 - + <%= link_to "教辅评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <% if @show_all && @order == "teaching_asistant_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "teaching_asistant_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%> + <% end%>
  • <% if @homework.homework_type == 2%>
  • - 系统评分 - + <%= link_to "系统评分",@show_all ? student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <% if @show_all && @order == "system_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "system_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%> + <% end%>
  • <% end%>
  • - 匿评 - + <%= link_to "匿评",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <% if @show_all && @order == "student_score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%> + <% end%>
  • - 成绩 - + <%= link_to "成绩",@show_all ? student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml10"%> + <% if @show_all && @order == "score"%> + <%= link_to "", student_work_index_path(:homework => @homework.id,:order => "score", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt19"%> + <% end%>
  • \ No newline at end of file From cc7a752623b3ff1eebd4f9adf3eb87321da89b59 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 17:20:29 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E5=88=B0=E5=A4=84=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E3=80=81=E7=BC=BA=E8=AF=84=E3=80=81=E5=8C=BF=E8=AF=84=E3=80=81?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 29 +++++----------------- app/views/student_work/index.html.erb | 21 +++++++++++++--- public/javascripts/course.js | 14 +++++------ 3 files changed, 30 insertions(+), 34 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 4264f1439..c2a76fb4f 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -415,25 +415,7 @@ class StudentWorkController < ApplicationController sheet1 = book.create_worksheet :name => "homework" blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10 sheet1.row(0).default_format = blue - if @homework.homework_type == 0 #普通作业 - sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), - l(:excel_t_score),l(:excel_ta_score),l(:excel_f_score),l(:excel_commit_time)]) - count_row = 1 - items.each do |homework| - sheet1[count_row,0]=homework.user.id - sheet1[count_row,1] = homework.user.lastname.to_s + homework.user.firstname.to_s - sheet1[count_row,2] = homework.user.login - sheet1[count_row,3] = homework.user.user_extensions.student_id - sheet1[count_row,4] = homework.user.mail - sheet1[count_row,5] = homework.name - sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) - sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) - # sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,8] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) - sheet1[count_row,9] = format_time(homework.created_at) - count_row += 1 - end - elsif @homework.homework_type == 1 #匿评作业 + if @homework.homework_type == 1 #匿评作业 sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), l(:excel_t_score),l(:excel_ta_score), l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)]) count_row = 1 @@ -453,7 +435,7 @@ class StudentWorkController < ApplicationController end elsif @homework.homework_type == 2 #编程作业 sheet1.row(0).concat([l(:excel_user_id),l(:excel_user_name),l(:excel_nickname),l(:excel_student_id),l(:excel_mail),l(:excel_homework_name), - l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_f_score),l(:excel_commit_time)]) + l(:excel_t_score),l(:excel_ta_score), l(:excel_s_score),l(:excel_n_score),l(:excel_f_score),l(:excel_commit_time)]) count_row = 1 items.each do |homework| sheet1[count_row,0]=homework.user.id @@ -464,9 +446,10 @@ class StudentWorkController < ApplicationController sheet1[count_row,5] = homework.name sheet1[count_row,6] = homework.teacher_score.nil? ? l(:label_without_score) : format("%.2f",homework.teacher_score) sheet1[count_row,7] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : format("%.2f",homework.teaching_asistant_score) - sheet1[count_row,8] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) - sheet1[count_row,9] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) - sheet1[count_row,10] = format_time(homework.created_at) + sheet1[count_row,8] = homework.system_score.nil? ? l(:label_without_score) : format("%.2f",homework.system_score) + sheet1[count_row,9] = homework.student_score.nil? ? l(:label_without_score) : format("%.2f",homework.student_score) + sheet1[count_row,10] = homework.respond_to?("score") ? homework.score.nil? ? l(:label_without_score) : format("%.2f",homework.score) : l(:label_without_score) + sheet1[count_row,11] = format_time(homework.created_at) count_row += 1 end end diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index fee601b5f..fcd70fe83 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -48,10 +48,23 @@
    • -
    • 导出作业成绩
    • -
    • 导出作业附件
    • -
    • 导出缺评情况
    • -
    • 导出匿评情况
    • +
    • + <%= link_to "导出作业成绩", student_work_index_path(:homework => @homework.id,:order => @order, :sort => @b_sort, :name => @name, :format => 'xls'),:class=>'hworkExport postTypeGrey'%> +
    • +
    • + <% if @homework.student_works.empty?%> + <%= link_to "导出作业附件", "javascript:void(0)", class: "hworkExport resourcesGrey", :onclick => "alert('没有学生提交作业,无法下载附件')" %> + <% else%> + <%= link_to "导出作业附件", zipdown_assort_path(obj_class: @homework.class, obj_id: @homework, format: :json), + remote: true, class: "hworkExport resourcesGrey", :id => "download_homework_attachments" %> + <% end%> +
    • +
    • + <%= link_to("导出缺评情况", absence_penalty_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey') if @homework.homework_type == 1%> +
    • +
    • + <%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey') if @homework.homework_type == 1%> +
    • 评分设置
  • diff --git a/public/javascripts/course.js b/public/javascripts/course.js index ea9501371..2882ccdcc 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -897,13 +897,13 @@ $(function(){ $("#about_project label").eq(1).remove(); - //附件下载提示 - $(".zip_download_alert").bind("mouseover",function(){ - $(this).next("div").show(); - }); - $(".zip_download_alert").bind("mouseout",function(){ - $(this).next("div").hide(); - }); + ////附件下载提示 + //$(".zip_download_alert").bind("mouseover",function(){ + // $(this).next("div").show(); + //}); + //$(".zip_download_alert").bind("mouseout",function(){ + // $(this).next("div").hide(); + //}); }); //匿评弹框取消按钮 From 7cc5ce92c68c390c7d1c70afcc15a1f9aa827565 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 20:20:20 +0800 Subject: [PATCH 17/26] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=AF=84=E5=88=86?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E8=AE=BE=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 50 ++++++++++++++- app/helpers/student_work_helper.rb | 27 ++++++++ .../student_work/_set_score_rule.html.erb | 63 +++++++++++++++++++ app/views/student_work/index.html.erb | 17 +++-- config/routes.rb | 1 + public/javascripts/course.js | 29 ++++++--- public/stylesheets/public.css | 6 +- 7 files changed, 176 insertions(+), 17 deletions(-) create mode 100644 app/views/student_work/_set_score_rule.html.erb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index c2a76fb4f..b65fc2743 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -3,11 +3,11 @@ class StudentWorkController < ApplicationController include StudentWorkHelper require 'bigdecimal' require "base64" - before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test] + before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule] before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work] before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work] before_filter :author_of_work, :only => [:edit, :update, :destroy] - before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list] + before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :set_score_rule] ### def program_test @@ -362,6 +362,50 @@ class StudentWorkController < ApplicationController end end + #设置评分规则 + def set_score_rule + homework_detail_manual = @homework.homework_detail_manual + homework_detail_programing = @homework.homework_detail_programing + + unless @homework.late_penalty.to_s == params[:late_penalty].to_s + @homework.late_penalty = params[:late_penalty] + @homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work| + student_work.late_penalty = @homework.late_penalty + student_work.save + end + end + + unless homework_detail_manual.absence_penalty.to_s == params[:absence_penalty].to_s + homework_detail_manual.absence_penalty = params[:absence_penalty] + if homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值 + work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" + @homework.student_works.each do |student_work| + absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 + student_work.save + end + end + end + + teacher_priority = params[:teacher_priority] ? 1 : 0 + if homework_detail_manual.ta_proportion.to_s != params[:ta_proportion].to_s || @homework.teacher_priority.to_s != teacher_priority.to_s || (homework_detail_programing && homework_detail_programing.ta_proportion.to_s != params[:sy_proportion].to_s) + homework_detail_manual.ta_proportion = params[:ta_proportion] + homework_detail_programing.ta_proportion = params[:sy_proportion] if homework_detail_programing + @homework.teacher_priority = teacher_priority + @homework.student_works.each do |student_work| + set_final_score @homework,student_work + student_work.save + end + end + + @homework.save + homework_detail_manual.save if homework_detail_manual + homework_detail_programing.save if homework_detail_programing + respond_to do |format| + format.html{redirect_to student_work_index_url(:homework => @homework.id)} + end + end + private #获取作业 def find_homework @@ -392,7 +436,7 @@ class StudentWorkController < ApplicationController end def teacher_of_course - render_403 unless User.current.allowed_to?(:as_teacher,@course) + render_403 unless User.current.allowed_to?(:as_teacher,@course) || User.current.admin? end #根据条件过滤作业结果 diff --git a/app/helpers/student_work_helper.rb b/app/helpers/student_work_helper.rb index aa359e273..834b8dd61 100644 --- a/app/helpers/student_work_helper.rb +++ b/app/helpers/student_work_helper.rb @@ -99,4 +99,31 @@ module StudentWorkHelper end result end + + #教辅评分比例下拉框 + def ta_proportion_option + type = [] + i = 0 + while i <= 100 + option = [] + option << i.to_s + "%" + option << i.to_f / 100 + type << option + i += 10 + end + type + end + + def ta_proportion_option_to num + type = [] + i = 0 + while i <= num + option = [] + option << i.to_s + "%" + option << i.to_f / 100 + type << option + i += 10 + end + type + end end \ No newline at end of file diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb new file mode 100644 index 000000000..97deafde8 --- /dev/null +++ b/app/views/student_work/_set_score_rule.html.erb @@ -0,0 +1,63 @@ +<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%> +
    + 评分设置 +
    + 迟交扣分 + +
    +
    + 缺评扣分 + +
    + + <% if homework.homework_type == 2%> +
    + 系统评分 + <%= select_tag :sy_proportion,options_for_select(ta_proportion_option), {:class => "markPercentage"} %> +
    + + + <% else%> + + <% end%> + +
    + 教辅评分 + <%= select_tag :ta_proportion,options_for_select(ta_proportion_option,homework.homework_detail_manual.ta_proportion), {:class => "markPercentage"} %> +
    +
    + 学生匿评 + +
    +
    + 教师优先 + /> + 教师评分为最终评分 +
    +
    +
    + 确定 +
    +
    + 取消 +
    +
    +
    +
    +<% end%> diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb index fcd70fe83..9dfebefbb 100644 --- a/app/views/student_work/index.html.erb +++ b/app/views/student_work/index.html.erb @@ -18,9 +18,16 @@ }); <% end%> -// $(function(){ -// $('.animated').autosize(); -// }); + //设置评分规则 + function set_score_rule(){ + $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework}) %>'); + showModal('ajax-modal', '350px'); + $('#ajax-modal').siblings().remove(); + $('#ajax-modal').before("" + + ""); + $('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed"); + } +
    @@ -65,7 +72,9 @@
  • <%= link_to("导出匿评情况", evaluation_list_student_work_index_path(:homework => @homework.id, :format => 'xls'),:class=>'hworkExport resourcesGrey') if @homework.homework_type == 1%>
  • -
  • 评分设置
  • +
  • + 评分设置 +
  • diff --git a/config/routes.rb b/config/routes.rb index 96b193862..756f744ae 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -121,6 +121,7 @@ RedmineApp::Application.routes.draw do get 'evaluation_list' # post 'set_program_score' post 'program_test' + post 'set_score_rule' end end diff --git a/public/javascripts/course.js b/public/javascripts/course.js index 2882ccdcc..43341658e 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -427,10 +427,10 @@ function regex_homework_name() } } -//处理迟交扣分 -function check_late_penalty() +//处理迟交、缺评扣分 +function check_late_penalty(id) { - var obj = $("input[name='late_penalty']"); + var obj = $("#" + id); var regex = /^\d+$/; if(regex.test(obj.val())) { @@ -499,11 +499,26 @@ $(function(){ $("#absence_penalty_notice").html(" "+ $("#absence_penalty").val() +" "); }); - $("#ta_proportion").change(function(){ - var ta_proportion = $("#ta_proportion").val(); - $("#student_proportion").val((100 - parseInt(ta_proportion * 100)) + "%"); - }); + //$("#ta_proportion").change(function(){ + // var ta_proportion = $("#ta_proportion").val(); + // $("#student_proportion").val((100 - parseInt(ta_proportion * 100)) + "%"); + //}); }); + +//生成select +function build_selector(max_num){ + var html = ""; + return html; +} + //第一次加载时,如果未开启匿评作业,隐藏显示匿评配置信息 $(function(){ if($("#homework_common_homework_type").attr("id") != null && $("#homework_common_homework_type").val() != 2) diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 4c5261e02..2305fe0ff 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -497,9 +497,9 @@ a.uploadIcon {background:url(../images/resource_icon_list.png) 8px -60px no-repe .uploadKeyword {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:280px;} /*评分设置弹窗*/ -.markPopup {width:290px; height:auto; border:3px solid #269ac9; padding:0px 0px 15px 15px; background-color:#ffffff; z-index:1000;} -.markInput {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:95px; color:#3d3c3c;} -.markPercentage {margin:10px 0; border:1px solid #e6e6e6; width:60px; height:30px; outline:none; font-size:12px; color:#3d3c3c;} +.markPopup {width:290px; height:auto; padding:5px 0px 15px 15px; background-color:#ffffff; z-index:1000;} +.markInput {margin-bottom:10px; outline:none; border:1px solid #e6e6e6; height:30px; width:140px; color:#3d3c3c;} +.markPercentage {margin:10px 0; border:1px solid #e6e6e6; width:70px; height:30px; outline:none; font-size:12px; color:#3d3c3c;} /*新个人主页框架css*/ From 5bdb1cd4613dc81584cebe287c017513e9e8f762 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 17 Sep 2015 20:33:36 +0800 Subject: [PATCH 18/26] =?UTF-8?q?1=E3=80=81=E5=90=AF=E5=8A=A8=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E3=80=81=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84=E6=97=B6?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86=E4=BD=8D=E7=BD=AE=202=E3=80=81?= =?UTF-8?q?=E7=BC=BA=E8=AF=84=E8=AF=84=E5=88=86=E8=AE=BE=E7=BD=AE=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- .../alert_anonymous_comment.js.erb | 2 +- db/schema.rb | 90 ++++++++++++------- 3 files changed, 61 insertions(+), 33 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index b65fc2743..79ad0d2d0 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -381,7 +381,7 @@ class StudentWorkController < ApplicationController work_ids = "(" + @homework.student_works.map(&:id).join(",") + ")" @homework.student_works.each do |student_work| absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count - student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * @homework_detail_manual.absence_penalty : 0 + student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0 student_work.save end end diff --git a/app/views/homework_common/alert_anonymous_comment.js.erb b/app/views/homework_common/alert_anonymous_comment.js.erb index 375b333f1..1c354aa45 100644 --- a/app/views/homework_common/alert_anonymous_comment.js.erb +++ b/app/views/homework_common/alert_anonymous_comment.js.erb @@ -3,4 +3,4 @@ showModal('ajax-modal', '500px'); $('#ajax-modal').siblings().remove(); $('#ajax-modal').before("" + ""); -$('#ajax-modal').parent().css("top","30%").css("left","30%"); \ No newline at end of file +$('#ajax-modal').parent().css("top","30%").css("left","30%").css("position","fixed"); \ No newline at end of file diff --git a/db/schema.rb b/db/schema.rb index 772c68cf5..9f3cdecca 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -236,6 +236,13 @@ ActiveRecord::Schema.define(:version => 20150917022239) do t.boolean "tracker_in_review_dialog", :default => false end + create_table "code_review_user_settings", :force => true do |t| + t.integer "user_id", :default => 0, :null => false + t.integer "mail_notification", :default => 0, :null => false + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "code_reviews", :force => true do |t| t.integer "project_id" t.integer "change_id" @@ -469,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150917022239) do add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" + create_table "discuss_demos", :force => true do |t| + t.string "title" + t.text "body" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "documents", :force => true do |t| t.integer "project_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false @@ -483,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150917022239) do add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["project_id"], :name => "documents_project_id" - create_table "dts", :force => true do |t| - t.string "IPLineCode" - t.string "Description" - t.string "Num" - t.string "Variable" - t.string "TraceInfo" - t.string "Method" + create_table "dts", :primary_key => "Num", :force => true do |t| + t.string "Defect", :limit => 50 + t.string "Category", :limit => 50 t.string "File" - t.string "IPLine" - t.string "Review" - t.string "Category" - t.string "Defect" - t.string "PreConditions" - t.string "StartLine" + t.string "Method" + t.string "Module", :limit => 20 + t.string "Variable", :limit => 50 + t.integer "StartLine" + t.integer "IPLine" + t.string "IPLineCode", :limit => 200 + t.string "Judge", :limit => 15 + t.integer "Review", :limit => 1 + t.string "Description" + t.text "PreConditions", :limit => 2147483647 + t.text "TraceInfo", :limit => 2147483647 + t.text "Code", :limit => 2147483647 t.integer "project_id" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at" + t.datetime "updated_at" + t.integer "id", :null => false end create_table "enabled_modules", :force => true do |t| @@ -1163,18 +1180,18 @@ ActiveRecord::Schema.define(:version => 20150917022239) do create_table "relative_memos", :force => true do |t| t.integer "osp_id" t.integer "parent_id" - t.string "subject", :null => false - t.text "content", :null => false + t.string "subject", :null => false + t.text "content", :limit => 16777215, :null => false t.integer "author_id" - t.integer "replies_count", :default => 0 + t.integer "replies_count", :default => 0 t.integer "last_reply_id" - t.boolean "lock", :default => false - t.boolean "sticky", :default => false - t.boolean "is_quote", :default => false - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - t.integer "viewed_count_crawl", :default => 0 - t.integer "viewed_count_local", :default => 0 + t.boolean "lock", :default => false + t.boolean "sticky", :default => false + t.boolean "is_quote", :default => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.integer "viewed_count_crawl", :default => 0 + t.integer "viewed_count_local", :default => 0 t.string "url" t.string "username" t.string "userhomeurl" @@ -1199,6 +1216,19 @@ ActiveRecord::Schema.define(:version => 20150917022239) do add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id" + create_table "rich_rich_files", :force => true do |t| + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + t.string "rich_file_file_name" + t.string "rich_file_content_type" + t.integer "rich_file_file_size" + t.datetime "rich_file_updated_at" + t.string "owner_type" + t.integer "owner_id" + t.text "uri_cache" + t.string "simplified_type", :default => "file" + end + create_table "roles", :force => true do |t| t.string "name", :limit => 30, :default => "", :null => false t.integer "position", :default => 1 @@ -1250,10 +1280,11 @@ ActiveRecord::Schema.define(:version => 20150917022239) do t.string "url" t.string "title" t.integer "share_type" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.integer "project_id" t.integer "user_id" + t.string "description" end create_table "softapplications", :force => true do |t| @@ -1423,8 +1454,8 @@ ActiveRecord::Schema.define(:version => 20150917022239) do t.integer "zip_code" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "identity" t.string "technical_title" + t.integer "identity" t.string "student_id" t.string "teacher_realname" t.string "student_realname" @@ -1492,9 +1523,6 @@ ActiveRecord::Schema.define(:version => 20150917022239) do t.integer "active" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.integer "level" - t.integer "file" - t.integer "issue" end create_table "user_statuses", :force => true do |t| From a8c5d180694d0f5b510c02573ce07869f95513ae Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 18 Sep 2015 09:32:25 +0800 Subject: [PATCH 19/26] =?UTF-8?q?1=E3=80=81=E4=B9=8B=E5=89=8D=E6=99=AE?= =?UTF-8?q?=E9=80=9A=E4=BD=9C=E4=B8=9A=E6=9B=B4=E6=94=B9=E4=B8=BA=E5=8C=BF?= =?UTF-8?q?=E8=AF=84=E4=BD=9C=E4=B8=9A=E3=80=82=E3=80=82=E3=80=82=202?= =?UTF-8?q?=E3=80=81=E7=B3=BB=E7=BB=9F=E8=AF=84=E5=88=86=E4=B8=BAnull?= =?UTF-8?q?=E6=97=B6=E9=BB=98=E8=AE=A4=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 12 +++++------ .../20150918004521_system_score_default.rb | 15 ++++++++++++++ .../20150918005722_about_normal_homework.rb | 20 +++++++++++++++++++ db/schema.rb | 4 ++-- 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20150918004521_system_score_default.rb create mode 100644 db/migrate/20150918005722_about_normal_homework.rb diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 79ad0d2d0..83128c45a 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -637,7 +637,7 @@ class StudentWorkController < ApplicationController student_work.final_score = student_work.system_score else ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2 - final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) final_score = final_sy_score + final_st_score student_work.final_score = format("%.2f",final_score.to_f) @@ -647,13 +647,13 @@ class StudentWorkController < ApplicationController student_work.final_score = student_work.system_score else ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2 - final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) final_score = final_sy_score + final_ts_score student_work.final_score = format("%.2f",final_score.to_f) end else - final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}") final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")) final_score = final_sy_score + final_ts_score + final_st_score @@ -666,7 +666,7 @@ class StudentWorkController < ApplicationController student_work.final_score = student_work.system_score else ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2 - final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) final_score = final_sy_score + final_st_score student_work.final_score = format("%.2f",final_score.to_f) @@ -676,13 +676,13 @@ class StudentWorkController < ApplicationController student_work.final_score = student_work.system_score else ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2 - final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{ta_proportion}") + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) final_score = final_sy_score + final_ts_score student_work.final_score = format("%.2f",final_score.to_f) end else - final_sy_score = BigDecimal.new("#{student_work.system_score}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}") final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")) final_score = final_sy_score + final_ts_score + final_st_score diff --git a/db/migrate/20150918004521_system_score_default.rb b/db/migrate/20150918004521_system_score_default.rb new file mode 100644 index 000000000..6195caad9 --- /dev/null +++ b/db/migrate/20150918004521_system_score_default.rb @@ -0,0 +1,15 @@ +class SystemScoreDefault < ActiveRecord::Migration + def up + change_column :student_works,:system_score,:float,:default => 0 + + + # StudentWork.where("system_score is null").each do |student_work| + # student_work.system_score = 0 + # student_work.save + # end + end + + def down + change_column :student_works,:system_score,:float + end +end diff --git a/db/migrate/20150918005722_about_normal_homework.rb b/db/migrate/20150918005722_about_normal_homework.rb new file mode 100644 index 000000000..8e0ddf00a --- /dev/null +++ b/db/migrate/20150918005722_about_normal_homework.rb @@ -0,0 +1,20 @@ +class AboutNormalHomework < ActiveRecord::Migration + def up + HomeworkCommon.where(:homework_type => 0).each do |homework| + unless homework.homework_detail_manual + homework_detail_manual = HomeworkDetailManual.new + homework_detail_manual.ta_proportion = 0.6 + homework_detail_manual.comment_status = 1 + homework_detail_manual.evaluation_start = homework.created_at + homework_detail_manual.evaluation_end = homework.created_at + homework_detail_manual.evaluation_num = 3 + homework_detail_manual.absence_penalty = 5 + homework_detail_manual.homework_common_id = homework.id + homework_detail_manual.save + end + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index 9f3cdecca..78c0802e7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20150917022239) do +ActiveRecord::Schema.define(:version => 20150918005722) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1328,7 +1328,7 @@ ActiveRecord::Schema.define(:version => 20150917022239) do t.datetime "updated_at", :null => false t.integer "late_penalty", :default => 0 t.integer "absence_penalty", :default => 0 - t.integer "system_score" + t.float "system_score", :default => 0.0 t.boolean "is_test", :default => false end From 4b83265508bbb0bfa783e6940b8321ed57c47db0 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 18 Sep 2015 11:05:21 +0800 Subject: [PATCH 20/26] =?UTF-8?q?1=E3=80=81=E7=BC=96=E7=A8=8B=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E5=8F=AF=E4=BB=A5=E4=BF=AE=E6=94=B9=E3=80=81=E5=88=A0?= =?UTF-8?q?=E9=99=A4=202=E3=80=81=E5=85=B3=E9=97=AD=E5=8C=BF=E8=AF=84?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E7=BB=93=E6=9D=9F=E5=8C=BF=E8=AF=84=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F=203=E3=80=81=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=88=90=E7=BB=A9=E8=AE=A1=E7=AE=97=E6=9C=89?= =?UTF-8?q?=E9=97=AE=E9=A2=98=204=E3=80=81=E7=9B=B8=E5=85=B3=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BF=AE=E6=94=B9=205=E3=80=81=E7=BC=96=E7=A8=8B?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E4=BD=9C=E5=93=81=E5=B1=95=E5=BC=80=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 5 +- app/helpers/application_helper.rb | 2 +- app/models/student_work.rb | 100 +++++++++++++++++- .../stop_anonymous_comment.js.erb | 2 +- .../student_work/_evaluation_un_work.html.erb | 4 +- .../_programing_work_show.html.erb | 76 ++++++++----- public/stylesheets/courses.css | 3 +- public/stylesheets/new_user.css | 4 + 8 files changed, 158 insertions(+), 38 deletions(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 83128c45a..866eecbd4 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -201,9 +201,7 @@ class StudentWorkController < ApplicationController end def destroy - if @homework.homework_type == 2 #编程作业,作品提交后不可以删除 - render_403 - elsif @work.destroy + if @work.destroy respond_to do |format| format.html { redirect_to student_work_index_url(:homework => @homework.id) @@ -257,7 +255,6 @@ class StudentWorkController < ApplicationController when 3 #学生评分 学生评分显示平均分 @work.student_score = @work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f end - set_final_score @homework,@work if @work.save respond_to do |format| format.js diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f085032c3..13f1383a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2362,7 +2362,7 @@ module ApplicationHelper if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前 link_to "作品已交", "", :class => 'c_blue', :title => "开启匿评后不可修改作品" elsif homework.homework_type == 2 #编程作业不能修改作品 - link_to "作品已交", student_work_index_path(:homework => homework.id),:class => 'c_blue',:title => "编程作业不可修改作品" + link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue' else link_to "修改作品", edit_student_work_path(work.id),:class => 'c_blue' end diff --git a/app/models/student_work.rb b/app/models/student_work.rb index 83a701f43..a6d641c0c 100644 --- a/app/models/student_work.rb +++ b/app/models/student_work.rb @@ -31,7 +31,7 @@ class StudentWork < ActiveRecord::Base else self.system_score = last_test.test_score end - self.final_score = self.system_score + set_final_score self.homework_common,self end end @@ -39,4 +39,102 @@ class StudentWork < ActiveRecord::Base self.description = last_test.src if last_test end + #成绩计算 + def set_final_score homework,student_work + if homework && homework.homework_detail_manual + if homework.homework_type == 1 #匿评作业 + if homework.teacher_priority == 1 #教师优先 + if student_work.teacher_score + student_work.final_score = student_work.teacher_score + else + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.student_score + elsif student_work.student_score.nil? + student_work.final_score = student_work.teaching_asistant_score + else + ta_proportion = homework.homework_detail_manual.ta_proportion + final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}") + final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_ta_score + final_s_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + else #不考虑教师评分 + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.student_score + elsif student_work.student_score.nil? + student_work.final_score = student_work.teaching_asistant_score + else + ta_proportion = homework.homework_detail_manual.ta_proportion + final_ta_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}") + final_s_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_ta_score + final_s_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业-----设定:系统评分必定不为空 + if homework.teacher_priority == 1 #教师优先 + if student_work.teacher_score + student_work.final_score = student_work.teacher_score + else + if student_work.teaching_asistant_score.nil? #教辅未评分 + if student_work.student_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + elsif student_work.student_score.nil? #学生未评分 + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_ts_score + student_work.final_score = format("%.2f",final_score.to_f) + end + else + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")) + final_score = final_sy_score + final_ts_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + else #不考虑教师评分 + if student_work.teaching_asistant_score.nil? #教辅未评分 + if student_work.student_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + homework.homework_detail_manual.ta_proportion / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + elsif student_work.student_score.nil? #学生未评分 + if student_work.teaching_asistant_score.nil? + student_work.final_score = student_work.system_score + else + ta_proportion = homework.homework_detail_programing.ta_proportion + (1.0 - homework.homework_detail_manual.ta_proportion - homework.homework_detail_programing.ta_proportion) / 2 + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_sy_score + final_ts_score + student_work.final_score = format("%.2f",final_score.to_f) + end + else + final_sy_score = BigDecimal.new("#{student_work.system_score || 0}") * BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") + final_ts_score = BigDecimal.new("#{student_work.teaching_asistant_score}") * BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}") + final_st_score = BigDecimal.new("#{student_work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{homework.homework_detail_programing.ta_proportion}") - BigDecimal.new("#{homework.homework_detail_manual.ta_proportion}")) + final_score = final_sy_score + final_ts_score + final_st_score + student_work.final_score = format("%.2f",final_score.to_f) + end + end + end + end + end end diff --git a/app/views/homework_common/stop_anonymous_comment.js.erb b/app/views/homework_common/stop_anonymous_comment.js.erb index 9a6131c64..70122c7ab 100644 --- a/app/views/homework_common/stop_anonymous_comment.js.erb +++ b/app/views/homework_common/stop_anonymous_comment.js.erb @@ -1,2 +1,2 @@ -$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('匿评结束'); +$("#<%= @homework.id %>_stop_anonymous_comment").replaceWith('匿评结束'); alert('关闭成功'); \ No newline at end of file diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb index a170f39ab..caaaa2775 100644 --- a/app/views/student_work/_evaluation_un_work.html.erb +++ b/app/views/student_work/_evaluation_un_work.html.erb @@ -37,8 +37,8 @@ <% if @homework.homework_type == 2%> -
  • - <%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%> +
  • + <%= student_work.system_score.nil? ? "--" : format("%.1f",student_work.system_score)%>
  • <% end%>
  • diff --git a/app/views/student_work/_programing_work_show.html.erb b/app/views/student_work/_programing_work_show.html.erb index 10e1870ef..b5ff8f064 100644 --- a/app/views/student_work/_programing_work_show.html.erb +++ b/app/views/student_work/_programing_work_show.html.erb @@ -1,42 +1,56 @@
    -
    +
    • - - 上交时间: - + 上交时间: <%=format_time @work.created_at %>
    • - <% if @work.user != User.current%> - + + <% if @work.user == User.current && @homework.homework_detail_manual.comment_status == 1 %> + +
    • + <%= link_to("", student_work_path(@work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del") %> +
    • +
    • + <%= link_to "",new_student_work_path(:homework => @homework.id),:class => "pic_edit"%> +
    • + <% end%> + <% if @homework.homework_detail_manual.comment_status == 3 && @work.user != User.current%> +
    • <%= render :partial => 'student_work_praise' %>
    • <% end%>
      +
    • - - 编程代码: - -
      - <%= text_format @work.description%> + 编程代码: +
      + <%= text_format(@work.description) if @work.description%>
    • <% if @is_teacher%> -
    • +
    • 测试结果:
      <% @work.student_work_tests.each_with_index do |test, index| %>
      -

      第<%= @work.student_work_tests.count - index%>次测试

      <%= test.created_at.to_s(:db) %> +

      + 第<%= @work.student_work_tests.count - index%>次测试 +

      + + <%= test.created_at.to_s(:db) %> +
      <% if test.status.to_i == -2 %> -
      <%= test.results.first %>
      +
      + <%= test.results.first %> +
      <% else %>
        @@ -46,9 +60,9 @@ <% if x["status"].to_i != 0 %> 测试错误! 您的输出: - <%=x["result"]%> + <%=x["result"]%> 正确输出: - <%=x["output"]%> + <%=x["output"]%>
        <% else %> 测试正确! @@ -56,27 +70,33 @@ <% end %> <% end %> -
      +
    <% end %> <% end %>
  • - - -
    - <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> -
    <% end%> + +
  • + <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && @work.user != User.current )%> + +
    + <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%> +
    + <% end%> +
    +
  • -
    - <%@work.student_works_scores.order("updated_at desc").each do |score|%> +
    + <%@student_work_scores.each do |score|%>
    - <%= render :partial => 'student_work_score',:locals => {:score => score}%> + <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%>
    <% end%> -
    - 收起 +
    + + 收起
    -
    \ No newline at end of file +
    \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 125016994..d6e4c5519 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -284,6 +284,7 @@ a:hover.tijiao{ background:#0f99a9;} .members_left ul li a{ float:left; text-align:center;} .members_left ul li span{ float:left; text-align:center; color:#484747;} .w150{ text-align:center; width:150px;min-height: 10px;} +.width150{width:150px;min-height: 10px;} .f_b{ font-weight: bold;} .members_right label{ margin-left:15px;} .N_search{ height:20px; border:1px solid #999;} @@ -692,7 +693,7 @@ a.hwork_center{ display:block; width:60px; text-align:center; margin-right:5px;} .show_hwork_arrow{ position:relative; top:2px; left:165px;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;} +.show_hwork_p{ width:630px; float:left;} .hwork_ping_text{ float:left; border:1px solid #e4e4e4; padding:5px; width:615px; height:35px;} .ping_box{ width:676px; padding:10px; background:#f5f3f3; } a.ping_pic{ display:block; width:34px; height:34px; padding:2px; border:1px solid #e3e3e3;} diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 219418a37..5fe0698fd 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1141,3 +1141,7 @@ a:hover.tijiao{ background:#0f99a9;} .c_pink{ color:#e65d5e;} .ni_con_work { width:300px; margin:25px 20px;} .ni_con_work p{ color:#808181; } + +a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; } +a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} +.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;} \ No newline at end of file From 859fe01c523487a9f028042ddeeb20a7a8e09559 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 18 Sep 2015 11:14:59 +0800 Subject: [PATCH 21/26] =?UTF-8?q?1=E3=80=81=E7=BC=96=E7=A8=8B=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=97=A0=E6=B3=95=E5=AF=BC=E5=87=BA=E7=BC=BA=E8=AF=84?= =?UTF-8?q?=E3=80=81=E5=8C=BF=E8=AF=84=E5=88=97=E8=A1=A8=202=E3=80=81?= =?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A=E8=AF=84=E5=88=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=88=9D=E5=A7=8B=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 2 +- .../student_work/_set_score_rule.html.erb | 4 +- app/views/student_work/index.html.erb | 4 +- public/javascripts/course.js | 54 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index cf6305e4d..2a8b4b74a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -453,7 +453,7 @@ class UsersController < ApplicationController render_attachment_warning_if_needed(homework) homework_detail_manual = HomeworkDetailManual.new - homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.2 + homework_detail_manual.ta_proportion = homework.homework_type == 1 ? 0.6 : 0.3 homework_detail_manual.comment_status = 1 homework_detail_manual.evaluation_start = Time.now homework_detail_manual.evaluation_end = Time.now diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb index 97deafde8..532972c45 100644 --- a/app/views/student_work/_set_score_rule.html.erb +++ b/app/views/student_work/_set_score_rule.html.erb @@ -13,7 +13,7 @@ <% if homework.homework_type == 2%>
    系统评分 - <%= select_tag :sy_proportion,options_for_select(ta_proportion_option), {:class => "markPercentage"} %> + <%= select_tag :sy_proportion,options_for_select(ta_proportion_option,homework.homework_detail_programing.ta_proportion), {:class => "markPercentage"} %>