karastoyanov / skill_forge Goto Github PK
View Code? Open in Web Editor NEWForge Your Skills
Forge Your Skills
When the user reports a quest a new textarea needs to be showed. In it, the user will write the reason for reporting the quest.
After an admin reviews a reported quest and marks it as "Resolved", the quest needs to be removed from the table with reported quests.
As an administrator of Skill-Forge, I want enhanced user management functionality to efficiently manage the platform's user base and ensure a positive user experience.
As an administrator, I want to have access to a user dashboard where I can view and manage user profiles, activity, and engagement metrics. This dashboard should provide real-time updates and customizable filters to streamline user management tasks.
The user dashboard should display user profiles with relevant information such as username, registration date, and activity status. Administrators should be able to filter user profiles based on various criteria such as registration date, activity level, and account status. The dashboard should provide real-time updates on user activity, including login/logout events and account modifications. Administrators should have the ability to edit user profiles and resetting passwords. The user management interface should include options to ban or suspend user accounts in case of policy violations or suspicious activity. Administrators should be able to permanently delete user accounts, ensuring compliance with data privacy regulations and preserving data integrity.
The user dashboard interface is designed and implemented according to specifications. Administrators can view, filter, and manage user profiles effectively using the dashboard. User management features such as editing, banning, suspending, and deleting accounts are fully functional and tested. The user management functionality complies with data privacy regulations and platform policies. Documentation is provided for administrators on how to use the new user management features.
Implement comment section where users and admin will be able to leave comments under the submited text
The functionality is required for Request Changes action for the user submited quests
Research Bootstrap form for the implementation
When new user creates account, all fileds are populated as None
by default making user_profile
to display all social links icons. Database fields needs to be modified and default values updated with empty strings.
In order to avoid manually applying changes to all pages for the navbar, create new template and implement inheritance in all other html pages.
New database table to store all the submited quests. The table should contain all the quest submits. no matter if the solution is correct, partially correct or entirely incorrect.
Add Contributors guidelines
Edit Quest
functionality in the Admin paneldocs
directory Levels.md
Add specific description/text at the top of each programming language
Implement Markdown support for various text area fields.
@CrazyDaisy15 will join the team as QA Manual Tester and will help us with the testing of the currently implemented features.
@rayapetkova For that purpose we will have to merge all our current progress in the main
branch. From there I will build a Docker image with the current app build 1.0:pre-release
which we will host on a separate VM inside the Stratios Network to provide a working ednpoint where @CrazyDaisy15 will be able to test and review the already implemented functionalities.
Prepare all the current branches to be merged with dev_sprint03
, once we are sure we have a working version of the application within that branch I will merge the changes into the main
branch and will build the Docker image.
No specific actions are needed at this point, we just have to review our current progress and prepare it for the merge.
Plan next version release 1.1-prerelease
:
test-prod-env
Class:SubmitedQuest
)Try to finish all the current strories, DO NOT start new major implementations unless we are sure we can implement them until 29.03.
Social Links section in the user_profile
and user_profile_view
sections
Implement tables with the solved quest for the User Profile menu
JavaScript and Python test runners does not execute properly quests with more complex test cases, e.g. mixed data data types.
Ensure that the test runners converts string data types properly before executing the user code.
Add a dropdown menu in which we can choose the admin who is going to review the reported quest.
Different pages for the quests - Python, JS, Java and C#
Implement zero testing. The user should be able to check the example input, the expected ouput and the results of his code, only for the first input/output for each quest(zero test).
The Report Quest functionality should be reworked and implement proper relantionships between the tables coding_quests
and reported_quests
. Check below
Each time when we load the table in the frontend, these nested loops create too much load to the database
<tbody>
{% for reported_quest in reported_quests %}
{% for quest in all_quests %}
{% if quest.quest_id == reported_quest.quest_id %}
<tr>
<td>{{ reported_quest.report_id}}</td>
<td>{{ quest.quest_id }}</td>
<td><a href="{{ url_for('open_edit_reported_quest', quest_id=quest.quest_id) }}">{{ quest.quest_name }}</a></td>
<td>{{ quest.language }}</td>
<td>{{ quest.quest_author }}</td>
<td>{{ reported_quest.report_date}}</td>
{% for user in all_users %}
{% if user.user_id == reported_quest.report_user_id %}
<td>{{ user.username }}</td>
{% endif %}
{% endfor %}
<td>{{ reported_quest.report_reason }}</td>
<td>{{ reported_quest.report_status }}</td>
<td>
<select name="admins" id="admins">
{% for admin in all_admins %}
<option value="{{ admin.username }}">{{ admin.username }}</option>
{% endfor %}
</select>
</td>
</tr>
{% endif %}
{% endfor%}
{% endfor %}
</tbody>
Instead, we can create relantions between the two tables. In the Class:SubmitedSolutions
there is a relation field coding_quest
based on quest_id = db.Column(db.String(20), db.ForeignKey('coding_quests.quest_id'), nullable=False)
foreign key
class SubmitedSolution(db.Model):
__tablename__ = 'user_submited_solutions'
submission_id = db.Column(db.String(20), primary_key=True) # Unique ID for each submission.
quest_id = db.Column(db.String(20), db.ForeignKey('coding_quests.quest_id'), nullable=False)
user_id = db.Column(db.String(20), db.ForeignKey('users.user_id'), nullable=False)
submission_date = db.Column(db.DateTime, default=datetime.now, nullable=False)
user_code = db.Column(db.Text, nullable=True)
successful_tests = db.Column(db.Integer, default=0, nullable=True)
unsuccessful_tests = db.Column(db.Integer, default=0, nullable=True)
quest_passed = db.Column(db.Boolean, nullable=True)
# Define the relationship between the user_submited_solutions and coding_quests table.
coding_quest = db.relationship('Quest')
In app.py
in the open_user_profile
route there is a refference to coding_quests
table called user_solved_quests
# Route to handle the user profile (self-open)
@login_required
@app.route('/my_profile', methods=['POST', 'GET'])
def open_user_profile():
# If user is not logged in, redirect to login page
if 'user_id' not in session:
return redirect(url_for('login'))
# Get the User ID for the session
user_id = session['user_id']
# Get the user's solved quests from the database
# Query SubmitedSolution objects and eager load the related CodingQuests
user_solved_quests = SubmitedSolution.query.options(joinedload(SubmitedSolution.coding_quest)).all()
# Get the user info from the database
user = User.query.get(user_id)
user.date_registered.strftime('%d-%m-%Y %H:%M:%S')
# Convert avatar binary data to Base64-encoded string
avatar_base64 = base64.b64encode(user.avatar).decode('utf-8') if user.avatar else None
return render_template('user_profile.html', user=user,
formatted_date=user.date_registered.strftime('%d-%m-%Y %H:%M:%S'),
avatar=avatar_base64,
user_solved_quests=user_solved_quests)
Finaly, the table should look something similar to that
<tbody>
{% for solved_quest in user_solved_quests %}
<tr>
<td>{{ solved_quest.submission_id }}</td>
<td>{{ solved_quest.quest_id }}</td>
<td><a href="{{ url_for('open_curr_quest', quest_id=solved_quest.coding_quest.quest_id) }}">{{ solved_quest.coding_quest.quest_name }}</a></td>
<td>{{ solved_quest.coding_quest.language }}</td>
<td>{{ solved_quest.coding_quest.difficulty }}</td>
<td>{{ solved_quest.submission_date }}</td>
<td>{{ solved_quest.successful_tests }}</td>
<td>{{ solved_quest.unsuccessful_tests }}</td>
<td>
{% if solved_quest.quest_passed %}
<img src="{{ url_for('static', filename='images/checked.png') }}" alt="Passed" width="20" height="20">
{% else %}
<img src="{{ url_for('static', filename='images/unchecked.png') }}" alt="Failed" width="20" height="20">
{% endif %}
</td>
</tr>
{% endfor %}
</tbody> <tbody>
{% for solved_quest in user_solved_quests %}
<tr>
<td>{{ solved_quest.submission_id }}</td>
<td>{{ solved_quest.quest_id }}</td>
<td><a href="{{ url_for('open_curr_quest', quest_id=solved_quest.coding_quest.quest_id) }}">{{ solved_quest.coding_quest.quest_name }}</a></td>
<td>{{ solved_quest.coding_quest.language }}</td>
<td>{{ solved_quest.coding_quest.difficulty }}</td>
<td>{{ solved_quest.submission_date }}</td>
<td>{{ solved_quest.successful_tests }}</td>
<td>{{ solved_quest.unsuccessful_tests }}</td>
<td>
{% if solved_quest.quest_passed %}
<img src="{{ url_for('static', filename='images/checked.png') }}" alt="Passed" width="20" height="20">
{% else %}
<img src="{{ url_for('static', filename='images/unchecked.png') }}" alt="Failed" width="20" height="20">
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
The result:
After PR merging user's profile styling is broked.
Fix the CSS before deploying v1.2
Commit directly to development
branch
New form for submiting quest from regular users. The should create db records in a separate table. The administrators should be able to review the submited quests in the admin panel(separate content form) and approve/denied/request change. The approved quests should be commited to the database.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.