zjz1993
5 years ago
25 changed files with 1412 additions and 268 deletions
@ -1 +1 @@ |
|||||||
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../models/classify.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAM7B;IAAsC,4BAAK;IAA3C;;IAkBA,CAAC;IAjBU,cAAK,GAAG,IAAI,CAAC;IAGpB;QADC,OAAO,CAAC,sBAAsB,EAAE;;gCACtB;IAIX;QAFC,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC/B,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;kCACjE;IAGb;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;mCACnD;IAGd;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAChC;IAGpB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAChC;IAjBH,QAAQ;QAD5B,OAAO,CAAC,MAAM,EAAE;OACI,QAAQ,CAkB5B;IAAD,eAAC;CAAA,AAlBD,CAAsC,mBAAK,GAkB1C;qBAlBoB,QAAQ"} |
{"version":3,"file":"classify.js","sourceRoot":"","sources":["../models/classify.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAM7B;IAAsC,4BAAK;IAA3C;;IAwBA,CAAC;IAvBU,cAAK,GAAG,IAAI,CAAC;IAGpB;QADC,OAAO,CAAC,sBAAsB,EAAE;;gCACtB;IAIX;QAFC,OAAO,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC/B,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;;kCACjE;IAGb;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;mCACnD;IAGd;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAChB;IAGpB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;mCACtB;IAGd;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAChC;IAGpB;QADC,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;yCAChC;IAvBH,QAAQ;QAD5B,OAAO,CAAC,MAAM,EAAE;OACI,QAAQ,CAwB5B;IAAD,eAAC;CAAA,AAxBD,CAAsC,mBAAK,GAwB1C;qBAxBoB,QAAQ"} |
@ -0,0 +1,53 @@ |
|||||||
|
"use strict"; |
||||||
|
var __extends = (this && this.__extends) || (function () { |
||||||
|
var extendStatics = function (d, b) { |
||||||
|
extendStatics = Object.setPrototypeOf || |
||||||
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
||||||
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
||||||
|
return extendStatics(d, b); |
||||||
|
}; |
||||||
|
return function (d, b) { |
||||||
|
extendStatics(d, b); |
||||||
|
function __() { this.constructor = d; } |
||||||
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
||||||
|
}; |
||||||
|
})(); |
||||||
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
||||||
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
||||||
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
||||||
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
||||||
|
return c > 3 && r && Object.defineProperty(target, key, r), r; |
||||||
|
}; |
||||||
|
var __metadata = (this && this.__metadata) || function (k, v) { |
||||||
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
||||||
|
}; |
||||||
|
exports.__esModule = true; |
||||||
|
var TypeORM = require("typeorm"); |
||||||
|
var common_1 = require("./common"); |
||||||
|
var ClassifyToProblem = /** @class */ (function (_super) { |
||||||
|
__extends(ClassifyToProblem, _super); |
||||||
|
function ClassifyToProblem() { |
||||||
|
return _super !== null && _super.apply(this, arguments) || this; |
||||||
|
} |
||||||
|
ClassifyToProblem.cache = true; |
||||||
|
__decorate([ |
||||||
|
TypeORM.PrimaryGeneratedColumn(), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], ClassifyToProblem.prototype, "id"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ nullable: true, type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], ClassifyToProblem.prototype, "c_id"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ nullable: true, type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], ClassifyToProblem.prototype, "p_id"); |
||||||
|
ClassifyToProblem = __decorate([ |
||||||
|
TypeORM.Entity() |
||||||
|
], ClassifyToProblem); |
||||||
|
return ClassifyToProblem; |
||||||
|
}(common_1["default"])); |
||||||
|
exports["default"] = ClassifyToProblem; |
||||||
|
//# sourceMappingURL=classify_to_problem.js.map
|
@ -0,0 +1 @@ |
|||||||
|
{"version":3,"file":"classify_to_problem.js","sourceRoot":"","sources":["../models/classify_to_problem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAG7B;IAA+C,qCAAK;IAApD;;IAaA,CAAC;IAZU,uBAAK,GAAG,IAAI,CAAC;IAGpB;QADC,OAAO,CAAC,sBAAsB,EAAE;;yCACtB;IAIX;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2CACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;2CACvC;IAZI,iBAAiB;QADrC,OAAO,CAAC,MAAM,EAAE;OACI,iBAAiB,CAarC;IAAD,wBAAC;CAAA,AAbD,CAA+C,mBAAK,GAanD;qBAboB,iBAAiB"} |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,73 @@ |
|||||||
|
"use strict"; |
||||||
|
var __extends = (this && this.__extends) || (function () { |
||||||
|
var extendStatics = function (d, b) { |
||||||
|
extendStatics = Object.setPrototypeOf || |
||||||
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || |
||||||
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; |
||||||
|
return extendStatics(d, b); |
||||||
|
}; |
||||||
|
return function (d, b) { |
||||||
|
extendStatics(d, b); |
||||||
|
function __() { this.constructor = d; } |
||||||
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); |
||||||
|
}; |
||||||
|
})(); |
||||||
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { |
||||||
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; |
||||||
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); |
||||||
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; |
||||||
|
return c > 3 && r && Object.defineProperty(target, key, r), r; |
||||||
|
}; |
||||||
|
var __metadata = (this && this.__metadata) || function (k, v) { |
||||||
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); |
||||||
|
}; |
||||||
|
exports.__esModule = true; |
||||||
|
var TypeORM = require("typeorm"); |
||||||
|
var common_1 = require("./common"); |
||||||
|
var UserToPractice = /** @class */ (function (_super) { |
||||||
|
__extends(UserToPractice, _super); |
||||||
|
function UserToPractice() { |
||||||
|
return _super !== null && _super.apply(this, arguments) || this; |
||||||
|
} |
||||||
|
UserToPractice.cache = true; |
||||||
|
__decorate([ |
||||||
|
TypeORM.PrimaryGeneratedColumn(), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "id"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ nullable: true, type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "u_id"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ nullable: true, type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "c_id"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ nullable: true, type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "p_id"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "is_practice"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "is_finished"); |
||||||
|
__decorate([ |
||||||
|
TypeORM.Index(), |
||||||
|
TypeORM.Column({ type: "integer" }), |
||||||
|
__metadata("design:type", Number) |
||||||
|
], UserToPractice.prototype, "practice_num"); |
||||||
|
UserToPractice = __decorate([ |
||||||
|
TypeORM.Entity() |
||||||
|
], UserToPractice); |
||||||
|
return UserToPractice; |
||||||
|
}(common_1["default"])); |
||||||
|
exports["default"] = UserToPractice; |
||||||
|
//# sourceMappingURL=user_to_practice.js.map
|
@ -0,0 +1 @@ |
|||||||
|
{"version":3,"file":"user_to_practice.js","sourceRoot":"","sources":["../models/user_to_practice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCAAmC;AACnC,mCAA6B;AAG7B;IAA4C,kCAAK;IAAjD;;IA6BA,CAAC;IA5BU,oBAAK,GAAG,IAAI,CAAC;IAGpB;QADC,OAAO,CAAC,sBAAsB,EAAE;;sCACtB;IAIX;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;wCACvC;IAIb;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CAChB;IAIpB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;+CAChB;IAIpB;QAFC,OAAO,CAAC,KAAK,EAAE;QACf,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;;gDACf;IA5BJ,cAAc;QADlC,OAAO,CAAC,MAAM,EAAE;OACI,cAAc,CA6BlC;IAAD,qBAAC;CAAA,AA7BD,CAA4C,mBAAK,GA6BhD;qBA7BoB,cAAc"} |
@ -0,0 +1,18 @@ |
|||||||
|
import * as TypeORM from "typeorm"; |
||||||
|
import Model from "./common"; |
||||||
|
|
||||||
|
@TypeORM.Entity() |
||||||
|
export default class ClassifyToProblem extends Model { |
||||||
|
static cache = true; |
||||||
|
|
||||||
|
@TypeORM.PrimaryGeneratedColumn() |
||||||
|
id: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ nullable: true, type: "integer" }) |
||||||
|
c_id: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ nullable: true, type: "integer" }) |
||||||
|
p_id: number; |
||||||
|
} |
@ -0,0 +1,34 @@ |
|||||||
|
import * as TypeORM from "typeorm"; |
||||||
|
import Model from "./common"; |
||||||
|
|
||||||
|
@TypeORM.Entity() |
||||||
|
export default class UserToPractice extends Model { |
||||||
|
static cache = true; |
||||||
|
|
||||||
|
@TypeORM.PrimaryGeneratedColumn() |
||||||
|
id: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ nullable: true, type: "integer" }) |
||||||
|
u_id: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ nullable: true, type: "integer" }) |
||||||
|
c_id: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ nullable: true, type: "integer" }) |
||||||
|
p_id: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ type: "integer" }) |
||||||
|
is_practice: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ type: "integer" }) |
||||||
|
is_finished: number; |
||||||
|
|
||||||
|
@TypeORM.Index() |
||||||
|
@TypeORM.Column({ type: "integer" }) |
||||||
|
practice_num: number; |
||||||
|
} |
@ -1,214 +1,40 @@ |
|||||||
<% this.title = '练习' %> |
<% this.title = '练习' %> |
||||||
<style> |
<style> |
||||||
.practice{ |
#practice{ |
||||||
display: flex; |
|
||||||
width: 100%; |
width: 100%; |
||||||
} |
} |
||||||
.practice .practice-main{ |
|
||||||
width: 80%; |
|
||||||
margin-right: 30px; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-navigation{ |
|
||||||
margin-bottom: 10px; |
|
||||||
background-color: #efefef; |
|
||||||
padding: 10px; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-navigation .classify-card{ |
|
||||||
width: 90px; |
|
||||||
height: 90px; |
|
||||||
display: inline-block; |
|
||||||
margin: 5px; |
|
||||||
vertical-align: top; |
|
||||||
cursor: pointer; |
|
||||||
background-color: red; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-navigation .classify-card small{ |
|
||||||
font-size: 12px; |
|
||||||
color: #fff; |
|
||||||
display: block; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-navigation .classify-card .classify-name{ |
|
||||||
text-align: center; |
|
||||||
line-height: 50px; |
|
||||||
color: white; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body{ |
|
||||||
background-color: #efefef; |
|
||||||
padding: 10px; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card{ |
|
||||||
margin-bottom: 20px; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card .classify-card-title{ |
|
||||||
margin-bottom: 10px; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card .classify-card-description{ |
|
||||||
border-bottom:1px solid #e4e4e4; |
|
||||||
margin-bottom: 10px; |
|
||||||
padding-bottom: 5px; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card .classify-card-problem{ |
|
||||||
border-top:1px solid #e4e4e4; |
|
||||||
padding-top: 10px; |
|
||||||
display: flex; |
|
||||||
flex-wrap: wrap; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card .classify-card-problem .problem{ |
|
||||||
border-radius: 5px; |
|
||||||
width: 30%; |
|
||||||
background-color: white; |
|
||||||
margin: 10px; |
|
||||||
height: 100px; |
|
||||||
overflow: hidden; |
|
||||||
cursor: pointer; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card .classify-card-problem .problem .problem-title{ |
|
||||||
text-align: center; |
|
||||||
padding: 5px 0; |
|
||||||
color: #14a6ef; |
|
||||||
background-color: rgba(59,180,242,.15); |
|
||||||
border-color: #caebfb; |
|
||||||
} |
|
||||||
.practice .practice-main .practice-main-body .classify-card .classify-card-problem .problem .problem-info{ |
|
||||||
font-size: 13px; |
|
||||||
padding: 5px; |
|
||||||
} |
|
||||||
.practice .practice-right{ |
|
||||||
width: 300px; |
|
||||||
padding: 30px 10px; |
|
||||||
height:200px; |
|
||||||
background-color: #efefef; |
|
||||||
} |
|
||||||
.practice .practice-right .username{ |
|
||||||
color:#3590D2; |
|
||||||
} |
|
||||||
</style> |
</style> |
||||||
<% include header %> |
<% include header %> |
||||||
<div class="practice"> |
<div id="practice"> |
||||||
<div class="practice-main"> |
<% if(result.length === 0) { %> <div class="ui placeholder segment"> |
||||||
<div class="practice-main-navigation"> |
<div class="ui icon header"> |
||||||
<div class="classify-card"> |
<i class="sticky note icon"></i> |
||||||
<small>#1</small> |
暂无题目处于可练习的状态下 |
||||||
<div class="classify-name">分类名字</div> |
</div> |
||||||
</div> |
</div> <% } else { %> <table class="ui very basic center aligned table"> |
||||||
<div class="classify-card"> |
<thead> |
||||||
<small>#1</small> |
<tr> |
||||||
<div class="classify-name">分类名字</div> |
<th>练习阶段名称</th> |
||||||
</div> |
<th>练习阶段介绍</th> |
||||||
</div> |
<th>练习阶段包含题目数量</th> |
||||||
<div class="practice-main-body"> |
<th>已完成题目数量</th> |
||||||
<div class="classify-card"> |
<th>练习阶段状态</th> |
||||||
<div class="classify-card-title"> |
<th>是否是当前阶段</th> |
||||||
<h2>测试分类</h2> |
</tr> |
||||||
</div> |
</thead> |
||||||
<div class="classify-card-description"> |
<tbody> |
||||||
测试分类的介绍 |
<% for (let resultItem of result){%> |
||||||
</div> |
<tr> |
||||||
<div class="ui indicating progress" data-value="124" data-total="200"> |
<% if(resultItem.href) { %> <td><a href="<%= resultItem.href%>"><%= resultItem.name%></a></td> <% } else { %> <td><%= resultItem.name%></td> <% } %> |
||||||
<div class="bar"> |
<td><%= resultItem.intro%></td> |
||||||
<div class="progress"></div> |
<td><%= resultItem.problem_num%></td> |
||||||
</div> |
<td><%= resultItem.ac_num%></td> |
||||||
<div class="label">当前分类完成进度</div> |
<% if(resultItem.href) { %> <td>可练习</td> <% } else { %> <td>目前不可练习,完成当前阶段后解锁</td> <% } %> |
||||||
</div> |
<% if(resultItem.isNow) { %> <td>是</td> <% } else { %> <td>否</td> <% } %> |
||||||
<div class="classify-card-problem"> |
</tr> |
||||||
<div class="problem"> |
<%}%> |
||||||
<div class="problem-title"> |
</tbody> |
||||||
第一个问题 |
</table> <% } %> |
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介发送到发送到范德萨发士大夫撒打发斯蒂芬 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="classify-card"> |
|
||||||
<div class="classify-card-title"> |
|
||||||
<h2>测试分类</h2> |
|
||||||
</div> |
|
||||||
<div class="classify-card-description"> |
|
||||||
测试分类的介绍 |
|
||||||
</div> |
|
||||||
<div class="ui indicating progress" data-value="1" data-total="200"> |
|
||||||
<div class="bar"> |
|
||||||
<div class="progress"></div> |
|
||||||
</div> |
|
||||||
<div class="label">当前分类完成进度</div> |
|
||||||
</div> |
|
||||||
<div class="classify-card-problem"> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介发送到发送到范德萨发士大夫撒打发斯蒂芬 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="problem"> |
|
||||||
<div class="problem-title"> |
|
||||||
第一个问题 |
|
||||||
</div> |
|
||||||
<div class="problem-info"> |
|
||||||
题目简介简介题目简介简介题目简介简介题目简介简介题目简介简介 |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
<div class="practice-right"> |
|
||||||
<h1 class="username">用户名</h1> |
|
||||||
<p>已通过数/分类总题数:5/20</p> |
|
||||||
</div> |
|
||||||
</div> |
|
||||||
|
|
||||||
<script> |
</div> |
||||||
function getColor() { |
|
||||||
let colorArray =["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]; |
|
||||||
let color="#"; |
|
||||||
for(let i=0;i<6;i++) { |
|
||||||
color+=colorArray[Math.floor(Math.random()*16)]; |
|
||||||
} |
|
||||||
return color; |
|
||||||
} |
|
||||||
</script> |
|
||||||
<% include footer %> |
<% include footer %> |
||||||
|
@ -0,0 +1,26 @@ |
|||||||
|
<% this.title = '练习' %> |
||||||
|
<style> |
||||||
|
</style> |
||||||
|
<% include header %> |
||||||
|
<div id="practice_classify"> |
||||||
|
<table class="ui selectable celled table"> |
||||||
|
<thead> |
||||||
|
<tr> |
||||||
|
<th>题目</th> |
||||||
|
<th>状态</th> |
||||||
|
</tr> |
||||||
|
</thead> |
||||||
|
<tbody> |
||||||
|
<% for (let problemItem of problems){%> |
||||||
|
<tr> |
||||||
|
<td><a href="<%= problemItem.href %>"><%= problemItem.title %></a></td> |
||||||
|
<td><%= problemItem.statusStr %></td> |
||||||
|
</tr> |
||||||
|
<%}%> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
|
||||||
|
<script> |
||||||
|
</script> |
||||||
|
<% include footer %> |
@ -0,0 +1,392 @@ |
|||||||
|
<% include util %> |
||||||
|
<% |
||||||
|
if (typeof contest === 'undefined') contest = null; |
||||||
|
if (contest) { |
||||||
|
this.title = this.alpha(pid) + '. ' + syzoj.utils.removeTitleTag(problem.title) + ' - ' + contest.title + ' - 比赛'; |
||||||
|
} else { |
||||||
|
this.title = problem.title + ' - 题目'; |
||||||
|
} |
||||||
|
%> |
||||||
|
<% include header %> |
||||||
|
<style> |
||||||
|
#languages-menu::-webkit-scrollbar, #testcase-menu::-webkit-scrollbar { |
||||||
|
width: 0px; |
||||||
|
background: transparent; |
||||||
|
} |
||||||
|
|
||||||
|
#languages-menu .item::after, #testcase-menu .item::after { |
||||||
|
display: none; |
||||||
|
} |
||||||
|
</style> |
||||||
|
|
||||||
|
<% include monaco-editor %> |
||||||
|
|
||||||
|
<div class="ui center aligned grid"> |
||||||
|
<div class="row"> |
||||||
|
<h1 class="ui header"> |
||||||
|
<% if (contest) { %> |
||||||
|
<%= this.alpha(pid) %>. <%= syzoj.utils.removeTitleTag(problem.title) %> |
||||||
|
<% } else { %> |
||||||
|
#<%= problem.id %>. <%= problem.title %><% if (problem.allowedEdit && !problem.is_public) { %><span class="ui tiny red label">未公开</span><% } %> |
||||||
|
<% } %> |
||||||
|
</h1> |
||||||
|
</div> |
||||||
|
<% if (problem.type !== 'submit-answer') { %> |
||||||
|
<div class="row" style="margin-top: -15px"> |
||||||
|
<span class="ui label">内存限制:<%= problem.memory_limit %> MiB</span> |
||||||
|
<span class="ui label">时间限制:<%= problem.time_limit %> ms</span> |
||||||
|
<% if (problem.type === 'interaction') { %> |
||||||
|
<span class="ui label">题目类型:交互</span> |
||||||
|
<% } else if (problem.file_io) { %> |
||||||
|
<span class="ui label">输入文件:<%= problem.file_io_input_name %></span> |
||||||
|
<span class="ui label">输出文件:<%= problem.file_io_output_name %></span> |
||||||
|
<% } else { %> |
||||||
|
<span class="ui label">标准输入输出</span> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (problem.type !== 'interaction') { %> |
||||||
|
<div class="row" style="margin-top: -<%= problem.type === 'submit-answer' ? 15 : 23 %>px"> |
||||||
|
<span class="ui label">题目类型:<%= { 'submit-answer': '答案提交', 'interaction': '交互', 'traditional': '传统' }[problem.type] %></span> |
||||||
|
<span class="ui label">评测方式:<%= (testcases && !testcases.error) ? (testcases.spj ? 'Special Judge' : '文本比较') : '无测试数据' %></span> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (!contest) { %> |
||||||
|
<div class="row" style="margin-top: -23px"> |
||||||
|
<span class="ui label">上传者: |
||||||
|
<% if (problem.is_anonymous && !problem.allowedManage) { %> |
||||||
|
匿名 |
||||||
|
<% } else { %> |
||||||
|
<a href="<%= syzoj.utils.makeUrl(['user', problem.user_id]) %>"><%= problem.user.username %></a> |
||||||
|
<% } %> |
||||||
|
</span> |
||||||
|
<% if (problem.allowedManage) { %> |
||||||
|
<span class="ui label">公开者: |
||||||
|
<% if (problem.publicizer) { %> |
||||||
|
<a href="<%= syzoj.utils.makeUrl(['user', problem.publicizer_id]) %>"><%= problem.publicizer.username %></a> |
||||||
|
<% } else { %> |
||||||
|
未知 |
||||||
|
<% } %> |
||||||
|
</span> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<div class="ui grid"> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<div class="ui buttons"> |
||||||
|
<% if (typeof contest !== 'undefined' && contest) { %> |
||||||
|
<% if (!contest.ended) { %> |
||||||
|
<a class="small ui primary button" href="#submit_code">提交</a> |
||||||
|
<% } else { %> |
||||||
|
<a class="small ui primary button" href="<%= syzoj.utils.makeUrl(['problem', problem.id]) %>">转到题库</a> |
||||||
|
<% } %> |
||||||
|
<a class="small ui positive button" href="<%= syzoj.utils.makeUrl(['contest', contest.id, 'submissions'], { problem_id: pid }) %>">提交记录</a> |
||||||
|
<% if (problem.additional_file) { %> |
||||||
|
<a class="small ui teal button" href="<%= syzoj.utils.makeUrl(['contest', contest.id, pid, 'download', 'additional_file']) %>">附加文件</a> |
||||||
|
<% } %> |
||||||
|
<a href="<%= syzoj.utils.makeUrl(['contest', contest.id]) %>" class="ui orange button">返回比赛</a> |
||||||
|
<% } else { %> |
||||||
|
<% if (testcases && !testcases.error) { %> |
||||||
|
<a class="small ui primary button" href="#submit_code">提交</a> |
||||||
|
<% } %> |
||||||
|
<a class="small ui positive button" href="<%= syzoj.utils.makeUrl(['submissions'], { problem_id: problem.id }) %>">提交记录</a> |
||||||
|
<a class="small ui orange button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'statistics', problem.type === 'submit-answer' ? 'shortest' : 'fastest']) %>">统计</a> |
||||||
|
<a class="small ui yellow button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'testdata']) %>">测试数据</a> |
||||||
|
<% if (problem.additional_file) { %> |
||||||
|
<a class="small ui teal button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'download', 'additional_file']) %>">附加文件</a> |
||||||
|
<% } %> |
||||||
|
<a class="small ui brown button" href="<%= syzoj.utils.makeUrl(['discussion', 'problem', problem.id]) %>" style="position: relative; "> |
||||||
|
讨论 |
||||||
|
<% if (discussionCount) { %> |
||||||
|
<div class="floating ui red tiny circular label" style="background-color: #8c5633 !important; top: -0.6em; "><%= discussionCount %></div> |
||||||
|
<% } %> |
||||||
|
</a> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<% if (!contest) { %> |
||||||
|
<div class="ui buttons right floated"> |
||||||
|
<% if (problem.allowedEdit) { %> |
||||||
|
<a class="small ui button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'edit']) %>">编辑</a> |
||||||
|
<a class="small ui button" href="<%= syzoj.utils.makeUrl(['problem', problem.id, 'manage']) %>">管理</a> |
||||||
|
<% } %> |
||||||
|
<% if (problem.allowedManage) { %> |
||||||
|
<% if (problem.is_public) { %> |
||||||
|
<a class="small ui button" id="dis_public" href-post="<%= syzoj.utils.makeUrl(['problem', problem.id, 'dis_public']) %>">取消公开</a> |
||||||
|
<% } else { %> |
||||||
|
<a class="small ui button" id="public" href-post="<%= syzoj.utils.makeUrl(['problem', problem.id, 'public']) %>">公开</a> |
||||||
|
<% } %> |
||||||
|
<div class="ui basic modal" id="modal-delete"> |
||||||
|
<div class="ui icon header"> |
||||||
|
<i class="trash icon"></i> |
||||||
|
<p style="margin-top: 15px; ">删除题目</p> |
||||||
|
</div> |
||||||
|
<div class="content" style="text-align: center; "> |
||||||
|
<p>确认删除此题目吗?提交记录、讨论以及测试数据将一并删除。<br> |
||||||
|
删除题目导致的修改用户提交、通过数量可能会耗费一些时间。</p> |
||||||
|
<b>警告:删除比赛中的题目会导致系统错乱!请确认没有比赛使用此题目。</b> |
||||||
|
</div> |
||||||
|
<div class="actions"> |
||||||
|
<div class="ui red basic cancel inverted button"> |
||||||
|
<i class="remove icon"></i> |
||||||
|
否 |
||||||
|
</div> |
||||||
|
<a class="ui green ok inverted button" href-post="<%= syzoj.utils.makeUrl(['problem', problem.id, 'delete']) %>"> |
||||||
|
<i class="checkmark icon"></i> |
||||||
|
是 |
||||||
|
</a> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="small ui red button" onclick="$('#modal-delete').modal('show')">删除</div> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% if (problem.description) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<h4 class="ui top attached block header">题目描述</h4> |
||||||
|
<div class="ui bottom attached segment font-content"><%- problem.description %></div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (problem.input_format) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<h4 class="ui top attached block header">输入格式</h4> |
||||||
|
<div class="ui bottom attached segment font-content"><%- problem.input_format %></div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (problem.output_format) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<h4 class="ui top attached block header">输出格式</h4> |
||||||
|
<div class="ui bottom attached segment font-content"><%- problem.output_format %></div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (problem.example) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<h4 class="ui top attached block header">样例</h4> |
||||||
|
<div class="ui bottom attached segment font-content"><%- problem.example %></div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (problem.limit_and_hint) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<h4 class="ui top attached block header">数据范围与提示</h4> |
||||||
|
<div class="ui bottom attached segment font-content"><%- problem.limit_and_hint %></div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<% if (problem.tags && problem.tags.length && (typeof contest === 'undefined' || !contest)) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<h4 class="ui block header" id="show_tag_title_div" style="margin-bottom: 0; margin-left: -1px; margin-right: -1px; "><a href="#" id="show_tag_button" style="color: #000; ">显示分类标签</a></h4> |
||||||
|
<div class="ui bottom attached segment" style="display: none; " id="show_tag_div"> |
||||||
|
<% for (let tag of problem.tags) { %> |
||||||
|
<a href="<%= syzoj.utils.makeUrl(['problems', 'tag', tag.id]) %>" class="ui medium <%= tag.color %> label"> |
||||||
|
<%= tag.name %> |
||||||
|
</a> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<script> |
||||||
|
$(function () { |
||||||
|
$('#show_tag_button').click(function (e) { |
||||||
|
e.preventDefault(); |
||||||
|
$('#show_tag_title_div').addClass('top'); |
||||||
|
$('#show_tag_title_div').addClass('top attached'); |
||||||
|
$('#show_tag_title_div').text('分类标签'); |
||||||
|
$('#show_tag_div').css('display', ''); |
||||||
|
}) |
||||||
|
}); |
||||||
|
</script> |
||||||
|
<% } %> |
||||||
|
<% let noSubmit = false; %> |
||||||
|
<% |
||||||
|
if (typeof contest !== 'undefined' && contest && contest.ended || (!testcases || testcases.error)) { |
||||||
|
noSubmit = true; |
||||||
|
} |
||||||
|
%> |
||||||
|
<% if (noSubmit) { %> |
||||||
|
<div class="row"> |
||||||
|
<div class="column"> |
||||||
|
<% |
||||||
|
const formUrl = syzoj.utils.makeUrl(['problem', 'practice', problem.id, cid, 'submit']); |
||||||
|
%> |
||||||
|
<form action="<%= formUrl %>" method="post" onsubmit="return submit_code()" id="submit_code" enctype="multipart/form-data"> |
||||||
|
<% if (problem.type === 'submit-answer') { %> |
||||||
|
<% |
||||||
|
let cases = []; |
||||||
|
if (testcases && !testcases.error) { |
||||||
|
for (let subtasks of testcases) { |
||||||
|
for (let testcase of subtasks.cases) { |
||||||
|
cases.push(testcase.answer); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
%> |
||||||
|
<script> |
||||||
|
var cases = <%- serializejs(cases) %>, currCase = 0; |
||||||
|
</script> |
||||||
|
<div class="ui grid"> |
||||||
|
<% if (testcases) { %> |
||||||
|
<div class="four wide column" style="margin-right: -25px; "> |
||||||
|
<div class="ui attached vertical fluid pointing menu" id="testcase-menu" style="height: 370px; overflow-y: scroll; overflow-x: hidden; "> |
||||||
|
<% for (let i = 0; i < cases.length; i++) { %> |
||||||
|
<a style="border-radius: 0; " class="item<%= i === 0 ? ' active' : '' %>" data-value="<%= i %>"> |
||||||
|
<%= cases[i] %> |
||||||
|
</a> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="twelve wide stretched column" style="position: relative; padding-left: 0; margin-left: calc(-1rem - 1px); width: calc(75% + 1rem + 13px) !important; "> |
||||||
|
<% for (let i = 0; i < cases.length; i++) { %> |
||||||
|
<div id="editor-<%= i %>" class="editor" style="position: absolute; width: 100%; height: calc(100% - 28px); border: 1px solid #D4D4D5; overflow: hidden; <%= i === 0 ? '' : 'visibility: hidden; ' %>"> |
||||||
|
<%- this.showLoadingEditor(); %> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
<input id="answer_by_editor" name="answer_by_editor" type="hidden"> |
||||||
|
<script> |
||||||
|
window.onEditorLoaded(function () { |
||||||
|
window.editors = []; |
||||||
|
for (var i = 0; i < cases.length; i++) { |
||||||
|
var editor = window.createCodeEditor(document.getElementById("editor-" + i)); |
||||||
|
editors[i] = editor; |
||||||
|
} |
||||||
|
|
||||||
|
$(function () { |
||||||
|
$('#testcase-menu .item').click(function() { |
||||||
|
$(this) |
||||||
|
.addClass('active') |
||||||
|
.closest('.ui.menu') |
||||||
|
.find('.item') |
||||||
|
.not($(this)) |
||||||
|
.removeClass('active') |
||||||
|
; |
||||||
|
|
||||||
|
var x = $(this).attr('data-value'); |
||||||
|
if (currCase != x) { |
||||||
|
$('#editor-' + currCase).css('visibility', 'hidden'); |
||||||
|
$('#editor-' + x).css('visibility', 'visible'); |
||||||
|
currCase = x; |
||||||
|
} |
||||||
|
}); |
||||||
|
}); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
<div class="ui form" style="width: 100%; "> |
||||||
|
<div class="inline fields" style="width: 100%; "> |
||||||
|
<div class="field" style="margin: 0 auto; "> |
||||||
|
<label for="answer">或者,上传答案(请使用 ZIP 格式压缩)</label> |
||||||
|
<input type="file" id="answer" name="answer"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="ui center aligned vertical segment" style="padding-bottom: 0; "><button type="submit" class="ui labeled icon button"><i class="ui edit icon"></i>提交</button></div> |
||||||
|
<% } else { %> |
||||||
|
<input name="language" type="hidden" id="form"> |
||||||
|
<input name="code" type="hidden"> |
||||||
|
<div class="ui grid"> |
||||||
|
<div class="four wide column" style="margin-right: -25px; "> |
||||||
|
<div class="ui attached vertical fluid pointing menu" id="languages-menu" style="height: 370px; overflow-y: scroll; overflow-x: hidden; "> |
||||||
|
<% |
||||||
|
let language = syzoj.config.enabled_languages[0]; |
||||||
|
if (state) { |
||||||
|
language = state.language; |
||||||
|
} else if (lastLanguage) language = lastLanguage; |
||||||
|
%> |
||||||
|
<% for (lang of syzoj.config.enabled_languages) { %> |
||||||
|
<a style="border-radius: 0; " class="item<%= lang === language ? ' active' : '' %>" data-value="<%= lang %>" data-mode="<%= syzoj.languages[lang].editor %>"> |
||||||
|
<%= syzoj.languages[lang].show %> |
||||||
|
<div class="ui right floated" style="opacity: 0.4; margin-top: 8px; font-size: 0.7em; "><%= syzoj.languages[lang].version %></div> |
||||||
|
</a> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="twelve wide stretched column" style="position: relative; padding-left: 0; margin-left: calc(-1rem - 1px); width: calc(75% + 1rem + 13px) !important; "> |
||||||
|
<div id="editor" style="position: absolute; width: 100%; height: calc(100% - 28px); border: 1px solid #D4D4D5; overflow: hidden; " class="editor"> |
||||||
|
<%- this.showLoadingEditor(); %> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="ui form" style="width: 100%; "> |
||||||
|
<div class="inline fields" style="width: 100%; "> |
||||||
|
<div class="field" style="margin: 0 auto; "> |
||||||
|
<label for="answer">或者,上传代码文件</label> |
||||||
|
<input type="file" id="answer" name="answer"> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="ui center aligned vertical segment" style="padding-bottom: 0; "> |
||||||
|
<button type="submit" class="ui labeled icon button"><i class="ui edit icon"></i>提交</button> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
</form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<% } %> |
||||||
|
</div> |
||||||
|
|
||||||
|
<% if (problem.type !== 'submit-answer') { %> |
||||||
|
<script type="text/javascript"> |
||||||
|
var editor; |
||||||
|
window.onEditorLoaded(function () { |
||||||
|
var editorElement = document.getElementById('editor'); |
||||||
|
var content = ''; |
||||||
|
<% if (state) { %>content = <%- serializejs(state.code) %>;<% } %> |
||||||
|
editor = window.createCodeEditor(editorElement, $('#languages-menu .item.active').data('mode'), content); |
||||||
|
window.editor = editor; |
||||||
|
}); |
||||||
|
|
||||||
|
var lastSubmitted = ''; |
||||||
|
|
||||||
|
function submit_code() { |
||||||
|
if (!$('#submit_code input[name=answer]').val().trim() && !editor.getValue().trim()) return false; |
||||||
|
$('#submit_code input[name=language]').val($('#languages-menu .item.active').data('value')); |
||||||
|
lastSubmitted = editor.getValue(); |
||||||
|
$('#submit_code input[name=code]').val(editor.getValue()); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
$('#languages-menu')[0].scrollTop = $('#languages-menu .active')[0].offsetTop - $('#languages-menu')[0].firstElementChild.offsetTop; |
||||||
|
|
||||||
|
$(function () { |
||||||
|
$('#languages-menu .item').click(function() { |
||||||
|
$(this) |
||||||
|
.addClass('active') |
||||||
|
.closest('.ui.menu') |
||||||
|
.find('.item') |
||||||
|
.not($(this)) |
||||||
|
.removeClass('active') |
||||||
|
; |
||||||
|
monaco.editor.setModelLanguage(editor.getModel(), $(this).data('mode')); |
||||||
|
}); |
||||||
|
}); |
||||||
|
</script> |
||||||
|
|
||||||
|
<% } else { %> |
||||||
|
<script> |
||||||
|
function submit_code() { |
||||||
|
var a = []; |
||||||
|
for (var i = 0; i < cases.length; i++) { |
||||||
|
a.push({ |
||||||
|
filename: cases[i], |
||||||
|
data: editors[i].getValue() |
||||||
|
}); |
||||||
|
} |
||||||
|
$('#answer_by_editor').val(JSON.stringify(a)); |
||||||
|
} |
||||||
|
</script> |
||||||
|
<% } %> |
||||||
|
<% include footer %> |
Loading…
Reference in new issue