Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Merge remote-tracking branch 'origin/master' into catalyst-master with fixed conflict #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 225 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
225 commits
Select commit Hold shift + click to select a range
3479a9b
Trim whitespace from jobe host to avoid confusion if admin added whit…
trampgeek Nov 16, 2022
6a5431d
Bug fix: this test was failing in Moodle 4.1.
trampgeek Nov 16, 2022
eccf10a
Update version date
trampgeek Nov 16, 2022
6dca4e8
Merged
trampgeek Nov 16, 2022
335fdd5
Turned on autochecking languages for run_in_sandbox; error\ is langua…
fastsandslash Nov 21, 2022
f525476
Added the JSON parsing fixes
fastsandslash Nov 21, 2022
722fdf5
Merge pull request #154 from fastsandslash/master
trampgeek Nov 21, 2022
cfcc8bd
Rebuild several minified files to stop grunt complaining on github CI
trampgeek Nov 22, 2022
88726ee
Lots of code-tidying to satisfy moodle CodeChecker.
trampgeek Nov 22, 2022
19f7221
More code-tidying, plus disabling of Moodle codechecker and dochecker
trampgeek Nov 23, 2022
2e5450f
Changed for CPU params handling
fastsandslash Nov 29, 2022
89c3031
Changed for CPU params handling
fastsandslash Nov 29, 2022
592504f
Updated ci .yml
fastsandslash Dec 6, 2022
67c303e
trial push
fastsandslash Dec 6, 2022
2394bea
Revert changes to ci.yml
trampgeek Dec 6, 2022
14e8a38
Changed for CPU params handling
fastsandslash Nov 29, 2022
d72ba3c
Changed for CPU params handling
fastsandslash Nov 29, 2022
762a408
Updated ci .yml
fastsandslash Dec 6, 2022
167450c
Merge branch 'master' of github.com:fastsandslash/moodle-qtype_coderu…
fastsandslash Dec 7, 2022
62edfea
Updated ci file to have two PHPs?
fastsandslash Dec 7, 2022
cc9c8cc
Regression fix: errors such as URL blocked weren't being handled corr…
trampgeek Dec 11, 2022
776f251
Code tidying.
trampgeek Dec 11, 2022
fa42e78
Pause execution to allow JobeInABox to initialise.
trampgeek Dec 11, 2022
3855dc1
Fix broken script.
trampgeek Dec 11, 2022
0cb6513
Fixed not setting cpuparams
fastsandslash Dec 11, 2022
18b3bed
Revert accidental changes and ci playaround
fastsandslash Dec 11, 2022
3aab5a1
Merge pull request #157 from fastsandslash/master
trampgeek Dec 11, 2022
c64dd2e
trying to isolate savepoints change
fastsandslash Dec 12, 2022
47df856
I need your latest code
fastsandslash Dec 19, 2022
a49c1f4
Handles Twig Error and converts to appropriate error
fastsandslash Dec 19, 2022
1da05c2
Remove extraneous code
fastsandslash Dec 19, 2022
d9f92fd
Merge pull request #158 from fastsandslash/master
trampgeek Dec 20, 2022
d4bf11e
Made changes to prototype error handling
fastsandslash Dec 20, 2022
2739509
Done some more major error handling, but incomplete.
fastsandslash Dec 21, 2022
340109a
Now have modified behaviour for handling drop-downs, fixed some tests
fastsandslash Dec 22, 2022
7e81e88
Prevent grading of the unchanged answer preload.
trampgeek Jan 15, 2023
21d7a0a
Add a few more queries.
trampgeek Jan 15, 2023
2862a2c
Commit grunt rebuilds of JavaScript modules.
trampgeek Jan 15, 2023
a6dc8e9
Merge branch 'development' of github.com:trampgeek/moodle-qtype_coder…
trampgeek Jan 15, 2023
50c0b1c
Update test to handle the fact that preloaded answers aren't actually…
trampgeek Jan 15, 2023
cf8dbf9
Merge Tim Hunt's updates to the tests.
trampgeek Jan 16, 2023
c06e365
Added duplicate prototype tests and fixed bugs
fastsandslash Jan 16, 2023
4c24593
Added test cases for template params and more Form related tests
fastsandslash Jan 17, 2023
49234a7
Updated alert closing handling to be stable
fastsandslash Jan 17, 2023
c6b072a
Pulling in changes made in development
fastsandslash Jan 18, 2023
62e71bb
Changed Twig template params test to check UI errors in php8
fastsandslash Jan 19, 2023
28f610b
Merge pull request #160 from fastsandslash/master
trampgeek Jan 19, 2023
5d51464
Development (#161)
jimbonothing64 Jan 22, 2023
2836bb9
Added fix for duplicate class names
fastsandslash Jan 24, 2023
26c4c37
Somewhat fix for Java progam names identical to support file names
fastsandslash Jan 25, 2023
9611ade
Fixed the UI display bug
fastsandslash Jan 26, 2023
7680a44
Tweaks to commenting.
trampgeek Jan 27, 2023
485ca1e
Add Michelle's hidden error message.
trampgeek Jan 27, 2023
aa32a8f
Scratchpad UI (#162)
jimbonothing64 Jan 27, 2023
063075d
Merge branch 'development' of github.com:trampgeek/moodle-qtype_coder…
trampgeek Jan 27, 2023
d92c2f3
Bug fix: the UI parameters from the prototype should be ignored if
trampgeek Jan 27, 2023
618baf0
To work around a Linux/Chrome bug that always matches the media check
trampgeek Jan 28, 2023
7e590e2
Add various UI parameters to the Ace UI.
trampgeek Jan 28, 2023
9a74eaa
Scratchpad Development (#164)
jimbonothing64 Feb 1, 2023
3c9decc
Merge resolved
fastsandslash Feb 1, 2023
5a5bad6
Merge conflict resolved
fastsandslash Feb 1, 2023
7bf4982
Bug fix: shouldn't try to merge prototype's UI parameters with the
trampgeek Feb 1, 2023
82502e8
Bulk tester now works with sample files
fastsandslash Feb 1, 2023
ec8bd3f
Update all JavaScript build files
trampgeek Feb 1, 2023
99771bd
Version date update.
trampgeek Feb 1, 2023
2f95ba8
Add UI parameter to control automatic extraction of code from a JSON
trampgeek Feb 1, 2023
87cdb13
Add functionality for extracting answer code from JSON produced by
trampgeek Feb 2, 2023
d27cec3
Merge latest changes from James
trampgeek Feb 2, 2023
2f8f75b
Resolve merge conflicts
trampgeek Feb 2, 2023
d4e0b3c
More merge issues
trampgeek Feb 2, 2023
20f907a
Merge branch 'fastsandslash-master' into development
trampgeek Feb 2, 2023
b237d13
Fix failing phpunit tests.
trampgeek Feb 2, 2023
d4ce034
Revamp handling of sample-attachments so that Preview can load
trampgeek Feb 4, 2023
cb66afc
Change default to false for auto-switching theme according to media s…
trampgeek Feb 7, 2023
944bd71
Provide more-meaningful response summary for questions using the
trampgeek Feb 7, 2023
3902591
Adjust test to reflect changed default value of auto_switch_light_dar…
trampgeek Feb 7, 2023
ef067b0
Update documentation of HTML-UI.
trampgeek Feb 7, 2023
94a9457
Scratchpad Development (#165)
jimbonothing64 Feb 14, 2023
860b189
Remove from the Ace Gapfiller UI the ability to use one of Ace's
trampgeek Feb 17, 2023
6b6891a
Merge request (#166)
fastsandslash Feb 19, 2023
30901f8
Bug fix: extraneous errors with questions that did not have sample an…
trampgeek Feb 20, 2023
07e3077
Legacy support for all question types with unspecified uiplugin.
trampgeek Feb 23, 2023
79ab52f
Tweak name of behat alert testing function to avoid apparent conflict
trampgeek Mar 7, 2023
cdd9a2d
Merge branch 'development' of github.com:trampgeek/moodle-qtype_coder…
trampgeek Mar 7, 2023
2905590
Increase time allowed for question initialisation on Jobe to 10 secs.
trampgeek Mar 7, 2023
9e4d342
Bug fix: per-question Ace theme setting not working properly.
trampgeek Mar 13, 2023
4c195de
Bug fix: race problem with ui_scratchpad could result in all scratchpad
trampgeek Mar 16, 2023
22adac6
Comment out a test of some redundant functionality
trampgeek Mar 16, 2023
6a95604
Fix error in last commit - prefix_ans was being negated on reload.
trampgeek Mar 16, 2023
8c874a1
Further tweaking of ui_scratchpad to handle some edge cases not handl…
trampgeek Mar 16, 2023
8a31488
Try to reduce the probability of loss of data from the Ace UI if the
trampgeek Mar 20, 2023
9ab7099
Bug fix: calls to get the best sandbox (e.g. by filter_ace_inline)
trampgeek Apr 6, 2023
5bf53be
Updated minimised js
trampgeek Apr 6, 2023
f82f225
Allow 0 marks for test cases.
trampgeek May 6, 2023
d5b3131
Fix PHP8.1 deprecated error for trim function (#169)
AnupamaSarjoshi May 9, 2023
ed3afc7
Set specific column widths for compatibility with newer versions of s…
trampgeek May 14, 2023
5290ccd
Use input elements in the Table UI rather than textareas when there i…
trampgeek May 16, 2023
e849afe
Bug fix: certain special literal strings like '$' were causing
trampgeek May 16, 2023
dde0047
Update version number
trampgeek May 17, 2023
8936a5a
Prevent various style errors from failing the run.
trampgeek Jun 5, 2023
d1f0d69
Tweaks for PHP8.2 compatibility.
trampgeek Jun 6, 2023
4c77f50
Merge branch 'master' into development - mostly php8.2 compatibility …
trampgeek Jun 6, 2023
27ca408
Change default sync interval for UI plugins from 10 to 5 seconds.
trampgeek Jun 10, 2023
2b91da9
Bug fix: the leftover values that could not be stored were not being …
trampgeek Jun 12, 2023
9f17827
Change colour of the "This is a prototype and base type can't be chan…
trampgeek Jun 12, 2023
a4c96a5
Commit minimisations and maps.
trampgeek Jun 12, 2023
befbeb5
Added the info panel concept, unsure if working (#172)
TheHickman Jun 27, 2023
8666296
Fix syntax errors from last pull.
trampgeek Jun 27, 2023
1ae5e08
Bug fix: renderer was accessing the outcome's epiloguehtml attribute
trampgeek Jun 28, 2023
2da43a8
Improve documentation of template graders.
trampgeek Jun 30, 2023
ed00b80
Update ci.yml
trampgeek Jul 19, 2023
ff415cd
PHP8.1 depricated error for trim() (#702680) (#174)
mkassaei Jul 25, 2023
7774a5f
Php8.1compatibilty (#175)
mkassaei Jul 27, 2023
df1137e
Fix wrong comment.
trampgeek Aug 5, 2023
21d1d7f
Merge branch 'master' into development
trampgeek Aug 5, 2023
f049643
Update all grunted files
trampgeek Aug 5, 2023
81e9463
Adjust test to accommodate somewhat larger export files.
trampgeek Aug 6, 2023
a7ae42d
Add annotation to prevent PHP 8.1 return type incompatibility error m…
trampgeek Aug 6, 2023
2ccf72e
Change behat test for duplicate prototype to handle changed functiona…
trampgeek Aug 6, 2023
f57895c
Fix error in the duplicate prototype test.
trampgeek Aug 7, 2023
1cf415e
Fix bad wording of error message.
trampgeek Aug 26, 2023
ecfa8f9
Change implementation of web-service throttling to lessen risk of
trampgeek Aug 28, 2023
b9e1864
Incorporate all recent development into master
trampgeek Aug 28, 2023
f60d478
Fix error in documentation of auto_switch_light_dark.
trampgeek Aug 28, 2023
05da74a
Fix typo.
trampgeek Aug 29, 2023
af45724
Bug fix: when creating a new question with a non-Ace prototype, the
trampgeek Sep 3, 2023
18fb456
Update version number plus various documentation tweaks.
trampgeek Sep 3, 2023
064f5fb
Merge branch 'development' (updating documentation and fixing bug
trampgeek Sep 3, 2023
77a0440
Fix test to match corrected error message.
trampgeek Sep 3, 2023
d411c43
Code tweak (aka hack) to maintain compatibility with original HTML-UI
trampgeek Sep 3, 2023
9337b7a
Flag version as a release candidate.
trampgeek Sep 3, 2023
85fb668
Documentation tweaks
trampgeek Sep 4, 2023
07c52fe
Undo the special case hack for old style python3_scratchpad questions;
trampgeek Sep 4, 2023
810885f
More documentation tweaks.
trampgeek Sep 4, 2023
7bb2a65
Change multilanguage question type so that answer code cannot be entered
trampgeek Sep 8, 2023
e4072d4
Update maturity from release-candidate to stable.
trampgeek Sep 17, 2023
74566f6
Delete stray symbolic link to grunt
trampgeek Sep 17, 2023
0a26ccb
Upgrade status from RELEASE_CANDIDATE to STABLE
trampgeek Sep 18, 2023
ff99617
Update version number and date in version.php
trampgeek Sep 18, 2023
709cb37
Twig range function can generate PHP ValueErrors. Catch these and ret…
trampgeek Sep 23, 2023
ad149d0
Bug fix: Twig errors occurring outside of the template (e.g. when
trampgeek Sep 23, 2023
278af71
Bug fix: Twig errors occurring outside of the template (e.g. when
trampgeek Sep 23, 2023
ed4a218
Update built-in prototypes to include all newer fields. Also, update
trampgeek Oct 26, 2023
7ba87a1
extension of multilanguage for Perl,PHP,Ruby,JavaScript,C#,Golang (#179)
rmallah Oct 26, 2023
7392b6f
Merge branch 'master' of github.com:trampgeek/moodle-qtype_coderunner
trampgeek Oct 26, 2023
3172598
Workaround bug in core tablelib that strips all html characters and n…
trampgeek Nov 4, 2023
31658d8
Bug fix: new multilanguage question type was specified to be a user-d…
trampgeek Nov 9, 2023
cb0b250
Moved outputdisplayarea erros from alerts to display, with red bg. Ch…
jimbonothing64 Nov 12, 2023
ce4d92a
Document extensions to multilanguage question type.
trampgeek Nov 12, 2023
2678cb7
Tighten criterion used to delete the built-in prototypes to include the
trampgeek Nov 12, 2023
f5820b0
Tweak version number/date
trampgeek Nov 12, 2023
515b971
Merge all James scratchpad-ui updates from branch 'master' into devel…
trampgeek Nov 12, 2023
5c343c2
Tweak version date.
trampgeek Nov 12, 2023
2561dfc
Bug fix: twig parameters in prototype extra were not be validated for…
trampgeek Nov 13, 2023
f353aea
Refactored to allow use of the copy-got-to-expected functionality with
trampgeek Nov 14, 2023
9e000e0
Bug fix (issue 182): LaTeX embedded in question feedback was not being
trampgeek Nov 15, 2023
1188096
Pass out more info when Jobe request fails. Also prevents fatal PHP e…
trampgeek Nov 17, 2023
ac20edf
Pass out more info when Jobe request fails. Also prevents fatal PHP e…
trampgeek Nov 17, 2023
08bb49a
Bug fix - locked_cells functionality was not working.
trampgeek Dec 1, 2023
1377b92
Improve formatting of error information from Jobe server.
trampgeek Dec 1, 2023
2ebc23a
Include minimised ui_table code
trampgeek Dec 2, 2023
337a160
Remove the category from the XML files to work around a bug in Moodle…
trampgeek Dec 10, 2023
ee8337f
Various test tweaks for Moodle 4.3 compatibility.
trampgeek Dec 10, 2023
5c312a4
Code tidying and improving efficiency when no UI is set.
trampgeek Dec 10, 2023
eb67cd1
PHP 8.2 compatibility tweak.
trampgeek Dec 10, 2023
e84faca
Bugfix Github issue #145: Some testcases don't check if the sandbox i…
mckeownp Dec 18, 2023
5dbbd08
Merge branch 'development' of https://github.com/trampgeek/moodle-qty…
mckeownp Dec 18, 2023
2d14840
Update version number
mckeownp Dec 18, 2023
10532d8
Code tidying to conform to latest Moodle code-checker standards. Upda…
trampgeek Dec 20, 2023
858f90c
Style updated to conform to moodle-extra :) (#184)
mckeownp Dec 29, 2023
7241a07
Minor style and layout tweaks on ajaxquestionloader plus grunting of …
trampgeek Dec 30, 2023
fe9f655
CodeRunner: 'full screen' button #578890
Jan 16, 2024
aa9177d
Fix bad format type
trampgeek Jan 26, 2024
08390e3
Fix bad format type
trampgeek Jan 26, 2024
284e686
Fix PHP8.2: Deprecated: Creation of dynamic property errors (#189)
AnupamaSarjoshi Jan 29, 2024
506fd1d
Merging code from Anupama Sarjoshi that fixes many PHP8.2 errors from
trampgeek Jan 29, 2024
a34e13e
Updating comments on class attributes
trampgeek Jan 29, 2024
947a302
Revert to use of standard adaptive_adapted_for_coderunner behaviour p…
trampgeek Jan 29, 2024
8aa5132
Trivial whitespace tweak
trampgeek Jan 29, 2024
775c6c7
Updating comments on class attributes
trampgeek Jan 29, 2024
1dde26e
Merge branch 'development' of https://github.com/trampgeek/moodle-qty…
trampgeek Jan 30, 2024
6864e5a
fix: gaps support typing in macrons and other letter characters (#190)
jimbonothing64 Jan 30, 2024
8770431
Merge branch 'wip578890' of https://github.com/danghieu1407/moodle-qt…
trampgeek Jan 30, 2024
6e54090
Documentation tweaks (remove confusing stray line in description of A…
trampgeek Feb 1, 2024
9eef386
Merge in update to ace-gapfiller UI to allow more general alphabetic …
trampgeek Feb 1, 2024
f33ebfd
Merge branch 'danghieu1407-wip578890'
trampgeek Feb 3, 2024
1b024b0
Changes to use Moodle's qbank exporttoxml script instead of custom co…
AnupamaSarjoshi Feb 5, 2024
69e8c68
Update minimised files
trampgeek Feb 5, 2024
7d56fc2
Merge updates to bulk tester.
trampgeek Feb 5, 2024
269d3ee
Merge branch 'master' into development
trampgeek Feb 5, 2024
92ec60b
Fix broken minimised files for scratchpad
trampgeek Feb 5, 2024
499f585
Update version and date.
trampgeek Feb 10, 2024
9b0d418
Squashed commit of merge from development branch. Changes include:
trampgeek Feb 11, 2024
22ba2ab
Add validation: Sandbox lang cannot be empty when creating a prototyp…
AnupamaSarjoshi Feb 11, 2024
5a66bfa
Correct some typos in Readme.md (#193)
anaHue Feb 11, 2024
80bf151
Improve identification of java main class (thanks zupanibla) and upda…
trampgeek Feb 11, 2024
0ef45e3
Remove tests that require -3 to be displayed because the emoticons fi…
trampgeek Feb 11, 2024
de3ca49
Merge branch 'master' into development
trampgeek Feb 11, 2024
e455101
Merge branch 'master' of github.com:trampgeek/moodle-qtype_coderunner
trampgeek Feb 11, 2024
f3b83ee
Remove tests that expect -3 to be displayed because the emoticons fil…
trampgeek Feb 11, 2024
5850111
Update version
trampgeek Feb 18, 2024
4a8da37
Fix fullscreen mode #578890
Feb 26, 2024
c543ac7
Add variant of download quiz attempts script that anonymises students…
trampgeek Feb 28, 2024
29d2914
Bug fix: when validation errors occur with combinator graders, the va…
trampgeek Feb 28, 2024
64f83f8
Update version date.
trampgeek Feb 28, 2024
9415f00
Update loadtester to handle new Ace maximise button, plus a few tweaks.
trampgeek Mar 7, 2024
adb81d9
Merge branch 'wip578890-fix' of https://github.com/danghieu1407/moodl…
trampgeek Mar 8, 2024
d6c4569
Merge branch 'danghieu1407-wip578890-fix'
trampgeek Mar 8, 2024
96a1198
Tweaks to full-screen capabilities to allow full-screening of the ind…
trampgeek Mar 14, 2024
73d0e3c
Prevent tab key from selecting the UI full-screen icon (which resulte…
trampgeek Mar 14, 2024
fb2f72e
Update behat testing to always use test config in test-sandbox-config…
trampgeek Mar 14, 2024
dd9a815
Add behat test for combinator template grader.
trampgeek Mar 20, 2024
b1f2d7c
Fix warning - undefined property behat_prefix (#208)
AnupamaSarjoshi Mar 20, 2024
b123dc7
Merge branch 'master' of github.com:trampgeek/moodle-qtype_coderunner
trampgeek Mar 20, 2024
95a0fb6
Remove hack to sandbox.php to force loading of test config. Instead, …
trampgeek Mar 20, 2024
d7ba97b
Add Load-balancing cookie support (#206)
AnupamaSarjoshi Mar 20, 2024
bf8a4d1
Merge branch 'master' of github.com:trampgeek/moodle-qtype_coderunner
trampgeek Mar 20, 2024
260736a
Testcases marked as Precheck Only were not being validating on save.
trampgeek Mar 21, 2024
7e9b816
Fix silly grunt error objecting to multiple blank lines and fix warni…
trampgeek Mar 21, 2024
0546df9
Code Runner: The full-screen and exit buttons lack keyboard tab suppo…
danghieu1407 Apr 4, 2024
9181364
Fix backup behat #773786 (#210)
danghieu1407 Apr 7, 2024
f36b4df
Adding category and course shortname to bulk test report (#212)
AnupamaSarjoshi Apr 19, 2024
0afdea9
Add missing prototypeextra field to Twig QUESTION variable. (#211)
wtrnoguchi Apr 19, 2024
cd422f7
merge origin/master to catalyst-master-update
gbarat87 May 22, 2024
5e13ed5
WR-433724 skip test for sandbox not configured
gbarat87 May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.0'
- php: '8.2'
moodle-branch: 'master'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_403_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_402_STABLE'
database: 'pgsql'
- php: '7.4'
moodle-branch: 'MOODLE_401_STABLE'
database: 'pgsql'
Expand All @@ -30,7 +36,7 @@ jobs:
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3

mariadb:
image: mariadb:10.5
image: mariadb:10.6
env:
MYSQL_USER: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: "true"
Expand Down Expand Up @@ -65,6 +71,9 @@ jobs:
- name: Start JobeInABox
run: sudo docker run -d -p 4000:80 --name jobe trampgeek/jobeinabox:latest

- name: Let JobeInABox settle
run: sleep 5s

- name: Test JobeInABox
run: |
curl http://localhost:4000/jobe/index.php/restapi/languages
Expand All @@ -88,6 +97,7 @@ jobs:
MOODLE_BRANCH: ${{ matrix.moodle-branch }}

- name: PHP Lint
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phplint

Expand All @@ -102,10 +112,12 @@ jobs:
run: moodle-plugin-ci phpmd

- name: Moodle Code Checker
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci codechecker --max-warnings 0

- name: Moodle PHPDoc Checker
continue-on-error: true # This step will show errors but will not fail
if: ${{ always() }}
run: moodle-plugin-ci phpdoc

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ NonRepoFiles/*
/amd/src/ui_blockly.js
/amd/src/ui_blockly.json
/amd/src/.eslintrc.js
.grunt

683 changes: 479 additions & 204 deletions Readme.md

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions ReadmeScratchpadUi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
## Scratchpad UI
The **Scratchpad UI** is an extension to the **Ace UI**:
- It is designed to allow the execution of code in the CodeRunner question in a manner similar to an IDE.
- It contains two editor boxes, one on top of another, allowing users to enter and edit code in both.

By default, only the top editor is visible and the **Scratchpad Area**, which contains the bottom editor, is hidden.
Clicking the **Scratchpad Button** shows the **Scratchpad Area**.
This includes a second editor, a **Run button** and a **Prefix with Answer** checkbox and an **Output Display Area**.
Additionally, there is a **Help Button** that provides information about how to use the Scratchpad.

It's possible to run code 'in-browser' by clicking the **Run Button**, _without_ making a submission via the **Check Button**:
- If **Prefix with Answer** is not checked, only the code in the **Scratchpad Editor** is run -- allowing for a rough working spot to quickly check the result of code.
- Otherwise, when **Prefix with Answer** is checked, the code in the **Scratchpad Editor** is appended to the code in the first editor before being run.

The Run Button has some limitations when using its default configuration:
- Does not support programs that use STDIN (by default);
- Only supports textual STDOUT (by default).

Note: *These features can be supported, see wrappers...*


### Switching a Question to Use the Scratchpad UI

To switch an Ace UI question to use the Scratchpad UI:
1. edit the question;
2. make sure the "Ace/Scratchpad compliant" tick-box is checked;
3. tick customise (second option, in first section);
4. in the "Customisation" section, change "Input UIs" from "Ace" to "Scratchpad";
5. save the question.

### Serialisation

Pressing CTRL ALT M will disable the plugin, exposing the underlying serialisation.
For most UIs this serialisation is passed into the question template as STUDENT_ANSWER.
When "Ace/Scratchpad compliant" is ticked STUDENT_ANSWER is set to the value of the first editor instead.

Note: The following information is not relevant unless you un-tick the "Ace/Scratchpad compliant" tick-box.

The serialisation for this plugin is JSON, with fields:
- `answer_code`: `[""]` A list containing a string with answer code from the first editor;
- `test_code`: `[""]` A list containing a string with containing answer code from the second editor;
- `show_hide`: `["1"]` when scratchpad is visible, otherwise `[""]`;
- `prefix_ans`: `["1"]` when **Prefix with Answer** is checked, otherwise `[""]`.

A special case is the default serialisation: `{"answer_code":[""],"test_code":[""],"show_hide":["1"],"prefix_ans":["1"]}` is converted to `""` (an empty string).

The UI will also accept (and convert) JSON with only the field `answer_code` and strings to a valid serialisation.
A valid serialisation is one with all four specified fields. All other serialisations will be rejected by the interface.

### UI Parameters

- `scratchpad_name`: display name of the scratchpad, used to hide/un-hide the scratchpad.
- `button_name`: run button text.
- `prefix_name`: prefix with answer check-box label text.
- `help_text`: help text to show.
- `run_lang`: language used to run code when the run button is clicked, this should be the language your wrapper is written in (if applicable).
- `wrapper_src`: location of wrapper code to be used by the run button, if applicable:
- setting to `globalextra` will use text in global extra field,
- `prototypeextra` will use the prototype extra field.
- `output_display_mode`: control how program output is displayed on runs, there are three modes:
- `text`: display program output as text, html escaped;
- `json`: display program output, when it is json, see next section...
- `html`: display program output as raw html.
- `open_delimiter`: The opening delimiter to use when inserting answer or Scratchpad code. It will replace the default value `{|`.
- `close_delimiter`: The closing delimiter to use when inserting answer or Scratchpad code. It will replace the default value `|}`.
- `disable_scratchpad`: disable the scratchpad, reverting to Ace UI from student perspective.
- `invert_prefix`: inverts meaning of prefix_ans serialisation -- `'1'` means un-ticked, vice versa. This can be used to swap the default state.
- `escape`: when `true` code will be JSON escaped (minus outer quotes `"`) before being inserted into the wrapper.
- `params` : parameters for the sandbox webservice.

### Wrappers
A wrapper is used to wrap code before it is run using the sandbox.
A wrapper could be used to enclose the code in a function call, or to run the program as a subprocess after manipulation.
Some tasks that require this are: running languages installed on Jobe but not supported by coderunner; reading standard input during runs; or displaying Matplotlib graphs.


You can insert the answer code and scratchpad code into the wrapper using `{| ANSWER_CODE |}` and `{| SCRATCHPAD_CODE |}` respectively.
If the **Prefix with Answer** checkbox is unchecked `{| ANSWER_CODE |}` will be replaced with an empty string `''`.
The default configuration uses the following wrapper:


```
{| ANSWER_CODE |}
{| SCRATCHPAD_CODE |}
```
Whitespace is ignored between the delimiters (`{|`,`|}`) and the variable name, e.g. `{|ANSWER_CODE |}` will be replaced.
You can change the delimiters using the `open_delimiter` and `close_delimiter` UI Parameters.


Four UI parameters are of particular importance when writing wrappers:

- `wrapper_src` sets the location of the wrapper code.
- `run_lang` sets the language the Sandbox Webservice uses to run code when the **Run Button** is pressed.
- `output_display_mode` controls how run output is displayed, see below.
- `escape` will escape (JSON escape with `"` removed from start and end) `ANSWER_CODE` and `SCRATCHPAD_CODE` before insertion into wrapper. Useful when inserting code into a string. NOTE: _single quotes `'` are NOT escaped.

There are three modes of displaying program run output, set by `output_display_mode`:
- `text`: Display the output as text, html escaped. **(default)**
- `json`: Display programs that output JSON, useful for capturing stdin and displaying images. **(recommended)**
- Accepts JSON in run output with the fields:
- `returncode`: Exit code from program run.
- `stdout`: Stdout text from program run.
- `stderr`: Error text from program run.
- `files`: An object containing filenames mapped to base64 encoded images. These will be displayed below any stdout text.
- When the `returncode` is set to `42`, an HTML input field will be added after the last `stdout` received.
When the enter key is pressed inside the input, the input's value is added to stdin and the program is run again with this updated stdin.
This is repeated until `returncode` is not set to `42`.
- `html`: Display program output as raw html inside the output area. **(advanced)**
- This can be used to show images and insert other HTML.
- Giving an `<input>` element the class `coderunner-run-input` will add an event: when the enter key is pressed inside the input, the input's value is added to stdin and the program is run again with this updated stdin.

Note: JSON is the preferred display mode; wrapper debugging is much simpler than HTML mode.
HTML output is only recommended if you are trying to display HTML elements and for very advanced users, enter at your own risk...
4 changes: 4 additions & 0 deletions Untitled Document
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="MoodleCore">
<rule ref="moodle-extra"/>
</ruleset>
44 changes: 31 additions & 13 deletions ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
* Assumed to be run after python questions have been tested, so focuses
* only on C-specific aspects.
*
* @package qtype
* @subpackage coderunner
* @package qtype_coderunner
* @copyright 2015 Richard Lobb, University of Canterbury
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand All @@ -51,10 +50,26 @@
$coursecontext = context_course::instance($courseid);
if ($qtype) {
$questiontype = qtype_coderunner::get_prototype($qtype, $coursecontext);
if ($questiontype === null) {
if ($questiontype === null || is_array($questiontype)) {
$questionprototype = $questiontype;
$questiontype = new stdClass();
$questiontype->success = false;
$questiontype->error = "Error fetching prototype '$qtype'.";
if ($questiontype === null) {
$questiontype->error = json_encode(["error" => "missingprototype",
"alert" => "prototype_missing_alert", "extras" => ""]);
} else {
$extras = "";
foreach ($questionprototype as $component) {
$extras .= get_string(
'listprototypeduplicates',
'qtype_coderunner',
['id' => $component->id, 'name' => $component->name,
'category' => $component->category]
);
}
$questiontype->error = json_encode(["error" => "duplicateprototype",
"alert" => "prototype_duplicate_alert", "extras" => $extras]);
}
} else {
$questiontype->success = true;
$questiontype->error = '';
Expand All @@ -63,29 +78,32 @@
} else if ($uiplugin) {
$uiplugins = qtype_coderunner_ui_plugins::get_instance();
$allnames = $uiplugins->all_names();
$uiparamstable = array();
$columnheaders = array();
$uiparamstable = [];
$columnheaders = [];
if (!in_array($uiplugin, $allnames)) {
$uiheader = get_string('unknownuiplugin', 'qtype_coderunner', array('pluginname' => $uiplugin));
$uiheader = get_string('unknownuiplugin', 'qtype_coderunner', ['pluginname' => $uiplugin]);
} else {
$uiparams = $uiplugins->parameters($uiplugin);
if ($uiparams->length() === 0) {
$uiheader = get_string('nouiparameters', 'qtype_coderunner', array('uiname' => $uiplugin));
$uiheader = get_string('nouiparameters', 'qtype_coderunner', ['uiname' => $uiplugin]);
} else {
$csv = implode(', ', $uiparams->all_names_starred());
$uiheader = get_string('uiparametertablehead', 'qtype_coderunner',
array('uiname' => $uiplugin)) . $csv . '.';
$uiheader = get_string(
'uiparametertablehead',
'qtype_coderunner',
['uiname' => $uiplugin]
) . $csv . '.';
$uiparamstable = $uiparams->table();
$namehdr = get_string('uiparamname', 'qtype_coderunner');
$descrhdr = get_string('uiparamdesc', 'qtype_coderunner');
$defaulthdr = get_string('uiparamdefault', 'qtype_coderunner');
$columnheaders = array($namehdr, $descrhdr, $defaulthdr);
$columnheaders = [$namehdr, $descrhdr, $defaulthdr];
}
}
echo json_encode(array('header' => $uiheader,
echo json_encode(['header' => $uiheader,
'uiparamstable' => $uiparamstable,
'columnheaders' => $columnheaders,
'showdetails' => get_string('showdetails', 'qtype_coderunner'),
'hidedetails' => get_string('hidedetails', 'qtype_coderunner')));
'hidedetails' => get_string('hidedetails', 'qtype_coderunner')]);
}
die();
21 changes: 11 additions & 10 deletions amd/build/ajaxquestionloader.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading