From: Daniel W. <dan...@gm...> - 2005-07-14 15:26:11
|
Thanks for this, we have patched the bug fix into our local CVS tree and we will probably be patching the functionality change in soon once we have an equivalent patch for the web client. I think the mailing list would probably be better for patches, but either method works well. Thanks again! Dan On 7/14/05, Harri J=E4rvi <har...@tu...> wrote: > Hi, >=20 > I sent two patches at the Sourceforge patch tracker. I'm not sure if it > would have been better to send them on the mailing list. Which way do > you prefer on the BOSS project? >=20 > Yours, > Harri J=E4rvi >=20 > -------- >=20 > [ 1237472 ] Allow Access checkbox in AssessmentFrame >=20 > There was a typo in the AssessmentFrame.java . The typo > seems to be in both the CVS and the latest release (3.2.1). >=20 > This typo caused that the "Allow Access to this > assessment" check box to not function. >=20 > The attached patch fixes the problem and also > rearranges the checkboxen in the frame to a more > logical order, where the "allow access" is presented > above the others, because it actually takes precedence > over the others. > This effect could be emphasized by disabling the > other checkboxen if "Allow Access" is not set. >=20 > -Harri J=E4rvi >=20 > Index: AssessmentFrame.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- AssessmentFrame.java (.../trunk/src/uk/ac/warwick/dcs/cobalt/b= oss/client/staff/AssessmentFrame.java) (revision 24) > +++ AssessmentFrame.java (.../branches/marking/src/uk/ac/warwick/d= cs/cobalt/boss/client/staff/AssessmentFrame.java) (revision 29) > @@ -122,12 +122,12 @@ > //private JTextField timeField; > //private int time; >=20 > + private JCheckBox accessCheck; > + private boolean access; > + > private JCheckBox registeredCheck; > private boolean registered; >=20 > - private JCheckBox accessCheck; > - private boolean access; > - > private JCheckBox multipleCheck; > private boolean multiple; >=20 > @@ -139,9 +139,9 @@ > private int newCpu; > private int newFileSize; > private int newLate; > - private boolean newRegistered; > - private boolean newAccess; > - private boolean newMultiple; > + //private boolean newAccess; > + //private boolean newRegistered; > + //private boolean newMultiple; > private boolean isError =3D false; >=20 > /** > @@ -249,18 +249,18 @@ > //timePanel.add(new JLabel("seconds")); > //timeField.setText("10"); >=20 > + JLabel accessLabel =3D new JLabel("Allow access to this assessment")= ; > + accessCheck =3D new JCheckBox(); > + JPanel accessPanel =3D new JPanel(); > + accessPanel.add(accessCheck); > + accessPanel.add(accessLabel); > + > JLabel registeredLabel =3D new JLabel("Restrict to registered studen= ts"); > registeredCheck =3D new JCheckBox(); > JPanel registeredPanel =3D new JPanel(); > registeredPanel.add(registeredCheck); > registeredPanel.add(registeredLabel); >=20 > - JLabel accessLabel =3D new JLabel("Allow access to this assessment")= ; > - accessCheck =3D new JCheckBox(); > - JPanel accessPanel =3D new JPanel(); > - accessPanel.add(accessCheck); > - accessPanel.add(accessLabel); > - > JLabel multipleLabel =3D new JLabel("Allow multiple submissions"); > multipleCheck =3D new JCheckBox(); > JPanel multiplePanel =3D new JPanel(); > @@ -400,8 +400,9 @@ > optionsBox.add(cpuPanel); > optionsBox.add(fileSizePanel); > optionsBox.add(Box.createVerticalStrut(15)); > + > + optionsBox.add(accessPanel); > optionsBox.add(registeredPanel); > - optionsBox.add(accessPanel); > optionsBox.add(multiplePanel); > optionsBox.add(Box.createVerticalGlue()); >=20 > @@ -1235,9 +1236,9 @@ > int newLate =3D Integer.parseInt(lateField.getText().trim()); > int newCpu =3D Integer.parseInt(cpuField.getText().trim()); > int newFileSize =3D Integer.parseInt(fileSizeField.getText().trim(= )); > + boolean newAccess =3D accessCheck.isSelected(); > + boolean newRegistered =3D registeredCheck.isSelected(); > boolean newMultiple =3D multipleCheck.isSelected(); > - boolean newRegistered =3D registeredCheck.isSelected(); > - boolean newAcess =3D accessCheck.isSelected(); > boolean newLateBoolean =3D newLate !=3D 0; > try { > server.updateSubmissionPolicy(newAssessment, parentModule, >=20 > -------- >=20 > [ 1237584 ] Disabling "Allow Access" checkbox disables the other two >=20 > This patch will disable the "Allow multiple > submissions" and "Require registration" checkboxen when > "Allow access" checkbox is not checked. >=20 > This will make the user interface easier to read and > understand. >=20 > -Harri J=E4rvi >=20 > Index: AssessmentFrame.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- AssessmentFrame.java (revision 29) > +++ AssessmentFrame.java (revision 30) > @@ -251,6 +251,20 @@ >=20 > JLabel accessLabel =3D new JLabel("Allow access to this assessment")= ; > accessCheck =3D new JCheckBox(); > + accessCheck.addItemListener(new ItemListener() { > + public void itemStateChanged(ItemEvent e) { > + boolean enableOthers =3D false; > + if (e.getStateChange() =3D=3D ItemEvent.SELECTED) { > + // Enable the other checkboxen if "Allow access" is > + // checked > + enableOthers =3D true; > + } > + registeredCheck.setEnabled(enableOthers); > + multipleCheck.setEnabled(enableOthers); > + } > + } > + ); > + > JPanel accessPanel =3D new JPanel(); > accessPanel.add(accessCheck); > accessPanel.add(accessLabel); > @@ -834,6 +848,12 @@ >=20 > multipleCheck.setSelected(multiple); >=20 > + // Disable other elements, if accessCheck is disabled > + if (!access) { > + multipleCheck.setEnabled(false); > + registeredCheck.setEnabled(false); > + } > + > late =3D server.getPenalty(codeNameAssessment, parentModule, valid= ator); >=20 > lateField.setText("" + late); >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by the 'Do More With Dual!' webinar happen= ing > July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual > core and dual graphics technology at this free one hour event hosted by H= P, > AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar > _______________________________________________ > Cobalt-developers mailing list > Cob...@li... > https://lists.sourceforge.net/lists/listinfo/cobalt-developers >=20 --=20 Daniel White University: da...@dc... Personal: dan...@gm... |