Merge branch 'dev_aliyun' into develop

dev_video
daiao 5 years ago
commit 3d184f2c8b

@ -1,5 +1,9 @@
class ShixunListsController < ApplicationController class ShixunListsController < ApplicationController
def index def index
# 去除开头标点符号
@reg = /^[,。?:;‘’!“”—……、]/
# 附件的替换
@atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
@results = ShixunSearchService.call(search_params, current_laboratory) @results = ShixunSearchService.call(search_params, current_laboratory)
end end

@ -16,7 +16,7 @@
<% identifier = Game.find_by(challenge_id: discuss.challenge_id, user_id: discuss.user_id)&.identifier %> <% identifier = Game.find_by(challenge_id: discuss.challenge_id, user_id: discuss.user_id)&.identifier %>
<td class="text-left"><%= link_to discuss.dis.name, "/tasks/#{identifier}", target: '_blank'%></td> <td class="text-left"><%= link_to discuss.dis.name, "/tasks/#{identifier}", target: '_blank'%></td>
<td class="text-left content-img"><%= content_safe discuss.content %></td> <td class="text-left content-img"><%= content_safe discuss.content %></td>
<td><%= discuss.user.show_real_name %></td> <td><%= link_to discuss.user.show_real_name, "/users/#{discuss.user.login}", target: '_blank' %></td>
<td><%= format_time discuss.created_at %></td> <td><%= format_time discuss.created_at %></td>
</tr> </tr>
<% end %> <% end %>

@ -4,25 +4,21 @@ json.shixun_list do
json.array! @results.with_highlights(multiple: true) do |obj, highlights| json.array! @results.with_highlights(multiple: true) do |obj, highlights|
json.merge! obj.to_searchable_json json.merge! obj.to_searchable_json
json.challenge_names obj.challenges.pluck(:subject) json.challenge_names obj.challenges.pluck(:subject)
highlights[:description]&.first&.sub!(@reg, '')
# 去除开头标点符号 highlights[:description]&.map{|des| des.gsub(@atta_reg, '')}
reg = /^[,。?:;‘’!“”—……、]/ highlights[:content]&.first&.sub!(@reg, '')
# 附件的替换 highlights[:content]&.map{|des| des.gsub(@atta_reg, '')}
atta_reg = /!\[.*]\(\/api\/attachments\/\d+\)/
highlights[:description]&.first&.sub!(reg, '')
highlights[:description]&.map{|des| des.gsub(atta_reg, '')}
highlights[:content]&.first&.sub!(reg, '')
highlights[:content]&.map{|des| des.gsub(atta_reg, '')}
json.title highlights.delete(:name)&.join('...') || obj.searchable_title json.title highlights.delete(:name)&.join('...') || obj.searchable_title
json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.gsub(atta_reg, '') json.description highlights[:description]&.join('...') || Util.extract_content(obj.description)[0..300]&.gsub(@atta_reg, '')
json.pic url_to_avatar(obj) json.pic url_to_avatar(obj)
json.content highlights json.content highlights
json.level level_to_s(obj.trainee) json.level level_to_s(obj.trainee)
json.subjects obj.subjects.visible.unhidden.uniq do |subject| #if params[:sort] != "wechat_myshixuns_count"
json.subjects obj.subjects.select{ |s| s.status == 2 && s.hidden == 0} do |subject|
json.(subject, :id, :name) json.(subject, :id, :name)
end end
#end
end end
end end

@ -1872,6 +1872,18 @@
<div class="code-name">&amp;#xe719;</div> <div class="code-name">&amp;#xe719;</div>
</li> </li>
<li class="dib">
<span class="icon iconfont">&#xe71c;</span>
<div class="name">初始化</div>
<div class="code-name">&amp;#xe71c;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe71e;</span>
<div class="name">测试集</div>
<div class="code-name">&amp;#xe71e;</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2> <h2 id="unicode-">Unicode 引用</h2>
@ -4685,6 +4697,24 @@
</div> </div>
</li> </li>
<li class="dib">
<span class="icon iconfont icon-chushihua"></span>
<div class="name">
初始化
</div>
<div class="code-name">.icon-chushihua
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-ceshiji"></span>
<div class="name">
测试集
</div>
<div class="code-name">.icon-ceshiji
</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="font-class-">font-class 引用</h2> <h2 id="font-class-">font-class 引用</h2>
@ -7170,6 +7200,22 @@
<div class="code-name">#icon-jiashang1</div> <div class="code-name">#icon-jiashang1</div>
</li> </li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-chushihua"></use>
</svg>
<div class="name">初始化</div>
<div class="code-name">#icon-chushihua</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-ceshiji"></use>
</svg>
<div class="name">测试集</div>
<div class="code-name">#icon-ceshiji</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2> <h2 id="symbol-">Symbol 引用</h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2153,6 +2153,20 @@
"font_class": "jiashang1", "font_class": "jiashang1",
"unicode": "e719", "unicode": "e719",
"unicode_decimal": 59161 "unicode_decimal": 59161
},
{
"icon_id": "12826208",
"name": "初始化",
"font_class": "chushihua",
"unicode": "e71c",
"unicode_decimal": 59164
},
{
"icon_id": "12826211",
"name": "测试集",
"font_class": "ceshiji",
"unicode": "e71e",
"unicode_decimal": 59166
} }
] ]
} }

