diff --git a/app/assets/javascripts/web-dev-listener.js b/app/assets/javascripts/web-dev-listener.js index cc67305de..112ed1aa8 100644 --- a/app/assets/javascripts/web-dev-listener.js +++ b/app/assets/javascripts/web-dev-listener.js @@ -35,6 +35,8 @@ function receiveMessage(event) { case 'create': create(_.pick(data, 'dom', 'styles', 'scripts')); checkGoals(data.goals, source, origin); + $('body').first().off('click', checkRememberedGoals); + $('body').first().on('click', checkRememberedGoals); break; case 'update': if (virtualDom) @@ -108,7 +110,13 @@ function update(options) { virtualScripts = scripts; } +var lastGoalArgs = []; +function checkRememberedGoals() { + checkGoals.apply(this, lastGoalArgs); +} + function checkGoals(goals, source, origin) { + lastGoalArgs = [goals, source, origin]; // Memoize for checkRememberedGoals // Check right now and also in one second, since our 1-second CSS transition might be affecting things until it is done. doCheckGoals(goals, source, origin); _.delay(function() { doCheckGoals(goals, source, origin); }, 1001); diff --git a/app/lib/surface/Surface.coffee b/app/lib/surface/Surface.coffee index c2d9deb2f..1e4598c5d 100644 --- a/app/lib/surface/Surface.coffee +++ b/app/lib/surface/Surface.coffee @@ -83,6 +83,8 @@ module.exports = Surface = class Surface extends CocoClass constructor: (@world, @normalCanvas, @webGLCanvas, givenOptions) -> super() + $(window).on('keydown', @onKeyEvent) + $(window).on('keyup', @onKeyEvent) @normalLayers = [] @options = _.clone(@defaults) @options = _.extend(@options, givenOptions) if givenOptions @@ -540,7 +542,13 @@ module.exports = Surface = class Surface extends CocoClass event.screenPos = @mouseScreenPos if @mouseScreenPos Backbone.Mediator.publish 'surface:mouse-scrolled', event unless @disabled @gameUIState.trigger('surface:mouse-scrolled', event) - + + + #- Keyboard callbacks + + onKeyEvent: (e) => + return unless @realTime + @realTimeInputEvents.add(_.pick(e, 'type', 'keyCode', 'ctrlKey', 'metaKey', 'shiftKey')) #- Canvas callbacks @@ -758,6 +766,8 @@ module.exports = Surface = class Surface extends CocoClass @webGLStage.enableMouseOver 0 @webGLCanvas.off 'mousewheel', @onMouseWheel $(window).off 'resize', @onResize + $(window).off('keydown', @onKeyEvent) + $(window).off('keyup', @onKeyEvent) clearTimeout @surfacePauseTimeout if @surfacePauseTimeout clearTimeout @surfaceZoomPauseTimeout if @surfaceZoomPauseTimeout super() diff --git a/app/locale/en.coffee b/app/locale/en.coffee index 2e9117ddf..fd231a7a2 100644 --- a/app/locale/en.coffee +++ b/app/locale/en.coffee @@ -1419,7 +1419,7 @@ archive_class: "archive class" unarchive_class: "unarchive class" unarchive_this_class: "Unarchive this class" - no_students_yet: "This class has no students yet." + no_students_yet: "View class to add students." # {change} try_refreshing: "(You may need to refresh the page)" add_students: "Add Students" create_new_class: "Create a New Class" diff --git a/app/locale/pt-BR.coffee b/app/locale/pt-BR.coffee index babc4b148..9b843a611 100644 --- a/app/locale/pt-BR.coffee +++ b/app/locale/pt-BR.coffee @@ -237,7 +237,7 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: email_invalid: "Endereço de email inválido." form_blurb: "Informe os e-mails abaixo e mostraremos a eles!" form_label: "Endereço de Email" - placeholder: "endereço de email" + placeholder: "Endereço de email" title: "Excelente Trabalho, Aprendiz" login: @@ -277,34 +277,34 @@ module.exports = nativeDescription: "Português do Brasil", englishDescription: connected_facebook_p: "Conclua sua inscrição para que você possa fazer login com sua conta do Facebook." facebook_exists: "Você já tem uma conta associada com o Facebook!" hey_students: "Estudantes, insira o código de classe do seu professor." -# birthday: "Birthday" -# parent_email_blurb: "We know you can't wait to learn programming — we're excited too! Your parents will receive an email with further instructions on how to create an account for you. Email {{email_link}} if you have any questions." -# classroom_not_found: "No classes exist with this Class Code. Check your spelling or ask your teacher for help." -# checking: "Checking..." -# account_exists: "This email is already in use:" -# sign_in: "Sign in" -# email_good: "Email looks good!" -# name_taken: "Username already taken! Try {{suggestedName}}?" -# name_available: "Username available!" -# name_is_email: "Username may not be an email" -# choose_type: "Choose your account type:" -# teacher_type_1: "Teach programming using CodeCombat!" -# teacher_type_2: "Set up your class" -# teacher_type_3: "Access Course Guides" -# teacher_type_4: "View student progress" -# signup_as_teacher: "Sign up as a Teacher" -# student_type_1: "Learn to program while playing an engaging game!" -# student_type_2: "Play with your class" -# student_type_3: "Compete in arenas" -# student_type_4: "Choose your hero!" -# student_type_5: "Have your Class Code ready!" -# signup_as_student: "Sign up as a Student" -# individuals_or_parents: "Individuals & Parents" -# individual_type: "For players learning to code outside of a class. Parents should sign up for an account here." -# signup_as_individual: "Sign up as an Individual" -# enter_class_code: "Enter your Class Code" -# enter_birthdate: "Enter your birthdate:" -# parent_use_birthdate: "Parents, use your own birthdate." + birthday: "Aniversário" + parent_email_blurb: "Nós sabemos que você não vê a hora de aprender programação ; nós estamos animados tambem ! Seus responsáveis irão receber um email com mais instruçoes em como criar uma conta para você .Mande um email {{email_link}} se ouver alguma pergunta." + classroom_not_found: "Nenhuma classe existe com esse codigo.Veja se o codigo esta correto ou peça ajuda ao seu professor." + checking: "Checando..." + account_exists: "Esse email já esta sendo usado:" + sign_in: "Logar" + email_good: "Email parece bom!" + name_taken: "Esse nome de usuario já esta sendo usado! Tente {{suggestedName}}?" + name_available: "Nome disponivel!" + name_is_email: "O nome de usuario não pode ser um email" + choose_type: "Escolha seu tipo de conta:" + teacher_type_1: "Ensine programação usando CodeCombat!" + teacher_type_2: "Organize sua sala" + teacher_type_3: "Acessar seus guias de curso" + teacher_type_4: "Ver progresso do estudante" + signup_as_teacher: "Cadastrar como professor" + student_type_1: "Aprenda programação enquanto se diverte jogando!" + student_type_2: "Jogue com sua classe" + student_type_3: "Competir em arenas" + student_type_4: "Escolha seu herói!" + student_type_5: "Tenha o seu codigo de classe pronto!" + signup_as_student: "Cadastrar como estudante" + individuals_or_parents: "Individuais e resposáveis" + individual_type: "Para aprender a programar fora da classe.Os responsáveis devem requerer uma conta aqui." + signup_as_individual: "Registrar como individual" + enter_class_code: "Coloque seu código de classe" + enter_birthdate: "Coloque sua data de aniversário:" + parent_use_birthdate: "Responsáveis, usem o seu propio dia de nascimento." # ask_teacher_1: "Ask your teacher for your Class Code." # ask_teacher_2: "Not part of a class? Create an " # ask_teacher_3: "Individual Account" diff --git a/app/templates/courses/teacher-classes-view.jade b/app/templates/courses/teacher-classes-view.jade index c39ad4b32..5e6c7908e 100644 --- a/app/templates/courses/teacher-classes-view.jade +++ b/app/templates/courses/teacher-classes-view.jade @@ -92,10 +92,6 @@ mixin addStudentsButton(classroom) .add-students .text-center div.small-details(data-i18n='teacher.no_students_yet') - | This class has no students yet. - a.add-students-btn.btn.btn-lg.btn-primary(data-classroom-id=classroom.id ) - span(data-i18n='teacher.add_students') - | Add Students mixin createClassButton .create-class diff --git a/app/templates/new-home-view.jade b/app/templates/new-home-view.jade index b97df0707..927915c5b 100644 --- a/app/templates/new-home-view.jade +++ b/app/templates/new-home-view.jade @@ -242,7 +242,7 @@ block content h6.course-name= i18n(course.attributes, 'name') + ':' p.small - var total = 0; - each concept in course.get('concepts') + each concept in course.get('concepts') || [] - if (conceptsSeen[concept]) continue; - conceptsSeen[concept] = true; if total === 3 diff --git a/app/templates/play/level/tome/cast-button-view.jade b/app/templates/play/level/tome/cast-button-view.jade index 2857d3c6f..50a851a19 100644 --- a/app/templates/play/level/tome/cast-button-view.jade +++ b/app/templates/play/level/tome/cast-button-view.jade @@ -5,10 +5,10 @@ if view.options.level.isType('game-dev') span(data-i18n="play_level.done") else - + button.btn.btn-lg.btn-illustrated.cast-button(title=view.castVerbose()) - span(data-i18n="play_level.tome_run_button_ran") Ran - + span(data-i18n="play_level.tome_cast_button_ran") Ran + if !view.observing if view.mirror .ladder-submission-view @@ -16,10 +16,10 @@ else button.btn.btn-lg.btn-illustrated.submit-button(title=view.castRealTimeVerbose()) span(data-i18n="play_level.tome_submit_button") Submit span.spl.secret.submit-again-time - + button.btn.btn-lg.btn-illustrated.btn-success.done-button.secret span(data-i18n="play_level.done") Done - + if view.autoSubmitsToLadder .hidden .ladder-submission-view diff --git a/scripts/mongodb/queries/findInvalidCourses.js b/scripts/mongodb/queries/findInvalidCourses.js new file mode 100644 index 000000000..1666c8e81 --- /dev/null +++ b/scripts/mongodb/queries/findInvalidCourses.js @@ -0,0 +1,35 @@ +// Find classrooms referencing invalid courses + +// Usage: +// mongo
:/