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): 6952e41f #28292

Merged
merged 34 commits into from Apr 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
f3c9d6f
show message instead of scholarship dropdown for new facilitator atte…
Apr 25, 2019
10ffb49
Fix concept annotations
bethanyaconnor Apr 26, 2019
d9bf059
fix initial sort of assessment submissions table
Erin007 Apr 26, 2019
ac147c1
add tests
Apr 26, 2019
8d1c965
UI test updates: Remove redundant 'sign out' steps
wjordan Apr 29, 2019
33b64b1
export fake timestamps for reuse and update sectionAssessmentsReduxTest
Erin007 Apr 29, 2019
f3081a8
update to reconfiguredChai
Erin007 Apr 29, 2019
e8c2e5d
dashboard i18n sync
deploy-code-org Apr 29, 2019
4ea9076
pegasus i18n sync
deploy-code-org Apr 29, 2019
50d4d3e
apps i18n sync
deploy-code-org Apr 29, 2019
449fe1c
move fake timestamps into sectionAssessmentsRedux
Erin007 Apr 29, 2019
9c25be1
Merge branch 'staging' into fix-timestamp-sort
Erin007 Apr 29, 2019
c68b496
always link to studio url from Project Card, even if it's beinmg rend…
Hamms Apr 29, 2019
0e31b50
UI test browser config: add 'w3c' tags to Firefox + Safari
wjordan Apr 29, 2019
465421e
add deprecated note to unplugged levels in levelbuilder
Erin007 Apr 29, 2019
147e692
pr feedback
Apr 29, 2019
dc0e3da
only call updateHiddenScript if assigning a script, but not a course
Erin007 Apr 29, 2019
ccc611c
update test, create constant
Apr 29, 2019
327d38c
rename constant
Apr 30, 2019
c24414c
Merge pull request #28272 from code-dot-org/ui-firefox-safari-update
wjordan Apr 30, 2019
9adfd93
Merge pull request #28279 from code-dot-org/staging
deploy-code-org Apr 30, 2019
5cdd06f
Merge pull request #28256 from code-dot-org/ui-test-sign-out-remove
wjordan Apr 30, 2019
d9ea1a0
Merge pull request #28280 from code-dot-org/staging
deploy-code-org Apr 30, 2019
b481179
Merge pull request #28268 from code-dot-org/fix-featured-student-crea…
Hamms Apr 30, 2019
63c9749
Merge pull request #28282 from code-dot-org/staging
deploy-code-org Apr 30, 2019
8faa6f4
Merge pull request #28249 from code-dot-org/fix-timestamp-sort
Erin007 Apr 30, 2019
78e622a
Merge pull request #28277 from code-dot-org/assign-course-dialog-close
Erin007 Apr 30, 2019
675e88e
Merge pull request #28271 from code-dot-org/lb-deprecate-unplugged-note
Erin007 Apr 30, 2019
03303e6
Merge pull request #28252 from code-dot-org/no-schol-dropdown-for-new…
Apr 30, 2019
fcde538
Merge pull request #28261 from code-dot-org/i18n-sync-in-up-04-29
bethanyaconnor Apr 30, 2019
10f689d
Merge pull request #28228 from code-dot-org/annotation-fix
bethanyaconnor Apr 30, 2019
3a52700
Merge pull request #28283 from code-dot-org/staging
deploy-code-org Apr 30, 2019
9841592
Merge pull request #28285 from code-dot-org/levelbuilder
ajpal Apr 30, 2019
6952e41
Merge pull request #28288 from code-dot-org/staging
deploy-code-org Apr 30, 2019
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
Expand Up @@ -103,6 +103,10 @@ export class WorkshopEnrollmentSchoolInfo extends React.Component {
}

