Skip to content

Commit

Permalink
Instructions page
Browse files Browse the repository at this point in the history
  • Loading branch information
KhalidIshani committed Feb 16, 2021
1 parent daca05b commit 4d2d620
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 14 deletions.
41 changes: 41 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.packages
.pub-cache/
.pub/
/build/

# Web related
lib/generated_plugin_registrant.dart

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json
26 changes: 19 additions & 7 deletions lib/Maze.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'dart:convert';
import 'PathGeneration.dart';
import 'server.dart';
import 'main.dart';
import 'instructions.dart';

class gameButton extends StatefulWidget {
int id;
Expand Down Expand Up @@ -298,6 +299,18 @@ class mazeState extends State<maze> {

}
),
Align(
alignment: Alignment.bottomRight,
child: IconButton(
icon: Icon(Icons.help),
onPressed:() {
Navigator.push(
context,
new MaterialPageRoute(builder: (ctxt) => new SecondScreen()),
);
},
),
)
]
),
),
Expand All @@ -316,13 +329,12 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Center(child: Text("GMT")),
),
body: Center(
child: maze1,
)
return Container(
child: Scaffold(
appBar: AppBar(
title: Center(child: Text("GMT")),
),
),
);
}
}
19 changes: 17 additions & 2 deletions lib/MazeTest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'dart:io';
import 'dart:convert';
import 'main.dart';
import 'server.dart';
import 'instructions.dart';
//initialize new maze
maze maze2= new maze();
Color color1 = Colors.grey;
Expand Down Expand Up @@ -142,7 +143,7 @@ class gameButtonState extends State<gameButton> {
void resetGame()
{
//reinitialize variables to default
moves = [];
moves2 = [];
correctMoves2 = {};
consecErrors2 = 0;
lastMove = 0; //records last CORRECT move of user
Expand All @@ -154,6 +155,7 @@ class gameButtonState extends State<gameButton> {
//function executed when any button pressed
void buttonPress()
{
moves2.add(widget.id);
times2.add(clock2.elapsedMilliseconds);
//first prevent uesr from making new moves during 250 milisecond animation
timeOut2 = true;
Expand Down Expand Up @@ -244,7 +246,6 @@ class gameButtonState extends State<gameButton> {
}

});
moves2.add(widget.id);
recentMove2=widget.id;
}
@override
Expand Down Expand Up @@ -332,6 +333,20 @@ class mazeState extends State<maze> {

}
),

Align(
alignment: Alignment.bottomRight,
child: IconButton(
icon: Icon(Icons.help),
onPressed:() {
Navigator.push(
context,
new MaterialPageRoute(builder: (ctxt) => new SecondScreen()),
);
},
),
)

]
),
),
Expand Down
26 changes: 26 additions & 0 deletions lib/instructions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

import 'package:flutter/material.dart';



class SecondScreen extends StatelessWidget {
@override
Widget build (BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("Instructions"),
),
body: SingleChildScrollView(
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: new Text("Subject must click on tiles one-by-one to make a path from the start tile (top leftmost tile) to the finish tile (bottom rightmost tile). There is a 28 step pathway hidden below these 100 possible locations. There are three rules that must be followed: \n 1.) The subject cannot move diagonally (only left, right, up, or down are legal moves). \n 2.) They cannot click on the same tile twice in succession. \n 3.) "
"They cannot move backwards (i.e. they cannot click on a tile that they have already revealed to be in the path). \n After each move, if the subject chose correctly a tile in the path, a green square is revealed briefly then hidden again. If the subject chose incorrectly, a red square is shown briefly. The green and red squares do not stay on the screen, but are revealed briefly just after the tile is clicked on.An incorrect choice (a red X) can be due to either the tile not being in the path, or because another type of error was made: \n 1.) They clicked on a tile that is diagonal from the last correct one. \n 2.) They clicked on the same tile twice in succession. \n 3.) They skipped a tile (choose a tile not connected to the last one they found to be in the path) \n If an incorrect tile choice is revealed, the subject must click on the last correct tile they chose before they click on another tile to try to advance to the end of the maze. Once they complete the maze, they are returned to the start position to do the same maze again, usually four more times, trying to remember the pathway that they just completed.In CogState, there are 20 well-matched alternate forms for the task, which are selected from in pseudo-random order (i.e. no path is repeated for a particular subject throughout a study). This ensures that a subject will not be presented the same hidden path on any two different testing sessions throughout a study.",
style: new TextStyle(fontSize: 20, height:1.5)),
),
),
),

);
}
}
6 changes: 1 addition & 5 deletions lib/server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ import 'package:json_annotation/json_annotation.dart';
import 'dart:async';
import 'dart:convert';

//const String serverURL = "https://x0-19.psych.umn.edu/posts";
const String serverURL = "http://160.94.0.29/posts";


@JsonSerializable(nullable: false)
Data _$DataFromJson(Map<String, dynamic> json) {
Expand Down Expand Up @@ -54,8 +51,7 @@ Future<Data> createData(
print(jsonUser);

final http.Response response = await http.post(
serverURL,
// 'http://160.94.0.29:5000/posts',
'https://x0-29.psych.umn.edu/dend/posts',
headers: <String, String>{
'Content-Type': 'application/json; charset=UTF-8',
},
Expand Down

0 comments on commit 4d2d620

Please sign in to comment.