Merge branch 'master' into production

This commit is contained in:
Scott Erickson 2016-08-11 09:45:12 -07:00
commit f1572dbf48
12 changed files with 93 additions and 89 deletions

View file

@ -57,42 +57,42 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription:
real_game: "Um jogo de verdade, com programação de verdade." 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." 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." 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_title: "Começe com seus alunos hoje!"
# request_demo_subtitle: "Request a demo and get your students started in less than an hour." request_demo_subtitle: "Solicite uma demonstração e começe com seus alunos em menos de uma hora."
# get_started_title: "Set up your class today" get_started_title: "Construa sua turma hoje"
# get_started_subtitle: "Set up a class, add your students, and monitor their progress as they learn computer science." get_started_subtitle: "Construa sua turma, adicione seus alunos e acompanhe o progresso deles na aprendizagem de ciência da computação."
# request_demo: "Request a Demo" request_demo: "Solicite um Demonstração"
# setup_a_class: "Set Up a Class" setup_a_class: "Gerencie a Turma"
have_an_account: "Tem uma conta?" have_an_account: "Tem uma conta?"
logged_in_as: "Você está logado como" logged_in_as: "Você está logado como"
# view_my_classes: "View my classes" view_my_classes: "Visualizar minhas turmas"
# computer_science: "Computer science courses for all ages" computer_science: "Cursos de ciência da computação para todas as idades"
# show_me_lesson_time: "Show me lesson time estimates for:" show_me_lesson_time: "Mostre-me a estimativa de tempo para:"
# curriculum: "Total curriculum hours:" curriculum: "Total de horas curriculares:"
ffa: "Gratuito para todos os estudantes" ffa: "Gratuito para todos os estudantes"
# lesson_time: "Lesson time:" lesson_time: "Tempo da lição:"
coming_soon: "Em breve!" coming_soon: "Em breve!"
courses_available_in: "Os cursos estão disponíveis em JavaScript, Python e Java (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." boast: "Dispomos de enigmas que são complexos o suficiente para fascinar tanto jogadores como programadores."
# winning: "A winning combination of RPG gameplay and programming homework that pulls off making kid-friendly education legitimately enjoyable." 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: "Everything you need to run a computer science class in your school today, no CS background required." 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: "Teachers!" teachers: "Professores!"
# teachers_and_educators: "Teachers & Educators" teachers_and_educators: "Professores e Educadores"
# class_in_box: "Learn how our classroom-in-a-box platform fits into your curriculum." class_in_box: "Aprenda como nossa plataforma de sala de aula in-a-box se encaixa no seu currículo."
# get_started: "Get Started" get_started: "Começar"
# students: "Students:" students: "Alunos:"
# join_class: "Join Class" join_class: "Participar da turma"
# role: "Your role:" role: "Seu papel:"
# student_count: "Number of students:" student_count: "Número de alunos:"
# start_playing_for_free: "Start Playing for Free!" start_playing_for_free: "Começe a jogar de graça!"
# students_and_players: "Students & Players" students_and_players: "Alunos e Jogadores"
# goto_classes: "Go to My Classes" goto_classes: "Ir para Minhas Turmas"
# view_profile: "View My Profile" view_profile: "Visualizar Meu Perfil"
# view_progress: "View Progress" view_progress: "Visualizar Progresso"
# check_out_wiki: "Check out our new Educator Wiki" check_out_wiki: "Confira nosso novo Wiki Educador"
# want_coco: "Want CodeCombat at your school?" want_coco: "Quer CodeCombat na sua escola?"
# form_select_role: "Select primary role" form_select_role: "Selecione seu papel principal"
# form_select_range: "Select class size" form_select_range: "Selecione o tamanho da turma"
nav: nav:
play: "Jogar" # The top nav bar entry where players choose which levels to play 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" blog: "Blog"
forum: "Fórum" forum: "Fórum"
account: "Conta" account: "Conta"
# my_account: "My Account" my_account: "Minha conta"
profile: "Perfil" profile: "Perfil"
stats: "Estatísticas" stats: "Estatísticas"
code: "Código" code: "Código"
@ -112,7 +112,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription:
about: "Sobre" about: "Sobre"
contact: "Contate-nos" contact: "Contate-nos"
twitter_follow: "Seguir" twitter_follow: "Seguir"
# students: "Students" students: "Alunos"
teachers: "Professores" teachers: "Professores"
careers: "Carreiras" careers: "Carreiras"
facebook: "Facebook" facebook: "Facebook"
@ -123,7 +123,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription:
toggle_nav: "Alternar navegação" toggle_nav: "Alternar navegação"
jobs: "Empregos" jobs: "Empregos"
schools: "Escolas" schools: "Escolas"
# educator_wiki: "Educator Wiki" educator_wiki: "Wiki Educador"
get_involved: "Involva-se" get_involved: "Involva-se"
open_source: "Código aberto (GitHub)" open_source: "Código aberto (GitHub)"
support: "Suporte" support: "Suporte"
@ -132,7 +132,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription:
help_suff: "e nós entraremos em contato!" help_suff: "e nós entraremos em contato!"
modal: modal:
# cancel: "Cancel" cancel: "Cancelar"
close: "Fechar" close: "Fechar"
okay: "Ok" okay: "Ok"
@ -243,7 +243,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription:
login: login:
sign_up: "Criar conta" sign_up: "Criar conta"
# email_or_username: "Email or username" email_or_username: "Email ou nome de usuário"
log_in: "Entrar" log_in: "Entrar"
logging_in: "Entrando" logging_in: "Entrando"
log_out: "Sair" log_out: "Sair"
@ -256,13 +256,13 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription:
signup_switch: "Deseja Criar uma Conta?" signup_switch: "Deseja Criar uma Conta?"
signup: signup:
# create_student_header: "Create Student Account" create_student_header: "Criar conta de Aluno"
# create_teacher_header: "Create Teacher Account" create_teacher_header: "Criar conta de Professor"
# create_individual_header: "Create Individual Account" create_individual_header: "Criar conta Individual"
# create_header: "Create Account" create_header: "Criar conta"
email_announcements: "Receber notícias por email." # {change} email_announcements: "Receber notícias por email." # {change}
creating: "Criando uma nova conta..." creating: "Criando uma nova conta..."
# create_account: "Create Account" create_account: "Criar conta"
sign_up: "Criar conta" sign_up: "Criar conta"
log_in: "Entre com a senha" log_in: "Entre com a senha"
required: "Você precisa fazer login antes de ir por esse caminho." 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" school_name: "Nome da Escola e da cidade"
optional: "Opcional" optional: "Opcional"
school_name_placeholder: "Escola de exemplo, Cotia, SP" 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_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+." 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+!" gplus_exists: "Você já tem uma conta associada com o Google+!"

