JoyOfCoding icon indicating copy to clipboard operation
JoyOfCoding copied to clipboard

Disable "Save Grade" button when student is not known

Open DavidWhitlock opened this issue 7 years ago • 0 comments

In the POA grading program, the "Save Grade" button is enabled when the student is unknown. When you try to click the button in this state, you get:

java.lang.NullPointerException
	at edu.pdx.cs410J.grader.poa.GradeBookPresenter.recordGradeInGradeBook(GradeBookPresenter.java:47)
	at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
	at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
	at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
	at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
	at com.google.common.eventbus.EventBus.post(EventBus.java:275)
	at edu.pdx.cs410J.grader.poa.POAGradePresenter.publishScoreToMessageBusAndDisplayNextPOA(POAGradePresenter.java:45)
	at edu.pdx.cs410J.grader.poa.POAGradePresenter$$Lambda$26/58940486.recordGrade(Unknown Source)
	at edu.pdx.cs410J.grader.poa.ui.POAGradeWidgets.lambda$addRecordGradeHandler$31(POAGradeWidgets.java:96)
	at edu.pdx.cs410J.grader.poa.ui.POAGradeWidgets$$Lambda$27/501107890.actionPerformed(Unknown Source)

In this state, the "Grade" text field is disabled. We should also disable the "Save Grade" button.

DavidWhitlock avatar Jul 15 '17 19:07 DavidWhitlock