---
# System prepended metadata

title: CP2023 Homework and Examination Rule

---

# CP2023 Homework and Examination Rule

這是英文版本， [點此](https://hackmd.io/@cp2023/rule) 查看中文版本
In case of discrepancies between the Traditional Chinese and English versions, the Traditional Chinese version shall prevail.

[TOC]

## Grading Machine Specifications

We recommend that you test your program on `Ubuntu` before submitting your assignment. We do not accept errors caused by different operating systems.

## Program Execution Flow

> How is your program executed?

Step 1: The TA will receive a compressed file named `XXX.zip`, and the file name can be customized.

```sh
❯ ls -1
XXX.zip
```

Step 2: The TA will execute unzip to decompress the file:

```sh
❯ unzip XXX.zip
Archive:  XXX.zip
  inflating: hw0101.c                
  inflating: hw0102.c                
  inflating: hw0103.c                
  inflating: hw0104.c                
  inflating: hw0105.c                
  inflating: README.pdf              
  inflating: hw0106.pdf              
  inflating: Makefile
```

```sh
❯ ls -1
Makefile
README.pdf
XXX.zip
hw0101.c
hw0102.c
hw0103.c
hw0104.c
hw0105.c
hw0106.pdf
```

> At this point, you can see that all the files have been decompressed (located in the same directory as the original compressed file).

Step 3: The TA will execute make to compile your program:

> If there is a compilation error in this step, please refer to [Makefile Rule](#Makefile-%E8%A6%8F%E5%89%87)

```sh
❯ make 
gcc hw0101.c -o hw0101
gcc hw0102.c -o hw0102
gcc hw0103.c -o hw0103
gcc hw0104.c -o hw0104
gcc hw0105.c -o hw0105
```

```sh
❯ ls -1
Makefile
README.pdf
XXX.zip
hw0101
hw0101.c
hw0102
hw0102.c
hw0103
hw0103.c
hw0104
hw0104.c
hw0105
hw0105.c
hw0106.pdf
```

> At this point, you can see that the executable files have been compiled (located in the same directory).

Step 4: The TA will individually execute your different programs and interact with your program to conduct grading tests.

```sh
❯ ./hw0101                                 
Who is the professor? I dont know
Wrong, Neokent is the professor.
```

> In this example, the TA inputs "I dont know."

Step 5: The TA will use a Chromium-based browser or a text editor to read your non-programming assignments (PDF or plain text documents) and conduct grading.

Step 6: The TA will enjoy a cup of milk tea, relax, and prepare to provide a fair final assessment.

Step 7: For unspecified behavior that you have mentioned in the README, the TA will conduct scoring adjustments.

Step 8: Completion of grading.

:::spoiler You can refer to this for the compression method:

sh


```sh
❯ zip XXX *.c *.pdf Makefile
  adding: hw0101.c (deflated 52%)
  adding: hw0102.c (deflated 71%)
  adding: hw0103.c (deflated 62%)
  adding: hw0104.c (deflated 85%)
  adding: hw0105.c (deflated 81%)
  adding: README.pdf (deflated 39%)
  adding: hw0106.pdf (deflated 26%)
  adding: Makefile (deflated 57%)
```
:::

:::spoiler `TA.sh`

You can run this in the directory containing your compressed file, and it will attempt to execute steps 2 to 4.

```sh
#!/bin/bash
set -x
unzip *.zip
make
for file in *; do
    if [[ -x "$file" && -f "$file" ]]; then
        ./"$file" || true
    fi
done
```
:::

## Makefile Rule

Before submission, please make sure to use the make command to confirm that compilation can pass.

If compilation fails, all questions that were not successfully compiled will be scored as 0.

However, as compassionate TAs, we have established a mechanism to protect beginners:

- CSU0001 Programming (I)
1. `hw1`: Deduct 10 points from the total score for that assignment, as a handling fee for the TA to fix your Makefile.
2. Before `mid` (including `mid`): Each question that fails to compile successfully will have its score multiplied by 0.7, as a handling fee for the TA to fix your Makefile.
3. After `mid`: Each question that fails to compile successfully will be scored as 0.
- CSU0002 Programming (II)
1. `hw1`: Each question that fails to compile successfully will have its score multiplied by 0.5.
2. After `hw1`: Each question that fails to compile successfully will be scored as 0.

## Non-Scorable Items

1. Errors caused by different operating systems; please test your program on `Ubuntu` before submission.
2. Makefile issues.
3. Using inappropriate file formats, such as someone submitting `hw0101.docx` in the past.
4. Mixed-up files.
5. Incorrect file naming (e.g., naming `hw0101` as `hw101`).
6. Abnormal program termination, such as Segmentation Fault.
7. Excessive execution time (infinite loops) causing the program not to finish within 10 seconds.

## Scorable Items

Please ensure that after verifying input data, the answer is correct, and then check if it meets one of the following conditions:

1. Missing/excessive whitespace.
2. Capitalization errors in English.
3. None of the above, but the answer is correct.


**However, if a question has special instructions, those instructions take precedence.**