@ -941,6 +941,12 @@ Created by iconfont
<glyph glyph-name="jiashang1" unicode="&#59161;" d="M512-128C228.693333-128 0 100.693333 0 384S228.693333 896 512 896s512-228.693333 512-512-228.693333-512-512-512z m0 989.866667C249.173333 861.866667 34.133333 646.826667 34.133333 384s215.04-477.866667 477.866667-477.866667 477.866667 215.04 477.866667 477.866667S774.826667 861.866667 512 861.866667zM699.733333 332.8h-375.466666c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h375.466666c20.48 0 34.133333-13.653333 34.133334-34.133334s-13.653333-34.133333-34.133334-34.133333zM512 145.066667c-20.48 0-34.133333 13.653333-34.133333 34.133333V554.666667c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333v-375.466667c0-20.48-13.653333-34.133333-34.133333-34.133333z" horiz-adv-x="1024" /> <glyph glyph-name="jiashang1" unicode="&#59161;" d="M512-128C228.693333-128 0 100.693333 0 384S228.693333 896 512 896s512-228.693333 512-512-228.693333-512-512-512z m0 989.866667C249.173333 861.866667 34.133333 646.826667 34.133333 384s215.04-477.866667 477.866667-477.866667 477.866667 215.04 477.866667 477.866667S774.826667 861.866667 512 861.866667zM699.733333 332.8h-375.466666c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h375.466666c20.48 0 34.133333-13.653333 34.133334-34.133334s-13.653333-34.133333-34.133334-34.133333zM512 145.066667c-20.48 0-34.133333 13.653333-34.133333 34.133333V554.666667c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333v-375.466667c0-20.48-13.653333-34.133333-34.133333-34.133333z" horiz-adv-x="1024" />
<glyph glyph-name="chushihua" unicode="&#59164;" d="M511.682434-128A468.457376 468.457376 0 0 0 44.559694 340.457376a66.73182 66.73182 0 0 0 133.46364 0A333.6591 333.6591 0 1 1 511.682434 675.451113a330.989827 330.989827 0 0 1-235.785764-98.095776 66.73182 66.73182 0 0 0-111.2197 66.73182l60.503517 203.309612a66.798552 66.798552 0 1 0 128.125094-37.814698l-9.564894-31.808835A468.234937 468.234937 0 1 0 511.682434-128zM600.658194 183.41516h-133.46364a66.73182 66.73182 0 0 0-66.73182 66.73182V472.58638a66.73182 66.73182 0 0 0 133.46364 0v-155.70758h66.73182a66.73182 66.73182 0 0 0 0-133.46364z" horiz-adv-x="1024" />
<glyph glyph-name="ceshiji" unicode="&#59166;" d="M536.332172 333.97898a75.330291 75.330291 0 0 0-29.985844 6.338471l-463.195967 207.95061a73.136205 73.136205 0 0 0 0 133.351681l463.195967 207.95061a73.136205 73.136205 0 0 0 59.971688 0l463.195966-207.95061a73.136205 73.136205 0 0 0 0-133.351681l-463.195966-207.95061a75.330291 75.330291 0 0 0-29.985844-6.338471zM251.832333 614.822008L536.332172 487.321224l284.499838 127.500784L536.332172 742.56658zM536.332172 102.868571a73.136205 73.136205 0 0 0-31.204781 7.069834l-463.195967 219.408615a73.184963 73.184963 0 0 0 62.409562 132.376532L536.332172 257.429752l431.259823 215.020443a73.136205 73.136205 0 0 0 65.33501-130.913807l-463.195966-230.866621a73.136205 73.136205 0 0 0-33.398867-7.801196zM536.332172-127.99805a73.136205 73.136205 0 0 0-31.204781 7.069833l-463.195967 219.408616a73.136205 73.136205 0 0 0 62.409562 131.888957L536.332172 26.319343l431.259823 215.264231a73.136205 73.136205 0 0 0 65.33501-130.913807l-463.195966-230.866621A73.136205 73.136205 0 0 0 536.332172-127.99805z" horiz-adv-x="1073" />
</font> </font>

