2.1.1 • Published 1 year ago

42grader v2.1.1

Weekly downloads
-
License
AGPL-3.0
Repository
-
Last release
1 year ago

42Grader

42 Picsine을 위해 Node.js 런타임과 자바스크립트로 만들어진 채점기

목차

  1. 설치 가이드
  2. 사용방법

설치 가이드

42grader는 npm 저장소에 업로드되어 있습니다. npm install 명령으로 바로 설치할 수 있습니다.

npm i -g 42grader

1. node.js 설치(권장 버전: 18 lts)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts

2. npm으로 42grader 설치

npm i -g 42grader

1. node.js 설치(권장 버전: 18 lts)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install --lts

2. npm prefix 변경

이 명령을 실행하기 전에 npm prefix를 변경하는 것이 무엇인지 반드시 이해해야 합니다. 이해하지 못했다면 절대 이 명령을 실행하지 마십시오.

npm config set prefix '~/.local/'
echo 'export PATH=~/.local/bin/:$PATH' >> ~/.zshrc
zsh

3. npm으로 42grader 설치

npm i -g 42grader

사용방법

42grader 명령으로 바로 실행할 수 있습니다.

폴더 구조

42Grader~/.42Grader 폴더를 사용합니다.

~/.42Grader/
├─ submission/
│  └─ (cloned git files)
└─ test/
   └─ tester files

clone git from remote 옵션에 no를 선택한 경우 submissions 폴더 및 내용이 반드시 존재해야 합니다.

run test 옵션에 yes를 선택한 경우 test 폴더 및 테스터 파일이 반드시 필요합니다.

테스터 파일

테스터 파일은 yaml 포맷을 가지고 있어야 합니다.

  • directory 필드에 폴더명을 입력하고,
  • Pdf의 Files to turn in 섹션에 적힌 파일명을 file 필드에 입력하세요.
  • 또한 pdf에 적힌 것과 동일한 함수 원형을 function 필드에 입력하세요.
  • testcase 필드에는 main.c 파일에 들어갈 C 코드를 작성합니다. main.c는 stdio.h, stdlib.h, string.hunistd.h를 포함하고 있습니다.
  • 모든 answer 필드의 정답은 마지막 개행 하나를 제거한 후 diff합니다. 만약 정답에 개행이 필요한 경우 \n 혹은 진짜 newline 하나를 삽입하세요.

예시 테스터 파일입니다.

test:
  - directory: ex00
    file: ft_putchar.c
    function: void	ft_putchar(char c);
    testcase: |
      ft_putchar('a');
      ft_putchar('b');
    answer: |
      ab
  - directory: ex01
    file: ft_print_alphabet.c
    function: void	ft_print_alphabet(void);
    testcase: |
      ft_print_alphabet();
    answer: |
      abcdefghijklmnopqrstuvwxyz
  - directory: ex02
    file: ft_print_reverse_alphabet.c
    function: void	ft_print_reverse_alphabet(void);
    testcase: |
      ft_print_reverse_alphabet();
    answer: |
      zyxwvutsrqponmlkjihgfedcba

About

./grader v1 폴더 안에 있는 42grader v1은 사용하지 마세요. MVP를 위해 C로 급조한 테스터기입니다. 안전/안정성을 보장하지 못합니다.

본 프로그램은 자유 소프트웨어입니다. Free Software Foundation에 의해 배포된 GNU Affero General Public License v3 혹은 이후의 버전 하에 본 프로그램을 배포하거나 수정할 수 있습니다.