Angular job portal app
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 

57 行
1.6 KiB

  1. import styles from './Quiz.module.scss';
  2. import { IonButton, IonIcon } from '@ionic/react';
  3. import Options from './Options';
  4. import { closeOutline } from 'ionicons/icons'
  5. import { Link } from 'react-router-dom';
  6. import { useState } from 'react';
  7. import Question from './Question';
  8. const options: string[] = [
  9. "System.out.println(“Hello, how are you?”);",
  10. "println('Hello, how are you?');",
  11. "out.print(Hello, how are you?);",
  12. "System.out.println(Hello, how are you?);"
  13. ];
  14. const Quiz: React.FC = () => {
  15. const [selected, setSelected] = useState<boolean>(false);
  16. const isSelected = (option: string) => {
  17. if (option !== "null") {
  18. setSelected(true);
  19. }
  20. }
  21. return (
  22. <div className={styles.quizContainer}>
  23. <div className={styles.upfold}>
  24. <header className={styles.header}>
  25. <h4 className={styles.heading}>Quiz</h4>
  26. <IonIcon icon={closeOutline} />
  27. </header>
  28. <Question question='How would you correctly display, “Hello, how are you?”?'
  29. questionNumber={1}
  30. timeLimit={1} />
  31. </div>
  32. <div className={styles.quizOptions}>
  33. <div className={styles.options}>
  34. <Options options={options} isSelected={isSelected} />
  35. </div>
  36. <Link to="/" className={styles.button + " " + (selected ? styles.active : "")}>
  37. <IonButton shape="round" expand='block'>Next</IonButton>
  38. </Link>
  39. </div>
  40. </div>
  41. );
  42. }
  43. export default Quiz;