File tree Expand file tree Collapse file tree 3 files changed +45
-3
lines changed
frame-editors/course-editor Expand file tree Collapse file tree 3 files changed +45
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import { Button } from "../../antd-bootstrap";
19
19
import { Icon , Tip } from "../../components" ;
20
20
import { UserMap } from "../../todo-types" ;
21
21
import { CourseActions } from "../actions" ;
22
- import { FoldersToolbar } from "../common" ;
22
+ import { AddItems , FoldersToolbar } from "../common/folders-tool-bar " ;
23
23
import { HandoutRecord , HandoutsMap , StudentsMap } from "../store" ;
24
24
import * as styles from "../styles" ;
25
25
// CoCalc and course components
@@ -237,3 +237,24 @@ export function HandoutsPanelHeader(props: { n: number }) {
237
237
</ Tip >
238
238
) ;
239
239
}
240
+
241
+ // used for adding assignments outside of the above component.
242
+ export function AddHandouts ( { name, actions } ) {
243
+ const handouts = useRedux ( name , "handouts" ) ;
244
+ return (
245
+ < AddItems
246
+ itemName = "handout"
247
+ items = { handouts }
248
+ addItems = { actions . assignments . addHandout }
249
+ selectorStyle = { {
250
+ position : null ,
251
+ width : "100%" ,
252
+ boxShadow : null ,
253
+ zIndex : null ,
254
+ backgroundColor : null ,
255
+ } }
256
+ defaultOpen
257
+ closable = { false }
258
+ />
259
+ ) ;
260
+ }
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import {
29
29
import { Parallel } from "@cocalc/frontend/course/configuration/parallel" ;
30
30
import { Nbgrader } from "@cocalc/frontend/course/configuration/nbgrader" ;
31
31
import { AddAssignments } from "@cocalc/frontend/course/assignments/assignments-panel" ;
32
+ import { AddHandouts } from "@cocalc/frontend/course/handouts/handouts-panel" ;
32
33
33
34
interface Props {
34
35
frameActions ;
@@ -89,7 +90,13 @@ function getModal(modal: string) {
89
90
case "add-students" :
90
91
return { Body : AddStudents , title : "Add Students" , icon : "users" } ;
91
92
case "add-assignments" :
92
- return { Body : AddAssignments , title : "Add Assignemtns" , icon : "share-square" } ;
93
+ return {
94
+ Body : AddAssignments ,
95
+ title : "Add Assignmetns" ,
96
+ icon : "share-square" ,
97
+ } ;
98
+ case "add-handouts" :
99
+ return { Body : AddHandouts , title : "Add Handouts" , icon : "text1" } ;
93
100
94
101
case "start-all-projects" :
95
102
return {
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ const COURSE_MENUS = {
40
40
label : menu . edit ,
41
41
pos : 1 ,
42
42
entries : {
43
- editStudents : [ "course-add-students" , "course-add-assignments" ] ,
43
+ editStudents : [
44
+ "course-add-students" ,
45
+ "course-add-assignments" ,
46
+ "course-add-handouts" ,
47
+ ] ,
44
48
courseUpgrades : [ "course-upgrades" ] ,
45
49
configCourse : [
46
50
"course-title-and-description" ,
@@ -106,6 +110,16 @@ const COMMANDS = {
106
110
actions . setModal ( "add-assignments" ) ;
107
111
} ,
108
112
} ,
113
+ "course-add-handouts" : {
114
+ icon : "text1" ,
115
+ label : "Add Handouts" ,
116
+ button : "+Handouts" ,
117
+ title : "Add one or more handouts to this course." ,
118
+ onClick : ( { props } ) => {
119
+ const { actions } = props ;
120
+ actions . setModal ( "add-handouts" ) ;
121
+ } ,
122
+ } ,
109
123
"course-title-and-description" : {
110
124
icon : "header" ,
111
125
label : "Course Title and Description" ,
You can’t perform that action at this time.
0 commit comments