Skip to content

Commit

Permalink
continue regex exercice
Browse files Browse the repository at this point in the history
  • Loading branch information
romaincarlier4 committed Oct 26, 2023
1 parent 7ff450f commit 6b80576
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Regex/run
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ global_success=true

if diff student_result1 good_result1; then
feedback-result --id regex1 success
feedback-msg -em --id regex1 "Correct"
feedback-msg -e -m "Correct" --id regex1
else
feedback-result --id regex1 failed
feedback-msg -em --id regex1 "Votre sortie : $(head --lines=10 student_result1)"
feedback-msg -e -m "Votre sortie : $(head --lines=10 student_result1)" --id regex1
global_success=false
fi

Expand All @@ -31,10 +31,10 @@ grep -oP '\[.*?\]' apache.log > good_result2

if diff student_result2 good_result2; then
feedback-result --id regex2 success
feedback-msg -em --id regex2 "Correct"
feedback-msg -e -m "Correct" --id regex2
else
feedback-result --id regex2 failed
feedback-msg -em --id regex2 "Votre sortie : $(head --lines=10 student_result2)"
feedback-msg -e -m "Votre sortie : $(head --lines=10 student_result2)" --id regex2
global_success=false
fi

Expand All @@ -43,10 +43,10 @@ grep -oP '"GET\s.*?"' apache.log > good_result3

if diff student_result3 good_result3; then
feedback-result --id regex3 success
feedback-msg -em --id regex3 "Correct"
feedback-msg -e -m "Correct" --id regex3
else
feedback-result --id regex3 failed
feedback-msg -em --id regex3 "Votre sortie : $(head --lines=10 student_result3)"
feedback-msg -e -m "Votre sortie : $(head --lines=10 student_result3)" --id regex13
global_success=false
fi

Expand All @@ -55,17 +55,17 @@ grep -oP '^.*200.*$' apache.log > good_result4

if diff student_result4 good_result4; then
feedback-result --id regex4 success
feedback-msg -em --id regex4 "Correct"
feedback-msg -e -m "Correct" --id regex4
else
feedback-result --id regex4 failed
feedback-msg -em --id regex4 "Votre sortie : $(head --lines=10 student_result4)"
feedback-msg -e -m "Votre sortie : $(head --lines=10 student_result4)" --id regex4
global_success=false
fi

if [ $global_success ]; then
feedback-result success
feedback-msg -em "Bravo, vous avez réussi"
else
feedback-result success
feedback-result failed
feedback-msg -em "Vous avez quelques erreurs"
fi
1 change: 1 addition & 0 deletions Regex/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ context: |-
Votre objectif sera d'extraire certaines informations à l'aide de regex.
environment_id: default
accessible: true
environment_parameters:
limits:
time: '3'
Expand Down

0 comments on commit 6b80576

Please sign in to comment.