Skip to content

Commit

Permalink
Merge pull request #148 from siesgstarena/admin
Browse files Browse the repository at this point in the history
fix the test solution language select menu
  • Loading branch information
SalmanAd01 authored Feb 15, 2023
2 parents 7fe0e0e + d1272f9 commit 75cd87b
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions src/Components/admin/testProblem/TestProblem.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import React, { useState } from 'react';
import { useParams } from 'react-router-dom';
import Select, { Option } from '@material/react-select';
import Select from '@material/react-select';
import { Headline4, Body2 } from '@material/react-typography';
import Button from '@material/react-button';
import MessageCard from '../../common/MessageCard/index';
import FileUpload from '../../common/FileUpload/index';
import useSessionExpired from '../../../customHooks/useSessionExpired';
import useSentry from '../../../customHooks/useSentry';
import { languageOptions } from '../../drawer/contests/status/options';

const TestProblem = () => {
const [language, setLanguage] = useState('C');
Expand All @@ -16,7 +17,6 @@ const TestProblem = () => {
const [messageType, setMessageType] = useState('');
const { redirectOnSessionExpiredAfterRender, isSessionExpired } = useSessionExpired();
const [solutionFile, setSolutionFile] = useState({});
const onLanguageChange = (index, item) => setLanguage(item.getAttribute('data-value'));
const onFileChange = (event) => {
setSolutionFile(event.target.files[0]);
};
Expand Down Expand Up @@ -61,22 +61,17 @@ const TestProblem = () => {
{problemId}
</Body2>
<Select
className="w-100"
notchedOutlineClassName="pa1"
enhanced
notchedOutlineClassName="pt2 pb2"
required
label="Language"
outlined
label="Select Language"
className="w-100"
value={language}
onEnhancedChange={onLanguageChange}
>
<Option value="C">C</Option>
<Option value="C++">C++</Option>
<Option value="C++ 14">C++ 14</Option>
<Option value="java">Java</Option>
<Option value="javascript">Javascript</Option>
<Option value="python2">Python 2</Option>
<Option value="python3">Python 3</Option>
</Select>
options={languageOptions}
onChange={(e) => {
setLanguage(e.target.value);
}}
/>
<div className="ma1 mt3">
<FileUpload
id="solution-file-upload"
Expand Down

0 comments on commit 75cd87b

Please sign in to comment.