-
Notifications
You must be signed in to change notification settings - Fork 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
fixed:question.isSolved is not keeping things the way the student submitted them. #35
Comments
Dear Wendy! If I understand you correctly, you want students to drag the dollar bills into the black box in this question. When they submit the question, you still want the notes to be where they were dragged previously. This is not possible with your current programming. To "remember" where the bills were positioned, a database entry must be made. For this there is the functionality described here: https://github.com/jsxgraph/moodleformulas_jsxgraph/blob/master/README.md So my idea for your case would be to expect more answers in the question. The first one is the one that counts and you have already implemented it that way. As memory you would have to create further answers, in which the coordinates of the bills are saved. Of course, these must not be used for the evaluation. An example, how one could save the coordinates, you can find here: https://github.com/jsxgraph/moodleformulas_jsxgraph/blob/master/README.md#example. I hope I could help. A change to our code does not seem necessary to me. Therefore I close the issue. If you still have questions, feel free to open it again. Kind regards, |
Thank you Andreas, This is the information I was missing. I appreciate
the time you took to look at my question.
…On Fri, Jul 21, 2023 at 4:31 AM Andreas W. ***@***.***> wrote:
Dear Wendy!
Thank you for your question. I took a closer look at the XML file and
tried it on my Moodle.
If I understand you correctly, you want students to drag the dollar bills
into the black box in this question. When they submit the question, you
still want the notes to be where they were dragged previously.
This is not possible with your current programming. To "remember" where
the bills were positioned, a database entry must be made. For this there is
the functionality described here:
https://github.com/jsxgraph/moodleformulas_jsxgraph/blob/master/README.md
So my idea for your case would be to expect more answers in the question.
The first one is the one that counts and you have already implemented it
that way. As memory you would have to create further answers, in which the
coordinates of the bills are saved. Of course, these must not be used for
the evaluation.
An example, how one could save the coordinates, you can find here:
https://github.com/jsxgraph/moodleformulas_jsxgraph/blob/master/README.md#example
.
I hope I could help. A change to our code does not seem necessary to me.
Therefore I close the issue. If you still have questions, feel free to open
it again.
Kind regards,
Andreas
—
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARPSPDTRYIMS77E7GLMRC6LXRI44PANCNFSM6AAAAAA2ROSSUU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Andreas, I adjusted the question to send back the Y values of the
dollars. It still can not get it to show where the student dragged them.
I appreciate any feedback you can provide.
Wendy Harper
On Fri, Jul 21, 2023 at 7:28 AM Wendy Harper ***@***.***>
wrote:
Thank you Andreas, This is the information I was missing. I appreciate
the time you took to look at my question.
On Fri, Jul 21, 2023 at 4:31 AM Andreas W. ***@***.***>
wrote:
> Dear Wendy!
> Thank you for your question. I took a closer look at the XML file and
> tried it on my Moodle.
>
> If I understand you correctly, you want students to drag the dollar bills
> into the black box in this question. When they submit the question, you
> still want the notes to be where they were dragged previously.
>
> This is not possible with your current programming. To "remember" where
> the bills were positioned, a database entry must be made. For this there is
> the functionality described here:
> https://github.com/jsxgraph/moodleformulas_jsxgraph/blob/master/README.md
>
> So my idea for your case would be to expect more answers in the question.
> The first one is the one that counts and you have already implemented it
> that way. As memory you would have to create further answers, in which the
> coordinates of the bills are saved. Of course, these must not be used for
> the evaluation.
>
> An example, how one could save the coordinates, you can find here:
> https://github.com/jsxgraph/moodleformulas_jsxgraph/blob/master/README.md#example
> .
>
> I hope I could help. A change to our code does not seem necessary to me.
> Therefore I close the issue. If you still have questions, feel free to open
> it again.
>
> Kind regards,
> Andreas
>
> —
> Reply to this email directly, view it on GitHub
> <#35 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ARPSPDTRYIMS77E7GLMRC6LXRI44PANCNFSM6AAAAAA2ROSSUU>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
<?xml version="1.0" encoding="UTF-8"?>
<quiz>
<!-- question: 1298588 -->
<question type="formulas">
<name>
<text>Drag-dollars to wallet ($4) (WIP)</text>
</name>
<questiontext format="html">
<text><![CDATA[<h5><span style="font-size: calc(0.927188rem + 0.32625vw); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";">{name} bought {item} for ${num}. Drag ${num} to the {location}.</span><br></h5>
<h5>
<table>
<tbody>
<tr>
<td> {#A}</td></tr></tbody></table><br></h5>]]></text>
</questiontext>
<generalfeedback format="html">
<text><![CDATA[<table>
<tbody>
<tr>
<td>
<jsxgraph width="{widthJSX}" height="180">
var board = JXG.JSXGraph.initBoard(BOARDID,{ axis:false,grid:false, boundingbox: [0,3,{width},-3], showCopyright: false, showNavigation: false });
board.create('text',[{width}/2,-0.5,'{FB}'],{anchorX:'middle'});
//Display the square
board.create('image', ['https://hshonorroll.com/mathGraphics/square_black.png', [.5,-2.5], [{width}-1,5]],{fixed:true,highlight:false});
for (let i=0; i<{num}; i++) {
if (i<5){
board.create('image', ['https://hshonorroll.com/mathGraphics/dollar-one.jpg', [(i*2)+2,(i*.25)], [3,1.3]]);
} else {
board.create('image', ['https://hshonorroll.com/mathGraphics/dollar-one.jpg', [(i*2)-8,((i-4)*.25)-2], [3,1.3]]);
}//end if
}//end for
</jsxgraph>
</td>
</tr>
<tr>
<td>
<h5></h5>
<h5>{name} bought {item} for ${num}. </h5>
<h5>There are {num} dollars in the {location}.</h5>
</td>
</tr>
</tbody>
</table>]]></text>
</generalfeedback>
<defaultgrade>0.99</defaultgrade>
<penalty>0.3333333</penalty>
<hidden>0</hidden>
<idnumber></idnumber>
<correctfeedback format="html">
<text>Your answer is correct.</text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text>Your answer is partially correct.</text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text>Your answer is incorrect.</text>
</incorrectfeedback>
<shownumcorrect/>
<varsrandom><text><![CDATA[num={1,2,3,4,5,6,7,8,9};
randExtra={1,2,3,4,5};
name={"Adam","Bert","Colin","Connor","Caleb","David","Daniel","Ezra","Eliziah","Fredrick","Gregory","Harry","Harrison","Isaiah","Joshua","Jacob","Karter","Kaleb","Liam","Lionelle","Mathew","Mark","Luke","John","Noah","Rafael","Randy"};
item={"a cupcake","candy","marbles","book","movie","game","toy"};]]></text>
</varsrandom>
<varsglobal><text><![CDATA[randExtra=1;
num=4;
FB="";
location="box";
numDollars=num+randExtra;
width=15;
widthJSX=width*30;
answerA=["zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten"];
answerB=["","one-half","one-third","one-fourth","one-fifth"];
numCWord=["zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen", "Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen","Twenty"];
numWord=["zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen", "fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"];
numW=numCWord[num];
]]></text>
</varsglobal>
<answernumbering><text>abc</text>
</answernumbering>
<answers>
<partindex>
<text>0</text>
</partindex>
<placeholder>
<text>#A</text>
</placeholder>
<answermark>
<text>0.99</text>
</answermark>
<answertype>
<text>0</text>
</answertype>
<numbox>
<text>6</text>
</numbox>
<vars1>
<text></text>
</vars1>
<answer>
<text>[num,6,6,6,6,6]</text>
</answer>
<vars2>
<text></text>
</vars2>
<correctness>
<text>_err == 0</text>
</correctness>
<unitpenalty>
<text>1</text>
</unitpenalty>
<postunit>
<text></text>
</postunit>
<ruleid>
<text>1</text>
</ruleid>
<otherrule>
<text></text>
</otherrule>
<subqtext format="html">
<text><![CDATA[<table>
<tbody>
<tr>
<td>
<jsxgraph width="{widthJSX}" height="180" ext_formulas="">
//Javascript code to create the construction
var jsxCode=function(question){
//initialize the variable
var itemsMoved=0;
var itemsHalf=0;
//Initialize the contruction
var board = question.initBoard(BOARDID,{
axis:false,
grid:false,
boundingbox: [0,3,{width},-3],
showCopyright: false,
showNavigation: false,
pan: {
enabled: true, // Allow panning
needTwoFingers: true, // panning is done with two fingers on touch devices
needShift: true // mouse panning needs pressing of the shift key
}
});
//turn off infobox
board.options.point.showInfobox = false;
//Display the square
board.create('image', ['https://hshonorroll.com/mathGraphics/square_black.png', [.5,-2.5], [{width}-1,2.5]],{fixed:true,highlight:false});
//add the items to an array
var att= {fixed:question.isSolved, snapToGrid: true, withLabel: false},
a=[]; //dollars
for (let i=0; i<{numDollars}; i++) {
a.push(board.create('image', ['https://hshonorroll.com/mathGraphics/dollar-one.jpg', [{width}/2.5,.5], [3,1.3]],att));
}//end for
var calculate=function(){
dollar=0;
ten=0;
hundred=0;
for(let c=0; c<{numDollars}; c++){
if (a[c].Y() <0) {
dollar++;
}// end if
}//end for
}//end calculate
// Whenever the construction is altered the values of the points are sent to formulas.
question.bindInput(0, () => {
calculate();
return dollar;
});//end bindInput0
question.bindInput(1, () => {
if ({numDollars} >0){
ans1=a[0].Y();
}else{
ans1=-10;
}//end if
return ans1;
});//end bindInput1
question.bindInput(2, () => {
if ({numDollars} >0){
ans2=a[1].Y();
}else{
ans1=-10;
}//end if
return ans2;
});//end bindInput2
question.bindInput(3, () => {
if ({numDollars} >0){
ans3=a[2].Y();
}else{
ans1=-10;
}//end if
return ans3;
});//end bindInput3
question.bindInput(4, () => {
if ({numDollars} >0){
ans4=a[3].Y();
}else{
ans1=-10;
}//end if
return ans4;
});//end bindInput4
question.bindInput(5, () => {
if ({numDollars} >0){
ans5=a[4].Y();
}else{
ans1=-10;
}//end if
return ans5;
});//end bindInput5
};//end function
new JSXQuestion(BOARDID, jsxCode, /* if you want to see inputs: */ true);
</jsxgraph>
</td>
</tr>
<tr>
<td>
<table>
<tbody>
<tr>
<td rowspan="2" style="text-align: right;">${_0} is in the {location}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>]]></text>
</subqtext>
<feedback format="html">
<text></text>
</feedback>
<correctfeedback format="html">
<text></text>
</correctfeedback>
<partiallycorrectfeedback format="html">
<text></text>
</partiallycorrectfeedback>
<incorrectfeedback format="html">
<text></text>
</incorrectfeedback>
</answers>
</question>
</quiz>
|
Dear Wendy. Please have a look. I have edited your question a little bit. You have to query at the beginning what the last value of the variable was and use this then to position the bills. Then it works! I also introduced a variable where you can find the correct answer. This consists of Best regards, questions-test-Drag-dollars to wallet ($4) (WIP)-20230726-1132.txt |
dragDollarWallet.txt
I added a file (renamed it txt, however it is an xml file) I want the money to stay where the student 'drops' it on the screen. Can you please let me know if it is a bug or a programming error on my part. Thank you, Wendy
The text was updated successfully, but these errors were encountered: