Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Zheng Yile
codiaclient
Commits
ba8cad61
Commit
ba8cad61
authored
Jun 21, 2021
by
Zheng Yile
Browse files
Modify codiaclient/network.py
parent
12b96534
Changes
1
Hide whitespace changes
Inline
Side-by-side
codiaclient/network.py
View file @
ba8cad61
...
...
@@ -458,7 +458,8 @@ mutation startSession($pid: ID!, $code: String) {
}'''
})
res
=
post
(
url
=
url
,
headers
=
headers
,
data
=
data
)
if
not
res
:
return
False
return
json
.
loads
(
res
.
text
)[
'data'
][
'startSession'
]
try
:
return
json
.
loads
(
res
.
text
)[
'data'
][
'startSession'
]
except
:
return
False
def
_login
(
username
,
passwd
):
headers
=
login_base_headers
.
copy
()
...
...
@@ -555,31 +556,31 @@ def _get_data_not_from_pack(eid, codecnt = None):
},
"query"
:
'''
query codingExercise($eid: ID!, $codecnt: Int!) {
node(id: $eid) {
... on CodingExercise {
viewerStatus {
exerciseStatuses(last: $codecnt) {
nodes {
... on CodingExerciseStatus {
id
scoreRate
submission {
id
reports {
key
value
}
}
solution {
lang
asset { content }
}
}
}
node(id: $eid) {
... on CodingExercise {
viewerStatus {
exerciseStatuses(last: $codecnt) {
nodes {
... on CodingExerciseStatus {
id
scoreRate
submission {
id
reports {
key
value
}
}
solution {
lang
asset { content }
}
}
}
}
}
}
}
}'''
})
res
=
post
(
url
=
url
,
headers
=
headers
,
data
=
data
)
if
not
res
:
return
False
...
...
@@ -603,39 +604,39 @@ def _get_data_from_pack(eid, pid, codecnt = None):
},
"query"
:
'''
query codingExercise($eid: ID!, $pid: ID, $codecnt: Int!) {
node(id: $pid) {
... on ExercisePack {
id
codingExercise(id: $eid) {
node(id: $pid) {
... on ExercisePack {
id
codingExercise(id: $eid) {
id
title
tags
viewerStatus {
passedCount
totalCount
exerciseStatuses(last: $codecnt) {
nodes {
... on CodingExerciseStatus {
id
title
tags
viewerStatus {
passedCount
totalCount
exerciseStatuses(last: $codecnt) {
nodes {
... on CodingExerciseStatus {
id
scoreRate
submission {
id
reports {
key
value
}
}
solution {
lang
asset { content }
}
}
}
}
scoreRate
submission {
id
reports {
key
value
}
}
solution {
lang
asset { content }
}
}
}
}
}
}
}
}
}'''
})
res
=
post
(
url
=
url
,
headers
=
headers
,
data
=
data
)
if
not
res
:
return
False
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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