Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload exercises should never show nav tabs #1599

Open
felipecalvo opened this issue Apr 5, 2021 · 0 comments
Open

Upload exercises should never show nav tabs #1599

felipecalvo opened this issue Apr 5, 2021 · 0 comments

Comments

@felipecalvo
Copy link
Contributor

Showing (or not) the navigation tabs (problem, console, extra code, etc) is decided ultimately by the following:

def should_render_exercise_tabs?(exercise, &block)
!exercise.hidden? && (exercise.queriable? || exercise.extra_visible? || block&.call)
end

Since it's the language the one which decides if the exercise is queriable or not (https://github.com/mumuki/mumuki-domain/blob/11818a3f1bc0edf276f8baa001e430df05cf288a/app/models/concerns/with_language.rb#L6-L9), the tabs are shown even in exercises with queriable languages that shouldn't have them, such as upload:

image

This doesn't happen on multiple or single choice exercises because we're creating them with language text, which is not queriable.

Creating upload exercises as text shouldn't be a workaround, because the upload input has an accept field which expects file extensions according to the exercise's language - and we probably don't want a .txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant