# 10.020 Mini Project Grading Guideline
## Checkoff Protocol
**TOTAL grade: 5pts**
There are 3 criterias for the grading as reflected in Vocareum. They make up the 5pts:
1. **[2pt]** Working Test Case
2. **[2pt]** Understanding of Code
3. **[1pt]** Code Quality
Details:
1. **[1pt]** **Code Quality**: Ensure that their project can **compile** and <span style="color:#f7007f;"><b>MUST run in Vocareum</b></span>.
* Running locally does not count, penalise them this 1pt if they do. Then for **quality** (consistent variable naming, clear comments).
* You [can read this article](https://testdriven.io/blog/clean-code-python/) (take it lightly, we won't be so strict) for starters.
3. **[2pts]** **Working Test Case**: Ensure that the items in the **checklist** (see respective heading below) are **functioning**.
- If any checklist item is missing, their grade will be prorated accordingly
4. **[2pts]** **Understanding of Code** via **Q&A**: we will verbally ask 3 **related questions** to **any** student in the team. There are two question categories, at least 1 question from each category will be selected.
1. About their implementation (exercise related)
2. About the project in **general** (background knowledge)
5. Record the points for their MP in our [internal excel sheet](https://docs.google.com/spreadsheets/d/1K4JyDPZ-yfL8-Fz-BZpjZm1AV-w9zbMFLVHqEKnoFKE/edit?usp=sharing). Results will be released after deadline.
==Please **write comments** if you give anything that's not 5 pts.==
## Mini Project 1
There are **2 exercises** in MP 1:
* Exercise 1
* Exercise 2
The checklist and Q&A are given below.
### Mini Project 1 Checklist [2pts]
There are **8 checks** for both exercises in MP1. Each is worth **0.25 pts**, totalling of **2pts** under "Working Test Case" **criteria**.
#### Exercise 1 [4 checks]
1. 10 **integers** (OK to have repeated value) appear when `Generate 10 numbers` button is clicked

3. Totally sorted **integer** output is displayed when `Sort` button is clicked

4. In `/app/static/library.py`, the implementation in `sortnumber1()` is **NOT hardcoded**, but some sorting function is called to actually compute the sorted value.
E.g: **NOT**
```python
document.getElementById("sorted").innerHTML = "0, 1, 2, 3, 4, 5, 6, 7, 8, 9"
```
but some sorting function is called to makeup the value `sortedArray` variable, e.g:
```python
input_array = [int(item.strip()) for item in input_array]
bubble_sort(input_array)
output_array = create_string(input_array)
document.getElementById("sorted").innerHTML = output_array
```
4. A **custom** sort function (e.g: `bubble_sort` with actual implementation) is used to compute (2), and not using python's default [`list.sort()`](https://docs.python.org/3/howto/sorting.html)
#### Exercise 2 [4 checks]
1. The textbox can accept **integers**, separated by a comma. **NO NEED** to test for float, string, or other weird data types (but it is good practice, just that we aren't so strict for this checkoff)
2. Some kind of **warning** should appear when the textbox is empty but `Sort` is clicked (no error)
3. The output **integers** are sorted properly when the button `Sort` is clicked.

5. A **custom** sort function (e.g: `bubble_sort` with actual implementation) is used to compute (2), and not using python's default [`list.sort()`](https://docs.python.org/3/howto/sorting.html)
### Q&A [2pts]
Choose 1-2 from each category.
Here's the general rubric for the Q&A section **for each exercise**:
| Points | Explanation |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| π`1` | Can answer **2 out of 3** with clarity (googling, internal discussion, reference to old notes allowed) |
| π`0.75` | Can answer **2 out of 3** but with **hints from TA/instructor**, and takes a comparably long time (lots of staring, silent moments) |
| π`0.5` | Only can answer 1 question accurately, the rest are _smokey_ |
| π`0.25 ` | Cannot answer any question accurately, but at least know **which file** contain their answer, and some explanation |
| π΅βπ«`0` | **No idea** at all about the project, not even about admin matters like which file should contain their answer |
#### Exercise 1
**Exercise related questions**
1. What sorting algorithm did you use in ex1? Show me the code.
2. How did you generate 10 numbers randomly?
3. What is the purpose of `seed` in `gen_random_int`?
4. Which function is called when the button `Sort` in ex1 is called?
5. How did you display the random output to the page?
6. How did you display the sorted output back to the page?
**Project related questions**
1. Which html file is shown when `/ex1` page is displayed?
2. What is a web server?
3. Who is doing executing the sorting algorithm? Your browser or your web server?
#### Exercise 2
**Exercise related questions**
1. What sorting algorithm did you use in ex2? Show me the code.
2. If I want to handle `float`, how can I do that?
3. Show me the code where you obtain the sequence of number typed by the user in the textbox. Explain.
4. How did you display the sorted output back to the page?
**Project related questions**
1. Which html file is shown when `/ex2` page is displayed?
2. What is the difference between `getElementsByName` and `getElementByID`?
3. If I want to create another page, say `/ex3` with the **same template** as `ex1`, which file should I modify? Briefly explain **how** should I modify it.
## Mini Project 2
There are **2 exercises** in MP 2:
* Exercise 1
* Exercise 2
### Mini Project 2 Checklist
The checklist and Q&A are given below.
There are **8 checks** for both exercises in MP1. Each is worth 0.25 pts, totalling of 2pts under βWorking Test Caseβ criteria. **This is similar to MP1**.
### Exercise 1 [3 checks]
1. Open `/app/serverlibrary.py` and make sure there's a `mergesort` implementation in there **from scratch**.

2. Able to **create** users **and** login as that user
3. Able to **create** many users and display it under `Users` page

### Exercise 2 [5 checks]
1. Open `/app/serverlibrary.py` and make sure there's a `Stack` implementation in there **from scratch**.

2. Open `/app/serverlibrary.py` and make sure there's a `EvaluateExpression` implementation in there **from scratch**.

3. They can create questions and the answer is correct. They can also send it to multiple people:

4. They can answer questions in the **challenges** (SHOW)

6. In the **Hall of Fame**, you can see the ranks properly. Each ROW is a question, and WITHIN the same row of question, the scores must be ranked properly:

#### Exercise 1
**Exercise related questions**
1. What sorting algorithm did you use in ex1? Show me the code.
2. How did you sort for example: [8,1,0,2] (or any other 4 numbers) using the sorting algorithm you used in (1)?
3. What changes did you make in `Users.html`, and why?
**Project related questions**
1. Which html file is shown when `/questions` page is displayed?
2. Do you need to call `transcrypt` when you make changes to `serverlibrary.py`? **Why or why not**?
3. Who is doing executing the **merge**-**sort** algorithm? Your browser or your web server?
4. When you click any link in the navbar, eg: Home, Challenges, etc the URL is changed into /home, /challenges, etc accordingly and different `.html` is displayed. **Which file** should you change if let's say you want to change the URI of `http://127.0.0.1:5000/questions` into `http://127.0.0.1:5000/list-questions`?
#### Exercise 2
**Exercise related questions**
1. Explain to me the purpose of using the **Stack** data structure in this exercise.
2. If I want to display **smallest TWO** instead of smallest three in the Hall of Fame, where should I make the changes? Which files?
3. Show me possible changes you can make if you want your code to accept NEGATIVE number as part of the questions you make. Or if your code can already accept negative values, explain how the parsing works.
4. Right now, if you type in strings into the Math Expression textbox, it will result in an error. Could you tell me the root cause of this, e.g: which file is the culprit, and how to fix it (verbally)?

**Project related questions**
1. We have this function in `clientlibrary.py`:
```python=
def stop_timer(self, form_id, question_id):
self.items[question_id].stop()
curform = document.getElementById("form-{}".format(form_id))
answer = curform.elements["answer"].value
curform.elements["challenge_id"].value = str(question_id)
curform.elements["elapsed_time"].value = self.items[
question_id
].elapsedtime
curform.submit()
```
Which button triggers `stop_timer`?
2. What does `submit()` in `stop_timer` above do? Explain the chain of functions that gets called after `submit()` is triggered.
3. What is the purpose of having `base.html`?