Skip to content

Commit

Permalink
Merge pull request #20969 from code-dot-org/dtp_candidate_d890cf45
Browse files Browse the repository at this point in the history
DTP (Test > Production: d890cf4)
  • Loading branch information
ewjordan committed Mar 1, 2018
2 parents ee9957b + d8e97a7 commit 67670b5
Show file tree
Hide file tree
Showing 205 changed files with 4,131 additions and 21,067 deletions.
4 changes: 4 additions & 0 deletions apps/i18n/common/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"addSectionName": "Enter a name for your section that will help you remember which classroom it is for. Your students will also be able to see this name.",
"addSectionNameHint": "e.g., Intro to CS - Period 2",
"addStudents": "Add students",
"addStudentsMultiple": "Add multiple students",
"addStudentsMultipleInstructions": "Type or paste the names of your students, one per line.",
"addStudentsManageMyOwn": "Create and manage my own list of students",
"addStudentsSyncThirdParty": "Sync my list of students from an existing classroom section in a third party tool",
"addStudentsToSectionInstructions": "Choose how you want to add your students:",
Expand Down Expand Up @@ -300,6 +302,7 @@
"disableMaker": "Disable Maker Toolkit",
"discountCodeSchoolConfirm": "Before you can receive your code, please verify the school at which you teach:",
"documentation": "Documentation",
"done": "Done",
"dontForget": "Don't forget",
"dragBlocksToMatch": "Drag the blocks to match",
"dropletBlock_addOperator_description": "Add two numbers",
Expand Down Expand Up @@ -825,6 +828,7 @@
"runTooltip": "Run the program defined by the blocks in the workspace.",
"runtimeErrorMsg": "Your program did not run successfully. Please remove line {lineNumber} and try again.",
"save": "Save",
"saveAll": "Save all",
"saveAndPublish": "Save & Publish",
"savedToGallery": "Saved",
"saving": "Saving...",
Expand Down
1 change: 1 addition & 0 deletions apps/i18n/studio/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@
"iceAge": "Ice Age!",
"ifDroid": "droid",
"ifDroidN": "droid {spriteIndex}",
"ifSprite": "actor",
"ifSpriteN": "actor {spriteIndex}",
"incrementPlayerScore" : "score point",
"isSet": "is set",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class CohortViewCalculator extends React.Component {
return (
<div style={styles.tableWrapper}>
<Table striped condensed>
<caption>Cohort Calulator</caption>
<caption>Cohort Calculator</caption>
<thead>
<tr>
<th />
Expand Down
1 change: 1 addition & 0 deletions apps/src/code-studio/pd/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class Permission {
// CSF Facilitators can create workshops, other facilitators cannot
this.isCsfFacilitator = this.hasPermission('csf_facilitator');
this.isOrganizer = this.hasPermission('workshop_organizer');
this.isProgramManager = this.hasPermission('program_manager');
this.isPartner = this.hasPermission('partner');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ export default class WorkshopForm extends React.Component {
style={this.getInputStyle()}
value={this.state.regional_partner_id || ''}
// Facilitators (who are not organizers, partners, nor admins) cannot edit this field
disabled={this.props.readOnly || (!this.permission.isWorkshopAdmin && !this.permission.isOrganizer && !this.permission.isPartner)}
disabled={this.props.readOnly || (!this.permission.isWorkshopAdmin && !this.permission.isOrganizer && !this.permission.isProgramManager && !this.permission.isPartner)}
>
<option value="">None</option>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class WorkshopManagement extends React.Component {
if (this.props.subject === '5-day Summer') {
surveyBaseUrl = "local_summer_workshop_survey_results";
} else {
surveyBaseUrl = this.permission.isOrganizer ? "organizer_survey_results" : "survey_results";
surveyBaseUrl = (this.permission.isOrganizer || this.permission.isProgramManager) ? "organizer_survey_results" : "survey_results";
}

this.surveyUrl = `/${surveyBaseUrl}/${this.props.workshopId}`;
Expand Down
6 changes: 3 additions & 3 deletions apps/src/code-studio/pd/workshop_dashboard/workshop_index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export default class WorkshopIndex extends React.Component {

render() {
const showOrganizer = this.permission.isWorkshopAdmin;
const canDelete = this.permission.isWorkshopAdmin || this.permission.isOrganizer;
const canCreate = (this.permission.isWorkshopAdmin || this.permission.isOrganizer || this.permission.isCsfFacilitator);
const canDelete = this.permission.isWorkshopAdmin || this.permission.isOrganizer || this.permission.isProgramManager;
const canCreate = (this.permission.isWorkshopAdmin || this.permission.isOrganizer || this.permission.isProgramManager || this.permission.isCsfFacilitator);

return (
<div>
Expand All @@ -79,7 +79,7 @@ export default class WorkshopIndex extends React.Component {
</Button>
)
}
{(this.permission.isWorkshopAdmin || this.permission.isOrganizer) && <Button onClick={this.handleAttendanceReportsClick}>Attendance Reports</Button>}
{(this.permission.isWorkshopAdmin || this.permission.isOrganizer || this.permission.isProgramManager) && <Button onClick={this.handleAttendanceReportsClick}>Attendance Reports</Button>}
{this.permission.isPartner && <Button onClick={this.handleOrganizerSurveyResultsClick}>Organizer Survey Results</Button>}
{this.permission.isFacilitator && <Button onClick={this.handleSurveyResultsClick}>Facilitator Survey Results</Button>}
<Button
Expand Down
3 changes: 3 additions & 0 deletions apps/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ exports.TestResults = {
// Contained level result. Not validated, but should be treated as a success
CONTAINED_LEVEL_RESULT: 101,

// The level was solved with fewer blocks than the recommended number of blocks.
BETTER_THAN_IDEAL: 102,

SUBMITTED_RESULT: 1000,
LOCKED_RESULT: 1001,
REVIEW_REJECTED_RESULT: 1500,
Expand Down
13 changes: 6 additions & 7 deletions apps/src/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ FeedbackUtils.prototype.getFeedbackMessage = function (options) {
var message;

// If a message was explicitly passed in, use that.
if (options.feedbackType !== TestResults.ALL_PASS &&
if (options.feedbackType < TestResults.ALL_PASS &&
options.level && options.level.failureMessageOverride) {
message = options.level.failureMessageOverride;
} else if (options.message) {
Expand Down Expand Up @@ -780,6 +780,7 @@ FeedbackUtils.prototype.getFeedbackMessage = function (options) {
// Success.
case TestResults.ALL_PASS:
case TestResults.FREE_PLAY:
case TestResults.BETTER_THAN_IDEAL:
case TestResults.PASS_WITH_EXTRA_TOP_BLOCKS:
var finalLevel = (options.response &&
(options.response.message === "no more levels"));
Expand Down Expand Up @@ -996,12 +997,7 @@ FeedbackUtils.prototype.getShowCodeComponent_ = function (options, challenge=fal
* @return {boolean}
*/
FeedbackUtils.prototype.canContinueToNextLevel = function (feedbackType) {
return (feedbackType === TestResults.ALL_PASS ||
feedbackType === TestResults.PASS_WITH_EXTRA_TOP_BLOCKS ||
feedbackType === TestResults.TOO_MANY_BLOCKS_FAIL ||
feedbackType === TestResults.APP_SPECIFIC_ACCEPTABLE_FAIL ||
feedbackType === TestResults.MISSING_RECOMMENDED_BLOCK_FINISHED ||
feedbackType === TestResults.FREE_PLAY);
return feedbackType >= TestResults.MINIMUM_PASS_RESULT;
};

/**
Expand Down Expand Up @@ -1566,6 +1562,9 @@ FeedbackUtils.prototype.getTestResults = function (levelComplete, requiredBlocks
return TestResults.TOO_MANY_BLOCKS_FAIL;
} else if (this.hasExtraTopBlocks() && Blockly.showUnusedBlocks) {
return TestResults.PASS_WITH_EXTRA_TOP_BLOCKS;
} else if (isFinite(this.studioApp_.IDEAL_BLOCK_NUM) &&
numEnabledBlocks < this.studioApp_.IDEAL_BLOCK_NUM) {
return TestResults.BETTER_THAN_IDEAL;
} else {
return TestResults.ALL_PASS;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/src/gamelab/ErrorDialogStack.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ErrorDialogStack extends React.Component {
'analysis-events',
{
study: 'animation_no_load',
study_group: 'animation_no_load_v3',
study_group: 'animation_no_load_v4',
event: 'delete_selected',
project_id: getCurrentId(),
data_json: JSON.stringify({'version': this.props.animationList.propsByKey[key].version,
Expand All @@ -48,7 +48,7 @@ class ErrorDialogStack extends React.Component {
'analysis-events',
{
study: 'animation_no_load',
study_group: 'animation_no_load_v3',
study_group: 'animation_no_load_v4',
event: 'reload_selected',
project_id: getCurrentId(),
data_json: JSON.stringify({'version': this.props.animationList.propsByKey[key].version,
Expand Down
11 changes: 8 additions & 3 deletions apps/src/gamelab/animationListModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,16 @@ function loadAnimationFromSource(key, callback) {
'analysis-events',
{
study: 'animation_no_load',
study_group: 'animation_no_load_v3',
study_group: 'animation_no_load_v4',
event: isOwner() ? 'animation_not_loaded_owner' : 'animation_not_loaded_viewer',
project_id: getCurrentId(),
data_json: JSON.stringify({'sourceUrl': sourceUrl, 'version': state.propsByKey[key].version,
'animationName': state.propsByKey[key].name, 'error': err.message})
data_json: JSON.stringify({
'sourceUrl': sourceUrl,
'mainJsonSourceUrl': state.propsByKey[key].sourceUrl,
'version': state.propsByKey[key].version,
'animationName': state.propsByKey[key].name,
'error': err.message
})
},
{includeUserId: true}
);
Expand Down

0 comments on commit 67670b5

Please sign in to comment.