# freelance3
We make lines between images for testing students.

## Money
**100   0** RMB.

## Goals
1. Make a server for teacher.
2. Make many clients for students.
3. Students do their image connection as a test.
4. Students send their result to teather.
5. Teacher check the results of each clients.
6. Teacher see the most wrong lines.

## Plans
### Librarys
* `flask` for serving
* `Cytoscape.js` for connecting each images
    * https://js.cytoscape.org/
    * https://js.cytoscape.org/demos/images-breadthfirst-layout/
    * https://github.com/cytoscape/cytoscape.js/blob/master/documentation/demos/images-breadthfirst-layout/code.js
* `typescript` and `yarn` for compiling
* `electron` for wrapping the webpage

### Cores
* For each clients, we use `IP` and `username` to identity. We can get the username from startup popup.
    * How we get user ip: https://kite.com/python/answers/how-to-get-an-ip-address-using-flask-in-python#:~:text=Use%20flask.,an%20IP%20address%20using%20Flask&text=remote_addr%20inside%20a%20Flask%20view,IP%20address%20of%20the%20requester.
~~* For each clients, we get the `server ip` by reading the `config.json` file. (`{"server_ip": 0.0.0.0}`)~~
* For each clients, we get the `server ip` by popups, along with username.
* For the teacher side, we use `Top-Table` to switch between pages. (Monitor, Summary, ~~Add More~~)

### Strategy
We do the client first.

Then we do the server.

## Needs Update
### Part1
~~1. 线可以变的很细吗?~~
~~2. 颜色能不能连好后是绿色，错误的线是红色~~
~~3. 在顶部电源开关这里放一个button，控制on/off, button的特性就跟你上次帮我做的那个软件一样的，不要透明，off状态白色，on状态蓝色。~~
~~4. 连线错误的时候仍然要给出提示，“连线错误”这4个字~~。（就算用户在连第一组线的时候，连上了第二组的正确线，我们仍然判定它是正确的）
~~5. 顶部电源开关被设置成on之后，如果连线正确，比如第一个灯的连线正确，第一个灯需要变成亮的状态，亮的颜色是白色。~~
~~6. 每按一下切换开关后，对应灯泡闪烁一下之后继续亮白色，闪烁的速度要快一点。（这里不需要有关灯的功能）~~
~~7. 电源开启与关闭时，要切换背景图片~~
~~8. 不要黄色闪动。~~
~~9. 解决bug，2+L, 1+N，应该报错没有报~~
~~10. 上下两个灯的接线的颜色可以用两种不同色吗? 把上下两个灯的接线的颜色设置成不一样的，s上面是绿色，下面是黄色(#FBC02D)。~~
~~11. "1对L" "2对L" 这两根线要设计成可以擦除的。这样就可以做到上下两个灯不同时亮，因为**上下两个灯不允许同时亮**。("1+L"擦除后，第一组连线仍然保留)~~
~~12. 教师端要看到每个同学的错误连线，而且要统计每根线的正确率，总的每根线的正确率~~

### Part2
~~1. Change title to `导通测试软件教师端`~~
~~2. 主页部分，设置为24个学生，要有提交和未提交的状态显示，提交后双击，弹出你目前做的这个对话框，我画在图上了，你看一下。~~
~~3. 连线情况统计表，这里，每一次有同学提交后，才刷新表格。 （不要一直刷新）~~
~~4. make sure the id is in the range of [1,24] at the login page~~
~~5. IP的连通性要在客户端登陆界面就被检测~~

