Skip to content

Commit

Permalink
fix: 小题也可以获取真实题号
Browse files Browse the repository at this point in the history
  • Loading branch information
SSmJaE committed Mar 31, 2023
1 parent 59e955c commit 0232090
Show file tree
Hide file tree
Showing 11 changed files with 478 additions and 360 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ jobs:
- name: 发布生成的release note
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.changelog.outputs.newVersion }}
tag_name: v${{ needs.check.outputs.newVersion }}
body_path: temp.md
# body: ${{ steps.changelog.outputs.clean_changelog }}

Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"welearn": {
"title": "随行课堂网课助手",
"name": "WELearn网课助手",
"version": "1.0.3",
"version": "1.0.4",
"matches": [
"*://course.sflep.com/*",
"*://welearn.sflep.com/*",
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "welearn_helper",
"version": "1.0.3",
"version": "1.0.4",
"author": "SSmJaE",
"license": "GPL-3.0",
"private": true,
Expand All @@ -15,29 +15,30 @@
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@floating-ui/react": "^0.20.1",
"@icon-park/react": "^1.4.2",
"@react-spring/web": "^9.7.1",
"ahooks": "^3.7.5",
"ahooks": "^3.7.6",
"lodash": "^4.17.21",
"query-string": "^8.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.5",
"react-error-boundary": "^3.1.4",
"react-rnd": "^10.4.1",
"simplebar-react": "^3.2.1",
"simplebar-react": "^3.2.3",
"valtio": "^1.10.3"
},
"devDependencies": {
"@types/chrome": "^0.0.222",
"@types/lodash": "^4.14.191",
"@types/node": "^18.15.1",
"@types/react": "^18.0.28",
"@types/lodash": "^4.14.192",
"@types/node": "^18.15.11",
"@types/react": "^18.0.31",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"dotenv": "^16.0.3",
"rollup-plugin-visualizer": "^5.9.0",
"typescript": "^4.9.5",
"vite": "^4.1.4",
"vite": "^4.2.1",
"vite-plugin-monkey": "^2.12.1"
}
}
513 changes: 275 additions & 238 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

25 changes: 20 additions & 5 deletions src/api/welearn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { setValue } from "../utils/polyfill";
import { backendErrorToString, perSession, requestErrorHandler } from "./decorators";
import { ICommonResponse } from "./types";

interface IQuestionWithAnswer {
export interface IQuestionWithAnswer {
question_id: string;
question_type: number;
answer_id?: string;
Expand Down Expand Up @@ -61,12 +61,27 @@ export class WELearnAPI {
}

@requestErrorHandler("答案查询失败")
static async queryByTaskId(taskId: number, isSchoolTest: boolean) {
static async queryByTaskId({
typical,
is_school_test,
tt_id,
sheet_id,
stt_id,
}: {
typical: boolean;
is_school_test: boolean;
tt_id: string | null;
sheet_id: string | null;
stt_id: string | null;
}) {
const response = await request.post<IQueryByTaskIdResponse>("/query/", {
body: {
query_type: QueryTypes.queryByTaskId,
task_id: taskId,
is_school_test: isSchoolTest,
typical,
is_school_test,
tt_id,
sheet_id,
stt_id,
},
});

Expand Down Expand Up @@ -110,7 +125,7 @@ export class WELearnAPI {
}

@requestErrorHandler("答案收录失败")
static async collectAll(taskId: number, domString: string, isSchoolTest: boolean) {
static async collectAll(taskId: string, domString: string, isSchoolTest: boolean) {
const response = await request.post<ICommonResponse>("/collect/", {
body: {
task_id: taskId,
Expand Down

0 comments on commit 0232090

Please sign in to comment.