July Doenet Workshop Day 2 Tasks

Post Day 1 tasks - Day 1 Tasks - Intro to Doenet - Google Docs

Post Day 2 tasks - Day 2 Tasks — Add Randomization - Google Docs

Once you are finished, please share your unlisted activity as a response to this thread before 12 PM Eastern so folks have a chance to play around with your take on the activity.

Activity link: https://beta.doenet.org/activityViewer/pRhiV3oGLkhbfWpADq49FB

Activity link: Doenet

activity link: https://beta.doenet.org/activityViewer/hDYzZFLbsm2ReHimFJ8zQn

I had some difficulty with the second part. Specifically, getting the multiple drop downs to be checked simultaneously.

Link: https://beta.doenet.org/activityViewer/cpnHSSdvhdzwyPJmcukm8T

I had a hard time with the second part, and I don’t think I got everything quite right.

Hi Rabia, thank you for submitting this! I’m working through a review and will post one bit of advice at a time :smiley:

First, for the second part of the first factoring problem, where the user is able to enter the factors in either order:
The issue here in your source is that the student doesn’t have to factor at all, for example try entering “x^2 - 9x + 20”. Here is an alternative way:

<setup>
  <math name="sol">(x-4)(x-5)</math>
</setup>
<answer name="answer1"simplifyOnCompare symbolicEquality>
  <label>Factor <m>x^2 -9x + 20</m>:</label>
  <award>$sol</award>
</answer>

The symbolicEquality attribute prevents the student from entering the quadratic unfactored, but the simplifyOnCompare attribute relaxes this requirement slightly so that the order of the factored terms can be switched. Test it and see!

(Here, also note that the correct place to put the problem label is inside the answer tag)

(Edited by Duane so you can see Virginia’s solution. Right now, these posts hide tags if you don’t put them in a code block – it tries to interpret them as HTML.)

There might be some funny business going on here, Shawn.

Hi Jennifer :slight_smile: Question 4 of the top part isn’t being as strict as one might want it to be - it is accepting equivalent correct answers as well. Additionally, question 4 of the bottom part has a numerical gcf. How could we be certain that g(x) factors to (ax+b)(cx+d) exactly (with no gcf)?

Everything looks great for the parts you shared. You are welcome to take a look at the other activities that were shared in this thread to get a hint.

(Hint: Check out the inline attribute of the answer component).

I am late but link

Only couldn’t get the multi-dropdowns to validate correctly.

EDIT: now is fix!

Hi Rabia,

For your multiple-part multiple choice problem, this part wasn’t working because the <answer> tag didn’t have an <award> component. I see that you added credit="1" to the correct choices, but unfortunately this only works when the choices are inside their own <answer> tag, rather than just a <choiceInput> (Think of <choiceInput> as just an input on a survey form, just for collecting responses.)

Here is one way that the problem can be resolved:

g(x) opens up down because the degree constant term leading coefficient multiplicity of the smaller root is positive negative zero .
 <answer name="answer1">
   <award>
     <when>
       $direction = <text>up</text> and 
       $reason = <text>leading coefficient</text> and 
       $sign = <text>positive</text>
     </when>
   </award>
  </answer>
</part>

Also note that because you used the forAnswer attribute in all of your choiceInput components, there’s no need to use a <considerAsResponses> component in the final <answer> as well!

See my solution to Rabia below.

Another way to do this is to NOT shuffle the choices. Then you can use the selectedIndex property of the named <choiceInput> and just give the number of the correct choice in the award statement.
However, Anurag made that impossible but having you guys shuffle :rofl: . Here’s the solution code if unshuffled…

 <part>
     <m>g(x)</m> opens
    <choiceInput name="direction" forAnswer="$answer1" inline>
        <choice>up</choice>
        <choice>down</choice>
      </choiceInput> because the 
   
   <choiceInput name="reason" forAnswer="$answer1" inline>
        <choice>degree</choice>
        <choice>constant term</choice>
        <choice>leading coefficient</choice>
        <choice>multiplicity of the smaller root</choice>
      </choiceInput> is  
   
   <choiceInput name="sign" forAnswer="$answer1" inline>
        <choice>positive</choice>
        <choice>negative</choice>
        <choice>zero</choice>
      </choiceInput>.
   
     <answer name="answer1">
       <award>
         <when>
           $direction.selectedIndex = 1and 
           $reason.selectedIndex = 3 and 
           $sign.selectedIndex = 1
         </when>
       </award>
      </answer>
    </part>

Ah, I see you discovered sectionWideCheckWork ! Great solution!

As one will discover, there are often many ways to accomplish something in Doenet :).

One can avoid choiceInput entirely and use the shuffleOrder attribute with the answer tag. Here’s a potential solution. Alternatively, you can also stick the sectionWideCheckWork with the <li>.

<div sectionWideCheckWork>

<answer shuffleOrder>
  <label>Question 1 - select 3</label>
  <choice>1</choice>
  <choice>2</choice>
  <choice credit="1">3</choice>
</answer>

<answer shuffleOrder>
  <label>Question 2 - select 2</label>
  <choice>1</choice>
  <choice credit="1">2</choice>
  <choice >3</choice>
</answer>

<answer shuffleOrder>
  <label>Question 3 - select 3</label>
  <choice>1</choice>
  <choice>2</choice>
  <choice credit="1">3</choice>
</answer>

</div>


Hi Rabia!
I noticed that you defined all of the randomized parameters for the final quadratic but forgot to change the function that gets rendered to the student.
I also found a typo in the calculation for b. Here’s a quick document with some comments so that you can see what I mean…Notes on Quadratic Activity for Rabia
Please let me know if you have any questions!

P.S. Testing blocks are your best friend :smiley:

1 Like