View file

@ -298,33 +298,37 @@ class ModelResource extends Resource
@loadsAttempted = 0 @loadsAttempted = 0
load: -> load: ->
# TODO: Track progress on requests and don't retry if progress was made recently. @markLoading()
# Probably use _.debounce and attach event listeners to xhr objects. @fetchModel()
# 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()
@ @
# # 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: -> fetchModel: ->
@jqxhr = @model.fetch(@fetchOptions) unless @model.loading @jqxhr = @model.fetch(@fetchOptions) unless @model.loading
@listen() @listen()

View file

@ -66,7 +66,8 @@ _.extend CampaignSchema.properties, {
original: { type: 'string', format: 'hidden' } original: { type: 'string', format: 'hidden' }
adventurer: { type: 'boolean' } adventurer: { type: 'boolean' }
practice: { 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.' } 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' } adminOnly: { type: 'boolean' }
disableSpaces: { type: ['boolean','number'] } disableSpaces: { type: ['boolean','number'] }

View file

@ -25,6 +25,7 @@ _.extend ClassroomSchema.properties,
levels: c.array { title: 'Levels' }, c.object { title: 'Level' }, { levels: c.array { title: 'Levels' }, c.object { title: 'Level' }, {
practice: {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.' } 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() type: c.shortString()
original: c.objectId() original: c.objectId()

View file

@ -330,6 +330,7 @@ _.extend LevelSchema.properties,
buildTime: {type: 'number', description: 'How long it has taken to build this level.'} buildTime: {type: 'number', description: 'How long it has taken to build this level.'}
practice: { type: 'boolean' } practice: { type: 'boolean' }
practiceThresholdMinutes: {type: 'number', description: 'Players with larger playtimes may be directed to a practice level.'} 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.' } 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 # Admin flags

View file

@ -43,6 +43,7 @@ block content
th Practice th Practice
th Practice Threshold (m) th Practice Threshold (m)
th Shareable th Shareable
th Primer
each level, levelIndex in levels each level, levelIndex in levels
- var levelNumber = campaign.getLevelNumber(level.get('original'), levelIndex + 1) - var levelNumber = campaign.getLevelNumber(level.get('original'), levelIndex + 1)
tr tr
@ -52,3 +53,4 @@ block content
td= level.get('practice') td= level.get('practice')
td= level.get('practiceThresholdMinutes') td= level.get('practiceThresholdMinutes')
td= level.get('shareable') td= level.get('shareable')
td= level.get('primerLanguage')

View file

@ -26,5 +26,3 @@ block content
.patches-view .patches-view
hr hr
div#error-view

View file

@ -8,14 +8,14 @@ block header
li li
a(href="/editor/level") a(href="/editor/level")
span.glyphicon-home.glyphicon span.glyphicon-home.glyphicon
else else
nav.navbar.navbar-default(role='navigation')#level-editor-top-nav nav.navbar.navbar-default(role='navigation')#level-editor-top-nav
ul.nav.navbar-nav ul.nav.navbar-nav
li li
a(href="/editor/level") a(href="/editor/level")
span.glyphicon-home.glyphicon span.glyphicon-home.glyphicon
ul.nav.navbar-nav.nav-tabs ul.nav.navbar-nav.nav-tabs
li.active li.active
a(href="#thangs-tab-view", data-toggle="tab", data-i18n="editor.level_tab_thangs") Thangs 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' a.play-with-team-button(data-team=team)= team + ' vs. AI'
for match in recentlyPlayedOpponents for match in recentlyPlayedOpponents
a.play-with-team-button(data-team=match.yourTeam, data-opponent=match.opponentSessionID)= match.yourTeam + ' vs. ' + match.opponentName a.play-with-team-button(data-team=match.yourTeam, data-opponent=match.opponentSessionID)= match.yourTeam + ' vs. ' + match.opponentName
else else
li(data-i18n="[title]general.play_preview", title="Play preview of current level")#play-button li(data-i18n="[title]general.play_preview", title="Play preview of current level")#play-button
a a
@ -93,7 +93,7 @@ block header
span.unwatch.secret span.unwatch.secret
span.glyphicon.glyphicon-eye-close span.glyphicon.glyphicon-eye-close
span.spl(data-i18n="common.unwatch") Unwatch span.spl(data-i18n="common.unwatch") Unwatch
li(class=anonymous ? "disabled": "") li(class=anonymous ? "disabled": "")
a(data-i18n="common.fork")#fork-start-button Fork a(data-i18n="common.fork")#fork-start-button Fork
li(class=anonymous ? "disabled": "") li(class=anonymous ? "disabled": "")
@ -126,9 +126,9 @@ block outer_content
.outer-content .outer-content
div.tab-content#level-editor-tabs div.tab-content#level-editor-tabs
div.tab-pane.active#thangs-tab-view div.tab-pane.active#thangs-tab-view
div.tab-pane#editor-level-scripts-tab-view div.tab-pane#editor-level-scripts-tab-view
div.tab-pane#editor-level-settings-tab-view div.tab-pane#editor-level-settings-tab-view
div.tab-pane#editor-level-components-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#systems-tab-view
div.tab-pane#editor-level-tasks-tab-view div.tab-pane#editor-level-tasks-tab-view
div.tab-pane#editor-level-patches.nano div.tab-pane#editor-level-patches.nano
.nano-content .nano-content
.patches-view .patches-view
@ -155,6 +155,4 @@ block outer_content
div.tab-pane#level-feedback-view div.tab-pane#level-feedback-view
div#error-view
block footer block footer

View file

@ -42,7 +42,7 @@ block header
for level in recentlyPlayedLevels for level in recentlyPlayedLevels
a.play-with-level-button(data-level=level)= level a.play-with-level-button(data-level=level)= level
input.play-with-level-input(placeholder="Type in a level name") input.play-with-level-input(placeholder="Type in a level name")
if authorized if authorized
li#save-button li#save-button
a a
@ -138,6 +138,5 @@ block outer_content
div#spritesheets div#spritesheets
div.tab-pane#editor-thang-patches-view div.tab-pane#editor-thang-patches-view
div.patches-view div.patches-view
div#error-view
.clearfix .clearfix
block footer block footer

View file

@ -8,7 +8,7 @@ block header
li li
a(href="/i18n") a(href="/i18n")
span.glyphicon-home.glyphicon span.glyphicon-home.glyphicon
else else
nav.navbar.navbar-default(role='navigation') nav.navbar.navbar-default(role='navigation')
ul.nav.navbar-nav 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 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 li.dropdown
a(data-toggle='dropdown') a(data-toggle='dropdown')
span.glyphicon-chevron-down.glyphicon span.glyphicon-chevron-down.glyphicon
ul.dropdown-menu ul.dropdown-menu
li.dropdown-header(data-i18n="common.actions") Actions li.dropdown-header(data-i18n="common.actions") Actions
li(class=anonymous ? "disabled": "") li(class=anonymous ? "disabled": "")
a(data-toggle="coco-modal", data-target="modal/RevertModal", data-i18n="editor.revert")#revert-button Revert a(data-toggle="coco-modal", data-target="modal/RevertModal", data-i18n="editor.revert")#revert-button Revert
li.divider li.divider
li.dropdown-header(data-i18n="common.info") Info li.dropdown-header(data-i18n="common.info") Info
li#history-button li#history-button
@ -51,7 +51,7 @@ block header
block outer_content block outer_content
.outer-content .outer-content
select.form-control#language-select select.form-control#language-select
for row in translationList for row in translationList
@ -68,6 +68,5 @@ block outer_content
else else
input.input-sm.form-control.translation-input(data-index=row.index.toString(), value=row.toValue) input.input-sm.form-control.translation-input(data-index=row.index.toString(), value=row.toValue)
div#error-view
.clearfix .clearfix
block footer block footer

View file

@ -16,7 +16,7 @@ module.exports = class SettingsTabView extends CocoView
'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals', 'name', 'description', 'documentation', 'nextLevel', 'background', 'victory', 'i18n', 'icon', 'goals',
'type', 'terrain', 'showsGuide', 'banner', 'employerDescription', 'loadingTip', 'requiresSubscription', 'type', 'terrain', 'showsGuide', 'banner', 'employerDescription', 'loadingTip', 'requiresSubscription',
'helpVideos', 'replayable', 'scoreTypes', 'concepts', 'picoCTFProblem', 'practice', 'practiceThresholdMinutes' 'helpVideos', 'replayable', 'scoreTypes', 'concepts', 'picoCTFProblem', 'practice', 'practiceThresholdMinutes'
'shareable', 'studentPlayInstructions' 'primerLanguage', 'shareable', 'studentPlayInstructions'
] ]
subscriptions: subscriptions:

View file

@ -69,6 +69,7 @@ LevelHandler = class LevelHandler extends Handler
'concepts' 'concepts'
'picoCTFProblem' 'picoCTFProblem'
'practiceThresholdMinutes', 'practiceThresholdMinutes',
'primerLanguage'
'studentPlayInstructions' 'studentPlayInstructions'
] ]