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

DTL (Test > Levelbuilder): db3169d3 #39146

Merged
merged 92 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
e67ce3d
unit calendar components
JillianK Feb 8, 2021
d100039
tests and i18n
JillianK Feb 9, 2021
d9c775c
cutting down on storybook entries and moving the unit calendar button…
JillianK Feb 9, 2021
f712b49
comments, using common test data, new shapes
JillianK Feb 9, 2021
640384c
resolve comments
JillianK Feb 11, 2021
1085494
playing with radium
JillianK Feb 11, 2021
4dd6d73
back to being able to hover
JillianK Feb 11, 2021
4e5d3b4
Some styling updates to UnitCalendarLessonChunk
dmcavoy Feb 11, 2021
56d2d2a
Merge remote-tracking branch 'origin/unit-calendar-part-2' into unit-…
dmcavoy Feb 11, 2021
8ab16c7
hovering across lines again plus new and improved styles
JillianK Feb 11, 2021
b796ae7
Merge branch 'staging' of github.com:code-dot-org/code-dot-org into u…
JillianK Feb 11, 2021
f8dbb61
fix tests
JillianK Feb 11, 2021
267f69f
Merge branch 'staging' of github.com:code-dot-org/code-dot-org into u…
JillianK Feb 12, 2021
289fa3c
small fixes now that we have a new default weekly instructional minutes
JillianK Feb 12, 2021
68f36f3
resolve comments, clean up scheduling
JillianK Feb 12, 2021
bc8a320
merge in isMajority with all of the rest of the lesson scheduling
JillianK Feb 12, 2021
2d8ac9a
clean up lesson chunk styling
JillianK Feb 15, 2021
89da642
catch openuri too long error and show message
ajpal Feb 15, 2021
6a42912
create frameworks table
davidsbailey Feb 16, 2021
6c6f11a
add empty Framework model
davidsbailey Feb 16, 2021
0947727
create standard_categories table
davidsbailey Feb 16, 2021
cc456e2
add empty StandardCategory model
davidsbailey Feb 16, 2021
a94682e
dashboard i18n sync
deploy-code-org Feb 16, 2021
449ea34
course content i18n sync
deploy-code-org Feb 16, 2021
80b94b9
apps i18n sync
deploy-code-org Feb 16, 2021
d2f5be8
hoc i18n sync
deploy-code-org Feb 16, 2021
6034183
update tests
ajpal Feb 16, 2021
0777450
add new fields to standards model
davidsbailey Feb 16, 2021
4a44220
resolve comments
JillianK Feb 16, 2021
2016d9e
Add storybook for LevelDetailsDialog
bethanyaconnor Feb 16, 2021
37f379c
Add tests for buttons and markdown level
bethanyaconnor Feb 16, 2021
9bb51d4
Add a test for StandaloneVideo
bethanyaconnor Feb 16, 2021
f650a34
Add implementation for LevelGroup
bethanyaconnor Feb 17, 2021
678abb1
Add a 'download' property to Button
Hamms Feb 17, 2021
0103ef6
Create programming environment model
dmcavoy Feb 17, 2021
c76343a
Create programming expression model
dmcavoy Feb 17, 2021
9db10a4
Add programming environment id
dmcavoy Feb 17, 2021
29db5dd
Create lesson programming expression join table
dmcavoy Feb 17, 2021
173f723
Update associations between lessons and programming expressions
dmcavoy Feb 17, 2021
0f6ad6e
correctly access data in testValues
Erin007 Feb 17, 2021
19461ec
Merge branch 'staging' into standards-hierarchy
davidsbailey Feb 17, 2021
c990491
hoist stripSpaceAndSpecial into new aiUtils file
Erin007 Feb 17, 2021
c1a80c0
Remove debug statement
bethanyaconnor Feb 17, 2021
a6d2f5b
explicitly set utf8 on new tables
davidsbailey Feb 17, 2021
3ed4368
Add index for programming environment and make sure utf8 is used for …
dmcavoy Feb 17, 2021
e8d3c1b
Fix up a couple associations
dmcavoy Feb 17, 2021
01b46a7
cleaned up table styles to share more styling between student list an…
cforkish Feb 15, 2021
9ba7d6c
reverted to dynamic sizing for detail view column widths, using an in…
cforkish Feb 17, 2021
106e827
base table height on number of rows, and shorten from 16 to 14.
cforkish Feb 17, 2021
5eb5542
Create CSA family and curriculum umbrella
dmcavoy Feb 17, 2021
6d27524
Temporarily disable flaky test
Feb 17, 2021
68f0d27
Merge pull request #39110 from code-dot-org/disable-azure-test
Feb 17, 2021
d64ce85
split out supported and not-supported tests into two separate test cases
Hamms Feb 17, 2021
b6389b5
Merge pull request #39096 from code-dot-org/expression-lesson-join
dmcavoy Feb 17, 2021
3060ba1
reverting the user and create menus back to clickable divs, but givin…
annaxuphoto Feb 17, 2021
9471a25
Merge pull request #39112 from code-dot-org/staging
deploy-code-org Feb 17, 2021
eb64fb0
Update schema cache dump after schema changes.
deploy-code-org Feb 17, 2021
5c98940
removed obsolete tests
cforkish Feb 17, 2021
14f4001
added comment explaining how column widths are determined.
cforkish Feb 17, 2021
6d9a0d6
Merge pull request #39066 from code-dot-org/i18n-sync-in-up-02-16-2021
annaxuphoto Feb 17, 2021
ac9b8b2
Merge branch 'staging' into add-csa
dmcavoy Feb 17, 2021
8f48a6f
Merge pull request #39116 from code-dot-org/staging
davidsbailey Feb 17, 2021
e5fd976
PR feedback on naming
bethanyaconnor Feb 17, 2021
7ba430a
Merge pull request #39114 from code-dot-org/nav-bar-accessibility-fix…
Feb 17, 2021
548ce07
Merge pull request #39118 from code-dot-org/staging
davidsbailey Feb 17, 2021
ed5b97c
Merge pull request #39091 from code-dot-org/cforkish/table-layout-cle…
cforkish Feb 17, 2021
b486bdc
Disable correct test
Feb 17, 2021
c66224f
Merge pull request #39057 from code-dot-org/feb15-library-too-long
ajpal Feb 17, 2021
c665a19
Absolute namespace for Foorm Form model in CSV export
bencodeorg Feb 18, 2021
76e4633
Merge pull request #39122 from code-dot-org/staging
deploy-code-org Feb 18, 2021
b37247b
Merge pull request #39119 from code-dot-org/disable-flaky-azure-test
Feb 18, 2021
70e6767
Merge pull request #39097 from code-dot-org/predict-inconsistencies
Erin007 Feb 18, 2021
13ebfc5
Merge pull request #39087 from code-dot-org/level-details-component-s…
bethanyaconnor Feb 18, 2021
90b784b
Merge branch 'staging' into standards-hierarchy
davidsbailey Feb 18, 2021
80a6f90
moved progress table legends outside of the progress tables themselve…
cforkish Feb 18, 2021
f082e09
Merge pull request #39065 from code-dot-org/standards-hierarchy
davidsbailey Feb 18, 2021
8afbe89
Update schema cache dump after schema changes.
deploy-code-org Feb 18, 2021
48ef9bd
Merge pull request #39125 from code-dot-org/cforkish/progress-table-l…
cforkish Feb 18, 2021
3ab1d9c
Merge pull request #39126 from code-dot-org/staging
deploy-code-org Feb 18, 2021
c494795
Fix typo in tests
dmcavoy Feb 18, 2021
110f990
Merge pull request #39105 from code-dot-org/add-csa
dmcavoy Feb 18, 2021
554dd8b
Merge pull request #39132 from code-dot-org/staging
deploy-code-org Feb 18, 2021
29d83d5
Merge pull request #38960 from code-dot-org/unit-calendar-part-2
JillianK Feb 18, 2021
d17dbff
Merge pull request #39135 from code-dot-org/staging
deploy-code-org Feb 18, 2021
99cbc2d
Merge pull request #39121 from code-dot-org/ben/foorm-survey-result-e…
bencodeorg Feb 18, 2021
2216e2d
Merge pull request #39137 from code-dot-org/staging
deploy-code-org Feb 18, 2021
1aee354
staging content changes (-robo-commit)
deploy-code-org Feb 18, 2021
e5376dd
Merge pull request #39139 from code-dot-org/staging
deploy-code-org Feb 18, 2021
bba0812
Merge pull request #39140 from code-dot-org/levelbuilder
deploy-code-org Feb 18, 2021
c732be0
Merge pull request #39143 from code-dot-org/staging
deploy-code-org Feb 18, 2021
d8c25a4
Merge pull request #39088 from code-dot-org/download-button
Hamms Feb 18, 2021
db3169d
Merge pull request #39145 from code-dot-org/staging
deploy-code-org Feb 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/i18n/common/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"applabTutorialTitle": "App Lab Hour of Code",
"archiveSection": "Archive Section",
"archivedSections": "Archived Sections",
"assessment": "Assessment",
"assessmentAndSurvey": "Assessments / Surveys",
"assessmentOpportunity": "Assessment Opportunity",
"assessmentOpportunities": "Assessment Opportunities",
Expand Down Expand Up @@ -928,6 +929,7 @@
"infinity": "Infinity",
"inProgress": "In progress",
"inspireStudents": "Inspire students",
"instructionalLesson": "Instructional Lesson",
"instructions": "Instructions",
"instructionsWithColon": "Instructions:",
"intlAnnouncementSpecial2020Body": "Take a Code Break with us, or see resources for students, parents, and teachers - including videos, fun tutorials, and projects! Most options only available in English.",
Expand Down Expand Up @@ -990,6 +992,7 @@
"level": "Level,",
"levels": "Levels",
"levelDetails": "Level Details",
"levelGroupDetailsDialogText": "This level is an assessment or survey with multiple questions. To view this level click \"{buttonText}\".",
"levelHeader": "Level",
"levelIncompleteError": "Keep coding! Something's not quite right yet.",
"levelN": "LEVEL {levelNumber}",
Expand Down Expand Up @@ -1022,6 +1025,7 @@
"libraryPublishInvalid": "Your library must include a description and at least one function.",
"libraryPublishFail": "There was an error publishing your library. Please check your internet connection and try again.",
"libraryPublishTitle": "Successfully published your library: ",
"libraryTooLongFail": "Your library is too long. Please make it shorter and try again.",
"librarySharedSections": "This library is assigned to the following sections:",
"libraryUnPublishExplanation": "No one will be able to import or update your library. However, people who have already imported your library will be able to keep using it. You can re-publish your library at any time.",
"libraryUnPublishFail": "There was an error unpublishing your library. Please check your internet connection and try again.",
Expand Down Expand Up @@ -1538,8 +1542,9 @@
"searchForCountry": "Search for your country.",
"searchForSchool": "Enter your school name, city, or zip code to search",
"searchForSchoolPrompt": "e.g. \"Lincoln Elementary\" or \"Lincoln Elementary Lynwood\" or \"Lynwood\"",
"seeFullResponse": " ...see full response",
"seeFullLevel": "See Full Level",
"seeFullQuestion": " ...see full question",
"seeFullResponse": " ...see full response",
"school": "School",
"schoolCity": "School City",
"schoolCityTown": "City / Town",
Expand Down Expand Up @@ -1879,6 +1884,7 @@
"unnamedFunction": "You have a variable or function that does not have a name. Don't forget to give everything a descriptive name.",
"unplugged": "Unplugged",
"unpluggedActivity": "Unplugged Activity",
"unpluggedLesson": "Unplugged Lesson",
"unpublish": "Unpublish",
"unpublishPending": "Unpublishing...",
"unpublishFailureTitle": "Unpublish Failed",
Expand Down Expand Up @@ -1933,6 +1939,7 @@
"viewAllSections": "View all sections",
"viewArchivedSections": "View archived sections",
"viewBy": "View By",
"viewCalendarButton": "View calendar",
"viewCode": "View code",
"viewCourse": "View course",
"viewCourses": "View courses",
Expand Down Expand Up @@ -1960,6 +1967,9 @@
"wantToLearn": "Want to learn to code?",
"warning": "Warning",
"watchVideo": "Watch the Video",
"weekLabel": "Week {number}",
"weeklyLessonLayout": "Weekly Lesson Layout",
"weeklyLessonLayoutDescription": "A weekly chart of a suggested schedule based on {minutes} instructional minutes per week.",
"welcomeToDanceParty": "Welcome to Dance Party!",
"when": "when",
"whenRun": "when run",
Expand Down
3 changes: 2 additions & 1 deletion apps/src/MLTrainers.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import KNN from 'ml-knn';
import {stripSpaceAndSpecial} from '@cdo/apps/aiUtils';

