cpeditor / cpeditor

The IDE for competitive programming :tada: | Fetch, Code, Compile, Run, Check, Submit :rocket:
https://cpeditor.org
GNU General Public License v3.0
1.83k stars 129 forks source link

Support custom submit commands #212

Open ouuan opened 4 years ago

ouuan commented 4 years ago

Is your feature request related to a problem? Please describe.

Now CP Editor only supports CF Tool, but:

  1. There are other CLI tools for submitting to online judges, like Online Judge Tools. They support more online judges.

  2. Users may use mirrors like https://codeforc.es/ for Codeforces, now they are forced to use https://codeforces.com.

  3. Users have no way to fix bugs caused by external API changes like #194 by themselves.

Describe the solution you'd like

We can let the user set custom submit commands.

A submit rule has the following components:

When clicking the submit button, if the problem URL matches a regex, CP Editor will execute the submit command, redirect stdout and stderr of the submit process to the message logger. When the process finishes, a toast message which contains the latest status or "Unknown" will show.

For example:

Describe alternatives you've considered

N/A

Additional context

N/A

ouuan commented 4 years ago

Of course, we have to provide presets for CF Tool, and move <CF Tool Command> to <CF Tool Command> ....

william-song-shy commented 4 years ago

这个确实挺重要的

william-song-shy commented 4 years ago

其实有些OJ也提供了API,比如luogu,可能没有那么麻烦吧

ouuan commented 4 years ago

其实有些OJ也提供了API,比如luogu,可能没有那么麻烦吧

Chinese:

不是要做提交工具,而是让 CP Editor 的用户可以使用除了 CF Tool 外的其它提交工具。另外这里最好说英语。

English:

We won't make OJ tools, we will just make the users of CP Editor able to use tools besides CF Tool. BTW, It's better to speak English here.

ybw051114 commented 4 years ago

I agree. But where is the API

ybw051114 commented 4 years ago

You can publish a docs first

neko-para commented 4 years ago

We can wrap tools in to scripts or programs, which provide the same interface.

neko-para commented 4 years ago

Alternatively, we can make extensions flexible(dynamic loaded), and let it generate its own settings page.

ouuan commented 4 years ago

It seems that we need one more page like the code snippets page and the parentheses page. We'd better write a solution for these pages and more pages in the future.

ybw051114 commented 3 years ago

When will this be in use