# URGENT! Regenerate wrong\_list

**URL:** <https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277>\
**Category:** Coding\
**Tags:** screen\
**Created:** [July 24, 2020, 7:10pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277 "2020-07-24T19:10:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lili1](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lili1](https://discourse.psychopy.org/u/Lili1)\
**Post date:** [July 24, 2020, 7:10pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/1 "2020-07-24T19:10:00Z")

</div>

I relied on this thread for my experiment: [How to repeat incorrect trials only - #5 by Michael](https://discourse.psychopy.org/t/how-to-repeat-incorrect-trials-only/6908/5). It works for the first round but after that, there are no iterations in the wrong\_list and all the items that initially were answered incorrectly are repeated.  
What should I change or add in my code to regenerate the wrong\_list?

 ![Screenshot (257)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/a/2/a2abc56d0d357c2d52c91189e93e6561d774d6b1.png)  
 ![Screenshot (256)](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/5/55b7c577fe5993a09df17f12989169aac7f5bdbf.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 25, 2020, 7:23pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/2 "2020-07-25T19:23:21Z")

</div>

At the beginning of each loop I would copy wrong\_list to wrong\_list save and then use wrong\_list\_save in the continueRoutine=False conditional.

In the End Routine section you’d also need to delete the check that outer loop thisN is 0

---

<div class="post-metadata">

**Author:** ![Lili1](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lili1](https://discourse.psychopy.org/u/Lili1)\
**Post date:** [July 25, 2020, 7:59pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/3 "2020-07-25T19:59:50Z")

</div>

Hey, thank you @wakecarter for the prompt reply! Could you be more specific: how do I copy wrong\_list to wrong\_list save?

---

<div class="post-metadata">

**Author:** ![Lili1](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lili1](https://discourse.psychopy.org/u/Lili1)\
**Post date:** [July 25, 2020, 9:00pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/4 "2020-07-25T21:00:04Z")

</div>

I added the code below in each frame but the problem persists.

wrong\_list\_save = [None] \* len(wrong\_list);

for i in range(0, len(wrong\_list)):

```
wrong_list_save[i] = wrong_list[i];
```

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 25, 2020, 10:53pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/5 "2020-07-25T22:53:17Z")

</div>

I was thinking just wrong\_list\_save = wrong\_list

---

<div class="post-metadata">

**Author:** ![Lili1](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Lili1](https://discourse.psychopy.org/u/Lili1)\
**Post date:** [July 26, 2020, 11:50am UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/6 "2020-07-26T11:50:41Z")

</div>

I tried this but it did not solve the problem ☹

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [July 26, 2020, 4:18pm UTC](https://discourse.psychopy.org/t/urgent-regenerate-wrong-list/15277/7 "2020-07-26T16:18:40Z")

</div>

Another approach would be to .append the incorrect trials to the end of the list but then .pop(0) to remove them from the beginning of the list when you use them.
