Individual Contributions (Milestone 3) ‐ Ceydanur Şen - bounswe/bounswe2024group11 GitHub Wiki
Ceydanur Şen
Role
- Backend
Responsibilities
- Development of the backend
- Project Plan
Main Contributions
- Implementation of profile endpoint with its model, serializer, and views. (I have implemented profile endpoint at the end of the milestone 2 but we could not use it and tested it back then)
- Enrich profile endpoint implemented. We needed additional fields for the profile endpoint such as interests, badges, and proficiency level.
- Implementation of proficiency (beginner, intermediate, advanced) field with its views and updates to profile serializer
- Implemenation of CD endpoints of interest
- Implementation of achievements endpoint
- Keeping in track according to the project plan with Muhammet Emin Çiftçi.
API Contributions
- Implemented achievements enpoint for user to get his achievements(badges) they earned such as earning a badge upon creating his first forum question. This feature contributes to the gamification related part of the project.
Here is a sample call to the endpoint from the terminal using curl
(Before executing it, you may need to change Bearer token in the headers part with an active JWT access token of yourself):
curl -X 'GET' \
'http://138.68.102.215:8000/api/v1/achievements/' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM1MzA1NjcwLCJpYXQiOjE3MzQ3MDA4NzAsImp0aSI6IjU1ZWY2NGNlMDc5NjRmM2JiODA3MThjMjQyN2IzNGJlIiwidXNlcl9pZCI6OX0.DW35oDk_PvIxziHnwjRG2vG2307Ds28Ceb4Belzn1fo'
An example response:
[
{
"achievement": {
"id": 1,
"slug": "first-quiz",
"title": "First Quiz",
"description": "Complete your first quiz",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": null
},
{
"achievement": {
"id": 2,
"slug": "first-question",
"title": "First Question",
"description": "Create your first forum question",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-16T20:23:46.948980Z"
},
{
"achievement": {
"id": 3,
"slug": "first-answer",
"title": "First Answer",
"description": "Leave your first forum answer",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-17T10:00:18.752536Z"
},
{
"achievement": {
"id": 4,
"slug": "first-follow",
"title": "First Follow",
"description": "Follow your first user",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-19T18:39:37.752877Z"
},
{
"achievement": {
"id": 5,
"slug": "first-bookmark",
"title": "First Bookmark",
"description": "Bookmark your first forum question",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-16T20:24:43.434518Z"
},
{
"achievement": {
"id": 6,
"slug": "quiz-creator",
"title": "Quiz Creator",
"description": "Create your first quiz",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": null
},
{
"achievement": {
"id": 7,
"slug": "quiz-fan",
"title": "Quiz Fan",
"description": "Take 10 quizzes",
"created_at": "2024-11-01T00:00:00Z",
"category": "growing_engagement"
},
"earned_at": null
},
{
"achievement": {
"id": 8,
"slug": "quiz-champion",
"title": "Quiz Champion",
"description": "Take 25 quizzes",
"created_at": "2024-11-01T00:00:00Z",
"category": "growing_engagement"
},
"earned_at": null
},
{
"achievement": {
"id": 9,
"slug": "perfect-scorer",
"title": "Perfect Scorer",
"description": "Take 5 quizzes with 100% score",
"created_at": "2024-11-01T00:00:00Z",
"category": "growing_engagement"
},
"earned_at": null
},
{
"achievement": {
"id": 10,
"slug": "quiz-expert",
"title": "Quiz Expert",
"description": "Create 10 quizzes",
"created_at": "2024-11-01T00:00:00Z",
"category": "quiz_creation"
},
"earned_at": null
},
{
"achievement": {
"id": 11,
"slug": "popular-teacher",
"title": "Popular Teacher",
"description": "Have your quizzes taken 10 times",
"created_at": "2024-11-01T00:00:00Z",
"category": "quiz_creation"
},
"earned_at": null
},
{
"achievement": {
"id": 12,
"slug": "active-questioner",
"title": "Active Questioner",
"description": "Create 10 forum questions",
"created_at": "2024-11-01T00:00:00Z",
"category": "forum_mastery"
},
"earned_at": null
},
{
"achievement": {
"id": 13,
"slug": "question-expert",
"title": "Question Expert",
"description": "Create 25 forum questions",
"created_at": "2024-11-01T00:00:00Z",
"category": "forum_mastery"
},
"earned_at": null
},
{
"achievement": {
"id": 14,
"slug": "helpful-member",
"title": "Helpful Member",
"description": "Get 10 upvotes on an answer",
"created_at": "2024-11-01T00:00:00Z",
"category": "forum_mastery"
},
"earned_at": null
},
{
"achievement": {
"id": 15,
"slug": "answer-guru",
"title": "Answer Guru",
"description": "Get 100 upvotes on an answer",
"created_at": "2024-11-01T00:00:00Z",
"category": "forum_mastery"
},
"earned_at": null
},
{
"achievement": {
"id": 16,
"slug": "save-expert",
"title": "Save Expert",
"description": "Bookmark 10 forum questions",
"created_at": "2024-11-01T00:00:00Z",
"category": "forum_mastery"
},
"earned_at": null
},
{
"achievement": {
"id": 17,
"slug": "new-friend",
"title": "New Friend",
"description": "Get 10 followers",
"created_at": "2024-11-01T00:00:00Z",
"category": "community"
},
"earned_at": "2024-12-19T18:39:38.195027Z"
},
{
"achievement": {
"id": 18,
"slug": "rising-star",
"title": "Rising Star",
"description": "Get 50 followers",
"created_at": "2024-11-01T00:00:00Z",
"category": "community"
},
"earned_at": null
},
{
"achievement": {
"id": 19,
"slug": "community-builder",
"title": "Community Builder",
"description": "Follow 10 people",
"created_at": "2024-11-01T00:00:00Z",
"category": "community"
},
"earned_at": null
},
{
"achievement": {
"id": 20,
"slug": "getting-started",
"title": "Getting Started",
"description": "Select your first 3 interests",
"created_at": "2024-11-01T00:00:00Z",
"category": "interests"
},
"earned_at": null
},
{
"achievement": {
"id": 21,
"slug": "diverse-learner",
"title": "Diverse Learner",
"description": "Select 10 different interests",
"created_at": "2024-11-01T00:00:00Z",
"category": "interests"
},
"earned_at": null
}
]
- Implemented CD endpoints for interests of the user to add new interest and delete them. The user can add new interest using his profile page and can delete them as they want. Interest field is actively used for the feed feature.
Here is a sample call to the endpoint from the terminal using curl
(Before executing it, you may need to change Bearer token in the headers part with an active JWT access token of yourself):
curl -X 'POST' \
'http://138.68.102.215:8000/api/v1/interests/' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM1MzA1NjcwLCJpYXQiOjE3MzQ3MDA4NzAsImp0aSI6IjU1ZWY2NGNlMDc5NjRmM2JiODA3MThjMjQyN2IzNGJlIiwidXNlcl9pZCI6OX0.DW35oDk_PvIxziHnwjRG2vG2307Ds28Ceb4Belzn1fo' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"linked_data_id": "bn:00007309n",
"description": "string"
}'
An example response:
{
"id": 7,
"achievement": null
}
3 . Implemented profile endpoint as a main feature for our project.
Here is a sample call to the endpoint from the terminal using curl
(Before executing it, you may need to change Bearer token in the headers part with an active JWT access token of yourself):
curl -X 'GET' \
'http://138.68.102.215:8000/api/v1/profile/ceyda/' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNzM1MzA1NjcwLCJpYXQiOjE3MzQ3MDA4NzAsImp0aSI6IjU1ZWY2NGNlMDc5NjRmM2JiODA3MThjMjQyN2IzNGJlIiwidXNlcl9pZCI6OX0.DW35oDk_PvIxziHnwjRG2vG2307Ds28Ceb4Belzn1fo'
An example response:
{
"id": 9,
"email": "[email protected]",
"full_name": "string",
"avatar": "https://api.dicebear.com/9.x/avataaars/webp?accessories=eyepatch,kurt,prescription01&seed=Jeff Reed",
"quizzes_taken": [
{
"id": 1,
"title": "Technology Quiz",
"description": "Test your knowledge about technology",
"difficulty": 1,
"author": {
"id": 2,
"username": "alibaba",
"email": "[email protected]",
"full_name": "alibaba",
"avatar": "https://api.dicebear.com/9.x/avataaars/webp?accessories=eyepatch,kurt,prescription01&seed=Cody%20Ross",
"is_followed": null,
"is_blocked": null
},
"tags": [
{
"id": 1,
"name": "technology",
"linked_data_id": "bn:00030858n",
"description": "The practical application of science to commerce or industry"
}
],
"type": 1,
"created_at": "2024-11-02T02:30:20Z",
"questions": [
{
"id": 1,
"question_text": "Algorithm",
"question_point": 0,
"choices": [
{
"id": 1,
"choice_text": "Algoritma",
"is_correct": true
},
{
"id": 2,
"choice_text": "Yazılım",
"is_correct": false
},
{
"id": 3,
"choice_text": "Veri",
"is_correct": false
},
{
"id": 4,
"choice_text": "Ağ",
"is_correct": false
}
],
"hints": []
},
{
"id": 2,
"question_text": "Cloud Computing",
"question_point": 0,
"choices": [
{
"id": 5,
"choice_text": "Bulut Bilişim",
"is_correct": true
},
{
"id": 6,
"choice_text": "Veritabanı",
"is_correct": false
},
{
"id": 7,
"choice_text": "Ağ",
"is_correct": false
},
{
"id": 8,
"choice_text": "Sunucu",
"is_correct": false
}
],
"hints": []
},
{
"id": 3,
"question_text": "Artificial Intelligence",
"question_point": 0,
"choices": [
{
"id": 9,
"choice_text": "Yapay Zeka",
"is_correct": true
},
{
"id": 10,
"choice_text": "Robot",
"is_correct": false
},
{
"id": 11,
"choice_text": "Bilişim",
"is_correct": false
},
{
"id": 12,
"choice_text": "Veri Tabanı",
"is_correct": false
}
],
"hints": []
},
{
"id": 4,
"question_text": "Cybersecurity",
"question_point": 0,
"choices": [
{
"id": 13,
"choice_text": "Siber Güvenlik",
"is_correct": true
},
{
"id": 14,
"choice_text": "Firewall",
"is_correct": false
},
{
"id": 15,
"choice_text": "Yazılım",
"is_correct": false
},
{
"id": 16,
"choice_text": "Donanım",
"is_correct": false
}
],
"hints": []
},
{
"id": 5,
"question_text": "Virtual Reality",
"question_point": 0,
"choices": [
{
"id": 17,
"choice_text": "Sanal Gerçeklik",
"is_correct": true
},
{
"id": 18,
"choice_text": "Gerçek Zeka",
"is_correct": false
},
{
"id": 19,
"choice_text": "Fiziksel Gerçeklik",
"is_correct": false
},
{
"id": 20,
"choice_text": "Dijital Dünya",
"is_correct": false
}
],
"hints": []
}
],
"num_taken": 1,
"is_taken": true,
"rating": {
"score": null,
"count": 0
},
"is_my_quiz": false,
"quiz_point": 0
}
],
"bookmarked_forums": [
{
"id": 2,
"title": "How do you use the word 'clutch' in English?",
"question": "In English, the word 'clutch' has different meanings depending on the context. It can refer to a car part, but it's also used in sports or to describe someone who performs well under pressure. Can someone explain the different uses of 'clutch' in everyday English? How would you use it in a sentence in different contexts?",
"tags": [
{
"id": 2,
"name": "clutch",
"linked_data_id": "bn:00020080n",
"description": "A pedal or lever that engages or disengages a rotating shaft and a driving mechanism"
}
],
"author": {
"id": 3,
"username": "jackma",
"email": "[email protected]",
"full_name": "jackma",
"avatar": "https://api.dicebear.com/9.x/avataaars/webp?accessories=eyepatch,kurt,prescription01&seed=David%20Bush",
"is_followed": null,
"is_blocked": null
},
"created_at": "2024-11-11T19:43:30Z",
"answers_count": 1,
"is_bookmarked": 2,
"is_upvoted": null,
"upvotes_count": 1,
"is_downvoted": null,
"downvotes_count": 0,
"answers": [
{
"id": 1,
"answer": "The word 'clutch' has several meanings: as a car part, it's a device that connects the engine to the wheels; as a verb, it means to grip tightly; in sports, it refers to performing well under pressure; and as a noun, it can also mean a small handbag.",
"author": {
"id": 2,
"username": "alibaba",
"email": "[email protected]",
"full_name": "alibaba",
"avatar": "https://api.dicebear.com/9.x/avataaars/webp?accessories=eyepatch,kurt,prescription01&seed=Cody%20Ross",
"is_followed": null,
"is_blocked": null
},
"created_at": "2024-11-01T00:00:00Z",
"is_my_answer": null,
"is_upvoted": null,
"is_downvoted": null,
"upvotes_count": 0,
"downvotes_count": 0,
"forum_question": 2
}
],
"is_my_forum_question": false,
"quiz_question": null,
"quiz_question_type": null,
"image_url": null,
"related_forum_questions": null
}
],
"score": 0,
"achievements": [
{
"achievement": {
"id": 1,
"slug": "first-quiz",
"title": "First Quiz",
"description": "Complete your first quiz",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-14T17:41:00.718666Z"
},
{
"achievement": {
"id": 2,
"slug": "first-question",
"title": "First Question",
"description": "Create your first forum question",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-14T15:28:52.634993Z"
},
{
"achievement": {
"id": 5,
"slug": "first-bookmark",
"title": "First Bookmark",
"description": "Bookmark your first forum question",
"created_at": "2024-11-01T00:00:00Z",
"category": "first_steps"
},
"earned_at": "2024-12-14T15:30:37.972850Z"
},
{
"achievement": {
"id": 20,
"slug": "getting-started",
"title": "Getting Started",
"description": "Select your first 3 interests",
"created_at": "2024-11-01T00:00:00Z",
"category": "interests"
},
"earned_at": "2024-12-14T15:38:08.955859Z"
}
],
"interests": [
{
"id": 1,
"name": "technology",
"linked_data_id": "bn:00030858n",
"description": "The practical application of science to commerce or industry"
},
{
"id": 7,
"name": "car",
"linked_data_id": "bn:00007309n",
"description": "A motor vehicle with four wheels; usually propelled by an internal combustion engine"
},
{
"id": 12,
"name": "deneme",
"linked_data_id": "deneme",
"description": "string"
},
{
"id": 13,
"name": "hvgh",
"linked_data_id": "hjjhvg",
"description": "string"
}
],
"followings": [],
"followers": [],
"blockings": [],
"is_following": false,
"is_blocked": false
}
Code Related Significant Issues
Issue Title | Description | Issue and/or PR Link |
---|---|---|
Implement Profile Enpoint for Authenticated Users | Implemented profile serializer, views and API documentation. In demo we showed the profile page successfully. We added new additional fields to profile model upon using this model and serialzier implemented earlier. | #681 |
Enrich Profile Model to Include Customisation and Gamification | Added new fields to profile endpoints used in feed and gamification features of the project (proficiency, badges, and interest) | #740 |
Implement Get Achievements Endpoint | User can see her achievement object with the information of when she earned this badge. | #756 |
Implement Interests CD Endpoints | This endpoint is implemented to add new interests and delete them. User can do these in her profile page | #767 |
Add Proficiency Feature for Users | Proficiency info is used as a core functionality of the app since the user can see the quizzes in their proficiency level. Updated necessary model, views and serializers accordingly. | #795 |
Return Full Quizzes Taken From Backend Profile Endpoint | The "profile/{username}/" is fixed to return necessary information needed. | #814 |
Management Related Significant Issues
Issue Title | Description | Issue and/or PR Link |
---|---|---|
Create Demo Scenario For Final Milestone | For the final milestone we determine the scenario should be and which features should be presented in which manner to show the most significant features of our app. | #734 |
PRs
PR | Summary |
---|---|
#694 | This PR is related to implementing profile page for the users. We showed this feature both in mobile and the web parts |
#776 | This PR is related to implementing CD endpoints for the interest functionallity. |
#783 | This PR is related to implementing get endpoint for the achievements functionallity. |
#805 | This PR is related to adding proficiency feature to our profile model. |
#808 | I reviewed leaderboard functionallity implemented by Arda and fixed some parts of the implementation |
#779 | I reviewed the implementation of Hasan Kerem and tried it locally before merging the branch |
Unit Tests
Unit Test | Summary |
---|---|
I have implemeneted unit tests for quiz and quiz question endpoints but when the quiz creation related branch is deleted unfortunately the tests implemented for quiz and quiz question are deleted also. (In the issue it can be seen that one of the acceptance criteria is unit test implementation.) | Related PR: #624 , Related Issue: #594 |