Coderunner 1.0.14 CodeRunner is a framework for the automated running and analysis of simulations. It automatically generates any necessary input files, organises the output data and analyses it. Computational methods and techniques for computer vision are applied to real-world problems such as 2/3D face biometrics, autonomous navigation, and vision-guided robotics based on 3D scene description.
Version 3.1.0 of CodeRunner has now been pushed to github. Significant new functionality includes:
- A 'Precheck' capability presents students with an extra button (beside the 'Check' button) that gives a penalty-free submission with limited checking. The question author can specify what type of checks can be performed on a Precheck. For example, the code may be compiled but not run, or the code may be passed through a code style checker like pylint, or the 'Use as examples' tests might be run but no other, as in the following figure:
- An answerbox preload capability allows the question author to define some initial text to appear in the question answer box. This can be used to provide students with a skeleton answer, such as (for C):
- Question authors can request that their sample answer be validated whenever a question is saved.
- Adaptive behaviour is now forced for CodeRunner questions regardless of the question behaviour chosen for the quiz in which the question is running. This allows teachers to set tests in which standard questions like multichoice and short-answer run in, say, a deferred feedback mode while CodeRunner questions still allow students to correct wrong answers on the fly.
- The template mechanism has been simplified by combining the combinator template and the per-test template into a single template plus an iscombinator boolean.
- The Show differences button has been re-implemented entirely in JavaScript, removing the complication of having to specify it via the column header.
- C++ 'write-a-function' and 'write-a-program' question types have been added to the set of built-in question types.
- Accessibility for visually-impaired students has been improved (thanks to Tim Hunt). The tab key now moves focus through all fields in the question-answering form until the student types or clicks in a field. The Ace editor can be switched off with CTRL/M.
- The 'Multiple tries' section of the authoring form has been removed and a penalty regime is now mandatory. This eliminates the confusion between the standard Moodle static question penalty (now hidden) and the formerly optional penalty regime. The behaviour of legacy questions is unaffected.
- A bulk tester allows administrators and authors to check that all question sample answers pass all tests (copied, with modifications, from the Stack question type).
- /question/type/coderunner/
- /question/behaviour/adaptive_adapted_for_coderunner/
If you installed the plugins with a git clone command, you should be able to upgrade each of them simply with a git pull. Alternatively you can fetch the code from the Github repositories at https://github.com/trampgeek/moodle-qtype_coderunner and https://github.com/trampgeek/moodle-qbehaviour_adaptive_adapted_for_coderunner respectively.
You will then need to log in as a Moodle administrator (select Notifications from the administrator menu if necessary); click Upgrade database when told that new versions of the two plugins have been found. You will also be prompted for the site-wide default value for a penalty regime to be used with all new questions. The default value is 10, 20, ... meaning that a cumulative penalty of 10% is applied for each wrong submission.
As usual, however, you should backup your database before performing such an upgrade.
Enjoy!
Richard
(Shortest import: frombrian2importCodeRunner)
brian2.groups.group.
CodeRunner
(*args, **kw)[source]¶Bases: brian2.core.base.BrianObject
A 'code runner' that runs a CodeObject
every timestep and keeps areference to the Group
. Used in NeuronGroup
for Thresholder
,Resetter
and StateUpdater
.
On creation, we try to run the before_run method with an empty additionalnamespace (see Network.before_run
). If the namespace is already completethis might catch unit mismatches.
group : Group
template : Template
The template that should be used for code generation
code : str, optional
Coderunner 1.3.1
The abstract code that should be executed every time step. Theupdate_abstract_code
method might generate this code dynamicallybefore every run instead.
dt : Quantity
, optional
The time step to be used for the simulation. Cannot be combined withthe clock
argument.
user_code : str, optional
The abstract code as specified by the user, i.e. without any additionsof internal code that the user not necessarily knows about. This willbe used for warnings and error messages.
clock : Clock
, optional
The update clock to be used. If neither a clock, nor the dt
argumentis specified, the defaultclock
will be used.
when : str, optional
In which scheduling slot to execute the operation during a time step.Defaults to 'start'
.
order : int, optional
The priority of this operation for operations occurring at the same timestep and in the same scheduling slot. Defaults to 0.
name : str, optional
check_units : bool, optional
Whether the units should be checked for consistency before a run. Isactivated (True
) by default but should be switched off for stateupdaters (units are already checked for the equations and the generatedabstract code might have already replaced variables with their unit-lessvalues)
template_kwds : dict, optional
A dictionary of additional information that is passed to the template.
needed_variables: list of str, optional :
A list of variables that are neither present in the abstract code, norin the USES_VARIABLES
statement in the template. This is onlyrarely necessary, an example being a StateMonitor
where thenames of the variables are neither known to the template nor includedin the abstract code statements.
override_conditional_write: list of str, optional :
A list of variable names which are used as conditions (e.g. forrefractoriness) which should be ignored.
codeobj_class : class, optional
The CodeObject
class to run code with. If not specified, defaults tothe group
's codeobj_class
attribute.
generate_empty_code : bool, optional
Whether to generate a CodeObject
if there is no abstract code toexecute. Defaults to True
but should be switched off e.g. for aStateUpdater
when there is nothing to do.
Methods
| Optional method to prepare the object before a run. |
| |
| |
| Update the abstract code for the code object. |
Coderunner 3
Details
A list of variables that are neither present in the abstract code, norin the USES_VARIABLES
statement in the template. This is onlyrarely necessary, an example being a StateMonitor
where thenames of the variables are neither known to the template nor includedin the abstract code statements.
override_conditional_write: list of str, optional :
A list of variable names which are used as conditions (e.g. forrefractoriness) which should be ignored.
codeobj_class : class, optional
The CodeObject
class to run code with. If not specified, defaults tothe group
's codeobj_class
attribute.
generate_empty_code : bool, optional
Whether to generate a CodeObject
if there is no abstract code toexecute. Defaults to True
but should be switched off e.g. for aStateUpdater
when there is nothing to do.
Methods
| Optional method to prepare the object before a run. |
| |
| |
| Update the abstract code for the code object. |
Coderunner 3
Details
before_run
(run_namespace)[source]¶Optional method to prepare the object before a run.
Called by Network.after_run
before the main simulation loop starts.
create_code_objects
(run_namespace)[source]¶
create_default_code_object
(run_namespace)[source]¶
update_abstract_code
(run_namespace)[source]¶Update the abstract code for the code object. Will be called inbefore_run
and should update the CodeRunner.abstract_code
attribute.
Does nothing by default.