# Ordered List Multiple Correct Sorts

**URL:** <https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400>\
**Category:** Questions\
**Created:** [August 30, 2020, 4:29pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400 "2020-08-30T16:29:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mary\_Watson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mary_watson/32/753_2.png) [@Mary\_Watson](https://cl.desmos.com/u/Mary_Watson)\
**Post date:** [August 30, 2020, 4:29pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400/1 "2020-08-30T16:29:44Z")

</div>

I have an ofdered list that has two possible correct sorts, is there a way I can code the key so that it accpets both lists? Is there an example of this already created? I’ve looked but not found one. I’m referring to screen 3 of this activity:

> **[IM G.1.3 Practice Problems • Activity Builder by Desmos](https://teacher.desmos.com/activitybuilder/custom/5f4b0912b0c5c235cf3b3038)**
>
> by Watson, Mary

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [August 30, 2020, 4:44pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400/2 "2020-08-30T16:44:30Z")

</div>

First make sure you check the “Use Order as Answer Key” in the 3 dots menu (which will also shuffle your list). Then, add this in the CL:  
`correct: this.matchesKey or (this.indexOfItem(1)=2 and this.itemAtIndex(2)=1 and this.itemAtIndex(3)=3)`

---

<div class="post-metadata">

**Author:** ![Mary\_Watson](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/mary_watson/32/753_2.png) [@Mary\_Watson](https://cl.desmos.com/u/Mary_Watson)\
**Post date:** [August 30, 2020, 6:02pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400/3 "2020-08-30T18:02:57Z")

</div>

Awesome! Thank you so much!

---

<div class="post-metadata">

**Author:** ![Brie\_Mills](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/brie_mills/32/1529_2.png) [@Brie\_Mills](https://cl.desmos.com/u/Brie_Mills)\
**Post date:** [November 2, 2021, 9:36pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400/4 "2021-11-02T21:36:41Z")

</div>

Thanks for this! I thought I had my sort figured out, but I’m getting a syntax error in my CL “Top level declarations must be variable or sink arguments.” (What’s weird to me is that I’m using almost identical code on another slide and it’s ok there.) What am I missing?

description = “How should the following statements be ordered to mirror the logic of a hypothesis test?”

right = list.matchesKey

content:  
“${description}”  
when right “You got it!”  
otherwise “Move the tiles by clicking and dragging them to the correct order.”

---

<div class="post-metadata">

**Author:** ![cwinske](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/cwinske/32/3106_2.png) [@cwinske](https://cl.desmos.com/u/cwinske)\
**Post date:** [November 2, 2021, 9:56pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400/5 "2021-11-02T21:56:39Z")

</div>

Your conditional statement at the end is causing the problem. Try assigning a variable to it.

```auto
description = “How should the following statements be ordered to mirror the logic of a hypothesis test?”

right = list.matchesKey

feedback = when right “You got it!”
otherwise “Move the tiles by clicking and dragging them to the correct order.”

content:
“${description}

${feedback}”

```

---

<div class="post-metadata">

**Author:** ![Brie\_Mills](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/brie_mills/32/1529_2.png) [@Brie\_Mills](https://cl.desmos.com/u/Brie_Mills)\
**Post date:** [November 2, 2021, 11:45pm UTC](https://cl.desmos.com/t/ordered-list-multiple-correct-sorts/1400/6 "2021-11-02T23:45:46Z")

</div>

Thanks! Interesting that I was able to do it that way before but can’t now. I’ll change all of my formatting to this as I think it’s cleaner anyway 🙂
