Hello LibreOffice-Community.
This is the first question I ask, please forgive me If I did something wrong.
What I have is a .ods file with many sentences, with each word in its own cell. I’ll make up a short example
- I want to go home
- I wish to go home
- Now I want to go home and sleep
- I like this
- Go want home to I
What I need to do, is to grade each of 2-5 according to their correctness in repeating 1.
So, the sentence 2 should get marked as 1 mistake (or 4 points).
Additional words do not matter and missing words count as wrong, so the sentence 3 should be graded as 0 mistakes (or 5 points), and the sentence 4 as 4 mistakes (or 1 point).
The order of words does not matter at all, so sentence 5 should still be graded as 0 mistakes or 5 points
The basic building-block of a solution would probably constitute something, that reads all cells in one line (or let’s say from C3 to AN3) (the correct sentence) and see, how many of those words appear in another line (let’s say from C4 to AN4) (the sentence to be graded). This number would constitute the “points” I need.
Amount of data:
Each correct sentence is 18 words long. There are 40 different sentences, each of which has a correct version and 16 different repetitions. But if a solution can correctly grade the above example, it should also handle the real data, I assume.
Thanks in advance for any answers. If more detail is needed I will gladly provide it.
Edit Basic Idea (?):
I think, one way to do it is by creating nested loops. I’ll try to put it in pseudocode, since I don’t know LibreOffice Basic
For Counter1 (call it N) = 1 to (Number of words in correct sentence, namely 18)
For Counter2 (call it M) =1 to (Number of words in the sentence to be graded, namely 34)
Compare the Nth Word in the correct sentence to the Mth word in the current sentence.
If they are equal: Points = Points+1
Is this a plausible approach? If so, how can I express it into Calc?
Edit2: Here follows a more precise example of what I want to achieve. What I have is comparable to the following table, but without the Points
Person Sentence Word1 Word2 Word3 Word4 Word5 Points
correct 1 I want to go home
correct 2 This is a short sentence
correct 3 I like Linux a lot
1 1 I wish to go home 4
1 2 That is a long sentence 3
1 3 I like Linux very much 3
2 1 I go home want very 4
2 2 Sentence long 2
2 3 Linux is very strange 1
So each of the persons 1 and 2 read the correct sentences and then repeated them more or less exactly. I need to find out how exactly, by counting how many of the words in the correct sentence the person repeated (in any order). This number constitues the Points.
Edit3 I upload an example of grading the same word twice. Oh no, I’dont, needs 3 points…