Character Color Plugin - Forum

Forum Navigation
You need to log in to create posts and topics.

Character Color Plugin

Page 1 of 2Next

Hi
I've created a new plugin that can change the color of your favorite character.

It's free.

regards,

 

Uploaded files:
  • You need to login to have access to uploads.
luishp, Vadim and 2 other users have reacted to this post.
luishpVadimpaeonSamuel Vanneste

Hola  @farhad2008

Lo he probado y funciona. Es muy bueno. ¿Se podría aplicar a un TextInput también?

 

Muchas gracias.

 

Roger Rey

Thank you @farhad2008!
I have added you to the plugin developers group.
Welcome :)

Hi, @luishp

Thanks for the honor

regards,

Hola,

Es posible que esta función pueda cambiar el color de más de un caracter. Si intento cambiar de color dos caracteres de una cadena no funciona, solo cambia de color el primero.

En este ejemplo el resultado final es que cambia de color el caracter con posición 3, el que tiene posición 2 no lo cambia.

set_char_color "Container1" 2 "red"
set_char_color "Container1" 3 "red"

Por otra parte ¿Se podría aplicar a otros objetos como "textinput"  o "área de texto".

Si es posible hacerlo más completo estaría dispuesto a comprarlo

 

 

 

Por otra parte ¿Se podría aplicar a otros objetos como "textinput" o "área de texto".

No se puede, aunque se pueden simular haciendo que un <div> sea editable:
https://stackoverflow.com/questions/17341670/change-color-of-one-character-in-a-text-box-html-css

@luishp

Lo que intento hacer es comparar dos cadenas de texto, una de ellas introducida por el usuario como respuesta. Lo que necesito es que en tiempo de ejecución coloree los caracteres que no coinciden con la solución.

@rrey

What I am trying to do is compare two text strings, one of them entered by the user in response. What I need is that at runtime I color the characters that do not match the solution.

I am not clear what the display(s) should look like ...

1) Do you want to show the differences as each character is being entered or only when the user has finished entering (and presses a Push Button (which compares the two strings and displays the differences).

a) If the answer is 'at the end', do you want to display just the user entered text (with differences hilited) ?

b) As far as I know, it is not possible to have the contents of a Text Entry Box contain 'rich text'.

You could make it appear so with some 'smoke and mirror' tricks i.e. cover it with a (rich text) object and echo the characters entered by the user in it ... this is where you would hilite the differences.

2) Can you elaborate on 'differences' ? ... what gets hilited in situations where ...

a) '123456789' vs. (entered) '1234abcd56789
b) '123456789' vs. (entered) '1234789'
c) 'cats hate dogs' vs. (entered) 'dogs hate cats'
d) any other patterns not covered above

Por ejemplo si la respuesta correcta es 'casa' y el usuario escribe como respuesta 'cosa', entonces el programa cambia de color la letra 'o' una vez ha pulsado el botón. Es decir, colorea las letras que no coinciden en su posición.

@rrey

For example, if the correct answer is 'home' and the user writes 'thing' as an answer, then the program changes the letter 'or' color once the button has been pressed. That is, color the letters that do not match in position.

Sorry for more questions (perhaps Google translation is causing confusion) but are you saying that ...

1) you have a Text Entry Box where user enters 'thing' (e.g. in black color)
2) user then clicks/presses a Push Button ... where the script does the comparison
3) you want to show the user that the answer was incorrect by changing the color of the entire word (i.e. 'thing') ...

- either by changing the color of the text in the Text Entry Box to (say) red
- or displaying the word 'thing' within a (rich) Text Box in (say) red color

Please confirm ... if not, perhaps you can show a screen shot.

Te dejo un ejemplo

https://docs.google.com/presentation/d/1s-pi5g-nKxwHfPO5Gy0wAkuCIwjtaTxDE68i4A2PPRc/edit?usp=sharing

 

 

@rrey

Thank you for the slide

1) The purpose of a Text Entry Box is to echo characters entered by a user; so there is no facility to make different characters of a different colour.

So the OUTPUT (in your slide) has to be a (rich) Text object.

2) So, it is possible to use script to compose the entered Text that shows erroneous characters in a different color.

The question is 'what qualifies as an erroneous character' ... your slide example (Elefante vs. Elofanta) is just one erroneous pattern i.e. same number of characters in INPUT as expected ... but how do you want to show ...

- ABCD vs. DCBA ... show all characters are erroneous ?
- ABCD vs. - ZZZABCD ... show all characters as erroneous ?
- ABCD vs. - ABD ... show D as erroneous ?

... if you like, you can show these examples in the same slide show.

Todo carácter que en el mismo orden de posición no conocida, será incorrecto.

Te dejo también la diapositiva

 

https://docs.google.com/presentation/d/1s-pi5g-nKxwHfPO5Gy0wAkuCIwjtaTxDE68i4A2PPRc/edit?usp=sharing

@rrey

Thank you for the visual descriptions.

This can be achieved fairly simply using script commands ... would you like me to provide a sample App ?

 

Sí. Me parece bien. Gracias.

@rrey

Take a look at attached project file and advise of any errors, omissions or misunderstandings ... I only understand Google-Spanish :-))

Note:

1) the first page is only for testing ... in a real exam, the student would get this text from some exam file contents.

2) all the work is done within the subroutine called ShowTextDifferences (so you can deploy it from several places within your Project) ... it accepts 4 parameters ...

- variable containing first string (e.g. teacher's test)
- variable containing second string (e.g. student's answer text)
- whether the comparison cares about uppercase/lowercase differences (i.e. is b same as B ?)
- variable in which to return the composed HTML result

3) the subroutine uses CSS classes .goodCompare and .badCompare when composing the comparison results ... take a look at Project >>> Properties >>> Styles ... this where you can add/remove (rich text) attributes

Uploaded files:
  • You need to login to have access to uploads.
asmat has reacted to this post.
asmat

@gaev

Gracias primero de todo por tu tiempo y trabajo.  Es un gran avance.

Hay alguna cosa que no coincide. Te lo explico aquí:

https://docs.google.com/presentation/d/1s-pi5g-nKxwHfPO5Gy0wAkuCIwjtaTxDE68i4A2PPRc/edit?usp=sharing

@rrey

Sorry, I messeed up ... did not retest everything after I added the CaseMatters feature :-(

New Version attached ... please download and test again.

Uploaded files:
  • You need to login to have access to uploads.

@gaev

Thank you.

Now it works perfectly. I am very happy.

For me it is a great help function for the educational applications that I create.

How can I pay you? It could be a very interesting pluguin

Roger Rey

Page 1 of 2Next