Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement rs school app tests preview page #2482

Merged
merged 29 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
e98f903
feat: implement empty auto-test page
Alphajax May 28, 2024
8a4c796
feat: implement showing new page at admin area dropdown
Alphajax May 28, 2024
d9c857f
feat: implement page using admin page layout
Alphajax May 29, 2024
df8da3a
feat: imeplement getAllRSSchoolAppTests api
Alphajax Jun 4, 2024
025fc4d
feat: implement previewing short info about auto-test tasks
Alphajax Jun 9, 2024
33cc1f5
refactor: remove unnecessary code
Alphajax Jun 10, 2024
423866d
fix: fix type error
Alphajax Jun 10, 2024
a1079f3
feat: implement test questions preview
Alphajax Jun 11, 2024
eec3f9d
fix: visual fixes
Alphajax Jun 12, 2024
089fa5b
refactor: refactor data loading logic
Alphajax Jun 13, 2024
5b8b73e
Merge branch 'master' into rs-app-2424
Alphajax Jun 13, 2024
747acb7
refactor: fix eslint issues
Alphajax Jun 13, 2024
4a09fad
fix: openapi build issue
Alphajax Jun 13, 2024
9dded12
fix: fix type error for attributes field
Alphajax Jun 18, 2024
6f596ad
Merge branch 'master' into rs-app-2424
Alphajax Jun 18, 2024
abcbc28
feact: implement previewing task on a new page
Alphajax Jul 7, 2024
c69adcb
Merge branch 'master' into rs-app-2424
Alphajax Jul 7, 2024
988c8cd
refactor: fix eslint isuue
Alphajax Jul 7, 2024
1c470a0
Merge branch 'master' into rs-app-2424
Alphajax Jul 8, 2024
8a80604
refactor: rename functions and variables, add fields validation
Alphajax Jul 10, 2024
f8a7638
Merge branch 'master' into rs-app-2424
Alphajax Jul 10, 2024
4ea35f6
refactor: rename funcions and variables at front end part
Alphajax Jul 10, 2024
f2baca8
feat: allow numberable fields to be null
Alphajax Jul 10, 2024
88aa80d
refactor: fix eslint issue
Alphajax Jul 10, 2024
db4fe99
fix: fix typescript issue
Alphajax Jul 10, 2024
8aba8c7
Merge branch 'master' into rs-app-2424
Alphajax Jul 15, 2024
9e6f400
fix: fix code review issues
Alphajax Jul 15, 2024
9c02b6e
fix: fixed user validation for auto tests page
Alphajax Jul 15, 2024
223891a
Merge branch 'master' into rs-app-2424
Alphajax Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
316 changes: 316 additions & 0 deletions client/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,122 @@ export interface AuthConnectionDto {
*/
'externalId': string;
}
/**
*
* @export
* @interface AutoTestTaskDto
*/
export interface AutoTestTaskDto {
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'type': AutoTestTaskDtoTypeEnum;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'name': string;
/**
*
* @type {number}
* @memberof AutoTestTaskDto
*/
'id': number;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'descriptionUrl': string;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'description': string;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'githubRepoName': string;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'sourceGithubRepoUrl': string;
/**
*
* @type {IdNameDto}
* @memberof AutoTestTaskDto
*/
'discipline': IdNameDto;
/**
*
* @type {boolean}
* @memberof AutoTestTaskDto
*/
'githubPrRequired': boolean;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'createdDate': string;
/**
*
* @type {string}
* @memberof AutoTestTaskDto
*/
'updatedDate': string;
/**
*
* @type {Array<string>}
* @memberof AutoTestTaskDto
*/
'tags': Array<string>;
/**
*
* @type {Array<string>}
* @memberof AutoTestTaskDto
*/
'skills': Array<string>;
/**
*
* @type {object}
* @memberof AutoTestTaskDto
*/
'attributes': object;
/**
*
* @type {Array<UsedCourseDto>}
* @memberof AutoTestTaskDto
*/
'courses': Array<UsedCourseDto>;
}

export const AutoTestTaskDtoTypeEnum = {
Jstask: 'jstask',
Kotlintask: 'kotlintask',
Objctask: 'objctask',
Htmltask: 'htmltask',
Ipynb: 'ipynb',
Selfeducation: 'selfeducation',
Codewars: 'codewars',
Test: 'test',
Codejam: 'codejam',
Interview: 'interview',
StageInterview: 'stage-interview',
Cvhtml: 'cv:html',
Cvmarkdown: 'cv:markdown'
} as const;

