fill_exercice: define HINT_COST

This commit is contained in:
nemunaire 2017-01-04 21:55:33 +01:00 committed by nemunaire
parent a5c81196d4
commit b9ce37d557

View File

@ -150,6 +150,7 @@ do
fi
EXO_GAIN=$((3 * (2 ** $EXO_NUM) - 1))
HINT_COST=$(($EXO_GAIN / 4))
echo ">>> Using default gain: ${EXO_GAIN} points"
EXO_SCENARIO=$(get_file "${THM_BASEURI}${EXO_BASEURI}/scenario.txt")
@ -187,9 +188,9 @@ do
# Hints
EXO_HINT=$(get_file "${THM_BASEURI}${EXO_BASEURI}/hint.txt")
if [ -n "$EXO_HINT" ]; then
HINT_ID=`new_hint "${THEME_ID}" "${EXO_ID}" "Astuce #1" "${EXO_HINT}" "1"`
HINT_ID=`new_hint "${THEME_ID}" "${EXO_ID}" "Astuce #1" "${EXO_HINT}" "${HINT_COST}"`
if [ -z "$HINT_ID" ]; then
echo -e "\e[31;01m!!! An error occured during hint import!\e[00m (title=Astuce #1;content=${EXO_HINT};cost=1)"
echo -e "\e[31;01m!!! An error occured during hint import!\e[00m (title=Astuce #1;content=${EXO_HINT};cost=${HINT_COST})"
else
echo -e "\e[32m>>> New hint added:\e[00m $HINT_ID - Astuce #1"
fi