Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tiku_APP_APITest
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuai
tiku_APP_APITest
Commits
0fe84f86
Commit
0fe84f86
authored
Jan 03, 2020
by
Thinkpad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mr 2020 1.3
parent
99fb257e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
17 deletions
+30
-17
DataAllMr.xls
tiku_App/TestData/DataAllMr.xls
+0
-0
getpaperBlocks.java
tiku_App/src/com/offcn/api/tk/app3/getpaperBlocks.java
+1
-0
submitPaper.java
tiku_App/src/com/offcn/api/tk/app3/submitPaper.java
+28
-17
TK.java
tiku_App/src/com/offcn/process/TK.java
+1
-0
No files found.
tiku_App/TestData/DataAllMr.xls
View file @
0fe84f86
No preview for this file type
tiku_App/src/com/offcn/api/tk/app3/getpaperBlocks.java
View file @
0fe84f86
...
...
@@ -144,6 +144,7 @@ public class getpaperBlocks extends TK implements API {
List
<
Object
>
examList
=
jp
.
getList
(
"data.list[0].list"
);
record_id_L
=
jp
.
getString
(
"data.recordId"
);
L_duration
=
jp
.
getString
(
"data.duration"
);
//是否验证数据库
if
(!
isProduct
)
{
...
...
tiku_App/src/com/offcn/api/tk/app3/submitPaper.java
View file @
0fe84f86
...
...
@@ -33,6 +33,7 @@ public class submitPaper extends TK implements API {
public
String
user_id
;
//用户id
public
String
duration
;
//真题试卷需要传递做题时长(s)(二维码扫描不需要)
public
String
channel
;
//做题平台来源(1:题库;2:NWN)
public
String
allow_answer
;
//主观题是否允许作答
@Override
...
...
@@ -53,15 +54,20 @@ public class submitPaper extends TK implements API {
user_id
=
MapUtil
.
getParameter
(
parameter
,
"user_id"
).
trim
();
duration
=
MapUtil
.
getParameter
(
parameter
,
"duration"
).
trim
();
channel
=
MapUtil
.
getParameter
(
parameter
,
"channel"
).
trim
();
allow_answer
=
MapUtil
.
getParameter
(
parameter
,
"allow_answer"
).
trim
();
if
((!
paper_id
.
equals
(
""
))
&&
paper_id
.
equals
(
"code"
))
{
paper_id
=
paper_id_L
;
parameter
=
parameter
.
replace
(
"\"paper_id\":code"
,
"\"paper_id\":\""
+
paper_id
+
"\""
);
}
//
if ((!paper_id.equals("")) && paper_id.equals("code")) {
//
paper_id = paper_id_L;
//
parameter = parameter.replace("\"paper_id\":code", "\"paper_id\":\""+ paper_id + "\"");
//
}
if
((!
record_id
.
equals
(
""
))
&&
record_id
.
equals
(
"code"
))
{
record_id
=
record_id_L
;
parameter
=
parameter
.
replace
(
"\"record_id\":code"
,
"\"record_id\":\""
+
record_id_L
+
"\""
);
}
if
((!
duration
.
equals
(
""
))
&&
duration
.
equals
(
"code"
))
{
duration
=
L_duration
;
parameter
=
parameter
.
replace
(
"\"duration\":code"
,
"\"duration\":\""
+
duration
+
"\""
);
}
if
((!
user_id
.
equals
(
""
))
&&
user_id
.
equals
(
"code"
))
{
user_id
=
ListUtil
.
getListValue
(
user_idList
,
0
);
parameter
=
parameter
.
replace
(
"\"user_id\":code"
,
"\"user_id\":\""
+
user_id
+
"\""
);
...
...
@@ -79,6 +85,10 @@ public class submitPaper extends TK implements API {
Map
<
String
,
String
>
jsonAsMap
=
new
HashMap
<
String
,
String
>();
parameter
=
MapUtil
.
getValue
(
"parameter"
,
data
);
paper_id
=
MapUtil
.
killQuotes
(
paper_id
,
"\""
);
type
=
MapUtil
.
killQuotes
(
type
,
"\""
);
channel
=
MapUtil
.
killQuotes
(
channel
,
"\""
);
allow_answer
=
MapUtil
.
killQuotes
(
allow_answer
,
"\""
);
String
tikuString
=
MapUtil
.
getParameter
(
parameter
,
"appid"
).
trim
();
tikuString
=
MapUtil
.
killQuotes
(
tikuString
,
"\""
);
...
...
@@ -88,6 +98,7 @@ public class submitPaper extends TK implements API {
jsonAsMap
.
put
(
"user_id"
,
user_id
);
jsonAsMap
.
put
(
"duration"
,
duration
);
jsonAsMap
.
put
(
"channel"
,
channel
);
jsonAsMap
.
put
(
"allow_answer"
,
allow_answer
);
jsonAsMap
.
put
(
"appid"
,
tikuString
);
MyRequest
myRequest
=
new
MyRequest
();
...
...
@@ -160,19 +171,19 @@ public class submitPaper extends TK implements API {
}
if
(
"接口响应成功!"
.
equals
(
msg
)){
List
<
String
>
list
=
jp
.
getList
(
"data.children.children"
);
System
.
out
.
println
(
list
);
if
(
list
!=
null
&&
list
.
size
()>
0
&&
list
.
get
(
0
)!=
null
)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
String
shelfIds
=
jp
.
getString
(
"data.children.children[0].shelf_id"
);
String
[]
shelfId
=
shelfIds
.
split
(
","
);
for
(
String
string
:
shelfId
)
{
L_shelf_id
=
string
.
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
trim
();
// System.out.println(string.replace("[", "").replace("]", ""));
}
}
//
}
//
List<String> list=jp.getList("data.children.children");
//
System.out.println(list);
//
if (list!=null && list.size()>0 && list.get(0)!=null) {
//
for(int i=0;i<list.size();i++){
//
String shelfIds =jp.getString("data.children.children[0].shelf_id");
//
String[] shelfId = shelfIds.split(",");
//
for (String string : shelfId) {
//
L_shelf_id = string.replace("[", "").replace("]", "").trim();
//
//
System.out.println(string.replace("[", "").replace("]", ""));
//
}
//
}
//
//
//
}
conn
=
ConnectionsMap
.
get
(
"tk"
);
}
}
...
...
tiku_App/src/com/offcn/process/TK.java
View file @
0fe84f86
...
...
@@ -79,6 +79,7 @@ public class TK extends BasicsGM{
public
static
String
L_submit_time
=
""
;
//交卷时间
public
static
String
L_subject_id
=
""
;
//考试科目id
public
static
String
L_choice_id
=
""
;
//试题选项id
public
static
String
L_duration
=
""
;
//做题时长(s)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment