Is there a way for users to contribute new problems?

Back to OpenSource Participation forum

Guy Gervais     2015-09-18 22:30:03
User avatar

I know you've implemented many ideas from users since this site started, but you're doing all the work.

Would there be any way for users to create new problems (subject to your approval, of course; we'd have to propose them first to get them approved)?

You might be able to build a "backlog" of problems and then release 1 or 2 every week to keep users coming back.

Rodion (admin)     2015-09-19 06:09:04
User avatar

Hello, Guy! Thanks to your suggestion :)

To be honest I think it may be rather boring for people to work on problems in details...

Let us see, the problem consists of, well, 3 parts:

  • the statement - you've seen them in markdown format;
  • the checker - small script in PHP;
  • the idea - with them I have a lot of troubles;

As about checker - it has very simple programming interface. Here is the one for A+B problem:

function checker() {
    $a = rand(1000000, 9999999);
    $b = rand(1000000, 9999999);
    return array("$a $b", $a + $b);
}

So it just needs to have a method named checker and be able to return array of two strings - for "test data" and for "expected answer". Though I have primitive tools to test the checker in the site, I often fall back to running them locally or at ideone, like this: http://ideone.com/czKCy7. Larger checkers can surely have additional functions, perhaps arranged into class, to avoid creating mess of code - main thing is that all this stuff is called from the same checker method and produces array with two elements.

(there are some additional things about checkers which can test answers rather than simply compare, and for those used for "challenges")

As PHP is not the sexiest language I'm ready to help in creating the checker - or rewriting it from example in any other language (preferably the language I can understand).

One of the obvious limitations for the checker is that it should be able to run fast just before the page is loaded. When this could not be achieved, I create arrays of precalculated results and the checker which simply shoot them out randomly.

If necessary, we can have something like a sandbox where problem statement and the checker could be tried - though this will not be of much help... Especially for checker-prototypes in other languages. :)

Rodion (admin)     2015-09-19 06:09:22
User avatar

So if you really have a time and intention to try - you are really welcome, though, probably it would be good to discuss the idea first - for I've found that not all of ideas could be easily implemented :(

When I have ideas which I do not know how to implement at once, I put them to our issues list with content label.

BTW despite of this forum name I suspect that usually the checker code could not be open-sourced for otherwise it could be slightly modified and plugged into as solution :)

Goodwin Lu     2015-12-10 01:30:18

I think that you could allow somebody to submit a problem, and a checker. It would either have to be approved by you or at least three people who are biship or better, or alternatively, rank 100 and above on the user rankings. Won't that be nice.

Rodion (admin)     2015-12-10 15:51:16
User avatar

Yes, that would be nice :)

If anyone is ready to send me the checker and statement, please do it by e-mail initially. I think if this will become a popular matter, we'll add some interface for testing checkers/statements and submitting them.

You see, I simply am not quite ready to create new functionality which, probably, will not be used. :)

Please login and solve 5 problems to be able to post at forum