Editor Issue

Editor Issue

por Patrick Wang -
Número de respuestas: 9
I have just installed Moodle 3.1 with the latest CodeRunner, I realize the editor has a problem, the cursor and the place where the code is actually entered is different. 

The page below show the cursor is very far away from the semicolon.

After I entered "s", the letter s actually just appeared next to the semicolon. Very strange. Can someone help me out?

Thanks.




En respuesta a Patrick Wang

Re: Editor Issue

por Patrick Wang -

I have solved the problem already. It is to do with the theme. I used the default theme, and everything is ok.

En respuesta a Patrick Wang

Re: Editor Issue

por Richard Lobb -

Hi Patrick

Thanks for posting both a problem and a solution. It seems your original theme had somehow resulted in the Ace editor using a proportional font. This doesn't work properly - Ace requires a fixed-width font.

Changing the entire theme to fix the problem seems a bit drastic. You might be able to switch back to your original theme and add the following css somewhere suitable:

.ace_editor,.ace_editor * {
    font-family:Courier,monospace !important;
    font-size:12px;
    color:inherit;
}

See here for a brief discussion of font issues with Ace, albeit in a different context.

Another thing you could try if you wanted to use your original theme is to pull the most recent version of CodeRunner (pushed just yesterday) and switch to the Development branch. That branch includes the latest version of the Ace editor which apparently has fixed some font issues like the above. It also fixes an annoying problem with large chunks of code being selected when you first click within the code after a Check. If that solves the problem too, you could either continue to use the Development branch (caveat emptor) or copy the Ace editor (i.e. the entire question/type/coderunner/ace subtree) out of it back into the Master branch.

Richard

En respuesta a Richard Lobb

Re: Editor Issue

por Patrick Wang -

Hi Richard,

I finally got it working by removing the font-size property. Btw, I am using Essential Theme. I posted the updated customized css below just in case others might encounter the similar issue.

.ace_editor,.ace_editor * {
    font-family:Courier,monospace !important;
    color:inherit;
}
Thanks for your invaluable help.


Patrick

En respuesta a Richard Lobb

Re: Editor Issue

por venkat talluri -

problem with large chunks of code being selected when i first click within the code after a Check. please give me solution it is very urgent. we are using latest version of coderunner (3.4.0) moodle

Anexo editor issue.jpg
En respuesta a venkat talluri

Re: Editor Issue

por Richard Lobb -

I can't replicate this problem myself with either CodeRunner 3.4 or 3.5 (just released). It used to be a problem with an older version of the Ace Editor but was fixed in mid 2016 by upgrading to the latest Ace editor. The version that comes with CodeRunner 3.4 and 3.5 shouldn't suffer from it.

Is anyone else experiencing this problem?

How long have you been running CodeRunner and how long have you been seeing this problem? What browser are you using and have you tried other browsers?

I suspect you are running an old version of Ace - perhaps cached somewhere? - though I don't see how that could be happening.

Sorry but I can't fix something that I can't replicate myself.

Richard

PS: I also don't see why this is "very urgent". We lived with it for years with an older version of Ace. You just have to learn to click somewhere in the window after the Check.

En respuesta a Richard Lobb

Re: Editor Issue

por Marcos Vinicius Lima -
Hello Richard, I'm with this Code Runner Editor Issue. I use Essential Theme but I dont know what file I need to edit to insert your css code.
Do I need to access moodle/theme/essential/style? Which css file?
Could you help me?
Thanks!

En respuesta a Marcos Vinicius Lima

Re: Editor Issue

por Richard Lobb -

I'm curious to know why this problem is still occurring. Can you tell me what versions of Moodle and CodeRunner you're using, please?

I don't have the essential theme installed on my machine but the built-in themes have a settings option under Advanced, to allow extra CSS to be injected. For Boost, for example, it's accessed via Site Administration > Appearance > Themes > Boost.

Does the Essential theme have such a setting?

Richard

En respuesta a Richard Lobb

Re: Editor Issue

por Marcos Vinicius Lima -

Hello Richard! I've changed the Moodle theme to default and the Code Runner editor is OK now. I was using the "Essential Theme version 2.5" with Moodle 3.0.3. In December I will update the Moodle to the lastest version. Thanks for your help! ;)