FidelusAleksander / ghcertified

Prepare for GitHub Certification exams!
https://ghcertified.com/
MIT License
395 stars 132 forks source link

Allow for taking practice exam with X questions #144

Closed FidelusAleksander closed 9 months ago

FidelusAleksander commented 9 months ago

Please describe the feature you feel like this repository should have.

Additional context

Would be nice to be able to take smaller portions of questions as practice exams

tfsjohan commented 9 months ago

When I've practiced for Azure tests with MeasureUp. I made it a habit to start with day with about 15 minutes of tests. I also did that with dead time, like if you had 15-30 minutes between meetings.

The benefit is that it is super easy to get it done, instead of having to dedicate more than an hour to it.

FidelusAleksander commented 9 months ago

@tfsjohan

Thanks for sharing, I'm sure there are other people that study in a similar way so I'd like the site to support that

I will have to figure out a nice way to incorporate this. I've never really dealt too much with frontend and UI/UX design so I'll have to think on it a bit

tfsjohan commented 9 months ago

I looked at the repo to see if I'd could help out with a PR, but at a quick glance I could figure out where the actual logic was.

Does it just iterate over all markdown files in a folder today?

FidelusAleksander commented 9 months ago

I should probably include something about that in contributing guide, it's just that i've put most of my focus on the actual content (writing questions). Here are the files that you are asking for

In short, all logic about how to display content is in layouts directory and it's sub-directories All content is in content directory and it's sub-directories.

FidelusAleksander commented 9 months ago

Hi @tfsjohan Are you still planning to look at this? I'm scheduled for taking Github Advanced Security next week so won't look into new features until after that probably

tfsjohan commented 9 months ago

Not sure. Suddenly felt a lot harder when it wasn't something I was familiar with already like JavaScript for the logic.

tfsjohan commented 9 months ago

Please have a look and see if it's good enough.

FidelusAleksander commented 9 months ago

@tfsjohan

I reviewed it and I might use a part of it but for the most part I will try to do it less "javascripty" and more inn Hugo way.

FidelusAleksander commented 9 months ago

Worked on this in https://github.com/FidelusAleksander/ghcertified/pull/161

Sadly this is not something as easily done in Hugo as I hoped (see https://discourse.gohugo.io/t/is-there-a-way-to-use-select-input-value-in-a-template/34718 )

I will leave it like that right now. Credits to @tfsjohan for the code snippet, didn't want to use the UI "Advanced Settings" part from your PR though.

If someone more experianced than me in CSS want's to modify the "Start exam" card so the UI option is there and not in a separate block then I'm all for it. image

Myself I'm going to leave it like this atm, preparing for GHAS

tfsjohan commented 9 months ago

How about using a html form with method GET and action is the permalink of the test. Then either a slider or a select to select number of questions with a name attribute that matches the query string parameter used in the quiz (questions)?

The slider could default to the number of questions on the actual exam, but go from 1 to number of test questions, with a step of 5 or some other integer to force integers only.

The start button needs to change from a link to a submit button.

With this kind of solution you can avoid having JavaScript in the Hugo files.

FidelusAleksander commented 9 months ago

@tfsjohan That sounds great

tfsjohan commented 9 months ago

It won't be possible to show the numeric value of the slider without using JavaScript or a datalist. A datalist could possible solve that, but you would need to make a clever loop of possible values.

But it would be easy with a tiny bit of JS, something like:

<span id="questionsValue">{{ examQuestionCount }}</span>
<input type="range" min="1" max="{{ testQuestionsCount }}" value="{{ examQuestionCount }}" step="1"
  onchange="document.getElementById('questionsValue').textContent = this.value;"
/>
tfsjohan commented 9 months ago

Just using a <input type="number" /> maybe is the easiest option and possible better UX as well?

FidelusAleksander commented 9 months ago

Just using a <input type="number" /> maybe is the easiest option and possible better UX as well?

If we put the default amount to the maximum number of questions possible then it's okay UX because it can only be lowered. But if we put default to 75 (the same as exam) then users will have no idea what is the maximum amount they can put in. A slider would cap on that value.

As long as it fits nicely in the UI i'm fine with either tbh. Little js is okay - probably my bad for choosing HuGo for this site

tfsjohan commented 9 months ago

If we put the default amount to the maximum number of questions possible then it's okay UX because it can only be lowered. But if we put default to 75 (the same as exam) then users will have no idea what is the maximum amount they can put in. A slider would cap on that value.

True. In some ways I like the idea that the default is the same as the actual exam. Especially if QuizDown also couple support showing a timer.

Are you planning on fixes this, or would you like me to give it a go?

probably my bad for choosing HuGo for this site

Maybe. But it is nice to have markdown as a simple form av CMS. But that could have been used by Next JS and the Markdown renderer as well. And Next JS can export a static site.

FidelusAleksander commented 9 months ago

Maybe. But it is nice to have markdown as a simple form av CMS. But that could have been used by Next JS and the Markdown renderer as well. And Next JS can export a static site.

I am a rookie with JS/HTML/CSS, always worked on backend/devops and never frontend. Hugo was my choice because i hoped to not have to work with these :smile:

Are you planning on fixes this, or would you like me to give it a go?

In the light of the above, I'd much rather spend time on adding additional practice questions instead of trying to make the CSS work :smiling_face_with_tear:

You go ahead @tfsjohan and give it a shot!

FidelusAleksander commented 9 months ago

Done in #163 by @tfsjohan :rocket: