Help With Computational Layer

Hi, I wonder if someone out there could help me. I am trying to create an activity such that the multi choice correct answers are as follows:
1st slide is the first option
2nd slide is the second option
3rd slide is the third option
4th slide is the fourth option and so on

I can get the first three to work but cannot get the fourth slide to give the fourth option as the correct answer.

Any help would be very much appreciated.

I find the logic of this a little confusing, but you’re using elementAt(3) when I think it should be 4. And the answer list in slide 5 has 2 at element 4, not 4.

Sorry Daniel but I have tried what you said and still cannot get that fourth slide to give the fourth option as the correct response. I did not write the code but have tried everything to get it to work but all to no avail. If you cannot sort this out for me could you possibly recommend an activity that has a similar set up that I might be able to use.

Thank you

I find this all to be a very convoluted way to grade, but it works for me. In slide 4, these were 3’s that needed to be changed to 4’s:

And, this list in slide 5 was originally L=[1,2,3,2,4]:

I think this achieves the same goal, but much simpler.

Daniel you are the man thank you so much for taking the time to sort out my activity it now works like a dream. Your efforts and expertise are very much appreciated.


Dave T

You’re very welcome. I’ve learned a lot just looking at other people’s code. Like I feel there was a purpose in the way the original activity was done, but I couldn’t figure out what that was.

Hi Dan, it’s me again sorry to bother you again but I can’t quite get the last slide to work.

What you did for me yesterday worked a treat on 4 slides and I have tried to extend it to 10 slides.

I have tried to follow what you have done but just cannot get the last slide to work. Could you possibly have a look at it for me.

All your different “tot” variables are referencing checks from mc components, but you have the check numbers wrong. If you just delete the number after “check”, the autocomplete menu should pop up with the available variable.

I would normally just name the variable “check” (with no number) for every single mc component to make it easier to duplicate slides. I was just trying to match some of the variable naming from the original.

Hi Dan, thanks for getting back to me. What you advised has worked and eliminated all the error signs. My problem now is that the last slide informs the student of how many attempts it took the student to answer the questions and now that I have 10 questions I cannot get this to work.
Dan I feel like a right idiot asking you all the time but I just want to get this resource out there.

You might need to republish. I still see the errors. Although you may need to double check your “sub”, “total”, and “check” variables in the note. They don’t look right to me.

Hi Dan, I have republished but no improvement. Not quite sure what you mean by “double check your “sub”, “total”, and “check” variables in the note. They don’t look right to me”. This is the code that you kindly wrote which works brilliantly for 4 slides and I am just trying to get it to work for 10 or more. Any further help would be great Dan.

Thank You

I don’t think I edited those variables. I just left what was originally there.

“sub” is supposed to be the total attempts, so it should be a sum of all the “sub” variables, but you have a product.

“total” is supposed to be the total correct, so it should be a sum of the “tot” variables, but a combination of addition and multiplication.

“check” is supposed to check all questions are correct, so a product of the “tot” variables would be appropriate, but you have a mix of “tot” and “sub” variables.

Is there any chance of you sorting this out for me?

I have spent so many hours on this but have got nowhere.

I really thought you 4 slide solution would be so straightforward to adapt to any number of slides.

I appreciate that you are no doubt bombarded by teachers from all over the world but I have no else to turn to.

Thank you

Replace them with this:

sub = numericValue("${sub1}+${sub2}+${sub3}+${sub4}+${sub5}+${sub6}+${sub7}+${sub8}+${sub9}+${sub10}")
total = numericValue("${tot1}+${tot2}+${tot3}+${tot4}+${tot5}+${tot6}+${tot7}+${tot8}+${tot9}+${tot10}")
check = numericValue("${tot1}*${tot2}*${tot3}*${tot4}*${tot5}*${tot6}*${tot7}*${tot8}*${tot9}*${tot10}")

Morning Daniel, thank you for trying to sort out my CL issue but unfortunately it still does not work correctly. It now only records the number of correct answers rather than the number of attempts to get all the correct answers. Any help you could give is very much appreciated.

Hi Dan, just wanted to let you know that I have (finally) sorted out the CL and it was all down to your support. I really appreciate your help Dan you have a great day.

1 Like

So you got those three variables worked out? The CL I see still doesn’t match the code I shared. I would copy and paste it. You seem to be missing where you should have + vs *.

Hi Dan I managed to get things sorted thanks to your support and guidance.

Not being totally familiar with CL once you explained things to me I was all over it:

It now works like clockwork here it is if you want to view it.