## Scoring with formula and if condition (ballot paper)

Hi!

Is there a guide or example around that could explain how to use a conditional formula for scoring?

Because, dear reader, you will wonder why I am asking this here is what I am trying to do: Think about a set of elections with paper ballots for an NGO general assembly. There are 7 candidates for 4 positions with 9 checkboxes, so the task is to "mark up to 4 out of 7". To make things a bit more complicated, each ballot has one or two spare entries for last-minute candidates that are set to \wrongchoice when unused.

So I need to invalidate a ballot if an unused spare checkbox was used and intend to do so by scoring it with "m=-100". Now I would like to do the same with the help of "set.XXX=p" where p is the number of available places: If more crosses are found than places assign score -100 to make it really obvious.

Suggestions?

### Replies (8)

#### RE: Scoring with formula and if condition (ballot paper) - Added by Alexis Bienvenüeover 10 years ago

I think the simplest way to do it is to export checked boxes data and handle it with another script (or LibreOffice macro or SQL commands or so).
To get it from AMC, you can

#### RE: Scoring with formula and if condition (ballot paper) - Added by Philipp von Klitzingover 10 years ago

The OpenOffice export is a real beauty! It has only a very small glitch for in the summary tab: The stats would also include checked boxes of ballots that are invalid. With the detailed list of checked boxes I can of course address that, and looking at the plugins I had already on my list.

Here is what I am trying to achieve: I would like to have a way to invalidate a ballot already inside AMC. The reasons are:
• inside AMC I can examine and correct the checkboxes
• having a score of -100 is a much better indication for a potentially invalid ballot than a score of 5 (where a score of 4 would still be ok); for the simple AMC user (they will change again and again) it would be less error prone.

So if there were a way to do "IF score > 4 THEN set score = -100" then that would be my choice of doing things. Most likely I would then want to remove that ballot entirely from the ballot in order to get clean stats in OpenOffice. Although, of course I also most account for the number of invalid ballots when presenting the results.

#### RE: Scoring with formula and if condition (ballot paper) - Added by Alexis Bienvenüeover 10 years ago

So you want to have a list of invalid ballots in order to look at them manually, and remove them from AMC.
I don't think looking at scores>4 is much difficult than looking at -100: just ask LibreOffice to color scores>4 in red.
However, you can use something like that:

`formula=(NMC>0 || NBC>4 ? -100 : NBC)`
I considered here that you marked possible answers as correct, and impossible answers (the answers for candidates that did not show up finally) as wrong. Then, `NMC` (number of checked wrong answers) should be 0, and `NBC` (number of checked correct answers) should be <= 4 for a ballot to be valid.

#### RE: Scoring with formula and if condition (ballot paper) - Added by Philipp von Klitzingover 10 years ago

Wounderful - I had already seen NMC and NBC in the guide, but wasn't sure about the correct syntax. Tested, works like a charm.

At first glance indeed, checking manually for >4 ist essentially the same as checking for -100. However, there will be around +/-12 ballots (=election rounds), and each of them has a different threshold. So it may be 4, it maybe 6 for a different ballot, and 1 for yet another one. So, if I can standardize all that on -100, then I believe the human operator, at times working under time pressure, will make less mistakes.

#### RE: Scoring with formula and if condition (ballot paper) - Added by Alexis Bienvenüeover 10 years ago

```set.INVALID=NMC>0 || NBC>4
```

should declare a question to be invalid when needed. Then the checked boxes of an invalid ballot won't be counted in the ODS stats page, which is another advantage.
Hum... this is not implemented yet.

#### RE: Scoring with formula and if condition (ballot paper) - Added by Philipp von Klitzingover 10 years ago

That would be absolutely useful.