A
A
Aligatro2017-07-20 20:16:19
PHP
Aligatro, 2017-07-20 20:16:19

How to organize the approval / rejection of edits from several users in the text?

Good evening friends. In general, it is extremely difficult to adequately formulate a question that fully reflects the essence of the problem, so I will try to explain what I mean.
In short, I need to refine Text_Diff (I am absolutely not tied specifically to this library, it's just the first thing I found on the net) so that, in addition to comparing two versions, it would be possible to display + delete / restore edits by users + based on to form the final document from:
"Original version of the text" -> "Approved edits" -> "Final version of the text".
For example:

original version
Это текст-"рыба", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века.
Approved edit by User 1
Это текст-"рыба", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века. Дополнение от пользователя 1
Approved edit by User 2
Это не только текст-"рыба" но и текст ракообразный, часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века. Дополнение от пользователя 2
Rejected edit by User 3
Это фееричный бред текст-"рыба", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века. Хрень от пользователя 3
Moderator's version
Это фееричный бред не только текст-"рыба" но и текст ракообразный, часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века. Дополнение от пользователя 1Дополнение от пользователя 2Хрень от пользователя 3
final version
Это не только текст-"рыба" но и текст ракообразный, часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной "рыбой" для текстов на латинице с начала XVI века. Дополнение от пользователя 1Дополнение от пользователя 2
It is important to note that all edits are added not one after another, but relative to the original version of the text
. I have problems with building the architecture as such, since I have not come up with anything more sensible than dozens of comparisons of text versions for each user.
So far my unusable sketch looks like this:
  1. We create a table where we store the text of each user edit (we isolate the edit text of each user by comparing the original version of the text and the user's version with edits, write the difference to the table)
  2. We create a table with the general text of edits from all users for subsequent comparison with the text from each user and highlighting their edits (here is a dead end, since it’s not at all clear to me how to work with the text order, because each new edit will be made relative to the original version of the document and not one after the other)
  3. If two separate users affect the same text in the document, place them one after the other (also a space, hypothetically, you can cross-compare with the previous general version with edits from other users, the version with edits from the current user and the original version for highlighting repeated edits, but sounds so-so)

As a result of text_diff calls, there will be an incredibly large number (and even with a comparison of everything, the entire chronology problem remains) , which is poor both in terms of architecture and performance. Therefore, I would like to ask you for help in finding the right direction of thought, or even better, with a link to the ready xD library.
Thanks to everyone who read to the end ...
Ps and yes, I know that it would not hurt me to read a course on algorithms, study types of sorts, etc. And I'll definitely do it, but right now, I just don't have time. And yes, I also know that for good I should know all this, but excuse me ...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
laxikodeje, 2017-07-20
@laxikodeje

The wiki engine does this.

T
ThunderCat, 2017-07-21
@ThunderCat

Am I dumb or are you reinventing git?

V
Vladislav U, 2017-07-27
@MSrVladis

Great task and setting!
I have been considering this decision for five years already, since the ready solution will give an incredible impetus to the development of the State where this mechanism is fully implemented and will be made as convenient as possible. It's no secret that numerous approvals in cascade control systems and not only take a huge amount of time, and most of these approvals lose the most valuable thing.
An additive that I hope will bring the solution closer: users need to be classified and assigned their own (unique) color, here you will see the smallest but incredibly tangible edits up to one character clearly. Also, the color "pants differentiation" will allow you to determine the level of editing text or other by the user. For example, - the green group (on the entire color scale of this color) is scientists, the blue group is civil servants, the red group is non-professional users (their edits require closer attention for various reasons) AND SO FURTHER. Also, each color is a unique serial number #00000 - #.......
Yes, the above has been touched upon; "implemented the engine in wikipedia" - nifig..a, like that! There, edits are made by trusted users and it is absolutely not visible clearly what was corrected (you need to search separately and find these revisions yourself) is very inconvenient and inefficient, and these formulations are not always really valuable and "scientific".
Unfortunately, I don't have much time or other resources to really help with this work, but if you don't mind... keep me posted. Thank you very much, there are still real SEEKERS.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question