Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into yslissue25014
commit
4ad5b6ebc6
@ -1,4 +1,9 @@
|
||||
class ChallengeAnswer < ApplicationRecord
|
||||
default_scope { order("challenge_answers.level asc") }
|
||||
belongs_to :challenge
|
||||
has_many :game_answers, :dependent => :destroy
|
||||
|
||||
def view_answer_time(user_id)
|
||||
game_answers.where(user_id: user_id).last&.view_time
|
||||
end
|
||||
end
|
||||
|
@ -0,0 +1,5 @@
|
||||
class GameAnswer < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :game
|
||||
belongs_to :challenge_answer
|
||||
end
|
@ -0,0 +1,13 @@
|
||||
class CreateGameAnswers < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :game_answers do |t|
|
||||
t.references :challenge_answer
|
||||
t.references :user
|
||||
t.references :game
|
||||
t.datetime :view_time
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddIndexForGameAnswers < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_index :game_answers, [:challenge_answer_id, :user_id], :unique => true
|
||||
end
|
||||
end
|
@ -0,0 +1,5 @@
|
||||
class AddTeamTitleToSubjects < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
add_column :subjects, :team_title, :string, default: "教学团队"
|
||||
end
|
||||
end
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 308 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,58 @@
|
||||
import React, { Component } from 'react';
|
||||
|
||||
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
|
||||
|
||||
import { Spin } from 'antd';
|
||||
import axios from 'axios';
|
||||
class Otherloginqq extends Component {
|
||||
|
||||
componentDidMount() {
|
||||
let query=this.props.location.search;
|
||||
|
||||
const type = query.split('?code=');
|
||||
const types = type[1].split('&state=');
|
||||
let codeurl = `/auth/qq/callback`;
|
||||
axios.get(codeurl,{params:{
|
||||
code:type[1],
|
||||
redirect_uri:`https://${window.location.host}/otherloginqq`
|
||||
}}).then((result)=> {
|
||||
if(result){
|
||||
if(result.data.status===0){
|
||||
if(result.data.new_user===true){
|
||||
window.location.href="/otherlogin?type=qq"
|
||||
}else{
|
||||
// this.getinfo()
|
||||
if(types[1]==="account"){
|
||||
window.location.href="/account/binding"
|
||||
}else{
|
||||
window.location.href="/"
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}).catch((error)=>{
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
// Loading
|
||||
return (
|
||||
<div className="App" style={{minHeight: '800px',width:"100%"}}>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.margintop{
|
||||
margin-top:20%;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<Spin size="large" className={"margintop"}/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default Otherloginqq;
|
@ -0,0 +1,169 @@
|
||||
import React, {Component} from 'react';
|
||||
import {Button, Layout, Input, Form} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {getImageUrl} from 'educoder';
|
||||
|
||||
|
||||
class Modifytext extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
//重新输入教学模式
|
||||
Modifytext = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
const url = `/paths/${this.props.pathid}/update_team_title.json`;
|
||||
axios.post(url, {
|
||||
team_title: values.teachingteam
|
||||
}).then((response) => {
|
||||
console.log(response);
|
||||
if (response) {
|
||||
if (response.data) {
|
||||
if (response.data.status === 0) {
|
||||
try {
|
||||
this.props.showNotification("修改成功!");
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
this.props.modifysy(2);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {getFieldDecorator} = this.props.form;
|
||||
return (
|
||||
<div>
|
||||
<div className="ml38">
|
||||
<style>{`
|
||||
|
||||
.flexRow {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.flexRow .name {
|
||||
margin-left: 12px;
|
||||
color: #666666;
|
||||
|
||||
text-align: center;
|
||||
flex: 0 0 100px;
|
||||
}
|
||||
.flexRow .description {
|
||||
margin-left: 10px;
|
||||
flex: 1;
|
||||
color: #CDCDCD;
|
||||
}
|
||||
.description span {
|
||||
margin-right: 20px;
|
||||
color: #05101A;
|
||||
}
|
||||
.flexRow .status {
|
||||
width: 100px;
|
||||
color: #28AC7F;
|
||||
text-align: right;
|
||||
}
|
||||
.flexTable .flexTable {
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
}
|
||||
|
||||
.settingFormsy label{
|
||||
color: #666666;
|
||||
font-size: 14px !important ;
|
||||
|
||||
}
|
||||
.settingFormsy input {
|
||||
width: 275px;
|
||||
height: 32px;
|
||||
}
|
||||
.settingFormsy input.validateInput {
|
||||
width: 220px;
|
||||
}
|
||||
.settingFormsy .formItemInline button {
|
||||
width: 110px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.settingFormsy .ant-form-item-label {
|
||||
width: 60px;
|
||||
text-align: left;
|
||||
}
|
||||
.formItemInline .ant-form-explain{
|
||||
position:absolute;
|
||||
bottom:-22px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
}
|
||||
.yslzxueshi .ant-input{
|
||||
height: 40px !important;
|
||||
width: 276px !important
|
||||
}
|
||||
|
||||
// class="ant-col ant-form-item-label"
|
||||
`}</style>
|
||||
<div className="settingFormsy">
|
||||
<React.Fragment>
|
||||
<Form>
|
||||
<div style={{
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
lineHeight: " 51px",
|
||||
}}>
|
||||
<Form.Item
|
||||
label=""
|
||||
className="formItemInline hideRequireTag mb20 mt20"
|
||||
>
|
||||
{getFieldDecorator('teachingteam', {
|
||||
rules: [{
|
||||
// initialValue: this.state.cityDefaultValue,
|
||||
required: true,
|
||||
message: '请输入模式',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder={`例如:教学团队`}></Input>
|
||||
)}
|
||||
</Form.Item>
|
||||
<div className="flexdirections yslzxueshi ml38 ">
|
||||
<p className="fontcolorsyslhui1 font-14 myysllineheight myyslminwidth"></p>
|
||||
<div className=" flexdirections ml10">
|
||||
{/*<div className="buttongo mycompitcursor" onClick={()=>this.yhBanksfalse()}><p className="fontwenzi mycompitcursor" >取消</p></div>*/}
|
||||
<Button type="primary" onClick={() => this.Modifytext()}>确定</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const Modifytexts = Form.create({name: 'Modifytext'})(Modifytext);
|
||||
|
||||
export default Modifytexts;
|
||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 306 KiB After Width: | Height: | Size: 308 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,5 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe GameAnswer, type: :model do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
Loading…
Reference in new issue