Skip to content

Commit

Permalink
Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
bennekrouf committed Jan 20, 2024
1 parent 8d006c3 commit 9be7902
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/domain/exercise/generate_one_exercise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ pub fn generate_one_exercise(dbs: &Database, exercise: &mut ExerciseOutput, exer
let exclude_verse = Some(exercise.verses[valid_verse_index].verse.clone());
let extracted_values = extract_and_shuffle_options(&mut exercise.verses, exercise_type, &exclude_verse);

<<<<<<< HEAD
// Extract and keep the correct answer separate
let correct_alternative = Alternative { verse: Some(exercise.verses[valid_verse_index].verse.clone()) };

// Prepare incorrect alternatives and shuffle them
let mut incorrect_alternatives: Vec<Alternative> = extracted_values.into_iter().map(|value| {
=======
// Ensure the correct answer is added first
let valid_verse = exercise.verses.get(valid_verse_index).unwrap();
let mut alternatives = vec![Alternative { verse: Some(valid_verse.verse.clone()) }];

// Add random alternatives
alternatives.extend(extracted_values.into_iter().map(|value| {
>>>>>>> c6a5876cabcf450c486e9315cd3f5973dbcb37a3
// // Add random alternatives
// alternatives.extend(extracted_values.into_iter().map(|value| {
match exercise_type {
ExerciseType::FindDiscriminant => {
Alternative {
Expand Down

0 comments on commit 9be7902

Please sign in to comment.