From: Harri <har...@tu...> - 2005-07-14 02:49:30
|
Hi, 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? Yours, Harri J=E4rvi -------- [ 1237472 ] Allow Access checkbox in AssessmentFrame There was a typo in the AssessmentFrame.java . The typo seems to be in both the CVS and the latest release (3.2.1). This typo caused that the "Allow Access to this assessment" check box to not function. 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. -Harri J=E4rvi 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/boss/cli= ent/staff/AssessmentFrame.java) (revision 24) +++ AssessmentFrame.java (.../branches/marking/src/uk/ac/warwick/dcs/coba= lt/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, -------- [ 1237584 ] Disabling "Allow Access" checkbox disables the other two This patch will disable the "Allow multiple submissions" and "Require registration" checkboxen when "Allow access" checkbox is not checked. This will make the user interface easier to read and understand. -Harri J=E4rvi 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); |
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... |
From: Harri <har...@tu...> - 2005-07-15 10:50:59
|
> 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! Hi, it won't probably be easy to implement the checkbox disabling in web client without use of JavaScript. The benefits might not be bigger than the disadvantages from adding javascript to the client. But even if there won't be checkbox disabling in the web client, I don't see reason for not having it in the GUI client. At least that way GUI users can get a benefit from using the GUI client. Attached is patch for uk.ac.warwick.dcs.cobalt.web.pages.staff.manager.ass.Policy to rearrange the checkbox as was done in the GUI client by the previous patch. I couldn't test the patch since I don't have the web client installed, but the change seemed trivial, so I wrote it. Patch is against Boss 3.2.1. Yours, Harri J=E4rvi |
From: Harri <har...@tu...> - 2005-07-15 10:52:14
Attachments:
Policy.java.31.diff
|
> 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! Hi, it won't probably be easy to implement the checkbox disabling in web client without use of JavaScript. The benefits might not be bigger than the disadvantages from adding javascript to the client. But even if there won't be checkbox disabling in the web client, I don't see reason for not having it in the GUI client. At least that way GUI users can get a benefit from using the GUI client. Attached is patch for uk.ac.warwick.dcs.cobalt.web.pages.staff.manager.ass.Policy to rearrange the checkbox as was done in the GUI client by the previous patch. I couldn't test the patch since I don't have the web client installed, but the change seemed trivial, so I wrote it. Patch is against Boss 3.2.1. Yours, Harri J=E4rvi |