diff --git a/app/locale/pt-BR.coffee b/app/locale/pt-BR.coffee index db981c752..6e0ab33ed 100644 --- a/app/locale/pt-BR.coffee +++ b/app/locale/pt-BR.coffee @@ -57,42 +57,42 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: real_game: "Um jogo de verdade, com programação de verdade." great_game: "Um grande jogo é mais do que apenas emblemas e realizações - Isso é sobre a jornada de um jogador, quebra-cabeças bem desenhados, e a habilidade para enfrentar desafios com ação e confiança." agency: "CodeCombat é um jogo que fornece aos jogadores essa ação e confiança com nosso robusto motor de digitação de código, que ajuda alunos iniciantes e avançados tanto na escrita quanto na validação do código." -# request_demo_title: "Get your students started today!" -# request_demo_subtitle: "Request a demo and get your students started in less than an hour." -# get_started_title: "Set up your class today" -# get_started_subtitle: "Set up a class, add your students, and monitor their progress as they learn computer science." -# request_demo: "Request a Demo" -# setup_a_class: "Set Up a Class" + request_demo_title: "Começe com seus alunos hoje!" + request_demo_subtitle: "Solicite uma demonstração e começe com seus alunos em menos de uma hora." + get_started_title: "Construa sua turma hoje" + get_started_subtitle: "Construa sua turma, adicione seus alunos e acompanhe o progresso deles na aprendizagem de ciência da computação." + request_demo: "Solicite um Demonstração" + setup_a_class: "Gerencie a Turma" have_an_account: "Tem uma conta?" logged_in_as: "Você está logado como" -# view_my_classes: "View my classes" -# computer_science: "Computer science courses for all ages" -# show_me_lesson_time: "Show me lesson time estimates for:" -# curriculum: "Total curriculum hours:" + view_my_classes: "Visualizar minhas turmas" + computer_science: "Cursos de ciência da computação para todas as idades" + show_me_lesson_time: "Mostre-me a estimativa de tempo para:" + curriculum: "Total de horas curriculares:" ffa: "Gratuito para todos os estudantes" -# lesson_time: "Lesson time:" + lesson_time: "Tempo da lição:" coming_soon: "Em breve!" courses_available_in: "Os cursos estão disponíveis em JavaScript, Python e Java (em breve!)" -# boast: "Boasts riddles that are complex enough to fascinate gamers and coders alike." -# winning: "A winning combination of RPG gameplay and programming homework that pulls off making kid-friendly education legitimately enjoyable." -# run_class: "Everything you need to run a computer science class in your school today, no CS background required." -# teachers: "Teachers!" -# teachers_and_educators: "Teachers & Educators" -# class_in_box: "Learn how our classroom-in-a-box platform fits into your curriculum." -# get_started: "Get Started" -# students: "Students:" -# join_class: "Join Class" -# role: "Your role:" -# student_count: "Number of students:" -# start_playing_for_free: "Start Playing for Free!" -# students_and_players: "Students & Players" -# goto_classes: "Go to My Classes" -# view_profile: "View My Profile" -# view_progress: "View Progress" -# check_out_wiki: "Check out our new Educator Wiki" -# want_coco: "Want CodeCombat at your school?" -# form_select_role: "Select primary role" -# form_select_range: "Select class size" + boast: "Dispomos de enigmas que são complexos o suficiente para fascinar tanto jogadores como programadores." + winning: "A combinação perfeita de jogabilidade de um RPG e lições de programação é o que torna a educação infantil legitimamente agradável." + run_class: "Tudo o que você precisa para criar uma turma de ciência da computação em sua escola hoje, nenhuma conhecimento em termos técnicos é necessário." + teachers: "Professores!" + teachers_and_educators: "Professores e Educadores" + class_in_box: "Aprenda como nossa plataforma de sala de aula in-a-box se encaixa no seu currículo." + get_started: "Começar" + students: "Alunos:" + join_class: "Participar da turma" + role: "Seu papel:" + student_count: "Número de alunos:" + start_playing_for_free: "Começe a jogar de graça!" + students_and_players: "Alunos e Jogadores" + goto_classes: "Ir para Minhas Turmas" + view_profile: "Visualizar Meu Perfil" + view_progress: "Visualizar Progresso" + check_out_wiki: "Confira nosso novo Wiki Educador" + want_coco: "Quer CodeCombat na sua escola?" + form_select_role: "Selecione seu papel principal" + form_select_range: "Selecione o tamanho da turma" nav: play: "Jogar" # The top nav bar entry where players choose which levels to play @@ -102,7 +102,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: blog: "Blog" forum: "Fórum" account: "Conta" -# my_account: "My Account" + my_account: "Minha conta" profile: "Perfil" stats: "Estatísticas" code: "Código" @@ -112,7 +112,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: about: "Sobre" contact: "Contate-nos" twitter_follow: "Seguir" -# students: "Students" + students: "Alunos" teachers: "Professores" careers: "Carreiras" facebook: "Facebook" @@ -123,7 +123,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: toggle_nav: "Alternar navegação" jobs: "Empregos" schools: "Escolas" -# educator_wiki: "Educator Wiki" + educator_wiki: "Wiki Educador" get_involved: "Involva-se" open_source: "Código aberto (GitHub)" support: "Suporte" @@ -132,7 +132,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: help_suff: "e nós entraremos em contato!" modal: -# cancel: "Cancel" + cancel: "Cancelar" close: "Fechar" okay: "Ok" @@ -243,7 +243,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: login: sign_up: "Criar conta" -# email_or_username: "Email or username" + email_or_username: "Email ou nome de usuário" log_in: "Entrar" logging_in: "Entrando" log_out: "Sair" @@ -256,13 +256,13 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: signup_switch: "Deseja Criar uma Conta?" signup: -# create_student_header: "Create Student Account" -# create_teacher_header: "Create Teacher Account" -# create_individual_header: "Create Individual Account" -# create_header: "Create Account" + create_student_header: "Criar conta de Aluno" + create_teacher_header: "Criar conta de Professor" + create_individual_header: "Criar conta Individual" + create_header: "Criar conta" email_announcements: "Receber notícias por email." # {change} creating: "Criando uma nova conta..." -# create_account: "Create Account" + create_account: "Criar conta" sign_up: "Criar conta" log_in: "Entre com a senha" required: "Você precisa fazer login antes de ir por esse caminho." @@ -270,7 +270,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: school_name: "Nome da Escola e da cidade" optional: "Opcional" school_name_placeholder: "Escola de exemplo, Cotia, SP" -# connect_with: "Connect with:" + connect_with: "Conectar com:" connected_gplus_header: "Você se conectou com sucesso ao Google+!" connected_gplus_p: "Conclua sua inscrição para que você possa fazer login com sua conta do Google+." gplus_exists: "Você já tem uma conta associada com o Google+!" diff --git a/app/models/SuperModel.coffee b/app/models/SuperModel.coffee index 4637db757..0712dd6c6 100644 --- a/app/models/SuperModel.coffee +++ b/app/models/SuperModel.coffee @@ -298,33 +298,37 @@ class ModelResource extends Resource @loadsAttempted = 0 load: -> - # TODO: Track progress on requests and don't retry if progress was made recently. - # Probably use _.debounce and attach event listeners to xhr objects. - - # This logic is for handling failed responses for level loading. - timeToWait = 5000 - tryLoad = => - return if this.isLoaded - if @loadsAttempted > 4 - @markFailed() - return @ - @markLoading() - @model.loading = false # So fetchModel can run again - if @loadsAttempted > 0 - console.log "Didn't load model in #{timeToWait}ms (attempt ##{@loadsAttempted}), trying again: ", _.result(@model, 'url') - @fetchModel() - @listenTo @model, 'error', (levelComponent, request) -> - if request.status not in [408, 504, 522, 524] - clearTimeout(@timeoutID) - clearTimeout(@timeoutID) if @timeoutID - @timeoutID = setTimeout(tryLoad, timeToWait) - if application.testing - application.timeoutsToClear?.push(@timeoutID) - @loadsAttempted += 1 - timeToWait *= 1.5 - tryLoad() + @markLoading() + @fetchModel() @ +# # TODO: Track progress on requests and don't retry if progress was made recently. +# # Probably use _.debounce and attach event listeners to xhr objects. +# +# # This logic is for handling failed responses for level loading. +# timeToWait = 5000 +# tryLoad = => +# return if this.isLoaded +# if @loadsAttempted > 4 +# @markFailed() +# return @ +# @markLoading() +# @model.loading = false # So fetchModel can run again +# if @loadsAttempted > 0 +# console.log "Didn't load model in #{timeToWait}ms (attempt ##{@loadsAttempted}), trying again: ", _.result(@model, 'url') +# @fetchModel() +# @listenTo @model, 'error', (levelComponent, request) -> +# if request.status not in [408, 504, 522, 524] +# clearTimeout(@timeoutID) +# clearTimeout(@timeoutID) if @timeoutID +# @timeoutID = setTimeout(tryLoad, timeToWait) +# if application.testing +# application.timeoutsToClear?.push(@timeoutID) +# @loadsAttempted += 1 +# timeToWait *= 1.5 +# tryLoad() +# @ + fetchModel: -> @jqxhr = @model.fetch(@fetchOptions) unless @model.loading @listen() diff --git a/app/schemas/models/campaign.schema.coffee b/app/schemas/models/campaign.schema.coffee index 8dfbe6f19..feada8d08 100644 --- a/app/schemas/models/campaign.schema.coffee +++ b/app/schemas/models/campaign.schema.coffee @@ -66,7 +66,8 @@ _.extend CampaignSchema.properties, { original: { type: 'string', format: 'hidden' } adventurer: { type: 'boolean' } practice: { type: 'boolean' } - practiceThresholdMinutes: {type: 'number'} + practiceThresholdMinutes: { type: 'number' } + primerLanguage: { type: 'string', enum: ['javascript', 'python'] } shareable: { title: 'Shareable', type: ['string', 'boolean'], enum: [false, true, 'project'], description: 'Whether the level is not shareable, shareable, or a sharing-encouraged project level.' } adminOnly: { type: 'boolean' } disableSpaces: { type: ['boolean','number'] } diff --git a/app/schemas/models/classroom.schema.coffee b/app/schemas/models/classroom.schema.coffee index e33563b40..6b7ba0d5e 100644 --- a/app/schemas/models/classroom.schema.coffee +++ b/app/schemas/models/classroom.schema.coffee @@ -25,6 +25,7 @@ _.extend ClassroomSchema.properties, levels: c.array { title: 'Levels' }, c.object { title: 'Level' }, { practice: {type: 'boolean'} practiceThresholdMinutes: {type: 'number'} + primerLanguage: { type: 'string', enum: ['javascript', 'python'] } shareable: { title: 'Shareable', type: ['string', 'boolean'], enum: [false, true, 'project'], description: 'Whether the level is not shareable, shareable, or a sharing-encouraged project level.' } type: c.shortString() original: c.objectId() diff --git a/app/schemas/models/level.coffee b/app/schemas/models/level.coffee index 120751c3f..d940235ee 100644 --- a/app/schemas/models/level.coffee +++ b/app/schemas/models/level.coffee @@ -330,6 +330,7 @@ _.extend LevelSchema.properties, buildTime: {type: 'number', description: 'How long it has taken to build this level.'} practice: { type: 'boolean' } practiceThresholdMinutes: {type: 'number', description: 'Players with larger playtimes may be directed to a practice level.'} + primerLanguage: { type: 'string', enum: ['javascript', 'python'], description: 'Programming language taught by this level.' } shareable: { title: 'Shareable', type: ['string', 'boolean'], enum: [false, true, 'project'], description: 'Whether the level is not shareable, shareable, or a sharing-encouraged project level.' } # Admin flags diff --git a/app/templates/admin/admin-classroom-levels.jade b/app/templates/admin/admin-classroom-levels.jade index 463e2d85e..dd712974d 100644 --- a/app/templates/admin/admin-classroom-levels.jade +++ b/app/templates/admin/admin-classroom-levels.jade @@ -43,6 +43,7 @@ block content th Practice th Practice Threshold (m) th Shareable + th Primer each level, levelIndex in levels - var levelNumber = campaign.getLevelNumber(level.get('original'), levelIndex + 1) tr @@ -52,3 +53,4 @@ block content td= level.get('practice') td= level.get('practiceThresholdMinutes') td= level.get('shareable') + td= level.get('primerLanguage') diff --git a/app/templates/editor/article/edit.jade b/app/templates/editor/article/edit.jade index dd0005c14..a5896d623 100644 --- a/app/templates/editor/article/edit.jade +++ b/app/templates/editor/article/edit.jade @@ -26,5 +26,3 @@ block content .patches-view hr - - div#error-view diff --git a/app/templates/editor/level/edit.jade b/app/templates/editor/level/edit.jade index f137b92fd..e252828c1 100644 --- a/app/templates/editor/level/edit.jade +++ b/app/templates/editor/level/edit.jade @@ -8,14 +8,14 @@ block header li a(href="/editor/level") span.glyphicon-home.glyphicon - + else nav.navbar.navbar-default(role='navigation')#level-editor-top-nav ul.nav.navbar-nav li a(href="/editor/level") span.glyphicon-home.glyphicon - + ul.nav.navbar-nav.nav-tabs li.active a(href="#thangs-tab-view", data-toggle="tab", data-i18n="editor.level_tab_thangs") Thangs @@ -75,7 +75,7 @@ block header a.play-with-team-button(data-team=team)= team + ' vs. AI' for match in recentlyPlayedOpponents a.play-with-team-button(data-team=match.yourTeam, data-opponent=match.opponentSessionID)= match.yourTeam + ' vs. ' + match.opponentName - + else li(data-i18n="[title]general.play_preview", title="Play preview of current level")#play-button a @@ -93,7 +93,7 @@ block header span.unwatch.secret span.glyphicon.glyphicon-eye-close span.spl(data-i18n="common.unwatch") Unwatch - + li(class=anonymous ? "disabled": "") a(data-i18n="common.fork")#fork-start-button Fork li(class=anonymous ? "disabled": "") @@ -126,9 +126,9 @@ block outer_content .outer-content div.tab-content#level-editor-tabs div.tab-pane.active#thangs-tab-view - + div.tab-pane#editor-level-scripts-tab-view - + div.tab-pane#editor-level-settings-tab-view div.tab-pane#editor-level-components-tab-view @@ -136,7 +136,7 @@ block outer_content div.tab-pane#systems-tab-view div.tab-pane#editor-level-tasks-tab-view - + div.tab-pane#editor-level-patches.nano .nano-content .patches-view @@ -155,6 +155,4 @@ block outer_content div.tab-pane#level-feedback-view - div#error-view - block footer diff --git a/app/templates/editor/thang/thang-type-edit-view.jade b/app/templates/editor/thang/thang-type-edit-view.jade index ab3ad2864..4cc153580 100644 --- a/app/templates/editor/thang/thang-type-edit-view.jade +++ b/app/templates/editor/thang/thang-type-edit-view.jade @@ -42,7 +42,7 @@ block header for level in recentlyPlayedLevels a.play-with-level-button(data-level=level)= level input.play-with-level-input(placeholder="Type in a level name") - + if authorized li#save-button a @@ -138,6 +138,5 @@ block outer_content div#spritesheets div.tab-pane#editor-thang-patches-view div.patches-view - div#error-view .clearfix block footer diff --git a/app/templates/i18n/i18n-edit-model-view.jade b/app/templates/i18n/i18n-edit-model-view.jade index b6f31afb5..0464793f4 100644 --- a/app/templates/i18n/i18n-edit-model-view.jade +++ b/app/templates/i18n/i18n-edit-model-view.jade @@ -8,7 +8,7 @@ block header li a(href="/i18n") span.glyphicon-home.glyphicon - + else nav.navbar.navbar-default(role='navigation') ul.nav.navbar-nav @@ -24,16 +24,16 @@ block header button.btn.btn-info.btn-sm.pull-right#patch-submit(disabled=model.hasLocalChanges() ? null : 'disabled', value=model.id, data-i18n="common.submit_changes") Submit Changes li.dropdown - + a(data-toggle='dropdown') span.glyphicon-chevron-down.glyphicon - + ul.dropdown-menu li.dropdown-header(data-i18n="common.actions") Actions - + li(class=anonymous ? "disabled": "") a(data-toggle="coco-modal", data-target="modal/RevertModal", data-i18n="editor.revert")#revert-button Revert - + li.divider li.dropdown-header(data-i18n="common.info") Info li#history-button @@ -51,7 +51,7 @@ block header block outer_content .outer-content - + select.form-control#language-select for row in translationList @@ -68,6 +68,5 @@ block outer_content else input.input-sm.form-control.translation-input(data-index=row.index.toString(), value=row.toValue) - div#error-view .clearfix block footer diff --git a/app/views/editor/level/settings/SettingsTabView.coffee b/app/views/editor/level/settings/SettingsTabView.coffee index a2be48d71..8e28e2242 100644 --- a/app/views/editor/level/settings/SettingsTabView.coffee +++ b/app/views/editor/level/settings/SettingsTabView.coffee @@ -16,7 +16,7 @@ module.exports = class SettingsTabView extends CocoView 'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals', 'type', 'terrain', 'showsGuide', 'banner', 'employerDescription', 'loadingTip', 'requiresSubscription', 'helpVideos', 'replayable', 'scoreTypes', 'concepts', 'picoCTFProblem', 'practice', 'practiceThresholdMinutes' - 'shareable', 'studentPlayInstructions' + 'primerLanguage', 'shareable', 'studentPlayInstructions' ] subscriptions: diff --git a/server/handlers/level_handler.coffee b/server/handlers/level_handler.coffee index 03435ddf0..cd5b73dd6 100644 --- a/server/handlers/level_handler.coffee +++ b/server/handlers/level_handler.coffee @@ -69,6 +69,7 @@ LevelHandler = class LevelHandler extends Handler 'concepts' 'picoCTFProblem' 'practiceThresholdMinutes', + 'primerLanguage' 'studentPlayInstructions' ]