Commit 9c6c7def authored by Siddique's avatar Siddique
Browse files

Docker fix

parent 41f78a0d
...@@ -2,6 +2,9 @@ server { ...@@ -2,6 +2,9 @@ server {
listen 80; listen 80;
server_name _; server_name _;
root /usr/share/nginx/html;
index index.html;
client_max_body_size 50m; client_max_body_size 50m;
location = /health { location = /health {
......
...@@ -335,9 +335,8 @@ export async function getRunReviewSummary(runId: string): Promise<ReviewSummaryR ...@@ -335,9 +335,8 @@ export async function getRunReviewSummary(runId: string): Promise<ReviewSummaryR
} }
export async function getRunHistory(runType: RunType = "grading"): Promise<RunHistoryResponse> { export async function getRunHistory(runType: RunType = "grading"): Promise<RunHistoryResponse> {
const url = new URL(`${API_BASE_URL}/runs`) const searchParams = new URLSearchParams({ run_type: runType })
url.searchParams.set("run_type", runType) const response = await fetch(`${API_BASE_URL}/runs?${searchParams.toString()}`)
const response = await fetch(url.toString())
if (!response.ok) { if (!response.ok) {
const message = await parseError(response) const message = await parseError(response)
...@@ -376,11 +375,14 @@ export async function getRunStudents( ...@@ -376,11 +375,14 @@ export async function getRunStudents(
page = 1, page = 1,
pageSize = 200 pageSize = 200
): Promise<RunStudentsResponse> { ): Promise<RunStudentsResponse> {
const url = new URL(`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/students`) const searchParams = new URLSearchParams({
url.searchParams.set("page", String(page)) page: String(page),
url.searchParams.set("page_size", String(pageSize)) page_size: String(pageSize)
})
const response = await fetch(url.toString()) const response = await fetch(
`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/students?${searchParams.toString()}`
)
if (!response.ok) { if (!response.ok) {
const message = await parseError(response) const message = await parseError(response)
...@@ -421,15 +423,18 @@ export async function getQuestionAnswers( ...@@ -421,15 +423,18 @@ export async function getQuestionAnswers(
scoreScale?: LabelScaleKey scoreScale?: LabelScaleKey
} = {} } = {}
): Promise<QuestionAnswersResponse> { ): Promise<QuestionAnswersResponse> {
const url = new URL( const searchParams = new URLSearchParams({
`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/questions/${questionId}/answers` page: String(page),
page_size: String(pageSize)
})
if (filters.scoreScale) searchParams.set("score_scale", filters.scoreScale)
filters.predictedScores?.forEach(score =>
searchParams.append("predicted_score", String(score))
) )
url.searchParams.set("page", String(page))
url.searchParams.set("page_size", String(pageSize))
if (filters.scoreScale) url.searchParams.set("score_scale", filters.scoreScale)
filters.predictedScores?.forEach(score => url.searchParams.append("predicted_score", String(score)))
const response = await fetch(url.toString()) const response = await fetch(
`${API_BASE_URL}/runs/${encodeURIComponent(runId)}/questions/${questionId}/answers?${searchParams.toString()}`
)
if (!response.ok) { if (!response.ok) {
const message = await parseError(response) const message = await parseError(response)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment