GithubHelp home page GithubHelp logo

skill_forge's Introduction

Skill-Forge Open-Source platform

Work in progress

skill_forge's People

Contributors

karastoyanov avatar rayapetkova avatar dependabot[bot] avatar

Stargazers

 avatar  avatar

skill_forge's Issues

Implement User administration functionality in the Admin Panel

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.

Story:

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.

Acceptance Criteria:

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.

Tasks:

  • Design the user dashboard interface with input fields, filters, and real-time update mechanisms.
  • Implement backend logic to retrieve user data from the database and populate the dashboard.
  • Develop frontend functionality for editing user profiles, including form validation and error handling.
  • Implement banishment and suspension features, including UI elements for administrators to take action on user accounts.

Definition of Done:

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.

Fix dabatase behavior for social links

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.

New Table user_submited_solutions

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.

Optimizing `Edit Quest` form in the Admin panel

Optimizng the file structure and Flask routes for the Edit Quest functionality in the Admin panel

Flask routes functions are separated in a different file for better visibility and code optimization

Implement leveling system

Consider following functionalities:

  • Gaining XP points
  • Leveling System - for the list with the levels refer to the docs directory Levels.md

First pre-release deployment

@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.

Version 1.2-prerelease deployment

Plan next version release 1.1-prerelease:

  • Implement last functionalities in test-prod-env
  • โš  Test the old database behavior after the migration - new migrations are made in the current version, we should check how the old production database will handle the migrations for the new release (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.

Zero test functionality

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).

Report Quest functionality rework

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:

Image

Implement Report Quest functionality

Implement Report Quest functionality which allows regular users report a specific quest. Reported quests should be stored in a separate db table. A edit form should be implemented as well

CodeMirror doesn't load properly

CodeMirror libraries doesn't load properly on the fileds with programming language different than Python.

For example, quest written for JavaScript

Image

User Submit Quest Form

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.