generated from darrentyson/GitHub-Classroom-Introductory-Assignment
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 5c635b5
Showing
19 changed files
with
990 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"tests": [ | ||
{ | ||
"name": "Activity 1 - Accept assignment", | ||
"setup": "", | ||
"run": "[ -e .github/results/activity1.txt ] && exit 0 || exit 1", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 5 | ||
}, | ||
{ | ||
"name": "Activity 2 - Make commit", | ||
"setup": "", | ||
"run": "[ -e .github/results/activity2.txt ] && exit 0 || exit 1", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 5 | ||
}, | ||
{ | ||
"name": "Activity 3 - Comment on PR", | ||
"setup": "", | ||
"run": "[ -e .github/results/activity3.txt ] && exit 0 || exit 1", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 5 | ||
}, | ||
{ | ||
"name": "Quiz - Question 1", | ||
"setup": "", | ||
"run": "/bin/bash .github/grading-scripts/quiz.sh 1", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 1 | ||
}, | ||
{ | ||
"name": "Quiz - Question 2", | ||
"setup": "", | ||
"run": "/bin/bash .github/grading-scripts/quiz.sh 2", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 1 | ||
}, | ||
{ | ||
"name": "Quiz - Question 3", | ||
"setup": "", | ||
"run": "/bin/bash .github/grading-scripts/quiz.sh 3", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 1 | ||
}, | ||
{ | ||
"name": "Quiz - Question 4", | ||
"setup": "", | ||
"run": "/bin/bash .github/grading-scripts/quiz.sh 4", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 1 | ||
}, | ||
{ | ||
"name": "Quiz - Question 5", | ||
"setup": "", | ||
"run": "/bin/bash .github/grading-scripts/quiz.sh 5", | ||
"input": "", | ||
"output": "", | ||
"comparison": "included", | ||
"timeout": 10, | ||
"points": 1 | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/bin/bash | ||
# | ||
# param | ||
# $1 - question number | ||
|
||
expected=(2 2 3 4 3) | ||
# echo ${#expected[@]} | ||
|
||
# check quiz file exists | ||
if [ ! -e quiz.md ]; then | ||
echo "Error: quiz file missing" | ||
exit 1 | ||
fi | ||
|
||
# IFS_backup=$IFS | ||
# IFS=$'\n' | ||
answers=($(grep -e "^Answer:" quiz.md | cut -d ':' -f 2 | tr -d "[:blank:]" | sed 's/.*/"&"/')) | ||
# IFS=$IFS_backup | ||
# echo ${#answers[@]} | ||
|
||
if [[ ${#answers[@]} != 5 ]]; then | ||
echo "Error: wrong number of answers in quiz file" | ||
exit 1 | ||
fi | ||
|
||
score=0 | ||
incorrect='' | ||
if [ $1 ]; then | ||
if [[ $(echo ${answers[$1 - 1]} | xargs) == "${expected[$1 - 1]}"* ]]; then | ||
echo "Question $1 answered correctly." | ||
echo "pass" | ||
else | ||
echo "Question $1 incorrect." | ||
exit 1 | ||
fi | ||
else | ||
for i in "${!expected[@]}"; do | ||
if [[ $(echo ${answers[$i]} | xargs) == "${expected[$i]}"* ]]; then | ||
echo "Question $(( $i+1 )) answered correctly." | ||
((score+=1)) | ||
else | ||
incorrect="$incorrect$(( $i+1 )) " | ||
echo "Question $(( $i+1 )) incorrect." | ||
fi | ||
done | ||
echo "::set-output name=quiz_score::$score" | ||
echo "::set-output name=incorrect_answers::$incorrect" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
text="$1" | ||
text="${text//$'%'/%25}" | ||
text="${text//$'\n'/'%0A'}" | ||
text="${text//$'\r'/%0D}" | ||
echo "$text" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This pull request was created as a place for your teacher to leave feedback on your work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
--- | ||
status-success: ':white_check_mark:' | ||
status-fail: ':x:' | ||
activity1-success: | ||
activity1-fail: | | ||
This assignment is designed to be run via [GitHub Classroom](https://classroom.github.com). If you got here without being given an assignment URL from your teacher, please speak to your teacher about setting up a [Classroom assignment](https://docs.github.com/en/education/manage-coursework-with-github-classroom/teach-with-github-classroom/create-an-individual-assignment). | ||
If your teacher did give you an assignment URL and you still got this message, there is probably a bug in the marking code. Please submit an issue to https://github.com/markpatterson27/GitHub-Classroom-Introductory-Assignment/issues describing the issue (preferably including a link back to _your_ assignment repo). | ||
activity2-success: Yay. You made a commit. | ||
activity2-fail: | | ||
A commit authored by you has not been found. | ||
<details> | ||
<summary>How to make a git commit</summary> | ||
**Clone** - [Clone](https://github.com/git-guides/git-clone) the repository to your local machine. | ||
\`\`\` | ||
git clone https://github.com/${GITHUB_REPOSITORY}.git | ||
\`\`\` | ||
**Edit** - Edit and save the files. | ||
\`\`\` | ||
cd ${REPO_NAME} | ||
code editme.md | ||
\`\`\` | ||
**Add** - [Add](https://github.com/git-guides/git-add) the changes to staging. | ||
\`\`\` | ||
git add editme.md | ||
\`\`\` | ||
**Commit** - [Commit](https://github.com/git-guides/git-commit) the changes to the git repo. | ||
\`\`\` | ||
git commit -m \"asked a question in editme.md\" | ||
\`\`\` | ||
**Push** - [Push](https://github.com/git-guides/git-push) the new commits back to the remote repository. | ||
\`\`\` | ||
git push origin main | ||
\`\`\` | ||
</details> | ||
activity3-success: Interesting comment. | ||
activity3-fail: Leave a comment below. | ||
quiz-success: Five out of five. All questions answered correctly. Well done. | ||
--- | ||
|
||
## Auto-Feedback | ||
|
||
### ${status-activity1} Activity 1 - Accept assignment | ||
|
||
${fb-activity1} | ||
|
||
### ${status-activity2} Activity 2 - Make commit | ||
|
||
${fb-activity2} | ||
|
||
### ${status-activity3} Activity 3 - Comment on Feedback PR | ||
|
||
${fb-activity3} | ||
|
||
### ${status-quiz} Quiz | ||
|
||
${fb-quiz} | ||
|
||
Autograding Score: ${points} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.