-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add programming language icons #2138
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update your screenshot with an exercise for each language?
You can change an exercise's programming language trough the console.
Correct remarks Co-authored-by: Rien <[email protected]>
Co-authored-by: Rien <[email protected]>
…a-edu/dodona into feature/programming-language-icons
If we also attach a programming language to a submission (inherited from the exercise for now), we could also add the programming language icon to all tables showing a list of submissions. If feasible, this could be turned into a new issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also add the programming language to the title tag (and thus tooltip) of the icon ("exercise" -> "python exercise").
@rien don't we want to handle the "no icon" case in the model so we don't have to add that exception each time we use it?
I would maybe put it in a helper, because otherwise we're mixing application logic with its views. |
Also useful to show the icons in the overview of learning activities for a series in the right margin (navigation element) and also on the exercise page itself (after the title in the header?). |
Yes, but this is logic, right? It seems logical to overwrite the icon attribute in the model and return the string from the datababase or "file-document-edit-outline". That way there's one place where de default icon is set and you can trust the |
Hmm yes, you're right. I think putting the icon in the database was mixing logic and views with each other to begin with. But adding a constant mapping in the I would indeed write something in the model like def icon
self[:icon] || "file-document-edit-outline"
end |
@winniederidder can you modify the code as proposed by @rien and add the title? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests still seem to fail. Probably a missing &.
somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I don't think the file test/remotes/exercises/public/CodersApprentice.png
should be in this PR. Ping me if removed so I can merge.
This pull request uses different icons for activities depending on their Programming Language.
Sample of a current table:
Current issues:
Example testing exercises are always linked to Python, so e.g. Echo JS shows a Python logo.
Blank, a.k.a. Programming Language = text is also not available yet to test visually.
Exercises are created via a git repo, so I require explanation on how to work with that.
Closes #1975 .