mumuki / mumuki-laboratory

:microscope: Where students practice and receive automated and human feedback

Home Page:http://mumuki.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload exercises should never show nav tabs

felipecalvo opened this issue · comments

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.