Skip to content
Snippets Groups Projects
Commit 05dd27b9 authored by srosse's avatar srosse
Browse files

OO-3715: cover a more widen options range

parent a38fde6a
No related branches found
No related tags found
No related merge requests found
......@@ -608,21 +608,26 @@ public class GTAParticipantController extends GTAAbstractController implements A
* @return If the solutions are visible to the user
*/
private boolean showSolutions(DueDate availableDate) {
boolean show = false;
boolean optional = gtaNode.isOptional();
File submitDirectory;
if(GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
submitDirectory = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
if(config.getBooleanSafe(GTACourseNode.GTASK_SUBMIT)) {
File submitDirectory;
if(GTAType.group.name().equals(config.getStringValue(GTACourseNode.GTASK_TYPE))) {
submitDirectory = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedGroup);
} else {
submitDirectory = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedIdentity);
}
if(availableDate == null && optional
&& (gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false) || TaskHelper.hasDocuments(submitDirectory))) {
show = true;
} else if(availableDate != null && (optional || !availableDate.isRelative())
&& (gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false) || TaskHelper.hasDocuments(submitDirectory))) {
show = true;
}
} else if(optional) {
show = gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false);
} else {
submitDirectory = gtaManager.getSubmitDirectory(courseEnv, gtaNode, assessedIdentity);
}
boolean show = false;
if(availableDate == null && optional
&& (gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false) || TaskHelper.hasDocuments(submitDirectory))) {
show = true;
} else if((availableDate != null && (optional || !availableDate.isRelative())
&& (gtaNode.getModuleConfiguration().getBooleanSafe(GTACourseNode.GTASK_SAMPLE_SOLUTION_VISIBLE_ALL, false)) || TaskHelper.hasDocuments(submitDirectory))) {
show = true;
}
return show;
......
......@@ -1861,7 +1861,7 @@ public class AssessmentTest extends Deployments {
gtaConfig
.selectWorkflow()
.enableAssignment(false)
.enableSubmission(false)
.enableSubmission(false)
.saveWorkflow();
gtaConfig
......@@ -1983,7 +1983,8 @@ public class AssessmentTest extends Deployments {
.selectWorkflow()
.optional(true)
.enableAssignment(false)
.enableSubmission(false)
.enableSubmission(false)
.enableSolutionForAll(true)
.saveWorkflow();
gtaConfig
......
......@@ -91,6 +91,18 @@ public class GroupTaskConfigurationPage {
return this;
}
public GroupTaskConfigurationPage enableSolutionForAll(boolean forAll) {
By optionBy;
if(forAll) {
optionBy = By.xpath("//div[@id='o_covisibleall']//label/input[@name='visibleall'][@value='all']");
} else {
optionBy = By.xpath("//div[@id='o_covisibleall']//label/input[@name='visibleall'][@value='restricted']");
}
OOGraphene.waitElement(optionBy, browser);
browser.findElement(optionBy).click();;
return this;
}
public GroupTaskConfigurationPage saveWorkflow() {
By saveBy = By.cssSelector(".o_sel_course_gta_save_workflow button.btn-primary");
browser.findElement(saveBy).click();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment