Skip to content

Commit f959319

Browse files
authored
Merge pull request code-dot-org#10302 from code-dot-org/viewSectionStep
[axof: 231] View section step
2 parents 11c6ab6 + 384ba56 commit f959319

File tree

6 files changed

+42
-15
lines changed

6 files changed

+42
-15
lines changed

apps/i18n/common/en_us.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"allowEditing": "Allow editing",
3-
"allowEditingInstructions": "1. \"Allow editing\" while students should be taking the assessment.",
3+
"allowEditingInstructions": "\"Allow editing\" while students should be taking the assessment.",
44
"and": "and",
55
"animationMode": "Animation",
66
"answersVisible": "Answers visible (read-only)",
@@ -186,7 +186,7 @@
186186
"lockFollowing": "Lock the following stages that are currently unlocked:",
187187
"lockSettings": "Lock settings",
188188
"lockStage": "Lock stage",
189-
"lockStageInstructions": "2. Once time is up, \"Lock stage\" to hide questions.",
189+
"lockStageInstructions": "Once time is up, \"Lock stage\" to hide questions.",
190190
"lockWhenDone": "Lock as soon as students are done",
191191
"makeYourOwnFlappy": "Make Your Own Flappy Game",
192192
"missingRecommendedBlocksErrorMsg": "Not quite. Try using a block you aren’t using yet.",
@@ -232,11 +232,12 @@
232232
"readonlyWorkspaceHeader": "View only: ",
233233
"recommendedBlockContextualHintTitle": "Try using a block like this to solve the puzzle.",
234234
"relockStage": "Re-lock stage",
235-
"relockStageInstructions": "4. \"Re-lock stage\" to prevent sharing of answers with other classes/schools.",
235+
"relockStageInstructions": "\"Re-lock stage\" to prevent sharing of answers with other classes/schools.",
236236
"repeat": "repeat",
237237
"reportAbuse": "Report Abuse",
238238
"resetProgram": "Reset",
239239
"restoreThisVersion": "Restore this Version",
240+
"reviewResponses": "Go to the assessment/survey tab for your section to review student responses.",
240241
"rotateText": "Rotate your device.",
241242
"runProgram": "Run",
242243
"runTooltip": "Run the program defined by the blocks in the workspace.",
@@ -274,7 +275,7 @@
274275
"unsubmitYourProject": "Unsubmit your project",
275276
"unsubmitYourProjectConfirm": "Unsubmitting your project will reset the submitted date, really unsubmit?",
276277
"showAnswers": "Show answers",
277-
"showAnswersInstructions": "3. \"Show answers\" to put the assessment into a read-only mode.",
278+
"showAnswersInstructions": "\"Show answers\" to put the assessment into a read-only mode.",
278279
"student": "Student",
279280
"studentControl": "Individual student control",
280281
"subtitle": "a visual programming environment",
@@ -294,6 +295,7 @@
294295
"unattachedBlockTipTitle": "Unattached blocks",
295296
"unattachedBlockTipBody": "Blocks that are not attached will not do anything. If you want these blocks in your program, try connecting them to other blocks.",
296297
"viewPageAs": "View page as:",
298+
"viewSection": "View section",
297299
"wantToLearn": "Want to learn to code?",
298300
"watchVideo": "Watch the Video",
299301
"when": "when",

