Administration: can edit exercices

This commit is contained in:
nemunaire 2014-01-14 16:14:31 +01:00
commit aeb4b5dd52
9 changed files with 138 additions and 31 deletions

View file

@ -3,6 +3,7 @@
BASEURL="localhost"
SALT_TEAM="connected"
OUT_TEAM="./teams"
OUT_HTDOCS="./htdocs"
MAX_PARAL=10
@ -85,16 +86,16 @@ do
do
OUT=`echo "$m" | sed -E 's#/([^/]+)/([^/]+)/([0-9]+)-[^/]+/([a-zA-Z0-9_]+)/submission#\1/\2/submission-\3-\4#'`
wget $WGET_OPT "http://$BASEURL/$m" -O "$BASEURL/$OUT.html"
wget $WGET_OPT "http://$BASEURL/$m/gerr" -O "$BASEURL/$OUT-bad.html"
wget $WGET_OPT "http://$BASEURL/$m/serr" -O "$BASEURL/$OUT-already.html"
done
# Remove /connected/XY
if sed -Ei "s#/[^/]+/([0-9]+)/#/#" "$BASEURL/$l/"* &&
sed -Ei "s#/([0-9]+)-[^/]*/([a-zA-Z0-9_]+)/submission#/submission-\1-\2.html#" "$BASEURL/$l/"*
then
exit 0
else
exit 1
fi
for f in `find "$BASEURL/$l" -type f`
do
sed -Ei "s#/[^/]+/([0-9]+)/#/#" "$f" &&
sed -Ei "s#/([0-9]+)-[^/]*/([a-zA-Z0-9_]+)/submission#/submission-\1-\2.html#" "$f"
done
) &
PIDLIST="$PIDLIST $!"
@ -122,6 +123,7 @@ done
# Move connected/ at root
mv "$BASEURL/$SALT_TEAM/" "$OUT_TEAM"
mv "$BASEURL/" "$OUT_HTDOCS"
# Remove all robots.txt
find . -name robots.txt -exec rm {} \;