File size: 586 Bytes
e3584eb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import random
from typing import List, Tuple

def generate_execution_order(num_questions: int, seed: int = 42) -> List[Tuple[str, str]]:
    """
    Generates a repeatable list of execution tuples, deciding which endpoint
    to call first for each question.
    Returns list of ("plain" first, "rif" second) or ("rif" first, "plain" second).
    """
    rng = random.Random(seed)
    order = []
    for _ in range(num_questions):
        if rng.choice([True, False]):
            order.append(("plain", "rif"))
        else:
            order.append(("rif", "plain"))
    return order