scholarshipInfo(enrollment) {
if (enrollment.scholarship_ineligible_reason) {
return <td>{enrollment.scholarship_ineligible_reason}</td>;
}

if (
this.props.permissionList.has(ProgramManager) ||
this.props.permissionList.has(WorkshopAdmin)
Expand Down
4 changes: 3 additions & 1 deletion apps/src/templates/courseOverview/AssignToSection.js
Expand Up @@ -69,7 +69,9 @@ class AssignToSection extends Component {
})
})
.done(result => {
updateHiddenScript(section.id, scriptId, false);
if (scriptId) {
updateHiddenScript(section.id, scriptId, false);
}
this.setState({
sectionIndexToAssign: null
});
Expand Down
3 changes: 2 additions & 1 deletion apps/src/templates/projects/ProjectCard.jsx
Expand Up @@ -2,6 +2,7 @@ import PropTypes from 'prop-types';
import React from 'react';
import color from '../../util/color';
import i18n from '@cdo/locale';
import {studio} from '@cdo/apps/lib/util/urlHelpers';
import $ from 'jquery';

const PROJECT_DEFAULT_IMAGE = '/blockly/media/projects/project_default.png';
Expand Down Expand Up @@ -120,7 +121,7 @@ export default class ProjectCard extends React.Component {
<div style={styles.card}>
<div style={thumbnailStyle}>
<a
href={url}
href={studio(url)}
style={{width: '100%'}}
target={isPublicGallery ? '_blank' : undefined}
>
Expand Down
Expand Up @@ -54,8 +54,10 @@ export const studentOverviewDataPropType = PropTypes.shape({
name: PropTypes.string.isRequired,
numMultipleChoiceCorrect: PropTypes.number,
numMultipleChoice: PropTypes.number,
submissionTimeStamp: PropTypes.string.isRequired,
/* timestamp is passed in as a Date so the column can be sorted accurately. See note in sectionAssessmentsRedux for details*/
submissionTimeStamp: PropTypes.instanceOf(Date).isRequired,
isSubmitted: PropTypes.bool.isRequired,
inProgress: PropTypes.bool.isRequired,
url: PropTypes.string
});

Expand Down Expand Up @@ -114,10 +116,22 @@ class SubmissionStatusAssessmentsTable extends Component {

submissionTimestampColumnFormatter = (submissionTimeStamp, {rowData}) => {
const isSubmitted = rowData.isSubmitted;
const inProgress = rowData.inProgress;
var submissionTimeStampText;
switch (true) {
case isSubmitted:
submissionTimeStampText = rowData.submissionTimeStamp.toLocaleString();
break;
case inProgress:
submissionTimeStampText = i18n.inProgress();
break;
default:
submissionTimeStampText = i18n.notStarted();
}

return (
<div style={styles.main}>
<div style={styles.text}>{submissionTimeStamp}</div>
<div style={styles.main} id="timestampCell">
<div style={styles.text}>{submissionTimeStampText}</div>
{isSubmitted && (
<div style={styles.icon}>
<FontAwesome id="checkmark" icon="check-circle" />
Expand Down Expand Up @@ -189,7 +203,8 @@ class SubmissionStatusAssessmentsTable extends Component {
style: {
...tableLayoutStyles.headerCell,
...{width: TABLE_COLUMN_WIDTHS.timeStamp}
}
},
id: 'timestampHeaderCell'
},
transforms: [sortable]
},
Expand Down
73 changes: 65 additions & 8 deletions apps/src/templates/sectionAssessments/assessmentsTestHelpers.js
@@ -1,4 +1,19 @@
import i18n from '@cdo/locale';
import {
inProgressFakeTimestamp,
notStartedFakeTimestamp
} from '@cdo/apps/templates/sectionAssessments/sectionAssessmentsRedux';

export const testDataTimestamps = {
newest: new Date('2019-04-09T20:52:05.000+00:00'),
newer: new Date('2019-04-09T20:40:05.000+00:00'),
new: new Date('2019-02-09T20:52:05.000+00:00'),
old: new Date('2018-12-09T20:52:05.000+00:00'),
older: new Date('2018-10-09T20:52:05.000+00:00'),
oldest: new Date('2018-10-07T20:52:05.000+00:00'),
notStarted: notStartedFakeTimestamp,
inProgress: inProgressFakeTimestamp
};

// Data for students' assessments multiple choice table
export const studentOverviewData = [
Expand All @@ -7,48 +22,90 @@ export const studentOverviewData = [
name: 'Caley',
numMultipleChoiceCorrect: 7,
numMultipleChoice: 10,
isSubmitted: true,
submissionTimeStamp: '2/16/18 - 7:41 AM'
isSubmitted: false,
inProgress: false,
submissionTimeStamp: testDataTimestamps.notStarted
},
{
id: 2,
name: 'Maddie',
numMultipleChoiceCorrect: 3,
numMultipleChoice: 10,
isSubmitted: false,
submissionTimeStamp: ''
inProgress: true,
submissionTimeStamp: testDataTimestamps.inProgress
},
{
id: 3,
name: 'Erin',
numMultipleChoiceCorrect: 8,
numMultipleChoice: 10,
isSubmitted: true,
submissionTimeStamp: '5/29/18 - 7:41 AM'
inProgress: false,
submissionTimeStamp: testDataTimestamps.newest
},
{
id: 4,
name: 'Dave',
numMultipleChoiceCorrect: 10,
numMultipleChoice: 10,
isSubmitted: true,
submissionTimeStamp: '5/29/18 - 8:00 AM'
inProgress: false,
submissionTimeStamp: testDataTimestamps.newer
},
{
id: 5,
name: 'Brad',
numMultipleChoiceCorrect: 0,
numMultipleChoice: 10,
isSubmitted: false,
submissionTimeStamp: ''
isSubmitted: true,
inProgress: false,
submissionTimeStamp: testDataTimestamps.new
},
{
id: 6,
name: 'Mike',
numMultipleChoiceCorrect: 0,
numMultipleChoice: 10,
isSubmitted: true,
submissionTimeStamp: '5/29/18 - 8:05 AM'
inProgress: false,
submissionTimeStamp: testDataTimestamps.old
},
{
id: 7,
name: 'Dani',
numMultipleChoiceCorrect: 0,
numMultipleChoice: 10,
isSubmitted: true,
inProgress: false,
submissionTimeStamp: testDataTimestamps.older
},
{
id: 8,
name: 'Amanda',
numMultipleChoiceCorrect: 0,
numMultipleChoice: 10,
isSubmitted: true,
inProgress: false,
submissionTimeStamp: testDataTimestamps.oldest
},
{
id: 9,
name: 'Nkiru',
numMultipleChoiceCorrect: 7,
numMultipleChoice: 10,
isSubmitted: false,
inProgress: true,
submissionTimeStamp: testDataTimestamps.inProgress
},
{
id: 10,
name: 'Karis',
numMultipleChoiceCorrect: 7,
numMultipleChoice: 10,
isSubmitted: false,
inProgress: false,
submissionTimeStamp: testDataTimestamps.notStarted
}
];

Expand Down
26 changes: 20 additions & 6 deletions apps/src/templates/sectionAssessments/sectionAssessmentsRedux.js
Expand Up @@ -3,7 +3,6 @@ import {
SET_SCRIPT,
getSelectedScriptName
} from '@cdo/apps/redux/scriptSelectionRedux';
import i18n from '@cdo/locale';
import experiments from '@cdo/apps/util/experiments';

export const ALL_STUDENT_FILTER = 0;
Expand Down Expand Up @@ -57,6 +56,14 @@ const ANSWER_LETTERS = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];

export const ASSESSMENT_FEEDBACK_OPTION_ID = 0;

/* In order for the sorting of the submission timestamp column to work correctly in the SubmissionStatusAssessmentsTable, the submissionTimeStamp field must be a Date. So, we pass in arbitrary Dates in the past to handle when the assessment is in progress or not yet started. */
export const inProgressFakeTimestamp = new Date(
'1990-01-01T20:52:05.000+00:00'
);
export const notStartedFakeTimestamp = new Date(
'1980-01-01T20:52:05.000+00:00'
);

// Action type constants
const SET_ASSESSMENT_RESPONSES = 'sectionAssessments/SET_ASSESSMENT_RESPONSES';
const SET_ASSESSMENTS_QUESTIONS =
Expand Down Expand Up @@ -651,25 +658,32 @@ export const getStudentsMCSummaryForCurrentAssessment = state => {
const studentsAssessment =
studentsObject.responses_by_assessment[currentAssessmentId];

// If the student has not submitted this assessment, display empty results.
// If the student has not submitted this assessment
if (!studentsAssessment) {
return {
id: studentId,
name: studentsObject.student_name,
isSubmitted: false,
submissionTimeStamp: i18n.notStarted()
inProgress: false,
submissionTimeStamp: notStartedFakeTimestamp
};
}
// Transform that data into what we need for this particular table, in this case
// it is the structure studentOverviewDataPropType
const submissionTimeStamp = studentsAssessment.submitted
? new Date(studentsAssessment.timestamp).toLocaleString()
: i18n.inProgress();

/* In progress assessments have a timestamp from the server indicating when the student last worked on the assessment. We don't display that timestamp in the SubmissionStatusAssessmentsTable, but we use it here to check if the assessment has been started. */
const inProgress =
studentsAssessment.timestamp && !studentsAssessment.submitted;
const submissionTimeStamp = inProgress
? inProgressFakeTimestamp
: new Date(studentsAssessment.timestamp);

return {
id: studentId,
name: studentsObject.student_name,
numMultipleChoiceCorrect: studentsAssessment.multi_correct,
numMultipleChoice: studentsAssessment.multi_count,
inProgress: inProgress,
isSubmitted: studentsAssessment.submitted,
submissionTimeStamp: submissionTimeStamp,
url: studentsAssessment.url
Expand Down