Skip to content

Commit d143f1a

Browse files
authored
Merge pull request #3662 from openstax/fix/gb-null-work
Fix grade book blowing up when dropped student had no work
2 parents 473d977 + 5f61ba0 commit d143f1a

File tree

6 files changed

+21
-8
lines changed

6 files changed

+21
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"mobx-react": "^7.1.0",
125125
"mobx-utils": "^6.0.3",
126126
"mockdate": "^2.0.5",
127-
"modeled-mobx": "0.6.3",
127+
"modeled-mobx": "0.6.4",
128128
"moment": "2.29.1",
129129
"moment-range": "^4.0.2",
130130
"moment-timezone": "0.5.23",

tutor/src/helpers/course-enrollment.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import Enroll from '../components/enroll';
1313
import urlFor from '../api';
1414
import { ApiErrorData, isApiError } from 'shared/api/request';
1515
import type { User, CoursesMap } from '../models';
16+
import { CourseData } from '../models/types';
1617

1718
export class CourseEnrollment extends BaseModel {
1819

@@ -188,7 +189,7 @@ export class CourseEnrollment extends BaseModel {
188189
@action async create() {
189190
if (this.needsPeriodSelection) {
190191
this.courseToJoin = new Course()
191-
const courseData = await this.api.request(
192+
const courseData = await this.api.request<CourseData>(
192193
urlFor('fetchEnrollmentChoices', { enrollmentCode: this.originalEnrollmentCode }),
193194
)
194195
this.courseToJoin = hydrateModel(Course, courseData)

tutor/src/models/course.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ export class Course extends BaseModel {
325325

326326
@action async saveExerciseExclusion({ exercise, is_excluded }: { exercise: Exercise, is_excluded: boolean }) {
327327
exercise.is_excluded = is_excluded; // eagerly set exclusion
328-
const data = await this.api.request(
328+
const data = await this.api.request<CourseData>(
329329
urlFor('saveExerciseExclusion', { courseId: this.id }),
330330
{ data: [{ id: exercise.id, is_excluded }] },
331331
)

tutor/src/models/course/lms.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import urlFor from '../../api'
55
import type { Course } from '../../models'
66
import Time from 'shared/model/time';
77
import UiSettings from 'shared/model/ui-settings';
8+
import { CourseLMSData } from '../types';
89

910
const LMS_VENDOR = 'lmsv';
1011

@@ -36,7 +37,7 @@ export class CourseLMS extends BaseModel {
3637
}
3738

3839
async fetch() {
39-
const json = await this.api.request(urlFor('fetchCourseLMS', { courseId: this.course.id }))
40+
const json = await this.api.request<CourseLMSData>(urlFor('fetchCourseLMS', { courseId: this.course.id }))
4041
hydrateInstance(this, json)
4142
}
4243

tutor/src/models/types.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ export interface TeacherProfileData {
4444
name: string
4545
}
4646

47+
export interface CourseLMSData {
48+
id: ID
49+
key: string
50+
secret: string
51+
launch_url: string
52+
configuration_url: string
53+
xml: string
54+
created_at: string
55+
updated_at: string
56+
}
57+
4758
export interface CoursePeriodData {
4859
id: ID
4960
enrollment_code: string

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9487,10 +9487,10 @@ mockdate@^2.0.5:
94879487
resolved "https://registry.yarnpkg.com/mockdate/-/mockdate-2.0.5.tgz#70c6abf9ed4b2dae65c81dfc170dd1a5cec53620"
94889488
integrity sha512-ST0PnThzWKcgSLyc+ugLVql45PvESt3Ul/wrdV/OPc/6Pr8dbLAIJsN1cIp41FLzbN+srVTNIRn+5Cju0nyV6A==
94899489

9490-
modeled-mobx@0.6.3:
9491-
version "0.6.3"
9492-
resolved "https://registry.yarnpkg.com/modeled-mobx/-/modeled-mobx-0.6.3.tgz#ab3f8f85080ad545753568de7c257700554f62a0"
9493-
integrity sha512-KzVXl5YkeSzTPihZd4tmhuGdWDdT/6NA3TAwmeGrO9dgAbn2QLRY6A0zqk0RyQ7I5CeGoT5GrdRpP9dtbRybAw==
9490+
modeled-mobx@0.6.4:
9491+
version "0.6.4"
9492+
resolved "https://registry.yarnpkg.com/modeled-mobx/-/modeled-mobx-0.6.4.tgz#6a6220e7100f8c13eff93b90e4e3ef1010e73dd3"
9493+
integrity sha512-bC5ZAmBXmCLjrqwEq54RURx9mvz1b9VqxUHYDVRqlAmq6i7SoTcR6U8e4LqmtOCe4RV/LoeesVT281CCeYIXQg==
94949494
dependencies:
94959495
mobx "^6.1"
94969496

0 commit comments

Comments
 (0)