freeCodeCamp / freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
http://contribute.freecodecamp.org/intro
BSD 3-Clause "New" or "Revised" License
402.89k stars 37.45k forks source link

Project solutions are missing from certified user data #54162

Open huyenltnguyen opened 6 months ago

huyenltnguyen commented 6 months ago

Description

Some project solutions are broken / missing from certified user data, and we have an error message next to those projects.

Screenshot Screenshot 2024-03-21 at 14 15 17

Projects with broken solution are:


We also have some projects which don't have a solution (the solution column is empty, rather than displaying an error message).

Screenshot Screenshot 2024-03-21 at 14 17 08

Projects with broken solution are:

Affected Page

In development environment and on /settings#certification-settings.

KaterinaNakou2003 commented 5 months ago

is the issue still open? I want to work on it

ilenia-magoni commented 5 months ago

@KaterinaNakou2003 We typically do not assign issues. Instead, we accept the first pull request that comprehensively solves the issue.

Issues labeled with help wanted or first timers only are open for contributions.

Please make sure you read our guidelines for contributing. We prioritize contributors following the instructions in our guide. Join us in our chat room or the forum if you need help contributing - our community will be happy to assist you.

Deep512 commented 5 months ago

@ilenia-magoni Correct me if I'm wrong, but I understand that we have to show an error message in case of no solution. Is there anything to be done about the broken/missing solution?

ilenia-magoni commented 5 months ago

@Deep512 no, the certified user data has to contain the project solutions

RavidYael commented 4 months ago

Hi @ilenia-magoni,

I've started addressing the issue and have a couple of questions based on your last comment about the certified user data needing to contain project solutions.

1. Critical Question: Are you certain this is only a development environment issue and not present in production? Currently, the code doesn't make the solution field mandatory, and from a quick glance at curriculum.json, I noticed some challenges entirely lack a solution attribute. This raises concerns that this issue could also exist in production. If so, perhaps better error handling, as suggested by @Deep512, might be a good approach.

2. Potential Solution: How do you suggest we approach fixing this issue given that numerous challenges currently lack solutions?

Thanks in advance!

ilenia-magoni commented 4 months ago

this issue is specifically to add the missing data to the mocked user @RavidYael , as such it can't be present in production. The mocked user is missing data as it has not been updated for the latest releases. The only saved solutions are those of final projects, as such we don't care that many challenges lack solutions, those solutions are not saved for each user, so they don't matter for the mocked user.

I am not sure you understand what this issue is about with this question. This is to update the certified-user with which the database can be seeded in the development environment.

RavidYael commented 4 months ago

I understand, in production, we will present the actual solution of the user. Thanks for clarifying!

ilenia-magoni commented 4 months ago

@RavidYael we do not give solutions to users, and this issue is impossible in production because it's about the script that creates a false user data in the development database

RavidYael commented 4 months ago

I'm not sure I fully understand. When a user completes the "Build a Survey Form" project, what would they see in the solution section in production? image

a2937 commented 4 months ago

@RavidYael There would be a "View" button that opens a link to their completed solution to the challenge. Like below. The user in the development database does not have a proper completed solution, as such it provides an error.

image

The user in the development database does not have a proper completed solution, as such it provides an error message. Are you with me so far?

a2937 commented 1 month ago

I'm bumping this issue because I think it might be necessary at some point to modify the user-data.js file such that we can insert new challenges into the seed code more easily. Ideally automatically whenever a new challenge is created with the FreeCodeCamp step tools.