apps/src/code-studio/components/progress/StageLockDialog.jsx

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const StageLockDialog = React.createClass({
7070
lockStatus: React.PropTypes.oneOf(Object.values(LockStatus)).isRequired
7171
})
7272
),
73+
selectedSection: React.PropTypes.string.isRequired,
7374
saving: React.PropTypes.bool.isRequired,
7475
saveDialog: React.PropTypes.func.isRequired
7576
},
@@ -109,6 +110,10 @@ const StageLockDialog = React.createClass({
109110
this.setAllLockStatus(LockStatus.ReadonlyAnswers);
110111
},
111112

113+
viewSection() {
114+
window.open(`${window.dashboard.CODE_ORG_URL}/teacher-dashboard#/sections/${this.props.selectedSection}/assessments`, '_blank');
115+
},
116+
112117
handleRadioChange(event) {
113118
const modifiedIndex = parseInt(event.target.name, 10);
114119
const value = event.target.value;
@@ -144,7 +149,7 @@ const StageLockDialog = React.createClass({
144149
<table>
145150
<tbody>
146151
<tr>
147-
<td>{commonMsg.allowEditingInstructions()}</td>
152+
<td>1. {commonMsg.allowEditingInstructions()}</td>
148153
<td>
149154
<button
150155
style={progressStyles.orangeButton}
@@ -155,7 +160,7 @@ const StageLockDialog = React.createClass({
155160
</td>
156161
</tr>
157162
<tr>
158-
<td>{commonMsg.lockStageInstructions()}</td>
163+
<td>2. {commonMsg.lockStageInstructions()}</td>
159164
<td>
160165
<button
161166
style={progressStyles.orangeButton}
@@ -166,7 +171,7 @@ const StageLockDialog = React.createClass({
166171
</td>
167172
</tr>
168173
<tr>
169-
<td>{commonMsg.showAnswersInstructions()}</td>
174+
<td>3. {commonMsg.showAnswersInstructions()}</td>
170175
<td>
171176
<button
172177
style={progressStyles.orangeButton}
@@ -177,7 +182,7 @@ const StageLockDialog = React.createClass({
177182
</td>
178183
</tr>
179184
<tr>
180-
<td>{commonMsg.relockStageInstructions()}</td>
185+
<td>4. {commonMsg.relockStageInstructions()}</td>
181186
<td>
182187
<button
183188
style={progressStyles.orangeButton}
@@ -187,6 +192,17 @@ const StageLockDialog = React.createClass({
187192
</button>
188193
</td>
189194
</tr>
195+
<tr>
196+
<td>5. {commonMsg.reviewResponses()}</td>
197+
<td>
198+
<button
199+
style={progressStyles.whiteButton}
200+
onClick={this.viewSection}
201+
>
202+
{commonMsg.viewSection()}
203+
</button>
204+
</td>
205+
</tr>
190206
</tbody>
191207
</table>
192208
<div style={styles.descriptionText}>{commonMsg.autolock()}</div>
@@ -280,7 +296,8 @@ const StageLockDialog = React.createClass({
280296
export default connect(state => ({
281297
initialLockStatus: state.stageLock.lockStatus,
282298
isOpen: !!state.stageLock.lockDialogStageId,
283-
saving: state.stageLock.saving
299+
saving: state.stageLock.saving,
300+
selectedSection: state.stageLock.selectedSection
284301
}), dispatch => ({
285302
saveDialog(lockStatus) {
286303
dispatch(saveLockDialog(lockStatus));

apps/src/code-studio/components/progress/progressStyles.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ const progressStyles = {
4141
orangeButton: Object.assign({}, baseButtonStyle, {
4242
backgroundColor: color.orange,
4343
color: color.white,
44-
})
44+
}),
45+
whiteButton: Object.assign({}, baseButtonStyle, {
46+
backgroundColor: color.white,
47+
color: color.dark_charcoal,
48+
borderColor: color.lighter_gray
49+
}),
4550
};
4651
export default progressStyles;

apps/src/code-studio/pd/workshop_dashboard/workshop.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* global TEACHER_DASHBOARD_URL */
2-
31
/**
42
* Workshop view / edit. Displays and optionally edits details for a workshop.
53
* Routes:
@@ -228,7 +226,7 @@ const Workshop = React.createClass({
228226
},
229227

230228
getSectionUrl() {
231-
return `${window.dashboard.workshop.TEACHER_DASHBOARD_URL}#/sections/${this.state.workshop.section_id}/manage`;
229+
return `${window.dashboard.CODE_ORG_URL}/teacher-dashboard#/sections/${this.state.workshop.section_id}/manage`;
232230
},
233231

234232
renderSignupPanel() {

dashboard/app/assets/javascripts/application.js.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,10 @@
3030
//= require details-polyfill/jquery.details
3131
//= require details-polyfill/details-polyfill
3232

33-
//= require selectize
33+
//= require selectize
34+
35+
// window.dashboard is used to communicate between dashboard/apps in a variety
36+
// of places. In this case we want to make availale to our JS the url of the
37+
// pegasus portion of our site (i.e. http://code.org vs. http://studio.code.org)
38+
window.dashboard = window.dashboard || {};
39+
window.dashboard.CODE_ORG_URL = "<%= CDO.code_org_url %>";

dashboard/app/views/pd/workshop_dashboard/index.html.haml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
:javascript
88
window.dashboard.workshop = {
9-
TEACHER_DASHBOARD_URL: "#{CDO.code_org_url '/teacher-dashboard'}",
109
TYPES: #{Pd::Workshop::TYPES},
1110
COURSES: #{Pd::Workshop::COURSES},
1211
SUBJECTS: #{Pd::Workshop::SUBJECTS.to_json},

0 commit comments

Comments
 (0)