const KNNTrainers = ['knnClassify', 'knnRegress'];

Expand Down Expand Up @@ -48,7 +49,7 @@ export function predict(modelData) {
convertTestValue(
modelData.featureNumberKey,
feature,
modelData.testData[feature]
modelData.testData[stripSpaceAndSpecial(feature)]
)
);
// Make a prediction.
Expand Down
5 changes: 5 additions & 0 deletions apps/src/aiUtils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Strip whitespace and special characters. We need this to use feature name
// strings as design element ids and object {} keys.
export function stripSpaceAndSpecial(string) {
return string.replace(/\W/g, '');
}
6 changes: 3 additions & 3 deletions apps/src/applab/ai.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import $ from 'jquery';
import designMode from './designMode';
import {stripSpaceAndSpecial} from '@cdo/apps/aiUtils';

function generateCodeDesignElements(modelId, modelData) {
var x = 20;
Expand All @@ -10,8 +11,7 @@ function generateCodeDesignElements(modelId, modelData) {
modelData.selectedFeatures.forEach(feature => {
y = y + SPACER_PIXELS;
var label = designMode.createElement('LABEL', x, y);
// Strip whitespace and special characters.
var alphaNumFeature = feature.replace(/\W/g, '');
var alphaNumFeature = stripSpaceAndSpecial(feature);
label.textContent = feature + ':';
label.id = 'design_' + alphaNumFeature + '_label';
label.style.width = '300px';
Expand Down Expand Up @@ -40,7 +40,7 @@ function generateCodeDesignElements(modelId, modelData) {
y = y + 2 * SPACER_PIXELS;
var label = designMode.createElement('LABEL', x, y);
label.textContent = modelData.labelColumn;
var alphaNumModelName = modelData.name.replace(/\W/g, '');
var alphaNumModelName = stripSpaceAndSpecial(modelData.name);
label.id = 'design_' + alphaNumModelName + '_label';
label.style.width = '300px';
y = y + SPACER_PIXELS;
Expand Down
13 changes: 12 additions & 1 deletion apps/src/code-studio/components/libraries/LibraryPublisher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export const PublishState = {
ERROR_PUBLISH: 'error_publish',
INVALID_INPUT: 'invalid_input',
PROFANE_INPUT: 'profane_input',
TOO_LONG: 'too_long',
ERROR_UNPUBLISH: 'error_unpublish'
};

Expand Down Expand Up @@ -165,7 +166,14 @@ export default class LibraryPublisher extends React.Component {
libraryJson,
error => {
console.warn(`Error publishing library: ${error}`);
this.setState({publishState: PublishState.ERROR_PUBLISH});
if (
error.message ===
'httpStatusCode: 413; status: error; error: Request Entity Too Large'
) {
this.setState({publishState: PublishState.TOO_LONG});
} else {
this.setState({publishState: PublishState.ERROR_PUBLISH});
}
},
data => {
// Write to projects database
Expand Down Expand Up @@ -318,6 +326,9 @@ export default class LibraryPublisher extends React.Component {
case PublishState.ERROR_PUBLISH:
errorMessage = i18n.libraryPublishFail();
break;
case PublishState.TOO_LONG:
errorMessage = i18n.libraryTooLongFail();
break;
case PublishState.ERROR_UNPUBLISH:
errorMessage = i18n.libraryUnPublishFail();
break;
Expand Down
189 changes: 189 additions & 0 deletions apps/src/code-studio/components/progress/UnitCalendar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
import React from 'react';
import PropTypes from 'prop-types';
import i18n from '@cdo/locale';
import _ from 'lodash';
import UnitCalendarLessonChunk from './UnitCalendarLessonChunk';
import {unitCalendarLesson} from '@cdo/apps/templates/progress/unitCalendarLessonShapes';
import FontAwesome from '@cdo/apps/templates/FontAwesome';
import color from '@cdo/apps/util/color';

const WEEK_WIDTH = 592;
const styles = {
weekColumn: {
minWidth: 100,
backgroundColor: color.purple,
color: 'white',
textAlign: 'center',
border: '1px solid ' + color.purple,
borderCollapse: 'collapse',
fontWeight: 'bold',
minHeight: 50
},
scheduleColumn: {
border: '1px solid ' + color.purple,
borderCollapse: 'collapse',
width: WEEK_WIDTH,
display: 'flex',
minHeight: 50
},
table: {
border: '1px solid ' + color.purple,
borderCollapse: 'collapse',
width: '100%'
},
key: {
border: '1px solid ' + color.purple,
borderCollapse: 'collapse',
width: '100%',
marginTop: 20
},
keyIcon: {
marginRight: 5
},
keySection: {
display: 'flex',
justifyContent: 'space-around',
width: '90%',
alignItems: 'center',
fontSize: 15
}
};

export default class UnitCalendar extends React.Component {
static propTypes = {
weeklyInstructionalMinutes: PropTypes.number.isRequired,
lessons: PropTypes.arrayOf(unitCalendarLesson).isRequired
};

constructor(props) {
super(props);
this.state = {
hovering: ''
};
}

generateSchedule = () => {
const {lessons, weeklyInstructionalMinutes} = this.props;
const lessonsCopy = _.cloneDeep(lessons);
let allWeeks = [];
let currWeek = [];
let currMinutes = 0;
// splitting lessons across weeks
lessonsCopy.forEach(lesson => {
lesson.isStart = false;
lesson.isEnd = false;
lesson.isMajority = false;
const originalLessonDuration = lesson.duration;
while (lesson.duration > 0) {
let lessonClone = _.cloneDeep(lesson);
if (currMinutes + lesson.duration <= weeklyInstructionalMinutes) {
// If the rest of the current lesson fits into this week, put it in the schedule.
if (originalLessonDuration === lesson.duration) {
lessonClone.isStart = true;
}
if (originalLessonDuration - lesson.duration <= lesson.duration) {
lessonClone.isMajority = true;
}
lessonClone.isEnd = true;
currWeek.push(lessonClone);
currMinutes = currMinutes + lesson.duration;
lesson.duration = 0;
} else if (currMinutes < weeklyInstructionalMinutes - 15) {
// If there's more than 15 minutes left in the week,
// add as much of the lesson as you can to this week.
if (originalLessonDuration === lesson.duration) {
lessonClone.isStart = true;
}
lessonClone.duration = weeklyInstructionalMinutes - currMinutes;
if (lesson.duration - lessonClone.duration < lessonClone.duration) {
lessonClone.isMajority = true;
}
currWeek.push(lessonClone);
lesson.duration = lesson.duration - lessonClone.duration;
currMinutes = weeklyInstructionalMinutes;
} else {
// If there isn't enough time in this week to add this lesson, start a new week.
allWeeks.push(currWeek);
currWeek = [];
currMinutes = 0;
}
}
});
allWeeks.push(currWeek);
return allWeeks;
};

handleHover = id => {
this.setState({hovering: id});
};

renderWeek = (week, weekNumber) => {
const minuteWidth = WEEK_WIDTH / this.props.weeklyInstructionalMinutes;
return week.map((lessonChunk, index) => (
<UnitCalendarLessonChunk
key={`week-${weekNumber}-lesson-chunk-${index}`}
minuteWidth={minuteWidth}
lessonChunk={lessonChunk}
isHover={lessonChunk.id === this.state.hovering}
handleHover={this.handleHover}
/>
));
};

render() {
const schedule = this.generateSchedule();
return (
<div>
<table style={styles.table}>
<tbody>
{schedule.map((week, index) => (
<tr key={`week-${index}`}>
<td style={styles.weekColumn}>
{i18n.weekLabel({number: index + 1})}
</td>
<td style={styles.scheduleColumn}>
{this.renderWeek(week, index + 1)}
</td>
</tr>
))}
</tbody>
</table>
<table style={styles.key}>
<tbody>
<tr>
<td style={styles.weekColumn}>Key</td>
<td style={styles.scheduleColumn}>
<div style={styles.keySection}>
<div>
<FontAwesome
icon="square-o"
style={{
color: color.teal,
...styles.keyIcon
}}
/>
{i18n.instructionalLesson()}
</div>
<div>
<FontAwesome
icon="check-circle"
style={{
color: color.purple,
...styles.keyIcon
}}
/>
{i18n.assessment()}
</div>
<div>
<FontAwesome icon="scissors" style={styles.keyIcon} />
{i18n.unpluggedLesson()}
</div>
</div>
</td>
</tr>
</tbody>
</table>
</div>
);
}
}