Question Authors' Forum

Editor Issue

 
Picture of Patrick Wang
Editor Issue
by Patrick Wang - Wednesday, 19 October 2016, 1:54 AM
 
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.




Picture of Patrick Wang
Re: Editor Issue
by Patrick Wang - Wednesday, 19 October 2016, 3:32 AM
 

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

Picture of Richard Lobb
Re: Editor Issue
by Richard Lobb - Wednesday, 19 October 2016, 10:38 AM
 

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

Picture of Patrick Wang
Re: Editor Issue
by Patrick Wang - Friday, 4 November 2016, 2:38 PM
 

HI Richard,

That is very helpful. Thanks.


Regards,

Patrick

Picture of Patrick Wang
Re: Editor Issue
by Patrick Wang - Friday, 28 April 2017, 2:47 PM
 

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

Picture of venkat talluri
Re: Editor Issue
by venkat talluri - Friday, 27 July 2018, 6:07 PM
 

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


Picture of Richard Lobb
Re: Editor Issue
by Richard Lobb - Saturday, 28 July 2018, 11:47 AM
 

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.