Before

Width:  |  Height:  |  Size: 381 KiB

After

Width:  |  Height:  |  Size: 383 KiB

@ -17,6 +17,7 @@
<meta name=”Description” Content=”EduCoder翻转课堂教学模式颠覆了传统教学模式让教师与学生的关系由“权威”变成了“伙伴”。将学习的主动权转交给学生使学生可个性化化学学生的学习主体得到了彰显。”> <meta name=”Description” Content=”EduCoder翻转课堂教学模式颠覆了传统教学模式让教师与学生的关系由“权威”变成了“伙伴”。将学习的主动权转交给学生使学生可个性化化学学生的学习主体得到了彰显。”>
<meta name=”Description” Content=”EduCoder实训项目为单个知识点关卡实践训练帮助学生巩固单一弱点强化学习。 > <meta name=”Description” Content=”EduCoder实训项目为单个知识点关卡实践训练帮助学生巩固单一弱点强化学习。 >
<meta name=”Description” Content=”EduCoder实践教学平台各类大赛为进一步提高各类学生综合运用高级语言程序设计能力培养创新意识和实践探索精神发掘优秀软件人才。 > <meta name=”Description” Content=”EduCoder实践教学平台各类大赛为进一步提高各类学生综合运用高级语言程序设计能力培养创新意识和实践探索精神发掘优秀软件人才。 >
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=0.3, maximum-scale=0.3">
<meta name="theme-color" content="#000000"> <meta name="theme-color" content="#000000">

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2020-01-15 09:56:34 * @Date: 2020-01-15 09:56:34
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-17 21:10:23 * @LastEditTime : 2020-01-18 15:07:09
*/ */
import './index.scss'; import './index.scss';
import React, {useState, useEffect, useRef} from 'react'; import React, {useState, useEffect, useRef} from 'react';
@ -44,28 +44,36 @@ const App = (props) => {
const {identifier} = props.match.params; const {identifier} = props.match.params;
// 获取路径参数 // 获取路径参数
const setCookier = () => { const setCookier = () => {
// const _params = window.location.search; const _params = window.location.search;
// if (_params) { if (_params) {
// let _search = _params.split('?')[1]; let _search = _params.split('?')[1];
// _search.split('&').forEach(item => { _search.split('&').forEach(item => {
// // console.log(item); // console.log(item);
// const _arr = item.split('='); const _arr = item.split('=');
// cookie.remove(_arr[0], { cookie.remove(_arr[0], {
// path: '/', path: '/',
// domain: '.educoder.net' domain: '.educoder.net'
// }); });
// cookie.save(_arr[0], _arr[1], { cookie.save(_arr[0], _arr[1], {
// path: '/', path: '/',
// domain: '.educoder.net' domain: '.educoder.net'
// }); });
// }); });
// } }
} }
setCookier(); setCookier();
const [isActive, setIsActive] = useState(-1); const [isActive, setIsActive] = useState(-1);
const [tip, setTip] = useState('');
const [codes, setCodes] = useState(wxCode);
// const [showInfo, setShowInfo] = useState(false);
// const [isVisible, setIsVisible] = useState(false); // const [isVisible, setIsVisible] = useState(false);
useEffect(() => {
if (codes !== props.wxCode) {
setCodes(props.wxCode);
}
}, [props]);
const editorRef = useRef(null); const editorRef = useRef(null);
let timer = null; let timer = null;
@ -129,8 +137,12 @@ const App = (props) => {
} }
// 初始化 // 初始化
const handleResetCode = () => { const handleResetCode = () => {
clearInterval(timer);
timer = null;
const result = window.confirm('你在本文件中修改的内容将丢失, 是否确定重新加载初始代码?'); const result = window.confirm('你在本文件中修改的内容将丢失, 是否确定重新加载初始代码?');
if (result) { if (result) {
setTip('初始化中...');
changeWXCodeEvaluateLoading(true);
identifier && restoreWXCode(identifier, { path }); identifier && restoreWXCode(identifier, { path });
} }
} }
@ -138,6 +150,7 @@ const App = (props) => {
const handleEvalateCode = () => { const handleEvalateCode = () => {
changeWXCodeEvaluateLoading(true); changeWXCodeEvaluateLoading(true);
evaluateWxCode(identifier, path); evaluateWxCode(identifier, path);
setTip('评测中...');
} }
// 关闭弹框 // 关闭弹框
@ -164,7 +177,9 @@ const App = (props) => {
let resultTxt = (_val) ? '全部通过' : `${sets_error_count}组测试结果不匹配`; let resultTxt = (_val) ? '全部通过' : `${sets_error_count}组测试结果不匹配`;
const iclasses = _val ? 'iconfont icon-wancheng icon success' : 'iconfont icon-tishi1 icon fail'; const iclasses = _val ? 'iconfont icon-wancheng icon success' : 'iconfont icon-tishi1 icon fail';
const tclasses = _val ? 'result-txt success' : 'result-txt fail'; const tclasses = _val ? 'result-txt success' : 'result-txt fail';
const ulClasses = last_compile_output ? 'case-list hasResult' : 'case-list'; const ulClasses = !!last_compile_output ? 'case-list hasResult' : 'case-list';
const resultFlag = !!last_compile_output ? 'wxcode-test-result active' : 'wxcode-test-result';
// console.log('==========>>>>>>>> 评测结果样式', last_compile_output, resultFlag);
return ( return (
<div className="wx-code-area"> <div className="wx-code-area">
<div className="wx-code-flex"> <div className="wx-code-flex">
@ -173,11 +188,11 @@ const App = (props) => {
height="100%" height="100%"
width="100%" width="100%"
language="python" language="python"
value={wxCode} value={codes}
options={{ options={{
selectOnLineNumbers: true, selectOnLineNumbers: true,
automaticLayout: true, automaticLayout: true,
fontSize: `36px` fontSize: `42px`
}} }}
theme='dark' theme='dark'
editorDidMount={handleEditorChange} editorDidMount={handleEditorChange}
@ -186,11 +201,11 @@ const App = (props) => {
<div className="wx-code-test"> <div className="wx-code-test">
<div className="flex-btn"> <div className="flex-btn">
<span className="icon-btn" onClick={handleResetCode}> <span className="icon-btn" onClick={handleResetCode}>
<i className="iconfont icon-reset icon"></i> <i className="iconfont icon-chushihua icon"></i>
<span className="icon-txt">初始化</span> <span className="icon-txt">初始化</span>
</span> </span>
<span className="icon-btn" onClick={handleClickTestCase}> <span className="icon-btn" onClick={handleClickTestCase}>
<i className="iconfont icon-base icon"></i> <i className="iconfont icon-ceshiji icon"></i>
<span className="icon-txt">测试集</span> <span className="icon-txt">测试集</span>
</span> </span>
</div> </div>
@ -205,7 +220,7 @@ const App = (props) => {
<span className="header-title">{testCase.length}个测试用例</span> <span className="header-title">{testCase.length}个测试用例</span>
<span className="header-close" onClick={handleCloseTestCase}>关闭</span> <span className="header-close" onClick={handleCloseTestCase}>关闭</span>
</div> </div>
<div className="wxcode-test-result" style={{ display: last_compile_output ? 'block' : 'none'}}> <div className={resultFlag}>
<i className={iclasses}></i> <i className={iclasses}></i>
<span className={tclasses}>{test_sets_count - sets_error_count}/{test_sets_count}</span> <span className={tclasses}>{test_sets_count - sets_error_count}/{test_sets_count}</span>
<span className={`${tclasses} result-txt-desc`}>{resultTxt}</span> <span className={`${tclasses} result-txt-desc`}>{resultTxt}</span>
@ -213,7 +228,7 @@ const App = (props) => {
<ul className={ulClasses}> <ul className={ulClasses}>
{ {
testCase.map((item, i) => { testCase.map((item, i) => {
const {input, output, actual_output, is_public, result} = item; const {input, output, actual_output, is_public, result, compile_success} = item;
const _classes = isActive === i ? 'case-item-desc active' : 'case-item-desc'; const _classes = isActive === i ? 'case-item-desc active' : 'case-item-desc';
const iconclasses = isActive === i ? 'iconfont icon-sanjiaoxing-down icon active' : 'iconfont icon-triangle icon'; const iconclasses = isActive === i ? 'iconfont icon-sanjiaoxing-down icon active' : 'iconfont icon-triangle icon';
const headerClasses = is_public ? 'item-header-desc active' : 'item-header-desc'; const headerClasses = is_public ? 'item-header-desc active' : 'item-header-desc';
@ -226,17 +241,23 @@ const App = (props) => {
测试集{i + 1} 测试集{i + 1}
</h2> </h2>
{ {
is_public && last_compile_output is_public
? (result ? compile_success > 0
? <span className="iconfont icon-wancheng case_item_success"></span> ? result ? <span className="iconfont icon-wancheng case_item_success"></span>
: <span className="iconfont icon-jinggao1 case_item_fail"></span>)
: (<span className="case-item-tips">
隐藏测试集暂不支持解锁和查看
{/* {result
? <span className="iconfont icon-wancheng case_item_success"></span>
: <span className="iconfont icon-jinggao1 case_item_fail"></span> : <span className="iconfont icon-jinggao1 case_item_fail"></span>
} */} : ''
</span>) :
<span className="case-item-tips">隐藏测试集暂不支持解锁和查看 </span>
// is_public
// ? result ? <span className="iconfont icon-wancheng case_item_success"></span>
// : <span className="iconfont icon-jinggao1 case_item_fail"></span>)
// : (
// 隐藏测试集,暂不支持解锁和查看
// {/* {result
// ? <span className="iconfont icon-wancheng case_item_success"></span>
// : <span className="iconfont icon-jinggao1 case_item_fail"></span>
// } */}
// </span>)
} }
</div> </div>
@ -273,7 +294,7 @@ const App = (props) => {
<div className={loading}> <div className={loading}>
<span className="loading-flex"> <span className="loading-flex">
<Icon className="loading-icon" type="loading" /> <Icon className="loading-icon" type="loading" />
<span className="loading-txt">测评中...</span> <span className="loading-txt">{tip}</span>
</span> </span>
</div> </div>
{/* 通过弹框 */} {/* 通过弹框 */}
@ -324,7 +345,7 @@ const mapStateToProps = (state) => {
test_sets_count, test_sets_count,
sets_error_count sets_error_count
} = state.wxcodeReducer; } = state.wxcodeReducer;
console.log(state); // console.log(state);
return { return {
path, path,
isShow, isShow,

@ -14,7 +14,7 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
height: 120px; height: 150px;
background-color: #052645; background-color: #052645;
padding: 0 50px; padding: 0 50px;
} }
@ -30,10 +30,10 @@
// font-size: 24px !important; // font-size: 24px !important;
// transform: scale(2.4); // transform: scale(2.4);
// line-height: 2; // line-height: 2;
font-size: 32px !important; font-size: 34px !important;
transform: scale(2); transform: scale(1.8);
position: relative; position: relative;
top: 10px; // top: 10px;
} }
// .icon-reset{ // .icon-reset{
// transform: scale(2.4); // transform: scale(2.4);
@ -43,9 +43,10 @@
// } // }
&:last-child{ &:last-child{
margin-left: 50px; margin-left: 60px;
} }
.icon-txt{ .icon-txt{
// margin-top: 5px;
font-size: 32px; font-size: 32px;
} }
} }
@ -55,11 +56,12 @@
border: none; border: none;
outline: none; outline: none;
border-radius: 9999px; border-radius: 9999px;
padding: 0 40px; padding: 0 50px;
line-height: 72px; line-height: 92px;
font-size: 36px; font-size: 38px;
color: #fff; color: #fff;
background:#2EA4FF; background:#2EA4FF;
letter-spacing: 2;
} }
.wx-code-test-case{ .wx-code-test-case{
@ -104,17 +106,18 @@
.header-title{ .header-title{
color:#637DA6; color:#637DA6;
// font-size: 24px; // font-size: 24px;
font-size: 36px; font-size: 48px;
} }
.header-close{ .header-close{
// font-size: 28px; // font-size: 42px;
font-size: 36px; font-size: 48px;
color: #2EA4FF; color: #2EA4FF;
} }
} }
.wxcode-test-result{ .wxcode-test-result{
display: flex; // display: flex;
display: none;
height: 72px; height: 72px;
// background: gold; // background: gold;
align-items: center; align-items: center;
@ -126,14 +129,14 @@
color: rgba(196, 79, 78, 1); color: rgba(196, 79, 78, 1);
} }
.icon{ .icon{
font-size: 36px !important; font-size: 48px !important;
position: relative; position: relative;
top: -8px; // top: -8px;
margin-right: 10px; margin-right: 10px;
} }
.result-txt{ .result-txt{
// font-size: 34px; // font-size: 34px;
font-size: 36px; font-size: 48px;
} }
.result-txt-desc{ .result-txt-desc{
max-width: 500px; max-width: 500px;
@ -142,6 +145,9 @@
white-space: nowrap; white-space: nowrap;
margin: 20px; margin: 20px;
} }
&.active{
display: flex;;
}
} }
.case-list{ .case-list{
@ -187,19 +193,19 @@
} }
.case-item-tips{ .case-item-tips{
color: #C67676; color: #C67676;
font-size: 22px; font-size: 38px;
} }
} }
.item-header-desc{ .item-header-desc{
font-size: 36px; font-size: 48px;
color: #405D8C; color: #405D8C;
line-height: 1.5; line-height: 1.5;
// background: gold; // background: gold;
.icon{ .icon{
position: relative; position: relative;
top: -4px; top: -4px;
font-size: 36px !important; font-size: 42px !important;
margin-right: 10px; margin-right: 10px;
} }
&.active{ &.active{
@ -208,12 +214,12 @@
} }
.case-item-tips{ .case-item-tips{
font-size: 28px; font-size: 42px;
} }
.case-item-desc{ .case-item-desc{
display: none; display: none;
flex-direction: column; flex-direction: column;
font-size: 28px; font-size: 42px;
line-height: 1.5; line-height: 1.5;
&.active{ &.active{
@ -223,11 +229,12 @@
.desc-title{ .desc-title{
color: #637DA6; color: #637DA6;
line-height: 2; line-height: 2;
font-size: 48px;
} }
.text-area-style{ .text-area-style{
background:#010E1F !important; background:#010E1F !important;
color: #fff; color: #fff;
font-size: 28px; font-size: 48px;
line-height: 1.5; line-height: 1.5;
border: none; border: none;
} }
@ -277,7 +284,7 @@
font-size: 100px !important; font-size: 100px !important;
} }
.loading-txt{ .loading-txt{
font-size: 36px; font-size: 42px;
} }
} }
} }
@ -309,7 +316,7 @@
.pass-value, .pass-value,
.pass-btn .btn, .pass-btn .btn,
.pass-btn-all .btn{ .pass-btn-all .btn{
font-size: 36px; font-size: 42px;
line-height: 1.5; line-height: 1.5;
} }
.pass-value{ .pass-value{

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2020-01-15 15:41:10 * @Date: 2020-01-15 15:41:10
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-17 21:06:46 * @LastEditTime : 2020-01-18 11:43:43
*/ */
import types from './actionTypes.js'; import types from './actionTypes.js';
import { import {
@ -46,7 +46,7 @@ export const getWXCodeTestCase = (identifier, params) => {
game_id: data.game && data.game.id, game_id: data.game && data.game.id,
myIdentifier: data.myshixun.identifier, myIdentifier: data.myshixun.identifier,
exec_time: data.challenge.exec_time, exec_time: data.challenge.exec_time,
path: _path.split('')[0] || _path.split(';')[0], path: _path.split('')[0] || _path.split(';')[0] || _path,
last_compile_output: data.last_compile_output, last_compile_output: data.last_compile_output,
test_sets_count: data.test_sets_count, test_sets_count: data.test_sets_count,
sets_error_count: data.sets_error_count sets_error_count: data.sets_error_count
@ -65,6 +65,10 @@ export const restoreWXCode = (identifier, params) => {
fetchRestoreWxCode(identifier, params).then(res => { fetchRestoreWxCode(identifier, params).then(res => {
console.log('点击了初始化代码: ', res); console.log('点击了初始化代码: ', res);
const {data} = res; const {data} = res;
dispatch({
type: types.SHOW_WX_CODE_LOADING,
payload: false
})
dispatch({ dispatch({
type: types.GET_WXCODE_BY_IDENTIFIER, type: types.GET_WXCODE_BY_IDENTIFIER,
payload: data.content || '' payload: data.content || ''
@ -90,11 +94,16 @@ export const updateWxCode = (path, identifier, userCode, game_id, evaluate = 0,)
}); });
} }
// 定时更新代码内容 // 定时更新代码内容
export const updateWXCodeForInterval = (identifier, path) => { export const updateWXCodeForInterval = (identifier, $path) => {
return (dispatch, getState) => { return (dispatch, getState) => {
const {wxCode, userCode, game_id, myIdentifier} = getState().wxcodeReducer; const {wxCode, userCode, game_id, myIdentifier, path} = getState().wxcodeReducer;
if (wxCode !== userCode) { if (wxCode !== userCode) {
updateWxCode(path, myIdentifier, userCode, game_id, 0); updateWxCode(path, myIdentifier, userCode, game_id, 0).then(res => {
dispatch({
type: types.GET_WXCODE_BY_IDENTIFIER,
payload: userCode
});
});
} }
} }
} }
@ -133,11 +142,13 @@ export const evaluateWxCode = (identifier, path) => {
// 定时调用 game_status fetchWxCodeGameStatus // 定时调用 game_status fetchWxCodeGameStatus
let count = 1; let count = 1;
const intervalTime = 500; const intervalTime = 500;
let time_out = false;
function wxCodeGameStatus (intervalTime, finalTime, count, timer) { function wxCodeGameStatus (intervalTime, finalTime, count, timer) {
const excuteTime = (count++) * intervalTime; // 当前执行时间 const excuteTime = (count++) * intervalTime; // 当前执行时间
console.log(finalTime, count, excuteTime); console.log(finalTime, count, excuteTime);
fetchWxCodeGameStatus(identifier, {resubmit: _resubmit}).then(r => { if ((excuteTime / 1000) > (finalTime + 1)) time_out = true;
const { status, test_sets = [], gold, experience, next_game, sets_error_count } = r.data; fetchWxCodeGameStatus(identifier, {resubmit: _resubmit, time_out}).then(r => {
const { status, test_sets = [], gold, experience, next_game, sets_error_count, test_sets_count, last_compile_output} = r.data;
if (+status > -1 || ((excuteTime / 1000) > (finalTime + 1))) { if (+status > -1 || ((excuteTime / 1000) > (finalTime + 1))) {
clearInterval(timer); clearInterval(timer);
timer = null; timer = null;

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2020-01-15 15:37:44 * @Date: 2020-01-15 15:37:44
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-17 19:50:00 * @LastEditTime : 2020-01-18 09:46:04
*/ */
import types from "../actions/actionTypes"; import types from "../actions/actionTypes";
const initialState = { const initialState = {
@ -30,6 +30,7 @@ const wxcodeReducer = (state = initialState, action) => {
const { payload, type } = action; const { payload, type } = action;
switch (type) { switch (type) {
case types.GET_WXCODE_BY_IDENTIFIER: case types.GET_WXCODE_BY_IDENTIFIER:
console.log('=====>>>>>', payload);
return { return {
...state, ...state,
wxCode: payload, wxCode: payload,

@ -10,20 +10,21 @@ import axios from 'axios';
import cookie from 'react-cookies' import cookie from 'react-cookies'
// axios.defaults.withCredentials = true; // axios.defaults.withCredentials = true;
const setCookier = () => { const setCookier = () => {
// const _params = window.location.search; const _params = window.location.search;
// if (_params) { if (_params) {
// let _search = _params.split('?')[1]; let _search = _params.split('?')[1];
// _search.split('&').forEach(item => { _search.split('&').forEach(item => {
// // console.log(item); // console.log(item);
// const _arr = item.split('='); const _arr = item.split('=');
// cookie.remove(_arr[0], { cookie.remove(_arr[0], {
// path: '/', path: '/',
// domain: '.educoder.net' domain: '.educoder.net'
// }); });
// cookie.save(_arr[0], _arr[1], { domain: '.educoder.net', path: '/'}); cookie.save(_arr[0], _arr[1], { domain: '.educoder.net', path: '/'});
// }); });
// } }
} }
// 获取代码块 // 获取代码块

@ -1872,6 +1872,18 @@
<div class="code-name">&amp;#xe719;</div> <div class="code-name">&amp;#xe719;</div>
</li> </li>
<li class="dib">
<span class="icon iconfont">&#xe71c;</span>
<div class="name">初始化</div>
<div class="code-name">&amp;#xe71c;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe71e;</span>
<div class="name">测试集</div>
<div class="code-name">&amp;#xe71e;</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="unicode-">Unicode 引用</h2> <h2 id="unicode-">Unicode 引用</h2>
@ -4685,6 +4697,24 @@
</div> </div>
</li> </li>
<li class="dib">
<span class="icon iconfont icon-chushihua"></span>
<div class="name">
初始化
</div>
<div class="code-name">.icon-chushihua
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-ceshiji"></span>
<div class="name">
测试集
</div>
<div class="code-name">.icon-ceshiji
</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="font-class-">font-class 引用</h2> <h2 id="font-class-">font-class 引用</h2>
@ -7170,6 +7200,22 @@
<div class="code-name">#icon-jiashang1</div> <div class="code-name">#icon-jiashang1</div>
</li> </li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-chushihua"></use>
</svg>
<div class="name">初始化</div>
<div class="code-name">#icon-chushihua</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-ceshiji"></use>
</svg>
<div class="name">测试集</div>
<div class="code-name">#icon-ceshiji</div>
</li>
</ul> </ul>
<div class="article markdown"> <div class="article markdown">
<h2 id="symbol-">Symbol 引用</h2> <h2 id="symbol-">Symbol 引用</h2>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -2153,6 +2153,20 @@
"font_class": "jiashang1", "font_class": "jiashang1",
"unicode": "e719", "unicode": "e719",
"unicode_decimal": 59161 "unicode_decimal": 59161
},
{
"icon_id": "12826208",
"name": "初始化",
"font_class": "chushihua",
"unicode": "e71c",
"unicode_decimal": 59164
},
{
"icon_id": "12826211",
"name": "测试集",
"font_class": "ceshiji",
"unicode": "e71e",
"unicode_decimal": 59166
} }
] ]
} }

@ -941,6 +941,12 @@ Created by iconfont
<glyph glyph-name="jiashang1" unicode="&#59161;" d="M512-128C228.693333-128 0 100.693333 0 384S228.693333 896 512 896s512-228.693333 512-512-228.693333-512-512-512z m0 989.866667C249.173333 861.866667 34.133333 646.826667 34.133333 384s215.04-477.866667 477.866667-477.866667 477.866667 215.04 477.866667 477.866667S774.826667 861.866667 512 861.866667zM699.733333 332.8h-375.466666c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h375.466666c20.48 0 34.133333-13.653333 34.133334-34.133334s-13.653333-34.133333-34.133334-34.133333zM512 145.066667c-20.48 0-34.133333 13.653333-34.133333 34.133333V554.666667c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333v-375.466667c0-20.48-13.653333-34.133333-34.133333-34.133333z" horiz-adv-x="1024" /> <glyph glyph-name="jiashang1" unicode="&#59161;" d="M512-128C228.693333-128 0 100.693333 0 384S228.693333 896 512 896s512-228.693333 512-512-228.693333-512-512-512z m0 989.866667C249.173333 861.866667 34.133333 646.826667 34.133333 384s215.04-477.866667 477.866667-477.866667 477.866667 215.04 477.866667 477.866667S774.826667 861.866667 512 861.866667zM699.733333 332.8h-375.466666c-20.48 0-34.133333 13.653333-34.133334 34.133333s13.653333 34.133333 34.133334 34.133334h375.466666c20.48 0 34.133333-13.653333 34.133334-34.133334s-13.653333-34.133333-34.133334-34.133333zM512 145.066667c-20.48 0-34.133333 13.653333-34.133333 34.133333V554.666667c0 20.48 13.653333 34.133333 34.133333 34.133333s34.133333-13.653333 34.133333-34.133333v-375.466667c0-20.48-13.653333-34.133333-34.133333-34.133333z" horiz-adv-x="1024" />
<glyph glyph-name="chushihua" unicode="&#59164;" d="M511.682434-128A468.457376 468.457376 0 0 0 44.559694 340.457376a66.73182 66.73182 0 0 0 133.46364 0A333.6591 333.6591 0 1 1 511.682434 675.451113a330.989827 330.989827 0 0 1-235.785764-98.095776 66.73182 66.73182 0 0 0-111.2197 66.73182l60.503517 203.309612a66.798552 66.798552 0 1 0 128.125094-37.814698l-9.564894-31.808835A468.234937 468.234937 0 1 0 511.682434-128zM600.658194 183.41516h-133.46364a66.73182 66.73182 0 0 0-66.73182 66.73182V472.58638a66.73182 66.73182 0 0 0 133.46364 0v-155.70758h66.73182a66.73182 66.73182 0 0 0 0-133.46364z" horiz-adv-x="1024" />
<glyph glyph-name="ceshiji" unicode="&#59166;" d="M536.332172 333.97898a75.330291 75.330291 0 0 0-29.985844 6.338471l-463.195967 207.95061a73.136205 73.136205 0 0 0 0 133.351681l463.195967 207.95061a73.136205 73.136205 0 0 0 59.971688 0l463.195966-207.95061a73.136205 73.136205 0 0 0 0-133.351681l-463.195966-207.95061a75.330291 75.330291 0 0 0-29.985844-6.338471zM251.832333 614.822008L536.332172 487.321224l284.499838 127.500784L536.332172 742.56658zM536.332172 102.868571a73.136205 73.136205 0 0 0-31.204781 7.069834l-463.195967 219.408615a73.184963 73.184963 0 0 0 62.409562 132.376532L536.332172 257.429752l431.259823 215.020443a73.136205 73.136205 0 0 0 65.33501-130.913807l-463.195966-230.866621a73.136205 73.136205 0 0 0-33.398867-7.801196zM536.332172-127.99805a73.136205 73.136205 0 0 0-31.204781 7.069833l-463.195967 219.408616a73.136205 73.136205 0 0 0 62.409562 131.888957L536.332172 26.319343l431.259823 215.264231a73.136205 73.136205 0 0 0 65.33501-130.913807l-463.195966-230.866621A73.136205 73.136205 0 0 0 536.332172-127.99805z" horiz-adv-x="1073" />
</font> </font>

Before

Width:  |  Height:  |  Size: 381 KiB

After

Width:  |  Height:  |  Size: 383 KiB

Loading…
Cancel
Save