export type AutoTestTaskDtoTypeEnum = typeof AutoTestTaskDtoTypeEnum[keyof typeof AutoTestTaskDtoTypeEnum];

/**
*
* @export
Expand Down Expand Up @@ -433,6 +549,49 @@ export const BadgeDtoIdEnum = {

export type BadgeDtoIdEnum = typeof BadgeDtoIdEnum[keyof typeof BadgeDtoIdEnum];

/**
*
* @export
* @interface BasicAutoTestTaskDto
*/
export interface BasicAutoTestTaskDto {
/**
*
* @type {number}
* @memberof BasicAutoTestTaskDto
*/
'id': number;
/**
*
* @type {string}
* @memberof BasicAutoTestTaskDto
*/
'name': string;
/**
*
* @type {object}
* @memberof BasicAutoTestTaskDto
*/
'maxAttemptsNumber': object | null;
/**
*
* @type {object}
* @memberof BasicAutoTestTaskDto
*/
'numberOfQuestions': object | null;
/**
*
* @type {object}
* @memberof BasicAutoTestTaskDto
*/
'strictAttemptsMode': object | null;
/**
*
* @type {object}
* @memberof BasicAutoTestTaskDto
*/
'thresholdPercentage': object | null;
}
/**
*
* @export
Expand Down Expand Up @@ -8018,6 +8177,163 @@ export class AuthApi extends BaseAPI {
}


/**
* AutoTestsApi - axios parameter creator
* @export
*/
export const AutoTestsApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAutoTest: async (id: number, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'id' is not null or undefined
assertParamExists('getAutoTest', 'id', id)
const localVarPath = `/auto-test/{id}`
.replace(`{${"id"}}`, encodeURIComponent(String(id)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBasicAutoTests: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/auto-test`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};

/**
* AutoTestsApi - functional programming interface
* @export
*/
export const AutoTestsApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = AutoTestsApiAxiosParamCreator(configuration)
return {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getAutoTest(id: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AutoTestTaskDto>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getAutoTest(id, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getBasicAutoTests(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<BasicAutoTestTaskDto>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getBasicAutoTests(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* AutoTestsApi - factory interface
* @export
*/
export const AutoTestsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = AutoTestsApiFp(configuration)
return {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getAutoTest(id: number, options?: any): AxiosPromise<AutoTestTaskDto> {
return localVarFp.getAutoTest(id, options).then((request) => request(axios, basePath));
},
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getBasicAutoTests(options?: any): AxiosPromise<Array<BasicAutoTestTaskDto>> {
return localVarFp.getBasicAutoTests(options).then((request) => request(axios, basePath));
},
};
};

/**
* AutoTestsApi - object-oriented interface
* @export
* @class AutoTestsApi
* @extends {BaseAPI}
*/
export class AutoTestsApi extends BaseAPI {
/**
*
* @param {number} id
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AutoTestsApi
*/
public getAutoTest(id: number, options?: AxiosRequestConfig) {
return AutoTestsApiFp(this.configuration).getAutoTest(id, options).then((request) => request(this.axios, this.basePath));
}

/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AutoTestsApi
*/
public getBasicAutoTests(options?: AxiosRequestConfig) {
return AutoTestsApiFp(this.configuration).getBasicAutoTests(options).then((request) => request(this.axios, this.basePath));
}
}


/**
* CertificateApi - axios parameter creator
* @export
Expand Down
9 changes: 9 additions & 0 deletions client/src/components/Sider/data/menuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import ProfileFilled from '@ant-design/icons/ProfileFilled';
import TeamOutlined from '@ant-design/icons/TeamOutlined';
import UserOutlined from '@ant-design/icons/UserOutlined';
import FileTextOutlined from '@ant-design/icons/FileTextOutlined';
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
import QqOutlined from '@ant-design/icons/QqOutlined';

import { DiscordOutlined } from 'components/Icons/DiscordOutlined';
import { Session } from 'components/withSession';
import {
Expand Down Expand Up @@ -137,6 +139,13 @@ const adminMenuItems: AdminMenuItemsData[] = [
href: '/admin/prompts',
access: session => isAdmin(session),
},
{
name: 'Auto tests',
key: 'auto-test',
icon: <ExclamationCircleOutlined />,
href: '/admin/auto-test',
access: session => isAdmin(session),
},
{
name: 'Students',
key: 'students',
Expand Down
Loading
Loading