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

Criar questão de código #5

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
11dad62
Create question code page
alvesisaque Sep 19, 2017
d829d4e
Fixing questions page
gustavomna Sep 21, 2017
7f1ae37
Questions type of urls changed
gustavomna Sep 21, 2017
f65c776
Editing question page
alvesisaque Sep 21, 2017
405b5d9
Adding Slug to questionsCode
gustavomna Sep 26, 2017
c511704
Update gitignore.
bedranfleck Sep 26, 2017
24ae5bb
Changing question code screen.
alvesisaque Sep 26, 2017
c74aae3
Creating the questions list page
egewarth Sep 26, 2017
d560d93
Fixing Questions type urls
gustavomna Oct 3, 2017
9ecaf04
Implementing slug urls
egewarth Oct 3, 2017
31706ca
Modifing name of questions classes
gustavomna Oct 3, 2017
69690b9
Merge branch 'feature/questions' of https://github.com/MES-codeSSchoo…
gustavomna Oct 3, 2017
e92ee6d
Fixing errors.
alvesisaque Oct 3, 2017
8be7f96
Fix errors of alignment and names.
alvesisaque Oct 3, 2017
e8a377f
Merge pull request #9 from MES-codeSSchool/feature/questions
alvesisaque Oct 3, 2017
9271c81
Fixing css identation.
alvesisaque Oct 5, 2017
63c053a
Merge pull request #14 from MES-codeSSchool/feature/questions
alvesisaque Oct 5, 2017
35b5008
Working in progress
gustavomna Oct 10, 2017
f92e380
Creating link do questions list
gustavomna Oct 11, 2017
fae2e3b
Finishing questions slug links
gustavomna Oct 17, 2017
5218e04
Merge pull request #15 from MES-codeSSchool/feature/links_slug
alvesisaque Oct 17, 2017
5662878
Changing pages structural colors
gustavomna Oct 5, 2017
4124907
Fixing fonts style and colors
gustavomna Oct 5, 2017
555f7e9
Correcting css in header and change font of language
alvesisaque Oct 5, 2017
9ef5de2
Correcting source and presentation
alvesisaque Oct 10, 2017
c7bcd85
Correcting font, buttons and alignment.
alvesisaque Oct 17, 2017
7dc02a3
Adding the button in QuestionList.
alvesisaque Oct 18, 2017
ba7ec9e
Changing button on questions to onClick in intire div
gustavomna Oct 19, 2017
e9071ee
Making adjustments.
alvesisaque Oct 19, 2017
63d85ea
Merge pull request #16 from MES-codeSSchool/feature/fix_style_elements
alvesisaque Oct 31, 2017
f36bfa6
Function to parsing markdown (received from django api) to html (used…
egewarth Oct 10, 2017
7e837df
Adding struct CodeQuestion to contain the information of the questions
egewarth Oct 17, 2017
d64ad7c
Renaming quantionName to title
egewarth Oct 17, 2017
7568052
Creating function markdownToHtml
egewarth Oct 31, 2017
9628768
Merge branch 'feature/markdown_to_string'
egewarth Oct 31, 2017
29cdbca
Fixing code clean issues
Gabiras12 Nov 9, 2017
6d2e4de
Code clean
egewarth Nov 9, 2017
53209a3
Merge branch 'fix/code-clean' of https://github.com/MES-codeSSchool/c…
egewarth Nov 9, 2017
0f49946
Fixing code clean issues
alvesisaque Nov 9, 2017
d8bbe8f
Adding ace editor to project
Gabiras12 Nov 14, 2017
6ddafbb
working in the editor's language
alvesisaque Nov 28, 2017
ee0e42f
Work in progress
egewarth Nov 28, 2017
f7e79c9
Update README.md
alvesisaque Dec 4, 2017
e5b6c2c
Update README.md
egewarth Dec 5, 2017
667f4cb
Update README.md
alvesisaque Dec 5, 2017
277bad4
Get suported languages
Gabiras12 Dec 5, 2017
f8b5999
Remove request button
Gabiras12 Dec 5, 2017
1f6e53a
Merge pull request #21 from MES-codeSSchool/feature/code-editor
gustavomna Dec 5, 2017
7967561
Update README.md
gustavomna Dec 5, 2017
0513db8
Update README.md
gustavomna Dec 5, 2017
01dd677
Update README.md
gustavomna Dec 5, 2017
ed9515d
Update README.md
egewarth Dec 5, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ bower_components
dist
elm-stuff
public/bower_components
src/scss/.sass-cache/
src/scss/.sass-cache/
**.DS_STORE
5 changes: 3 additions & 2 deletions src/Codeschool/Model.elm
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ type Route
| Progress
| Learn
| Help
| QuestionList
| Question Id
| QuestionRoot
| QuestionList Slug
| Question Slug Slug
| Social
| Profile
| Logout
Expand Down
16 changes: 10 additions & 6 deletions src/Codeschool/Routing.elm
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ matchers =
, map Progress (s "progress")
, map Learn (s "learn")
, map Help (s "help")
, map Question (s "questions" </> int)
, map QuestionList (s "questions")
, map QuestionRoot (s "questions")
, map QuestionList (s "questions" </> string)
, map Question (s "questions" </> string </> string)
, map Social (s "social")
, map Profile (s "profile")
, map Logout (s "logout")
Expand Down Expand Up @@ -68,12 +69,15 @@ baseReverse route =
Help ->
"help/"

Question id ->
"questions/" ++ toString id

QuestionList ->
QuestionRoot ->
"questions/"

QuestionList st ->
"questions/" ++ st

Question a b ->
"code/" ++ a ++ "/" ++ b

Social ->
"social"

Expand Down
15 changes: 10 additions & 5 deletions src/Codeschool/View.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import Page.Learn
import Page.NotFound
import Page.Profile
import Page.Progress
import Page.Questions.Base
import Page.Questions.QuestionRoot
import Page.Questions.QuestionList
import Page.Questions.Code
import Page.ScoreBoard
import Page.Social
import Page.Submission
Expand Down Expand Up @@ -49,11 +51,14 @@ getRouteView model =
Progress ->
Page.Progress.view model

QuestionList ->
Page.Questions.Base.viewList Page.Questions.Base.clsList
QuestionList string ->
Page.Questions.QuestionList.viewList Page.Questions.QuestionList.clsList

Question id ->
Page.Questions.Base.viewDetail model
Question string slug ->
Page.Questions.Code.view model

QuestionRoot ->
Page.Questions.QuestionRoot.viewList Page.Questions.QuestionRoot.clsList

ScoreBoard ->
Page.ScoreBoard.view model
Expand Down
2 changes: 1 addition & 1 deletion src/Page/Actions.elm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ view model =
div [ attribute "slot" "dropdown-content", class "page-header__user-menu-content" ]
[ h1 [class "mobile-button__fonts-title"] [ text "Actions" ]
, span [ onClick (ChangeRoute (ClassroomList)), class "mobile-button__item" ] [ h1 [class "mobile-button__fonts"] [text "Classrooms"] ]
, span [ onClick (ChangeRoute (QuestionList)), class "mobile-button__item" ] [ h1 [class "mobile-button__fonts"] [text "Questions"] ]
, span [ onClick (ChangeRoute (QuestionRoot)), class "mobile-button__item" ] [ h1 [class "mobile-button__fonts"] [text "Questions"] ]
, span [ onClick (ChangeRoute (Social)), class "mobile-button__item" ] [ h1 [class "mobile-button__fonts"] [text "Social"] ]
, span [ onClick (ChangeRoute (Profile)), class "mobile-button__item" ] [ h1 [class "mobile-button__fonts"] [text "Profile"] ]
, checkLogin model
Expand Down
44 changes: 44 additions & 0 deletions src/Page/Questions/Code.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module Page.Questions.Code exposing (view)

-- import Codeschool.Msg exposing (..)
-- import Data.User exposing (User)

import Codeschool.Model exposing (Model)
import Html exposing (..)
import Html.Attributes exposing (..)
import Ui.Generic exposing (container, icon)
import Ui.Parts exposing (promoSimple, promoTable, simpleHero)


-- import Html.Attributes exposing (..)
-- import Html.Events exposing (..)



view : Model -> Html msg
view m =
div []
[ simpleHero "Titulo da questão" "" "simple-hero__page-blue"
, div [ class "question-description" ]
[ text
"""
Codifique um software receba o ano de nascimento de uma pessoa e o ano atual. Calcule e mostre:
a) A idade dessa pessoa.
b) Quantos anos essa pessoa terá em 2018.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa
"""
]
, select [ class "select-language" ]
[ option [ value "", disabled True, selected True, class "disabled-item" ] [ text "Select language" ]
, option [ value "C" ] [ text "C" ]
, option [ value "Python" ] [ text "Python" ]
, option [ value "Java" ] [ text "Java" ]
, option [ value "Java" ] [ text "Java" ]
, option [ value "Java" ] [ text "Java" ]
]
, div [ class "item-question" ]
[ textarea [ class "item-question", maxlength 1000, placeholder "Insert your code" ] []
]
, button [ class "send-button" ] [ text "Send to evaluation" ]
]
92 changes: 92 additions & 0 deletions src/Page/Questions/QuestionList.elm
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
module Page.Questions.QuestionList exposing (clsList, viewList)

import Data.Question exposing (..)
import Html exposing (..)
import Html.Attributes exposing (..)
import Ui.Generic exposing (container, date, emoticon)
import Ui.Parts exposing (promoSimple, promoTable, simpleHero)

questions_type = "Basic questions"
questions_type_description = "Easy Easy Maaann, mostly basic questions"

viewList : List QuestionInfo -> Html msg
viewList m =
let
-- testing if there are no questions
-- m = []
empty =
[ emoticon ":-("
, p [ class "center-text" ]
[ text "Sorry, there are no questions for you."
, br [] []
, text "Please wait for more questions or send a message to you teacher to check if everything is ok."
]
]

listing =
[ div [ class "question-info-list" ] (List.map questionInfo m)
]

fab_ =
div [] []

children =
case m of
[] ->
fab_ :: empty

_ ->
fab_ :: listing
in
div []
[ simpleHero questions_type questions_type_description "simple-hero__page-blue"
, div [] children
]


questionInfo : QuestionInfo -> Html msg
questionInfo cls =
div [ class "question-card" ]
[ Ui.Generic.icon [ class "question-info-card__icon" ] cls.icon
, h1 [ class "question-card__title" ]
[ text cls.questionName
]
, p [ class "question-card__description" ]
[ text cls.shortDescription
]
]


questionOne : QuestionInfo
questionOne =
{ questionName = "Questão mais facil"
, shortDescription = "Questão mais facil, se n conseguir fazer vaza."
, icon = "sentiment_very_satisfied"
}


questionTwo : QuestionInfo
questionTwo =
{ questionName = "Segunda mais facil"
, shortDescription = "Questão facil também."
, icon = "code"
}

questionThree : QuestionInfo
questionThree =
{ questionName = "Questão dificil"
, shortDescription = "Essa é hard"
, icon = "loop"
}

questionFour : QuestionInfo
questionFour =
{ questionName = "Questão dificil"
, shortDescription = "Essa é hard"
, icon = "loop"
}


clsList : List QuestionInfo
clsList =
[ questionOne, questionTwo, questionThree, questionFour ]
45 changes: 28 additions & 17 deletions src/Page/Questions/Base.elm → src/Page/Questions/QuestionRoot.elm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Page.Questions.Base exposing (clsList, viewDetail, viewList)
module Page.Questions.QuestionRoot exposing (clsList, viewDetail, viewList)

-- import Codeschool.Msg exposing (..)
-- import Data.User exposing (User)
Expand Down Expand Up @@ -49,7 +49,7 @@ viewList m =
fab_ :: listing
in
div []
[ simpleHero "List of Questions" "See all questions available for you" "simple-hero__page-blue"
[ simpleHero "Category of Questions" "See all questions available for you" "simple-hero__page-blue"
, div [] children
]

Expand All @@ -69,36 +69,47 @@ questionInfo cls =

questionOne : QuestionInfo
questionOne =
{ questionName = "VEMMM MALUCOOOOO"
, shortDescription = "DESCREVE INSANOOOOOOOOOOOOOO."
, icon = "code"
{ questionName = "Basic"
, shortDescription = "Elementary programming problems."
, icon = "sentiment_very_satisfied"
}


questionTwo : QuestionInfo
questionTwo =
{ questionName = "nome da questão pois é"
, shortDescription = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris varius tellus velit, ut accumsan odio tincidunt in."
, icon = "sentiment_very_satisfied"
{ questionName = "Conditionals"
, shortDescription = "Conditional flow control (if/else)."
, icon = "code"
}


questionThree : QuestionInfo
questionThree =
{ questionName = "Sequência de Fibonacci"
, shortDescription = "Questão para testar seus conhecimentos sobre como funciona o algoritmo de fibonacci"
, icon = "all_out"
{ questionName = "Loops"
, shortDescription = "Iterations with for/while commands"
, icon = "loop"
}


questionFour : QuestionInfo
questionFour =
{ questionName = "Sequência de Fibonacci"
, shortDescription = "Questão para testar seus conhecimentos sobre como funciona o algoritmo de fibonacci"
, icon = "all_out"
{ questionName = "Functions"
, shortDescription = "Organize code using functions."
, icon = "functions"
}

questionFive : QuestionInfo
questionFive =
{ questionName = "Files"
, shortDescription = "Open, process and write files."
, icon = "insert_drive_file"
}

questionSix : QuestionInfo
questionSix =
{ questionName = "Lists"
, shortDescription = "Linear data structures."
, icon = "list"
}

clsList : List QuestionInfo
clsList =
[ questionOne, questionTwo, questionThree, questionFour ]
[ questionOne, questionTwo, questionThree, questionFour, questionFive, questionSix ]
2 changes: 1 addition & 1 deletion src/Ui/Header.elm
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ header model =
[]
]
, link ClassroomList "Classrooms"
, link QuestionList "Questions"
, link QuestionRoot "Questions"
, link Social "Social"
, div [class "page-header__special-buttons"]
[
Expand Down
50 changes: 46 additions & 4 deletions src/scss/6_components/pages/_question.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
width: 30%;
padding: 20px;

// > * {

// }

&__title {
position: relative;
align-self: center;
Expand All @@ -44,10 +40,16 @@
}
}

.question-card {
@extend .question-info-card;
width: 40% !important;
}

.question-info-list {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
text-align: center;
}

@media (max-width: $breakpoint-large-screen) {
Expand All @@ -60,4 +62,44 @@
min-width: 15em;
}

.question-card {
flex: 1;
min-width: 15em;
}

}
.question-description {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 75%;
margin: 3%;
margin-top: 25px;
}
.select-language {
width: 300px;
margin-top: 50px;
margin-bottom: 10px;
margin-left: 3%;
}
.item-question {
width: 90%;
height: 30vw;
margin: 0 auto;
margin-right: 5%;
margin-left: 1.6%;
}

.send-button {
width: 10px;
height: 50px;
margin: 15px auto;
background-color: $color-green;
color: white;
border-radius: 5px;
width: 20%;
margin-right: 5%;
margin-left: 64.2%;

}