Skip to content

Commit

Permalink
Update unsupported C# DOTNET prototypes and examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
trampgeek committed Jan 22, 2025
1 parent b4ffb54 commit 42a5394
Show file tree
Hide file tree
Showing 5 changed files with 537 additions and 1 deletion.
2 changes: 1 addition & 1 deletion changehistory.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### 2 January 2025. 5.5.0

* New features:
* Addition of some unsupported question types, include an experimental C# dot net question type.
* Addition of some unsupported question types, include two experimental C# dot net question types.
* Addition of an experimental capability for combinator grader questions to return files such as images
to be displayed in the response to the student. WARNING: these files do not survive
course backup/restore cycles and would need to be rebuilt by regrading if wanted.
Expand Down
152 changes: 152 additions & 0 deletions unsupportedquestiontypes/examples/dotnet_c#_method_example.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 53194 -->
<question type="coderunner">
<name>
<text>C# sqr method</text>
</name>
<questiontext format="html">
<text><![CDATA[<p>Write a static C# method <code>static int sqr(int n)</code> that returns the square of its parameter <code>n</code>. Write only the method, not the test class - your method will be wrapped in a class when tested.</p>]]></text>
</questiontext>
<generalfeedback format="html">
<text></text>
</generalfeedback>
<defaultgrade>1</defaultgrade>
<penalty>0</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<coderunnertype>csharpdotnetmethod</coderunnertype>
<prototypetype>0</prototypetype>
<allornothing>1</allornothing>
<penaltyregime>10, 20, ...</penaltyregime>
<precheck>0</precheck>
<hidecheck>0</hidecheck>
<showsource>0</showsource>
<answerboxlines>8</answerboxlines>
<answerboxcolumns>100</answerboxcolumns>
<answerpreload></answerpreload>
<globalextra></globalextra>
<useace></useace>
<resultcolumns></resultcolumns>
<template></template>
<iscombinatortemplate></iscombinatortemplate>
<allowmultiplestdins></allowmultiplestdins>
<answer>static int sqr(int n) {
return n * n;
}</answer>
<validateonsave>1</validateonsave>
<testsplitterre></testsplitterre>
<language></language>
<acelang></acelang>
<sandbox></sandbox>
<grader></grader>
<cputimelimitsecs></cputimelimitsecs>
<memlimitmb></memlimitmb>
<sandboxparams></sandboxparams>
<templateparams></templateparams>
<hoisttemplateparams>1</hoisttemplateparams>
<extractcodefromjson>1</extractcodefromjson>
<templateparamslang>None</templateparamslang>
<templateparamsevalpertry>0</templateparamsevalpertry>
<templateparamsevald><![CDATA[{"total_time_budget":10,"warnings_are_errors":true,"profiling":false}]]></templateparamsevald>
<twigall>0</twigall>
<uiplugin></uiplugin>
<uiparameters></uiparameters>
<attachments>0</attachments>
<attachmentsrequired>0</attachmentsrequired>
<maxfilesize>10240</maxfilesize>
<filenamesregex></filenamesregex>
<filenamesexplain></filenamesexplain>
<displayfeedback>1</displayfeedback>
<giveupallowed>0</giveupallowed>
<prototypeextra></prototypeextra>
<testcases>
<testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000" >
<testcode>
<text>Console.WriteLine(sqr(-11));</text>
</testcode>
<stdin>
<text></text>
</stdin>
<expected>
<text>121</text>
</expected>
<extra>
<text></text>
</extra>
<display>
<text>SHOW</text>
</display>
</testcase>
<testcase testtype="0" useasexample="1" hiderestiffail="0" mark="1.0000000" >
<testcode>
<text>Console.WriteLine(sqr(100));</text>
</testcode>
<stdin>
<text></text>
</stdin>
<expected>
<text>10000</text>
</expected>
<extra>
<text></text>
</extra>
<display>
<text>SHOW</text>
</display>
</testcase>
<testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000" >
<testcode>
<text>Console.WriteLine(sqr(-100));</text>
</testcode>
<stdin>
<text></text>
</stdin>
<expected>
<text>10000</text>
</expected>
<extra>
<text></text>
</extra>
<display>
<text>SHOW</text>
</display>
</testcase>
<testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000" >
<testcode>
<text>Console.WriteLine(sqr(0));</text>
</testcode>
<stdin>
<text></text>
</stdin>
<expected>
<text>0</text>
</expected>
<extra>
<text></text>
</extra>
<display>
<text>SHOW</text>
</display>
</testcase>
<testcase testtype="0" useasexample="0" hiderestiffail="0" mark="1.0000000" >
<testcode>
<text>Console.WriteLine(sqr(-17));</text>
</testcode>
<stdin>
<text></text>
</stdin>
<expected>
<text>289</text>
</expected>
<extra>
<text></text>
</extra>
<display>
<text>HIDE</text>
</display>
</testcase>
</testcases>
</question>

</quiz>
Loading

0 comments on commit 42a5394

Please sign in to comment.