Qiskit / platypus

Qiskit Textbook (beta)
https://learn.qiskit.org
Apache License 2.0
143 stars 249 forks source link

Bug: 404 on Problem Sets link #2005

Closed micpap25 closed 9 months ago

micpap25 commented 1 year ago

Where does the issue happen?

https://learn.qiskit.org/problem-sets

What is the content issue?

This link leads to a 404 even though it is in the Content dropdown. It should redirect to a problem set like https://learn.qiskit.org/problem-sets/single_systems_problem_set/problem-1

Screenshots

image

Additional information

No response

micpap25 commented 1 year ago

@vabarbosa Would you happen to know either how to 1. define a redirect on /problem-sets or 2. create a new page at /problem-sets as a landing page

vabarbosa commented 1 year ago

hello @micpap25, a redirect would be created in this here.

micpap25 commented 1 year ago

Where is the redirect that, for example, sends from https://learn.qiskit.org/course/basics to https://learn.qiskit.org/course/basics/single-systems defined? It is not in the file you linked

vabarbosa commented 1 year ago

@micpap25 redirecting from /course/<courseId> to /course/<courseId>/<sectionId> is actually taken care of by the framework (Mathigon Studio) being used. see the code here: https://github.com/mathigon/studio/blob/main/server/app.ts#L295-L314

we do the same thing with the summer school content i.e., redirect from https://learn.qiskit.org/summer-school/2022 to https://learn.qiskit.org/summer-school/2022/history-quantum-computing-motivation-quantum-simulation and you can see this code here: https://github.com/Qiskit/platypus/blob/main/server/app.ts#L213-L234

micpap25 commented 1 year ago

That is different from what I am trying to do; it would be the equivalent of redirecting from https://learn.qiskit.org/summer-school to a summer school course. I don't believe this is possible with Mathigon Studio.

vabarbosa commented 1 year ago

@micpap25.. oh ok. there is no current mechanism in place that already does that but it should not be too difficult to add.

we have the utility function tocFilterByType which returns all content: https://learn.qiskit.org/courseList

you should be able to use that to get the first problem set and redirect to it, e.g.,

    .get('/problem-sets', (req, res) => {
      const allContent = tocFilterByType();
      const theProblemSets = allContent.filter(content => content.url === "/problem-sets");
      const firstProblemSet = theProblemSets[0];
      res.redirect(firstProblemSet.url);
    })

fyi, i have no error handling here and did no testing but it should hopefully give you an idea on a possible approach

vabarbosa commented 9 months ago

This repository is no longer maintained. It has been superseded by IBM Quantum Learning.