I have a problem only with c and cpp questions in code runner. There is no syntax highlighting only for them. I made a test for Pascal, Java, Python and everything is OK.
I also try to use code snippet suggestion for some keyword with CTRL + space, but that also doesn't work. If I put cursor on white space and hit CTRL + space it only suggest previously declared variables in the written code (img1).
I don't think the problem is in the theme I use for Moodle, because the problem mentioned doesn't occur in other programming languages. I will attach some pictures.
Tested also on production site with same problem.
The program compiles without any background issues and provides answers about which test cases it meets and which doesn't.
Second image is inspect element of page where c-question is loaded.
Thanks in advance.
Moodle 3.4.9 (Build: 20190513)
Hi Adnan, thanks for the nice clear bug report.
If you're unable to upgrade your Moodle version, the following workaround hack might work. It seems to have fixed the problem on this site, but it has had minimal testing and I've no idea whether it's a general fix.
Line 448 of the file ace/mode-c_cpp.js in the CodeRunner folder (e.g. /var/www/html/moodle/question/type/coderunner) is currently
this.lineCommentStart = "//";
I changed that line to the equivalent
this.lineCommentStart = "/" + "/";
As a Moodle admin, I then used the "Purge all caches" facility and the bug seems to have disappeared!
You might want to try simply purging the caches first, before editing the file; it didn't work for me, but ... who knows?
Modifying the code as you said ACE works perfectly well with c and cpp question type.
Before I post a question on the forum I tried a lot of things related to this problem:
- to apply a custom css for the current theme mentioned in the post on the link https://coderunner.org.nz/mod/forum/discuss.php?d=27,
- also try to change default theme for Moodle but nothing happens.
-From this link: https://github.com/ajaxorg/ace-builds test all ace-builds for ace:
Every time I did some changes I always perform clear theme cache and purge all cache, but without success.
Once again, thanks Richard.